Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor DB as document store, add Postgres, remove mongo #9176

Merged
merged 269 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from 245 commits
Commits
Show all changes
269 commits
Select commit Hold shift + click to select a range
19f25bd
Merge branch 'eelco/json_serde' into aziz/sql_json
eelcovdw Aug 21, 2024
f83a959
use new json serde, add enum support
eelcovdw Aug 21, 2024
292e5b5
usercode, status, log
eelcovdw Aug 21, 2024
c9d647c
organize files
eelcovdw Aug 21, 2024
3529f44
cleaning
eelcovdw Aug 21, 2024
343ed69
add attr_searchable
eelcovdw Aug 22, 2024
05e8306
add order_by for sync stash
eelcovdw Aug 22, 2024
e23af54
sync stash
eelcovdw Aug 22, 2024
85f3991
implement code history
abyesilyurt Aug 23, 2024
94a75af
blob store, contains
eelcovdw Aug 23, 2024
13e9a97
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Aug 23, 2024
6243156
key to str
abyesilyurt Aug 23, 2024
e47682e
update permissions
eelcovdw Aug 23, 2024
812b4a5
action store WIP
eelcovdw Aug 23, 2024
ce75ea7
Merge remote-tracking branch 'origin/aziz/sql_json' into eelco/json_a…
abyesilyurt Aug 23, 2024
f771c59
implement action stash
abyesilyurt Aug 23, 2024
db703f4
implement storage permissions
abyesilyurt Aug 23, 2024
b7aa781
action object fixes
abyesilyurt Aug 23, 2024
43ce9e5
fix get_mock
abyesilyurt Aug 23, 2024
72df3b2
add exclude attrs
eelcovdw Aug 23, 2024
b71e5e7
Merge branch 'eelco/json_action_store' of github.com:OpenMined/PySyft…
abyesilyurt Aug 23, 2024
948ef0d
fix deserialize
eelcovdw Aug 23, 2024
edd05f7
Merge branch 'eelco/json_action_store' of github.com:OpenMined/PySyft…
abyesilyurt Aug 23, 2024
4d8c159
fix error handling
abyesilyurt Aug 23, 2024
b7bd8cb
type hint fixes
abyesilyurt Aug 23, 2024
bb84ae6
fix perms
abyesilyurt Aug 23, 2024
5e3666d
fix test
abyesilyurt Aug 23, 2024
f25a86a
fix get_perms
abyesilyurt Aug 23, 2024
7b31c9a
fix sync
abyesilyurt Aug 23, 2024
0789e08
Add postgres document store
kiendang Aug 26, 2024
439f400
Add postgres action store
kiendang Aug 26, 2024
b0be81a
add project stash
abyesilyurt Aug 26, 2024
858ce52
Merge remote-tracking branch 'origin/dev' into aziz/sql_json
abyesilyurt Aug 26, 2024
d27616e
Merge branch 'dev' into postgres
khoaguin Aug 26, 2024
94d80d4
[syft/stores] Update `server.py` to use `PostgreSQL` stores
khoaguin Aug 26, 2024
42aced9
move sqlite connection to Server
eelcovdw Aug 26, 2024
5762e6d
move sqlite connection to Server
eelcovdw Aug 26, 2024
78fe0c7
implement notification stash
abyesilyurt Aug 26, 2024
662c5a6
signature handling improvements
abyesilyurt Aug 26, 2024
cc07ef2
Merge branch 'dev' into postgres
khoaguin Aug 27, 2024
ad4e38b
[syft/server] replace mongo store config with postgres
khoaguin Aug 27, 2024
5e0a3fc
merge WIP
eelcovdw Aug 27, 2024
cfdd3d5
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Aug 27, 2024
48cc473
add stash
eelcovdw Aug 27, 2024
f3ea67b
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Aug 27, 2024
72c7c58
fix bugs
abyesilyurt Aug 27, 2024
fee78f2
fix first notebook
eelcovdw Aug 27, 2024
d68e986
fix settingsstash
eelcovdw Aug 27, 2024
635afbe
fix order
abyesilyurt Aug 27, 2024
4c64595
fix sorting, add get_index
eelcovdw Aug 27, 2024
d26128a
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
eelcovdw Aug 27, 2024
17156ba
Merge branch 'dev' into postgres
khoaguin Aug 28, 2024
2541fb8
fix bugs
abyesilyurt Aug 28, 2024
93c5e25
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Aug 28, 2024
366e267
bug fix
abyesilyurt Aug 28, 2024
d6d5546
Merge branch 'dev' into postgres
madhavajay Aug 28, 2024
f6d21a6
add basic postgres support
abyesilyurt Aug 28, 2024
eccdb6b
Made some progress on postgreql
madhavajay Aug 28, 2024
1fc12a2
fix sync
abyesilyurt Aug 28, 2024
1c221fa
Merge remote-tracking branch 'origin/aziz/fix_sync' into aziz/postgre…
abyesilyurt Aug 28, 2024
add9bb1
Merge branch 'dev' into postgres
shubham3121 Aug 29, 2024
ca9896a
Add helm templates for postgres
shubham3121 Aug 29, 2024
27ca802
Merge branch 'dev' into postgres
khoaguin Aug 30, 2024
bad8e5a
[syft/stores] new exception handlings for some methods in `SQLiteBack…
khoaguin Aug 30, 2024
85f72f4
[syft/store] fix wrong imports and ports for postgres store
khoaguin Aug 30, 2024
a0a1f6c
merge dev
eelcovdw Sep 2, 2024
abfc2f1
fix
eelcovdw Sep 2, 2024
ea3114c
wip
abyesilyurt Sep 3, 2024
156e6f6
Merge remote-tracking branch 'origin' into aziz/postgres_json
abyesilyurt Sep 3, 2024
56bbe96
Merge branch 'aziz/sql_json' into aziz/postgres_json
abyesilyurt Sep 3, 2024
d2af027
Merge branch 'dev' into aziz/sql_json
eelcovdw Sep 4, 2024
f0a3d19
remove dict document store
abyesilyurt Sep 4, 2024
fd89d26
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Sep 4, 2024
ffa9f59
fix settings stash test
abyesilyurt Sep 4, 2024
83a6ab7
add remaining stashes
eelcovdw Sep 4, 2024
a7bfef2
fix
eelcovdw Sep 4, 2024
6bf895d
fixes
eelcovdw Sep 4, 2024
c615b63
fix notifcation tests
abyesilyurt Sep 4, 2024
03b4e11
fix request stash tests
abyesilyurt Sep 4, 2024
cc1b400
fix user stash tests
abyesilyurt Sep 4, 2024
8163587
fix dataset stash tests
abyesilyurt Sep 4, 2024
1aabb41
fix base stash tests
abyesilyurt Sep 4, 2024
37e6a74
json serialize filter
eelcovdw Sep 4, 2024
aa1d8b3
fix
eelcovdw Sep 4, 2024
b2b9379
Merge pull request #9263 from OpenMined/eelco/remaining_stashes
eelcovdw Sep 4, 2024
87b7d1a
fix notification service tests
abyesilyurt Sep 4, 2024
10ee731
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Sep 4, 2024
2bd627a
fix request service
abyesilyurt Sep 4, 2024
d3360e5
fix protocol
eelcovdw Sep 5, 2024
14ed20f
merge dev
eelcovdw Sep 5, 2024
0fdc2b8
remove dataset stash any type
eelcovdw Sep 5, 2024
e1c4e85
fix dependencies
eelcovdw Sep 5, 2024
6ca11f8
fix project tests
abyesilyurt Sep 5, 2024
1e2b976
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Sep 5, 2024
38212c7
fix job unittests
eelcovdw Sep 5, 2024
2745350
merge
eelcovdw Sep 5, 2024
668bc3b
simple way to create stashes
abyesilyurt Sep 5, 2024
6156456
fix queue
eelcovdw Sep 5, 2024
c6ae446
fix jobservice
eelcovdw Sep 5, 2024
6213fe5
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Sep 5, 2024
cd38c63
make traceback clickable
abyesilyurt Sep 5, 2024
33d654f
postgres bug fixes
abyesilyurt Sep 5, 2024
6e9d8fa
Merge branch 'dev' into postgres
khoaguin Sep 6, 2024
ddeab6d
wip postgres integration
abyesilyurt Sep 6, 2024
12a8bc4
comment out postgres
abyesilyurt Sep 6, 2024
01c1599
[k8s] stop creating the mongo pod in the cluster
khoaguin Sep 9, 2024
b578c0e
Merge branch 'dev' into postgres
khoaguin Sep 9, 2024
2fb065e
[syft/postgre_store] fix store initialization by adding `CREATE TABLE…
khoaguin Sep 9, 2024
9980c32
[lint] fix some linting issues
khoaguin Sep 9, 2024
6e128cf
[tox] waiting for postgres instead of mongo service in k8s tests
khoaguin Sep 9, 2024
c5f0a48
[notebooks] revert api notebook `0-load-data` back to `dev`'s state
khoaguin Sep 9, 2024
e00edf7
[postgres] add error handling for getting postgres storage config fro…
khoaguin Sep 9, 2024
dc2ca25
Merge remote-tracking branch 'origin/dev' into aziz/sql_json
abyesilyurt Sep 9, 2024
55316a7
fix consumer
eelcovdw Sep 9, 2024
dc668f3
[stores] refactor `_execute` to be a static method for both sqlite an…
khoaguin Sep 9, 2024
48c7741
add Query, split table creation
eelcovdw Sep 9, 2024
2ec8371
fix queue stash tests
abyesilyurt Sep 9, 2024
6f7d3e0
remove old methods
eelcovdw Sep 9, 2024
4f884ff
fix action store tests
abyesilyurt Sep 9, 2024
08ba5b2
fix worker pool tests
abyesilyurt Sep 9, 2024
726d8d1
fix some tests
abyesilyurt Sep 9, 2024
decebb0
Merge remote-tracking branch 'origin/dev' into aziz/sql_json
abyesilyurt Sep 9, 2024
76f0f51
Merge branch 'dev' into postgres
khoaguin Sep 10, 2024
77c8ac8
scope the use of cursor and db connection
shubham3121 Sep 10, 2024
4fd6070
fix lint
shubham3121 Sep 10, 2024
da16fcf
fix _delete args in postgres sqlstore
shubham3121 Sep 10, 2024
d3e6e2b
fix iter and order
abyesilyurt Sep 10, 2024
eb3501b
WIP migrationservice
eelcovdw Sep 10, 2024
9fddca6
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
eelcovdw Sep 10, 2024
8b5c98c
merge
eelcovdw Sep 10, 2024
8af186f
fix migrations
eelcovdw Sep 10, 2024
a523780
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Sep 10, 2024
151682d
fix test
abyesilyurt Sep 10, 2024
c4c1344
fix test
eelcovdw Sep 10, 2024
dcbc08e
merge
eelcovdw Sep 10, 2024
1ff2e96
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
eelcovdw Sep 10, 2024
72d36d6
add a few log statements
shubham3121 Sep 10, 2024
3d6dfff
merge
eelcovdw Sep 10, 2024
c51f544
set prepare_threshold to None
shubham3121 Sep 10, 2024
ff90871
fix new query
eelcovdw Sep 10, 2024
2609c0d
fix more tests
abyesilyurt Sep 10, 2024
c34ade6
Merge pull request #9277 from OpenMined/eelco/split-objectstash
eelcovdw Sep 10, 2024
8a68ff4
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Sep 10, 2024
064bb2d
fix all unit tests
abyesilyurt Sep 10, 2024
d92a9f0
refactor get_one, add validation to limit offset
eelcovdw Sep 10, 2024
0a542cc
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
eelcovdw Sep 10, 2024
00d69ac
fix dataset get_all
eelcovdw Sep 10, 2024
7ee43e9
implement reset password flow for python and fix it
abyesilyurt Sep 10, 2024
158c2f3
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Sep 10, 2024
b6c2381
fix some linting errors
abyesilyurt Sep 10, 2024
5998d58
fix is_unique, get_role
eelcovdw Sep 10, 2024
fc03c41
merge
eelcovdw Sep 10, 2024
a094d64
comments
eelcovdw Sep 10, 2024
d593a94
fix set type annotation
eelcovdw Sep 10, 2024
963a857
local session management
eelcovdw Sep 10, 2024
ef3ba4b
Merge branch 'dev' into postgres
khoaguin Sep 11, 2024
c81764b
[clean] remove mongo related tests and fixtures
khoaguin Sep 11, 2024
175a50b
[clean] remove mongo from tox.ini and helm's `base.yaml`
khoaguin Sep 11, 2024
81bf1a3
[clean] delete mongo code from document store
khoaguin Sep 11, 2024
095398f
Merge remote-tracking branch 'origin' into aziz/sql_json
abyesilyurt Sep 11, 2024
6df49c7
[clean] remove mongomock in tests and mongo-related packages
khoaguin Sep 11, 2024
fee08de
[clean] remove mongo related api reference
khoaguin Sep 11, 2024
3eabf45
fix lint
abyesilyurt Sep 11, 2024
895e3cd
[script] `reset_k8s.sh` works with postgres
khoaguin Sep 11, 2024
3272d9b
fix session
eelcovdw Sep 11, 2024
aea9877
replace DocumentStore with DBManager
abyesilyurt Sep 11, 2024
114a287
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Sep 11, 2024
6d0b4b9
fix env variables in module scope, fix root admin already exists
eelcovdw Sep 11, 2024
17315ab
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
eelcovdw Sep 11, 2024
93ac91b
Merge branch 'dev' into postgres
khoaguin Sep 11, 2024
410deb6
Merge branch 'dev' into postgres
khoaguin Sep 12, 2024
d5a950a
add a connection pool class
shubham3121 Sep 11, 2024
93c886e
Merge branch 'aziz/sql_json' into shubham/postgres-k8s
shubham3121 Sep 12, 2024
8606b5c
Merge branch 'dev' into aziz/sql_json
shubham3121 Sep 12, 2024
4aa6c2f
Merge branch 'aziz/sql_json' into shubham/postgres-k8s
shubham3121 Sep 12, 2024
fd6ef15
add protocol
eelcovdw Sep 12, 2024
90d1ee4
split db manager class
eelcovdw Sep 12, 2024
1aa70c5
rename db_sqlite
eelcovdw Sep 12, 2024
5ff95b9
add partial updates
abyesilyurt Sep 12, 2024
07bba88
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Sep 12, 2024
3b77c22
root admin delete check
eelcovdw Sep 12, 2024
5a96ae9
fix
eelcovdw Sep 12, 2024
7b46813
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
eelcovdw Sep 12, 2024
d631b90
fix tests that delete root user
eelcovdw Sep 12, 2024
ffc2b52
implement nested queries
abyesilyurt Sep 12, 2024
bd0ed78
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Sep 12, 2024
cadba5c
remove duplicate postgres reference in base.yml
shubham3121 Sep 12, 2024
8eb48a0
add a test for todo item
abyesilyurt Sep 12, 2024
3451ead
clean up todo notes
abyesilyurt Sep 12, 2024
d065151
rename postgres_db to postgres.py
shubham3121 Sep 12, 2024
f9caf28
rename base to sqlite_db.py
shubham3121 Sep 12, 2024
a849dbe
Merge branch 'dev' into aziz/sql_json
eelcovdw Sep 12, 2024
f768b58
Merge branch 'aziz/sql_json' into shubham/postgres-k8s
shubham3121 Sep 12, 2024
83a6b3e
Merge branch 'aziz/sql_json' into shubham/postgres-k8s
shubham3121 Sep 12, 2024
12c0f17
fix imports
shubham3121 Sep 12, 2024
000092d
update postgres version to 16.1
shubham3121 Sep 12, 2024
f1cd69a
[deps] scanning postgres:16.1 security
khoaguin Sep 12, 2024
011a1bb
fixes
eelcovdw Sep 12, 2024
8d1d482
fix network service
abyesilyurt Sep 12, 2024
f62e497
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Sep 12, 2024
71c0c02
Merge branch 'shubham/postgres-k8s' into aziz/sql_json
abyesilyurt Sep 12, 2024
5d8ecd0
update protocol file
abyesilyurt Sep 12, 2024
7deb517
add db config
abyesilyurt Sep 12, 2024
b35a503
fix migration tests
eelcovdw Sep 12, 2024
2f558aa
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
eelcovdw Sep 12, 2024
0708054
- [db] fix failed stack.notebook test since by changing `SQLITE_PATH`…
khoaguin Sep 13, 2024
547e191
Merge branch 'dev' into aziz/sql_json
khoaguin Sep 13, 2024
0ddbc53
add different base to handle two dbs
abyesilyurt Sep 13, 2024
43ca0d3
add get_table to basecls
eelcovdw Sep 13, 2024
1ef6506
fix postgres error
abyesilyurt Sep 13, 2024
8a6921d
fix queries for postgres
abyesilyurt Sep 13, 2024
4d187bf
Merge branches 'aziz/sql_json' and 'aziz/sql_json' of github.com:Open…
abyesilyurt Sep 13, 2024
f933469
fix sqlite
abyesilyurt Sep 13, 2024
501861b
fix ordering in postgres
abyesilyurt Sep 13, 2024
0dc509e
fix string casting in postgres
abyesilyurt Sep 13, 2024
66851f4
deduplicate permissions
eelcovdw Sep 13, 2024
270d55f
merge
eelcovdw Sep 13, 2024
638132c
fix getlatest
eelcovdw Sep 13, 2024
72256f7
fix orderby non-json
eelcovdw Sep 13, 2024
86153ae
fix lint CI
eelcovdw Sep 13, 2024
7bf6452
fix lint
eelcovdw Sep 13, 2024
4865ec6
remove uses of find_all
abyesilyurt Sep 13, 2024
5e1882a
fix instrument imports
eelcovdw Sep 13, 2024
3a19577
trying to fix flaky test
abyesilyurt Sep 13, 2024
9afcacb
Merge branch 'dev' into aziz/sql_json
shubham3121 Sep 16, 2024
39a06b7
[protocol_version] define old version for `SyftWorkerImage` and `Noti…
khoaguin Sep 16, 2024
1742cf0
reset queue version to 1 and remove migrations for queue and subclasses
shubham3121 Sep 16, 2024
cbd320d
fix lint
shubham3121 Sep 16, 2024
74f0edb
fix arg to refer to canonical name if exists
shubham3121 Sep 16, 2024
3b3023d
[clean] remove `store_client_config` arg using for debug
khoaguin Sep 16, 2024
b93f7d7
fix migration logic for worker settings
shubham3121 Sep 16, 2024
34a9ca0
fix partial updates
abyesilyurt Sep 16, 2024
2be5322
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Sep 16, 2024
48668e4
fix return statement in queue stash migration
shubham3121 Sep 16, 2024
ef4d05f
rename create_root_admin
eelcovdw Sep 16, 2024
8c1c5fc
rename searchable attrs serde
eelcovdw Sep 16, 2024
1040fa5
jsonserde default noop
eelcovdw Sep 16, 2024
cc8e976
change sqlite db path in container mode and postgresql mount path in …
khoaguin Sep 16, 2024
a6ea3d5
fix class name for APIEndpointQueueItem version 1
shubham3121 Sep 16, 2024
7a64588
add sqlalchemy opentelemetry intrumentation package to pypi
shubham3121 Sep 16, 2024
5b4c63a
refactor db reset logic
abyesilyurt Sep 16, 2024
e352e92
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
abyesilyurt Sep 16, 2024
8a47d99
use in memory sqlite
abyesilyurt Sep 17, 2024
8417653
manage db path externally
abyesilyurt Sep 17, 2024
e5ff154
Revert "manage db path externally"
abyesilyurt Sep 17, 2024
f489ee4
more logs in custom endpoint notebook
eelcovdw Sep 17, 2024
c3eb2df
Merge branch 'aziz/sql_json' of github.com:OpenMined/PySyft into aziz…
eelcovdw Sep 17, 2024
f1e8d41
debug partition_by_server
eelcovdw Sep 17, 2024
c6d0e0b
wrap DatabaseError
eelcovdw Sep 17, 2024
b59fede
error handling for Query db errors
eelcovdw Sep 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/container-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ jobs:
name: syft.sbom.json
path: syft.sbom.json

scan-mongo-latest-trivy:
scan-postgres-latest-trivy:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
Expand All @@ -238,24 +238,24 @@ jobs:
continue-on-error: true
uses: aquasecurity/trivy-action@master
with:
image-ref: "mongo:7.0.0"
image-ref: "postgres:16.1"
format: "cyclonedx"
output: "mongo-trivy-results.sbom.json"
output: "postgres-trivy-results.sbom.json"
timeout: "10m0s"

#Upload SBOM to GitHub Artifacts
- name: Upload SBOM to GitHub Artifacts
uses: actions/upload-artifact@v4
with:
name: mongo-trivy-results.sbom.json
path: mongo-trivy-results.sbom.json
name: postgres-trivy-results.sbom.json
path: postgres-trivy-results.sbom.json

#Generate sarif file
- name: Run Trivy vulnerability scanner
continue-on-error: true
uses: aquasecurity/trivy-action@master
with:
image-ref: "mongo:7.0.0"
image-ref: "postgres:16.1"
format: "sarif"
output: "trivy-results.sarif"
timeout: "10m0s"
Expand All @@ -266,7 +266,7 @@ jobs:
with:
sarif_file: "trivy-results.sarif"

scan-mongo-latest-snyk:
scan-postgres-latest-snyk:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
Expand All @@ -281,7 +281,7 @@ jobs:
# This is where you will need to introduce the Snyk API token created with your Snyk account
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
image: mongo:7.0.0
image: postgres:16.1
args: --sarif-file-output=snyk-code.sarif

# Replace any "undefined" security severity values with 0. The undefined value is used in the case
Expand Down
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ import_heading_localfolder=relative
ignore_comments=False
force_grid_wrap=True
honor_noqa=True
skip_glob=packages/syft/src/syft/__init__.py,packages/grid/data/*,packages/syft/tests/mongomock/*
skip_glob=packages/syft/src/syft/__init__.py,packages/grid/data/*
18 changes: 6 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,36 @@ repos:
rev: v4.5.0
hooks:
- id: check-ast
exclude: ^(packages/syft/tests/mongomock)
always_run: true
- id: trailing-whitespace
always_run: true
exclude: ^(docs/|.+\.md|.bumpversion.cfg|packages/syft/tests/mongomock)
exclude: ^(docs/|.+\.md|.bumpversion.cfg)
- id: check-docstring-first
always_run: true
exclude: ^(packages/syft/tests/mongomock)
- id: check-json
always_run: true
exclude: ^(packages/grid/frontend/|packages/syft/tests/mongomock|.vscode)
exclude: ^(packages/grid/frontend/|.vscode)
- id: check-added-large-files
always_run: true
exclude: ^(packages/grid/backend/wheels/.*|docs/img/header.png|docs/img/terminalizer.gif)
- id: check-yaml
always_run: true
exclude: ^(packages/grid/k8s/rendered/|packages/grid/helm/|packages/syft/tests/mongomock)
exclude: ^(packages/grid/k8s/rendered/|packages/grid/helm/)
- id: check-merge-conflict
always_run: true
args: ["--assume-in-merge"]
- id: check-executables-have-shebangs
always_run: true
exclude: ^(packages/syft/tests/mongomock)
- id: debug-statements
always_run: true
exclude: ^(packages/syft/tests/mongomock)
- id: name-tests-test
always_run: true
exclude: ^(.*/tests/utils/)|^(.*fixtures.py|packages/syft/tests/mongomock)|^(tests/scenarios/bigquery/helpers)
exclude: ^(.*/tests/utils/)|^(.*fixtures.py)|^(tests/scenarios/bigquery/helpers)
- id: requirements-txt-fixer
always_run: true
exclude: "packages/syft/tests/mongomock"
- id: mixed-line-ending
args: ["--fix=lf"]
exclude: '\.bat|\.csv|\.ps1$|packages/syft/tests/mongomock'
exclude: '\.bat|\.csv|\.ps1$'

- repo: https://github.com/MarcoGorelli/absolufy-imports # This repository has been archived by the owner on Aug 15, 2023. It is now read-only.
rev: v0.3.1
Expand Down Expand Up @@ -88,7 +83,6 @@ repos:
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
exclude: packages/syft/tests/mongomock
types_or: [python, pyi, jupyter]
- id: ruff-format
types_or: [python, pyi, jupyter]
Expand Down Expand Up @@ -178,7 +172,7 @@ repos:
rev: "v3.0.0-alpha.9-for-vscode"
hooks:
- id: prettier
exclude: ^(packages/grid/helm|packages/grid/frontend/pnpm-lock.yaml|packages/syft/tests/mongomock|.vscode)
exclude: ^(packages/grid/helm|packages/grid/frontend/pnpm-lock.yaml|.vscode)

# - repo: meta
# hooks:
Expand Down
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
},
{
"name": "Syft Debugger",
"type": "debugpy",
Expand Down
31 changes: 0 additions & 31 deletions docs/source/api_reference/syft.store.mongo_client.rst

This file was deleted.

35 changes: 0 additions & 35 deletions docs/source/api_reference/syft.store.mongo_codecs.rst

This file was deleted.

40 changes: 0 additions & 40 deletions docs/source/api_reference/syft.store.mongo_document_store.rst

This file was deleted.

3 changes: 0 additions & 3 deletions docs/source/api_reference/syft.store.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,5 @@
syft.store.kv_document_store
syft.store.linked_obj
syft.store.locks
syft.store.mongo_client
syft.store.mongo_codecs
syft.store.mongo_document_store
syft.store.sqlite_document_store

4 changes: 2 additions & 2 deletions notebooks/tutorials/deployments/03-deploy-k8s-k3d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"If you want to deploy your Kubernetes cluster in a resource-constrained environment, use the following flags to override the default configurations. Please note that you will need at least 1 CPU and 2 GB of RAM on Docker, and some tests may not work in such low-resource environments:\n",
"\n",
"```sh\n",
"helm install my-syft openmined/syft --version $SYFT_VERSION --namespace syft --create-namespace --set ingress.className=\"traefik\" --set server.resourcesPreset=null --set seaweedfs.resourcesPreset=null --set mongo.resourcesPreset=null --set registry.resourcesPreset=null --set proxy.resourcesPreset=null --set frontend.resourcesPreset=null\n",
"helm install my-syft openmined/syft --version $SYFT_VERSION --namespace syft --create-namespace --set ingress.className=\"traefik\" --set server.resourcesPreset=null --set seaweedfs.resourcesPreset=null --set postgres.resourcesPreset=null --set registry.resourcesPreset=null --set proxy.resourcesPreset=null --set frontend.resourcesPreset=null\n",
"```\n",
"\n",
"</div>\n",
Expand All @@ -89,7 +89,7 @@
"If you would like to set your own default password even for the production style deployment, use the following command:\n",
"\n",
"```sh\n",
"helm install my-syft openmined/syft --version $SYFT_VERSION --namespace syft --create-namespace --set ingress.className=\"traefik\" --set global.randomizedSecrets=false --set server.secret.defaultRootPassword=\"changethis\" --set seaweedfs.secret.s3RootPassword=\"admin\" --set mongo.secret.rootPassword=\"example\"\n",
"helm install my-syft openmined/syft --version $SYFT_VERSION --namespace syft --create-namespace --set ingress.className=\"traefik\" --set global.randomizedSecrets=false --set server.secret.defaultRootPassword=\"changethis\" --set seaweedfs.secret.s3RootPassword=\"admin\" --set postgres.secret.rootPassword=\"example\"\n",
"```\n",
"</div>\n"
]
Expand Down
13 changes: 7 additions & 6 deletions packages/grid/backend/backend.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ARG TORCH_VERSION="2.2.2"

# ==================== [BUILD STEP] Python Dev Base ==================== #

FROM cgr.dev/chainguard/wolfi-base as syft_deps
FROM cgr.dev/chainguard/wolfi-base AS syft_deps

ARG PYTHON_VERSION
ARG UV_VERSION
Expand Down Expand Up @@ -45,7 +45,7 @@ RUN --mount=type=cache,target=/root/.cache,sharing=locked \

# ==================== [Final] Setup Syft Server ==================== #

FROM cgr.dev/chainguard/wolfi-base as backend
FROM cgr.dev/chainguard/wolfi-base AS backend

ARG PYTHON_VERSION
ARG UV_VERSION
Expand Down Expand Up @@ -84,9 +84,10 @@ ENV \
DEFAULT_ROOT_EMAIL="[email protected]" \
DEFAULT_ROOT_PASSWORD="changethis" \
STACK_API_KEY="changeme" \
MONGO_HOST="localhost" \
MONGO_PORT="27017" \
MONGO_USERNAME="root" \
MONGO_PASSWORD="example"
POSTGRESQL_DBNAME="syftdb_postgres" \
POSTGRESQL_HOST="localhost" \
POSTGRESQL_PORT="5432" \
POSTGRESQL_USERNAME="syft_postgres" \
POSTGRESQL_PASSWORD="example"

CMD ["bash", "./grid/start.sh"]
11 changes: 6 additions & 5 deletions packages/grid/backend/grid/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,19 @@ def get_emails_enabled(self) -> Self:
# NETWORK_CHECK_INTERVAL: int = int(os.getenv("NETWORK_CHECK_INTERVAL", 60))
# DATASITE_CHECK_INTERVAL: int = int(os.getenv("DATASITE_CHECK_INTERVAL", 60))
CONTAINER_HOST: str = str(os.getenv("CONTAINER_HOST", "docker"))
MONGO_HOST: str = str(os.getenv("MONGO_HOST", ""))
MONGO_PORT: int = int(os.getenv("MONGO_PORT", 27017))
MONGO_USERNAME: str = str(os.getenv("MONGO_USERNAME", ""))
MONGO_PASSWORD: str = str(os.getenv("MONGO_PASSWORD", ""))
POSTGRESQL_DBNAME: str = str(os.getenv("POSTGRESQL_DBNAME", ""))
POSTGRESQL_HOST: str = str(os.getenv("POSTGRESQL_HOST", ""))
POSTGRESQL_PORT: int = int(os.getenv("POSTGRESQL_PORT", 5432))
POSTGRESQL_USERNAME: str = str(os.getenv("POSTGRESQL_USERNAME", ""))
POSTGRESQL_PASSWORD: str = str(os.getenv("POSTGRESQL_PASSWORD", ""))
DEV_MODE: bool = True if os.getenv("DEV_MODE", "false").lower() == "true" else False
# ZMQ stuff
QUEUE_PORT: int = int(os.getenv("QUEUE_PORT", 5556))
CREATE_PRODUCER: bool = (
True if os.getenv("CREATE_PRODUCER", "false").lower() == "true" else False
)
N_CONSUMERS: int = int(os.getenv("N_CONSUMERS", 1))
SQLITE_PATH: str = os.path.expandvars("$HOME/data/db/")
SQLITE_PATH: str = os.path.expandvars("/tmp/syft/")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @shubham3121 I changed this to /tmp/syft to solve sqlalchemy can't open database file in /root/data/db, but not sure it's optimal. Also in postgres-statefulset.yaml the mountPath is set to /data/db, should be change it to be the same to value of SQLITE_PATH?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What error do we get with /root/data/db ? Does it complain about directory doesn't exists or some sort of permission error ? Earlier we used to dir if doesn't exist, I think sqlalchemy could do that same maybe via some config.

Copy link
Member

@khoaguin khoaguin Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error is like below. I think it's a permission issue. This made the stack.test.notebook failed since the backend container was not running

Screenshot from 2024-09-13 10-55-57

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its seems like a permission issue to create a directory at the root level. Maybe we can create the director beforehand (while changing ownership of directory to user)

Copy link
Member

@khoaguin khoaguin Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but is there any problem with using /tmp/syft since we use it in the local python version?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after discussion changed it to /tmp/data/db for both single container and k8s mode in this commit cc8e976

SINGLE_CONTAINER_MODE: bool = str_to_bool(os.getenv("SINGLE_CONTAINER_MODE", False))
CONSUMER_SERVICE_NAME: str | None = os.getenv("CONSUMER_SERVICE_NAME")
INMEMORY_WORKERS: bool = str_to_bool(os.getenv("INMEMORY_WORKERS", True))
Expand Down
Loading
Loading