lamindb_setup 0.76.7__tar.gz → 0.76.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/.github/workflows/build.yml +243 -243
  2. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/.github/workflows/doc-changes.yml +23 -23
  3. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/.gitignore +111 -111
  4. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/.pre-commit-config.yaml +46 -46
  5. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/PKG-INFO +1 -1
  6. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/README.md +6 -6
  7. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/changelog.md +654 -654
  8. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-cloud/01-init-local-instance.ipynb +117 -117
  9. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-cloud/02-connect-local-instance.ipynb +179 -179
  10. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-cloud/03-add-managed-storage.ipynb +452 -452
  11. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-cloud/08-test-multi-session.ipynb +159 -159
  12. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-cloud/test_notebooks.py +8 -8
  13. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-prod/test-cache-management.ipynb +305 -305
  14. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-prod/test-cloud-sync.ipynb +536 -536
  15. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-prod/test-connect-anonymously.ipynb +87 -87
  16. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-prod/test-empty-init.ipynb +129 -129
  17. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-prod/test-import-schema.ipynb +133 -133
  18. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-prod/test-insufficient-user-info.ipynb +209 -209
  19. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-prod/test-invalid-schema.ipynb +52 -52
  20. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-prod/test-sqlite-lock.ipynb +280 -280
  21. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-prod/test_notebooks2.py +8 -8
  22. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/index.md +12 -12
  23. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/notebooks.md +24 -24
  24. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/__init__.py +1 -1
  25. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_cache.py +34 -34
  26. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_check.py +7 -7
  27. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_check_setup.py +79 -79
  28. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_close.py +35 -35
  29. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_connect_instance.py +433 -433
  30. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_delete.py +137 -137
  31. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_django.py +41 -41
  32. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_exportdb.py +68 -68
  33. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_importdb.py +50 -50
  34. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_init_instance.py +374 -374
  35. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_migrate.py +239 -239
  36. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_register_instance.py +36 -36
  37. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_schema.py +27 -27
  38. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_schema_metadata.py +411 -391
  39. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_set_managed_storage.py +55 -55
  40. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_setup_user.py +118 -118
  41. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/_silence_loggers.py +44 -44
  42. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/__init__.py +21 -21
  43. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_aws_credentials.py +151 -151
  44. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_aws_storage.py +48 -48
  45. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_deprecated.py +55 -55
  46. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_docs.py +14 -14
  47. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_hub_client.py +164 -164
  48. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_hub_core.py +473 -473
  49. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_hub_crud.py +211 -211
  50. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_hub_utils.py +109 -109
  51. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_private_django_api.py +88 -88
  52. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_settings.py +138 -138
  53. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_settings_instance.py +461 -461
  54. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_settings_load.py +100 -100
  55. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_settings_save.py +81 -81
  56. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_settings_storage.py +393 -393
  57. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_settings_store.py +72 -72
  58. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_settings_user.py +51 -51
  59. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/_setup_bionty_sources.py +101 -99
  60. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/cloud_sqlite_locker.py +232 -232
  61. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/django.py +113 -113
  62. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/exceptions.py +12 -12
  63. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/hashing.py +114 -114
  64. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/types.py +19 -19
  65. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/lamindb_setup/core/upath.py +779 -779
  66. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/noxfile.py +110 -110
  67. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/pyproject.toml +147 -147
  68. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-cloud/scripts/script-to-fail-managed-storage.py +26 -26
  69. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-cloud/test_connect_instance.py +131 -131
  70. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-cloud/test_delete_instance.py +10 -10
  71. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-cloud/test_fail_managed_storage.py +12 -12
  72. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-cloud/test_init_instance.py +185 -185
  73. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-cloud/test_login.py +19 -19
  74. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-cloud/test_migrate.py +22 -22
  75. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-cloud/test_set_storage.py +15 -15
  76. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-local/conftest.py +31 -31
  77. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-local/test_all.py +335 -335
  78. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-local/test_update_schema_in_hub.py +195 -195
  79. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-prod/test_django.py +9 -9
  80. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-prod/test_global_settings.py +55 -55
  81. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-prod/test_switch_and_fallback_env.py +50 -50
  82. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-prod/test_upath.py +44 -44
  83. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/storage/test_hashing.py +54 -54
  84. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/storage/test_storage_access.py +50 -50
  85. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/storage/test_storage_basis.py +26 -26
  86. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/storage/test_storage_stats.py +46 -46
  87. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/storage/test_to_url.py +31 -31
  88. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/LICENSE +0 -0
  89. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-cloud/04-test-bionty.ipynb +0 -0
  90. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-cloud/05-init-hosted-instance.ipynb +0 -0
  91. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-cloud/06-connect-hosted-instance.ipynb +0 -0
  92. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/hub-cloud/07-keep-artifacts-local.ipynb +0 -0
  93. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/docs/reference.md +0 -0
  94. {lamindb_setup-0.76.7 → lamindb_setup-0.76.8}/tests/hub-prod/conftest.py +0 -0
@@ -1,243 +1,243 @@
1
- name: build
2
-
3
- on:
4
- push:
5
- branches: [main, staging]
6
- pull_request:
7
- branches: [main]
8
- repository_dispatch:
9
- types: [build]
10
-
11
- jobs:
12
- # tests only on production hub
13
- hub-prod:
14
- runs-on: ubuntu-latest
15
- timeout-minutes: 6
16
- steps:
17
- - uses: actions/checkout@v3
18
- - uses: actions/setup-python@v4
19
- with:
20
- python-version: "3.10" # run one job on 3.9
21
- cache: "pip"
22
- - uses: aws-actions/configure-aws-credentials@v2
23
- with:
24
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
25
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
26
- aws-region: eu-central-1
27
- - run: pip install "laminci@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
28
- - run: nox -s "install(group='hub-prod')"
29
- - run: nox -s "build(lamin_env='prod', group='hub-prod')"
30
- - uses: actions/upload-artifact@v2
31
- with:
32
- name: coverage--hub-prod
33
- path: .coverage
34
-
35
- # tests both on production and staging hub
36
- hub-cloud:
37
- runs-on: ubuntu-22.04
38
- strategy:
39
- fail-fast: false
40
- matrix:
41
- include:
42
- - lamin_env: "prod"
43
- python-version: "3.11"
44
- - lamin_env: "staging"
45
- python-version: "3.10" # test on 3.9
46
- timeout-minutes: 7
47
- steps:
48
- - uses: aws-actions/configure-aws-credentials@v2
49
- with:
50
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
51
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
52
- aws-region: eu-central-1
53
- - uses: actions/checkout@v4
54
- - uses: actions/setup-python@v4
55
- with:
56
- python-version: ${{ matrix.python-version }}
57
- cache: "pip"
58
- cache-dependency-path: ".github/workflows/build.yml"
59
- - uses: actions/checkout@v4
60
- with:
61
- repository: laminlabs/laminhub
62
- token: ${{ secrets.GH_TOKEN_DEPLOY_LAMINAPP }}
63
- path: laminhub
64
- ref: main
65
- - uses: actions/cache@v3
66
- with:
67
- path: ~/.cache/pre-commit
68
- key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
69
- - id: cache-postgres
70
- uses: actions/cache@v3
71
- with:
72
- path: ~/postgres.tar
73
- key: cache-postgres-0
74
- - if: steps.cache-postgres.outputs.cache-hit != 'true'
75
- run: docker pull postgres:latest && docker image save postgres:latest --output ~/postgres.tar
76
- - if: steps.cache-postgres.outputs.cache-hit == 'true'
77
- run: docker image load --input ~/postgres.tar
78
- - run: pip install "laminci@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
79
- # account for in a different job
80
- # - uses: "google-github-actions/auth@v0"
81
- # with:
82
- # credentials_json: "${{ secrets.GCP_CREDENTIALS }}"
83
- # - uses: "google-github-actions/setup-gcloud@v0"
84
- - run: nox -s "install(group='hub-cloud')"
85
- - run: nox -s "build(lamin_env='${{ matrix.lamin_env }}', group='hub-cloud')"
86
- - uses: actions/upload-artifact@v2
87
- if: ${{ matrix.lamin_env == 'prod' }}
88
- with:
89
- name: coverage--hub-cloud
90
- path: .coverage
91
-
92
- # test user access to storage
93
- storage:
94
- runs-on: ubuntu-latest
95
- timeout-minutes: 6
96
- steps:
97
- - uses: actions/checkout@v4
98
- - uses: actions/setup-python@v4
99
- with:
100
- python-version: "3.9"
101
- cache: "pip"
102
- cache-dependency-path: ".github/workflows/build.yml"
103
- - run: pip install "laminci@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
104
- - run: nox -s "install(group='storage')"
105
- - run: nox -s lint
106
- - run: nox -s storage
107
- env:
108
- TEST_INSTANCE_PRIVATE_POSTGRES: ${{ secrets.TEST_INSTANCE_PRIVATE_POSTGRES }}
109
- TMP_AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
110
- TMP_AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
111
- - uses: actions/upload-artifact@v2
112
- with:
113
- name: coverage--storage
114
- path: .coverage
115
-
116
- # test low-level hub functionality
117
- hub-local:
118
- runs-on: ubuntu-latest
119
- timeout-minutes: 6
120
- steps:
121
- - uses: aws-actions/configure-aws-credentials@v2
122
- with:
123
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
124
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
125
- aws-region: eu-central-1
126
- - uses: actions/checkout@v4
127
- - uses: actions/checkout@v4
128
- with:
129
- repository: laminlabs/laminhub
130
- token: ${{ secrets.GH_TOKEN_DEPLOY_LAMINAPP }}
131
- path: laminhub
132
- ref: main
133
- - name: Set env file for local test of edge functions
134
- run: |
135
- touch .env.local
136
- echo "AWS_ACCESS_KEY_ID_HOSTED_S3=${{ secrets.AWS_ACCESS_KEY_ID }}" >> .env.local
137
- echo "AWS_SECRET_ACCESS_KEY_HOSTED_S3=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> .env.local
138
- working-directory: laminhub/rest-hub/supabase
139
- - uses: actions/setup-python@v4
140
- with:
141
- python-version: "3.11" # we need to run everything for coverage on 3.11
142
- cache: "pip"
143
- cache-dependency-path: ".github/workflows/build.yml"
144
- - run: pip install "laminci@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
145
- - run: nox -s "install(group='hub-local')"
146
- - id: cache-supabase
147
- uses: actions/cache@v3
148
- with:
149
- path: /var/lib/docker
150
- key: cache-supabase
151
- - uses: supabase/setup-cli@v1
152
- - run: nox -s hub_local
153
- env:
154
- LAMIN_ENV: "local"
155
- - uses: actions/upload-artifact@v2
156
- with:
157
- name: coverage--hub-local
158
- path: .coverage
159
-
160
- coverage:
161
- needs: [hub-prod, hub-cloud, storage, hub-local]
162
- runs-on: ubuntu-latest
163
- steps:
164
- - uses: actions/checkout@v4
165
- - uses: actions/setup-python@v4
166
- with:
167
- python-version: "3.11"
168
- cache: "pip"
169
- - run: |
170
- pip install coverage[toml]
171
- pip install --no-deps .
172
- - uses: actions/download-artifact@v2
173
- - name: run coverage
174
- run: |
175
- coverage combine coverage--*/.coverage*
176
- coverage report --fail-under=0
177
- coverage xml
178
- - uses: codecov/codecov-action@v2
179
- with:
180
- token: ${{ secrets.CODECOV_TOKEN }}
181
-
182
- docs:
183
- needs: hub-cloud
184
- runs-on: ubuntu-latest
185
- steps:
186
- - uses: aws-actions/configure-aws-credentials@v2
187
- with:
188
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
189
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
190
- aws-region: eu-central-1
191
- - uses: actions/checkout@v4
192
- with:
193
- submodules: recursive
194
- fetch-depth: 0
195
- - name: checkout lndocs
196
- uses: actions/checkout@v4
197
- with:
198
- repository: laminlabs/lndocs
199
- ssh-key: ${{ secrets.READ_LNDOCS }}
200
- path: lndocs
201
- ref: main
202
- - uses: actions/setup-python@v4
203
- with:
204
- python-version: "3.10"
205
- cache: "pip"
206
- cache-dependency-path: ".github/workflows/build.yml"
207
- - run: pip install "laminci@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
208
- - run: nox -s "install(group='docs')"
209
- - uses: actions/download-artifact@v2
210
- - run: nox -s docs
211
- - uses: nwtgck/actions-netlify@v1.2
212
- with:
213
- publish-dir: "_build/html"
214
- production-deploy: ${{ github.event_name == 'push' }}
215
- github-token: ${{ secrets.GITHUB_TOKEN }}
216
- enable-commit-comment: false
217
- env:
218
- NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
219
- NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
220
-
221
- notify:
222
- if: always()
223
- # this here is only for notifying developers of laminhub
224
- # hence, it only needs groups hub-local and hub-cloud
225
- needs: [hub-local, hub-cloud]
226
- runs-on: ubuntu-latest
227
- steps:
228
- - uses: voxmedia/github-action-slack-notify-build@v1
229
- if: ${{ needs.hub-local.result == 'success' && needs.hub-cloud.result == 'success' && github.event_name == 'repository_dispatch' }}
230
- env:
231
- SLACK_BOT_TOKEN: ${{ secrets.SLACK_GITHUB_ACTION }}
232
- with:
233
- channel_id: C05S2C02JHM
234
- status: SUCCESS
235
- color: good
236
- - uses: voxmedia/github-action-slack-notify-build@v1
237
- if: ${{ ( needs.hub-local.result == 'failure' || needs.hub-cloud.result == 'failure' ) && github.event_name == 'repository_dispatch' }}
238
- env:
239
- SLACK_BOT_TOKEN: ${{ secrets.SLACK_GITHUB_ACTION }}
240
- with:
241
- channel_id: C05S2C02JHM
242
- status: FAILURE
243
- color: danger
1
+ name: build
2
+
3
+ on:
4
+ push:
5
+ branches: [main, staging]
6
+ pull_request:
7
+ branches: [main]
8
+ repository_dispatch:
9
+ types: [build]
10
+
11
+ jobs:
12
+ # tests only on production hub
13
+ hub-prod:
14
+ runs-on: ubuntu-latest
15
+ timeout-minutes: 6
16
+ steps:
17
+ - uses: actions/checkout@v3
18
+ - uses: actions/setup-python@v4
19
+ with:
20
+ python-version: "3.10" # run one job on 3.9
21
+ cache: "pip"
22
+ - uses: aws-actions/configure-aws-credentials@v2
23
+ with:
24
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
25
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
26
+ aws-region: eu-central-1
27
+ - run: pip install "laminci@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
28
+ - run: nox -s "install(group='hub-prod')"
29
+ - run: nox -s "build(lamin_env='prod', group='hub-prod')"
30
+ - uses: actions/upload-artifact@v2
31
+ with:
32
+ name: coverage--hub-prod
33
+ path: .coverage
34
+
35
+ # tests both on production and staging hub
36
+ hub-cloud:
37
+ runs-on: ubuntu-22.04
38
+ strategy:
39
+ fail-fast: false
40
+ matrix:
41
+ include:
42
+ - lamin_env: "prod"
43
+ python-version: "3.11"
44
+ - lamin_env: "staging"
45
+ python-version: "3.10" # test on 3.9
46
+ timeout-minutes: 7
47
+ steps:
48
+ - uses: aws-actions/configure-aws-credentials@v2
49
+ with:
50
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
51
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
52
+ aws-region: eu-central-1
53
+ - uses: actions/checkout@v4
54
+ - uses: actions/setup-python@v4
55
+ with:
56
+ python-version: ${{ matrix.python-version }}
57
+ cache: "pip"
58
+ cache-dependency-path: ".github/workflows/build.yml"
59
+ - uses: actions/checkout@v4
60
+ with:
61
+ repository: laminlabs/laminhub
62
+ token: ${{ secrets.GH_TOKEN_DEPLOY_LAMINAPP }}
63
+ path: laminhub
64
+ ref: main
65
+ - uses: actions/cache@v3
66
+ with:
67
+ path: ~/.cache/pre-commit
68
+ key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
69
+ - id: cache-postgres
70
+ uses: actions/cache@v3
71
+ with:
72
+ path: ~/postgres.tar
73
+ key: cache-postgres-0
74
+ - if: steps.cache-postgres.outputs.cache-hit != 'true'
75
+ run: docker pull postgres:latest && docker image save postgres:latest --output ~/postgres.tar
76
+ - if: steps.cache-postgres.outputs.cache-hit == 'true'
77
+ run: docker image load --input ~/postgres.tar
78
+ - run: pip install "laminci@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
79
+ # account for in a different job
80
+ # - uses: "google-github-actions/auth@v0"
81
+ # with:
82
+ # credentials_json: "${{ secrets.GCP_CREDENTIALS }}"
83
+ # - uses: "google-github-actions/setup-gcloud@v0"
84
+ - run: nox -s "install(group='hub-cloud')"
85
+ - run: nox -s "build(lamin_env='${{ matrix.lamin_env }}', group='hub-cloud')"
86
+ - uses: actions/upload-artifact@v2
87
+ if: ${{ matrix.lamin_env == 'prod' }}
88
+ with:
89
+ name: coverage--hub-cloud
90
+ path: .coverage
91
+
92
+ # test user access to storage
93
+ storage:
94
+ runs-on: ubuntu-latest
95
+ timeout-minutes: 6
96
+ steps:
97
+ - uses: actions/checkout@v4
98
+ - uses: actions/setup-python@v4
99
+ with:
100
+ python-version: "3.9"
101
+ cache: "pip"
102
+ cache-dependency-path: ".github/workflows/build.yml"
103
+ - run: pip install "laminci@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
104
+ - run: nox -s "install(group='storage')"
105
+ - run: nox -s lint
106
+ - run: nox -s storage
107
+ env:
108
+ TEST_INSTANCE_PRIVATE_POSTGRES: ${{ secrets.TEST_INSTANCE_PRIVATE_POSTGRES }}
109
+ TMP_AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
110
+ TMP_AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
111
+ - uses: actions/upload-artifact@v2
112
+ with:
113
+ name: coverage--storage
114
+ path: .coverage
115
+
116
+ # test low-level hub functionality
117
+ hub-local:
118
+ runs-on: ubuntu-latest
119
+ timeout-minutes: 6
120
+ steps:
121
+ - uses: aws-actions/configure-aws-credentials@v2
122
+ with:
123
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
124
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
125
+ aws-region: eu-central-1
126
+ - uses: actions/checkout@v4
127
+ - uses: actions/checkout@v4
128
+ with:
129
+ repository: laminlabs/laminhub
130
+ token: ${{ secrets.GH_TOKEN_DEPLOY_LAMINAPP }}
131
+ path: laminhub
132
+ ref: main
133
+ - name: Set env file for local test of edge functions
134
+ run: |
135
+ touch .env.local
136
+ echo "AWS_ACCESS_KEY_ID_HOSTED_S3=${{ secrets.AWS_ACCESS_KEY_ID }}" >> .env.local
137
+ echo "AWS_SECRET_ACCESS_KEY_HOSTED_S3=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> .env.local
138
+ working-directory: laminhub/rest-hub/supabase
139
+ - uses: actions/setup-python@v4
140
+ with:
141
+ python-version: "3.11" # we need to run everything for coverage on 3.11
142
+ cache: "pip"
143
+ cache-dependency-path: ".github/workflows/build.yml"
144
+ - run: pip install "laminci@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
145
+ - run: nox -s "install(group='hub-local')"
146
+ - id: cache-supabase
147
+ uses: actions/cache@v3
148
+ with:
149
+ path: /var/lib/docker
150
+ key: cache-supabase
151
+ - uses: supabase/setup-cli@v1
152
+ - run: nox -s hub_local
153
+ env:
154
+ LAMIN_ENV: "local"
155
+ - uses: actions/upload-artifact@v2
156
+ with:
157
+ name: coverage--hub-local
158
+ path: .coverage
159
+
160
+ coverage:
161
+ needs: [hub-prod, hub-cloud, storage, hub-local]
162
+ runs-on: ubuntu-latest
163
+ steps:
164
+ - uses: actions/checkout@v4
165
+ - uses: actions/setup-python@v4
166
+ with:
167
+ python-version: "3.11"
168
+ cache: "pip"
169
+ - run: |
170
+ pip install coverage[toml]
171
+ pip install --no-deps .
172
+ - uses: actions/download-artifact@v2
173
+ - name: run coverage
174
+ run: |
175
+ coverage combine coverage--*/.coverage*
176
+ coverage report --fail-under=0
177
+ coverage xml
178
+ - uses: codecov/codecov-action@v2
179
+ with:
180
+ token: ${{ secrets.CODECOV_TOKEN }}
181
+
182
+ docs:
183
+ needs: hub-cloud
184
+ runs-on: ubuntu-latest
185
+ steps:
186
+ - uses: aws-actions/configure-aws-credentials@v2
187
+ with:
188
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
189
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
190
+ aws-region: eu-central-1
191
+ - uses: actions/checkout@v4
192
+ with:
193
+ submodules: recursive
194
+ fetch-depth: 0
195
+ - name: checkout lndocs
196
+ uses: actions/checkout@v4
197
+ with:
198
+ repository: laminlabs/lndocs
199
+ ssh-key: ${{ secrets.READ_LNDOCS }}
200
+ path: lndocs
201
+ ref: main
202
+ - uses: actions/setup-python@v4
203
+ with:
204
+ python-version: "3.10"
205
+ cache: "pip"
206
+ cache-dependency-path: ".github/workflows/build.yml"
207
+ - run: pip install "laminci@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
208
+ - run: nox -s "install(group='docs')"
209
+ - uses: actions/download-artifact@v2
210
+ - run: nox -s docs
211
+ - uses: nwtgck/actions-netlify@v1.2
212
+ with:
213
+ publish-dir: "_build/html"
214
+ production-deploy: ${{ github.event_name == 'push' }}
215
+ github-token: ${{ secrets.GITHUB_TOKEN }}
216
+ enable-commit-comment: false
217
+ env:
218
+ NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
219
+ NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
220
+
221
+ notify:
222
+ if: always()
223
+ # this here is only for notifying developers of laminhub
224
+ # hence, it only needs groups hub-local and hub-cloud
225
+ needs: [hub-local, hub-cloud]
226
+ runs-on: ubuntu-latest
227
+ steps:
228
+ - uses: voxmedia/github-action-slack-notify-build@v1
229
+ if: ${{ needs.hub-local.result == 'success' && needs.hub-cloud.result == 'success' && github.event_name == 'repository_dispatch' }}
230
+ env:
231
+ SLACK_BOT_TOKEN: ${{ secrets.SLACK_GITHUB_ACTION }}
232
+ with:
233
+ channel_id: C05S2C02JHM
234
+ status: SUCCESS
235
+ color: good
236
+ - uses: voxmedia/github-action-slack-notify-build@v1
237
+ if: ${{ ( needs.hub-local.result == 'failure' || needs.hub-cloud.result == 'failure' ) && github.event_name == 'repository_dispatch' }}
238
+ env:
239
+ SLACK_BOT_TOKEN: ${{ secrets.SLACK_GITHUB_ACTION }}
240
+ with:
241
+ channel_id: C05S2C02JHM
242
+ status: FAILURE
243
+ color: danger
@@ -1,23 +1,23 @@
1
- name: doc-changes
2
-
3
- on:
4
- pull_request_target:
5
- branches:
6
- - main
7
- types:
8
- - closed
9
-
10
- jobs:
11
- latest-changes:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v4
15
- - uses: actions/setup-python@v5
16
- with:
17
- python-version: "3.11"
18
- - run: pip install "laminci[doc-changes]@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
19
- - run: laminci doc-changes
20
- env:
21
- repo_token: ${{ secrets.GITHUB_TOKEN }}
22
- docs_token: ${{ secrets.LAMIN_BUILD_DOCS }}
23
- changelog_file: lamin-docs/docs/changelog/soon/lamindb.md
1
+ name: doc-changes
2
+
3
+ on:
4
+ pull_request_target:
5
+ branches:
6
+ - main
7
+ types:
8
+ - closed
9
+
10
+ jobs:
11
+ latest-changes:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.11"
18
+ - run: pip install "laminci[doc-changes]@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
19
+ - run: laminci doc-changes
20
+ env:
21
+ repo_token: ${{ secrets.GITHUB_TOKEN }}
22
+ docs_token: ${{ secrets.LAMIN_BUILD_DOCS }}
23
+ changelog_file: lamin-docs/docs/changelog/soon/lamindb.md