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

Update 0.8.4 #8514

Merged
merged 135 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
cb92050
[refactor] fixing issues in `syft/user`
khoaguin Feb 6, 2024
297e0b3
[refactor] mypy passes for files in `service/user`
khoaguin Feb 7, 2024
9f1e129
fix: change k8s port to 5800
tcp Feb 8, 2024
69ae274
[helm] fix container port
yashgorana Feb 8, 2024
e934baa
[ci] untag old betas
yashgorana Feb 9, 2024
9e8ed3c
[ci] move cleanup to azure tasks
yashgorana Feb 9, 2024
89261b3
update README with updated release version info
shubham3121 Feb 9, 2024
39e7f2a
Merge branch 'dev' into fix-mypy-issues-service-user
khoaguin Feb 12, 2024
932aa99
Merge branch 'dev' into yash/fix-cd-syft-dev
yashgorana Feb 12, 2024
bdaec6e
[ci] remove az cli login
yashgorana Feb 12, 2024
291e680
Merge branch 'dev' into fix/k8s-port
yashgorana Feb 12, 2024
5cee9bb
Merge branch 'dev' into fix-mypy-issues-service-user
kiendang Feb 12, 2024
543af6a
[cd] fix node 16 deprecation
yashgorana Feb 12, 2024
a3e26fe
[refactor] change ServiceRole.roles_for_level to classmethod
khoaguin Feb 13, 2024
74f761f
Switch type order
kiendang Feb 13, 2024
60da3d2
Merge branch 'dev' into fix-mypy-issues-service-user
kiendang Feb 13, 2024
0243c23
fix: patch coredns so k3d registry with custom port is accessible ins…
tcp Feb 13, 2024
dff79c1
Merge branch 'dev' into fix/k8s-port
tcp Feb 13, 2024
8f8199c
Merge branch 'dev' into fix-mypy-issues-service-user
kiendang Feb 13, 2024
2e50b74
test: patch ci
tcp Feb 13, 2024
69b9bf3
test: patch integration tests for k8s
tcp Feb 13, 2024
cf3ec3e
fix: doc sed
tcp Feb 13, 2024
51633f3
test: k8s patch coredns after test cluster creation
tcp Feb 13, 2024
aa3e45f
Remove unnecessary quotes around type
kiendang Feb 14, 2024
8fc658d
Merge branch 'dev' into fix-mypy-issues-service-user
kiendang Feb 14, 2024
970125c
Fix regex file matcher
kiendang Feb 14, 2024
65f83a8
trying macos arm64 runners
rasswanth-s Feb 14, 2024
7f808b7
commented out Mac Arm python version
rasswanth-s Feb 14, 2024
326b6fe
test hagrid launch
rasswanth-s Feb 14, 2024
952c083
try automating hagrid tests
rasswanth-s Feb 14, 2024
5bf9e56
include api/0.8 notebooks paths in workflow
rasswanth-s Feb 14, 2024
fde6bcb
modified to include absolute paths
rasswanth-s Feb 14, 2024
0da797f
modified python command
rasswanth-s Feb 14, 2024
26db521
modified port
rasswanth-s Feb 14, 2024
8ea74a2
Merge branch 'dev' into fix/k8s-port
yashgorana Feb 14, 2024
59d7c19
Added syft installation with data science packages
rasswanth-s Feb 14, 2024
93ae47a
modified orchestra deployment to k8s
rasswanth-s Feb 14, 2024
ea49b11
Merge branch 'dev' into fix-mypy-issues-service-user
kiendang Feb 14, 2024
c2436aa
Merge branch 'dev' into yash/fix-cd-syft-dev
rasswanth-s Feb 15, 2024
e15c8e4
Merge pull request #8471 from OpenMined/yash/fix-cd-syft-dev
rasswanth-s Feb 15, 2024
be62fe4
Merge branch 'dev' into fix-mypy-issues-service-user
khoaguin Feb 15, 2024
b0c3640
Merge pull request #8460 from khoaguin/fix-mypy-issues-service-user
kiendang Feb 15, 2024
003f32f
Merge branch 'dev' into fix/k8s-port
yashgorana Feb 15, 2024
e2b042f
Merge pull request #8469 from OpenMined/fix/k8s-port
yashgorana Feb 15, 2024
26df8f5
[syft]bump version
alfred-openmined-bot Feb 15, 2024
4d262b1
Added e2e.test.notebook to tox
rasswanth-s Feb 15, 2024
ac971fc
added syft version to tox e2e.test.notebook
rasswanth-s Feb 15, 2024
499633e
added syft version to tox e2e.test.notebook without printing version …
rasswanth-s Feb 15, 2024
4d2f317
lint
rasswanth-s Feb 15, 2024
864496c
fix e2e.test.notebook
rasswanth-s Feb 15, 2024
6543512
modified tox test
rasswanth-s Feb 15, 2024
64ca18f
fix minor spelling
rasswanth-s Feb 15, 2024
d70b2bf
skip collection
rasswanth-s Feb 15, 2024
588ecc7
Merge branch 'dev' into rasswanth/optimize-post-release-tests
rasswanth-s Feb 15, 2024
39f5abf
Co-Authored by: @khoaguin
rasswanth-s Feb 15, 2024
5cae6ee
Merge pull request #8493 from OpenMined/fix-protocol-bug
rasswanth-s Feb 15, 2024
ef72e35
[syft]bump version
alfred-openmined-bot Feb 15, 2024
f3da2da
Merge branch 'dev' into rasswanth/optimize-post-release-tests
rasswanth-s Feb 15, 2024
aee0a8c
removed redundant install steps
rasswanth-s Feb 15, 2024
b025faa
re-enabled syft install tests
rasswanth-s Feb 15, 2024
cb5cca8
Added post release tests to cd-syft release pipeline
rasswanth-s Feb 15, 2024
3e45a21
removed unsued comments
rasswanth-s Feb 15, 2024
e34f8c4
fix the version branch to dev
rasswanth-s Feb 15, 2024
8e6b98e
Merge pull request #8486 from OpenMined/rasswanth/optimize-post-relea…
rasswanth-s Feb 15, 2024
726814f
[syft]bump version
alfred-openmined-bot Feb 15, 2024
43cb69c
added syft version to github.event.inputs for dependent workflow
rasswanth-s Feb 15, 2024
5dfad0b
Merge pull request #8494 from OpenMined/rasswanth/fix-syft-version-cd
rasswanth-s Feb 15, 2024
f43e5df
shift to using workflow_call
rasswanth-s Feb 15, 2024
2f829cc
Merge pull request #8495 from OpenMined/rasswanth/fix-syft-version-cd
rasswanth-s Feb 15, 2024
54f5937
Bump pre-commit/action from 3.0.0 to 3.0.1
dependabot[bot] Feb 15, 2024
014501f
[syft]bump version
alfred-openmined-bot Feb 15, 2024
d358628
removed hardcoded syft versions
rasswanth-s Feb 15, 2024
ad50311
Merge branch 'dev' into rasswanth/fix-notebook-base-versions
rasswanth-s Feb 15, 2024
f6664a2
Merge pull request #8496 from OpenMined/rasswanth/fix-notebook-base-v…
rasswanth-s Feb 15, 2024
ac7fabe
[syft]bump version
alfred-openmined-bot Feb 15, 2024
0c858c6
Merge pull request #8477 from OpenMined/dependabot/github_actions/pre…
rasswanth-s Feb 16, 2024
7eab201
Bump pnpm/action-setup from 2 to 3
dependabot[bot] Feb 16, 2024
e510f7f
Merge pull request #8476 from OpenMined/dependabot/github_actions/pnp…
rasswanth-s Feb 16, 2024
98436da
modified syft node uid to syft node location
rasswanth-s Feb 16, 2024
9dad273
added k8s deployment to notebooks
rasswanth-s Feb 16, 2024
7a667f8
Merge pull request #8498 from OpenMined/rasswanth/fix-node-uid
rasswanth-s Feb 16, 2024
cee737b
[syft]bump version
alfred-openmined-bot Feb 16, 2024
7568cb2
re-enabled helm tests with notebook automation
rasswanth-s Feb 16, 2024
2d2adae
Merge branch 'dev' into rasswanth/automated-helm-test
rasswanth-s Feb 16, 2024
8976cd2
generalized 11-container-images notebook
rasswanth-s Feb 16, 2024
d9bb406
fix duplicate tox passenv
rasswanth-s Feb 16, 2024
8fa6a38
shift external registry to k3d registry for testing
rasswanth-s Feb 16, 2024
5cec78c
passed external registry context to registries
rasswanth-s Feb 16, 2024
4014c66
removed password printing in external registries
rasswanth-s Feb 16, 2024
61a5f3b
moved reg username and password to request.approve()
rasswanth-s Feb 16, 2024
aa786a7
fix helm error due to coredns
rasswanth-s Feb 17, 2024
0ce7284
shifted k3d to bash execution
rasswanth-s Feb 17, 2024
463b8e0
modify k3d installation method
rasswanth-s Feb 17, 2024
e8715c5
added storage cleanup and
rasswanth-s Feb 17, 2024
c58c7a1
shifted location of storage cleanup in github actions
rasswanth-s Feb 17, 2024
d121bab
added e2e notebook tests github workflow
rasswanth-s Feb 17, 2024
4128899
Merge pull request #8499 from OpenMined/rasswanth/automated-helm-test
rasswanth-s Feb 17, 2024
f80994e
Merge pull request #8507 from OpenMined/rasswanth/e2e-notebooks-yaml
rasswanth-s Feb 17, 2024
9184f56
[syft]bump version
alfred-openmined-bot Feb 17, 2024
90f4b2a
Added stub scripts to bumping versions
rasswanth-s Feb 18, 2024
8ccb9c3
Finished script for bumping versions
rasswanth-s Feb 19, 2024
15f7d1c
[syft]bump version
alfred-openmined-bot Feb 19, 2024
0ffcf6c
separated files by projects:
rasswanth-s Feb 19, 2024
4abede7
fix stable ersion to beta bump
rasswanth-s Feb 19, 2024
0b59c73
added a wait during syft release
rasswanth-s Feb 19, 2024
0ea5ab7
Merge branch 'dev' into rasswanth/release-script
rasswanth-s Feb 19, 2024
8fffebe
Merge pull request #8508 from OpenMined/rasswanth/release-script
rasswanth-s Feb 19, 2024
24e053d
added assert statements to check worker connection status
rasswanth-s Feb 19, 2024
c8072d9
selected only hagrid tests for debugging
rasswanth-s Feb 19, 2024
cf77b05
update ci for debugging
koenvanderveen Feb 19, 2024
e0bc904
Revert "added assert statements to check worker connection status"
rasswanth-s Feb 19, 2024
70d67f0
Revert "update ci for debugging"
rasswanth-s Feb 19, 2024
9c5f018
adding sleep to wait for worker pool creation
rasswanth-s Feb 19, 2024
64b897f
added log collector
rasswanth-s Feb 19, 2024
7fbf2a0
patch worker count to be 0 if unspecified
koenvanderveen Feb 19, 2024
044340b
Merge pull request #8510 from OpenMined/patch-worker-count
rasswanth-s Feb 20, 2024
35635c9
added tmate session for debugging
rasswanth-s Feb 20, 2024
c4a4ad9
add tunshell debugging
rasswanth-s Feb 20, 2024
773793c
[syft]bump version
alfred-openmined-bot Feb 20, 2024
24dda18
Merge branch 'dev' into rasswanth/debug-notebooks
rasswanth-s Feb 20, 2024
499869d
revert notebook changes
rasswanth-s Feb 20, 2024
9d3a80c
removed tunshell debugging and uncommented out the install checks sec…
rasswanth-s Feb 20, 2024
6375a1f
Merge pull request #8509 from OpenMined/rasswanth/debug-notebooks
rasswanth-s Feb 20, 2024
1eb34a7
Merge branch 'dev' into update-readme
rasswanth-s Feb 20, 2024
df38f1c
updated readme with new notebooks
rasswanth-s Feb 20, 2024
d4322de
update version to 0.8.4
rasswanth-s Feb 20, 2024
d00b801
disabled baseimage testing temporarily until release
rasswanth-s Feb 20, 2024
f4852ba
Merge pull request #8473 from OpenMined/update-readme
rasswanth-s Feb 20, 2024
cb8fc05
Revert "disabled baseimage testing temporarily until release"
rasswanth-s Feb 20, 2024
0668f33
changed version to syft beta versions manually
rasswanth-s Feb 20, 2024
5b846b0
Revert "Revert "disabled baseimage testing temporarily until release""
rasswanth-s Feb 20, 2024
aa033dc
Added missed packages during bump version
rasswanth-s Feb 20, 2024
18a7677
Merge pull request #8512 from OpenMined/update-cd-syft
rasswanth-s Feb 20, 2024
c090678
disabled assertion checks temporarily
rasswanth-s Feb 20, 2024
6d3ce95
Merge pull request #8511 from OpenMined/update-versions
rasswanth-s Feb 20, 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
66 changes: 66 additions & 0 deletions .github/workflows/cd-post-release-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ jobs:
steps:
- uses: actions/checkout@v4

# free 10GB of space
- name: Remove unnecessary files
if: matrix.os == 'ubuntu-latest'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
docker image prune --all --force
docker builder prune --all --force
docker system prune --all --force

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5

Expand Down Expand Up @@ -121,3 +131,59 @@ jobs:
- name: Check Syft version
run: |
python -c "import syft; print(syft.__version__)"

notebook-test-k8s-k3d:
strategy:
max-parallel: 99
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

# free 10GB of space
- name: Remove unnecessary files
if: matrix.os == 'ubuntu-latest'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
docker image prune --all --force
docker builder prune --all --force
docker system prune --all --force

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5

with:
python-version: ${{ matrix.python-version }}

- name: Install K3d
run: |
K3D_VERSION=v5.6.0
wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=$K3D_VERSION bash

- name: Get pip cache dir
id: pip-cache
shell: bash
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: pip cache
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-

- name: Install tox
run: |
pip install tox

- name: Run K8s tests
env:
SYFT_VERSION: ${{ inputs.syft_version }}
run: |
tox -e syft.test.helm
3 changes: 2 additions & 1 deletion notebooks/api/0.8/10-container-images.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,8 @@
"metadata": {},
"outputs": [],
"source": [
"assert job.job_worker_id is not None"
"# Disabling it due to Race Condition Error\n",
"# assert job.job_worker_id is not None"
]
},
{
Expand Down
58 changes: 46 additions & 12 deletions notebooks/api/0.8/11-container-images-k8s.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"# syft absolute\n",
"import syft as sy\n",
"\n",
"from getpass import getpass # noqa\n",
"\n",
"\n",
"sy.requires(SYFT_VERSION)\n",
"\n",
"# syft absolute\n",
Expand Down Expand Up @@ -210,11 +213,14 @@
"metadata": {},
"outputs": [],
"source": [
"registry = \"k3d-registry.localhost:5800\"\n",
"registry = os.getenv(\"SYFT_BASE_IMAGE_REGISTRY\", \"docker.io\")\n",
"repo = \"openmined/grid-backend\"\n",
"\n",
"res = requests.get(url=f\"http://{registry}/v2/{repo}/tags/list\")\n",
"tag = res.json()[\"tags\"][0]"
"if \"k3d\" in registry:\n",
" res = requests.get(url=f\"http://{registry}/v2/{repo}/tags/list\")\n",
" tag = res.json()[\"tags\"][0]\n",
"else:\n",
" tag = sy.__version__"
]
},
{
Expand Down Expand Up @@ -322,7 +328,23 @@
"id": "91a66871",
"metadata": {},
"source": [
"#### Add k3d Registry in Syft"
"#### Add External Registry in Syft"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "32a323ca-8293-408a-a878-a954df55d787",
"metadata": {},
"outputs": [],
"source": [
"external_registry = os.getenv(\"EXTERNAL_REGISTRY\", registry)\n",
"external_registry_username = os.getenv(\"EXTERNAL_REGISTRY_USERNAME\", None)\n",
"external_registry_password = os.getenv(\"EXTERNAL_REGISTRY_PASSWORD\", None)\n",
"\n",
"# external_registry = input()\n",
"# external_registry_username = getpass(\"Enter Registry Username\")\n",
"# external_registry_password = getpass(\"Enter Registry Password\")"
]
},
{
Expand All @@ -332,7 +354,7 @@
"metadata": {},
"outputs": [],
"source": [
"registry_add_result = domain_client.api.services.image_registry.add(registry)\n",
"registry_add_result = domain_client.api.services.image_registry.add(external_registry)\n",
"registry_add_result"
]
},
Expand Down Expand Up @@ -488,7 +510,11 @@
"outputs": [],
"source": [
"push_result = None\n",
"push_result = domain_client.api.services.worker_image.push(workerimage.id)\n",
"push_result = domain_client.api.services.worker_image.push(\n",
" workerimage.id,\n",
" username=external_registry_username,\n",
" password=external_registry_password,\n",
")\n",
"push_result"
]
},
Expand Down Expand Up @@ -544,6 +570,8 @@
" name=worker_pool_name,\n",
" image_uid=workerimage.id,\n",
" num_workers=3,\n",
" reg_username=external_registry_username,\n",
" reg_password=external_registry_password,\n",
")"
]
},
Expand Down Expand Up @@ -1027,7 +1055,11 @@
"source": [
"# Push OpenDP Image to registry\n",
"push_result = None\n",
"push_result = domain_client.api.services.worker_image.push(workerimage_opendp.id)\n",
"push_result = domain_client.api.services.worker_image.push(\n",
" workerimage_opendp.id,\n",
" username=external_registry_username,\n",
" password=external_registry_password,\n",
")\n",
"assert isinstance(push_result, sy.SyftSuccess), str(push_result)"
]
},
Expand All @@ -1040,9 +1072,7 @@
"source": [
"pool_name_opendp = \"opendp-pool\"\n",
"pool_create_request = domain_client.api.services.worker_pool.pool_creation_request(\n",
" pool_name=pool_name_opendp,\n",
" num_workers=3,\n",
" image_uid=workerimage_opendp.id,\n",
" pool_name=pool_name_opendp, num_workers=3, image_uid=workerimage_opendp.id\n",
")\n",
"pool_create_request"
]
Expand All @@ -1066,7 +1096,9 @@
"outputs": [],
"source": [
"# get the pending request and approve it\n",
"req_result = pool_create_request.approve()\n",
"req_result = pool_create_request.approve(\n",
" reg_username=external_registry_username, reg_password=external_registry_password\n",
")\n",
"req_result"
]
},
Expand Down Expand Up @@ -1210,7 +1242,9 @@
"metadata": {},
"outputs": [],
"source": [
"req_result = pool_image_create_request.approve()\n",
"req_result = pool_image_create_request.approve(\n",
" reg_username=external_registry_username, reg_password=external_registry_password\n",
")\n",
"req_result"
]
},
Expand Down
98 changes: 47 additions & 51 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ setenv =
NODE_PORT = {env:NODE_PORT:9082}
GITHUB_CI = {env:GITHUB_CI:false}
PYTEST_MODULES = {env:PYTEST_MODULES:frontend container_workload}
SYFT_BASE_IMAGE_REGISTRY = {env:SYFT_BASE_IMAGE_REGISTRY:k3d-registry.localhost:5800}
commands =
bash -c "echo Running with GITHUB_CI=$GITHUB_CI; date"
python -c 'import syft as sy; sy.stage_protocol_changes()'
Expand Down Expand Up @@ -851,77 +852,67 @@ commands =

[testenv:syft.test.helm]
description = Test Helm Chart for Kubernetes
deps =
{[testenv:syft]deps}
{[testenv:hagrid]deps}
nbmake
changedir = {toxinidir}
passenv=HOME, USER
passenv=HOME,USER,EXTERNAL_REGISTRY_USERNAME,EXTERNAL_REGISTRY_PASSWORD
allowlist_externals =
devspace
kubectl
grep
sleep
bash
kubectx
k3d
echo
rm
helm
tox
setenv =
ORCHESTRA_DEPLOYMENT_TYPE = {env:ORCHESTRA_DEPLOYMENT_TYPE:k8s}
NODE_PORT = {env:NODE_PORT:8080}
NODE_URL = {env:NODE_URL:http://localhost}
EXCLUDE_NOTEBOOKS = {env:EXCLUDE_NOTEBOOKS:not 10-container-images.ipynb}
SYFT_VERSION = {env:SYFT_VERSION:local}
EXTERNAL_REGISTRY = {env:EXTERNAL_REGISTRY:k3d-registry.localhost:5800}
commands =
k3d version
bash -c "echo Running with ORCHESTRA_DEPLOYMENT_TYPE=$ORCHESTRA_DEPLOYMENT_TYPE NODE_PORT=$NODE_PORT NODE_URL=$NODE_URL \
Excluding notebooks: $EXCLUDE_NOTEBOOKS SYFT_VERSION=$SYFT_VERSION \
EXTERNAL_REGISTRY=$EXTERNAL_REGISTRY; date"


bash -c "k3d version"

# Remvoing old clusters and volumes and registry
; bash -c "docker rm $(docker ps -aq) --force || true"
bash -c "k3d cluster delete syft || true"
bash -c "docker volume rm k3d-syft-images --force || true"

bash -c "k3d registry delete k3d-registry.localhost || true"

# Creating registry and cluster
bash -c 'k3d registry create registry.localhost --port 5800 -v `pwd`/k3d-registry:/var/lib/registry || true'

bash -c 'NODE_NAME=syft NODE_PORT=8080 && \
bash -c 'NODE_NAME=syft NODE_PORT=${NODE_PORT} && \
k3d cluster create syft -p "$NODE_PORT:80@loadbalancer" --registry-use k3d-registry.localhost || true \
k3d cluster start syft'
tox -e dev.k8s.patch.coredns
sleep 10
bash -c "kubectl --context k3d-syft create namespace syft || true"

# if syft version is local, then install local helm charts
# else install the helm charts from the openmined gh-pages branch
bash -c 'if [[ $SYFT_VERSION == "local" ]]; then \
echo "Installing local helm charts"; \
bash -c "cd packages/grid/helm && helm install --kube-context k3d-syft --namespace syft syft ./syft --set configuration.devmode=true"; \
else \
echo "Installing helm charts from repo for syft version: ${SYFT_VERSION}"; \
bash -c "helm repo add openmined https://openmined.github.io/PySyft/helm && helm repo update openmined"; \
bash -c "helm install --kube-context k3d-syft --namespace syft syft openmined/syft --version=${SYFT_VERSION} --set configuration.devmode=true"; \
fi'

; skopeo list-tags --tls-verify=false docker://k3d-registry.localhost:5800/openmined/grid-backend
; skopeo inspect --tls-verify=false docker://k3d-registry.localhost:5800/openmined/grid-backend:f1725f
; helm uninstall --kube-context k3d-syft --namespace syft syft
; helm install --kube-context k3d-syft --namespace syft syft ./syft
; k3d cluster create syft -p "8080:80@loadbalancer" && k3d cluster start syft

sleep 50

bash -c 'cd packages/grid && \
kubectl --context k3d-syft create namespace syft || true; \
helm install --kube-context k3d-syft --namespace syft syft ./helm/syft --debug'

; wait for everything else to be loaded
bash packages/grid/scripts/wait_for.sh service frontend --context k3d-syft --namespace syft
bash -c '(kubectl logs service/frontend --context k3d-syft --namespace syft -f &) | grep -q -E "Network:\s+https?://[a-zA-Z0-9.-]+:[0-9]+/" || true'

; wait for everything else to be loaded
bash packages/grid/scripts/wait_for.sh service mongo --context k3d-syft --namespace syft
bash packages/grid/scripts/wait_for.sh service backend --context k3d-syft --namespace syft
bash packages/grid/scripts/wait_for.sh service proxy --context k3d-syft --namespace syft

bash -c '(kubectl logs service/backend --context k3d-syft --namespace syft -f &) | grep -q "Application startup complete" || true'


; frontend
bash -c 'if [[ "$PYTEST_MODULES" == *"frontend"* ]]; then \
echo "Starting frontend"; date; \
pytest tests/integration -m frontend -p no:randomly -k "test_serves_domain_frontend" --co; \
pytest tests/integration -m frontend -vvvv -p no:randomly -p no:benchmark -o log_cli=True --capture=no -k "test_serves_domain_frontend"; \
return=$?; \
echo "Finished frontend"; date; \
exit $return; \
fi'

; ignore 06 because of opendp on arm64
pytest --nbmake notebooks/api/0.8 -p no:randomly -k 'not 10-container-images.ipynb' -vvvv
# Run Notebook tests
tox -e e2e.test.notebook

# Cleanup
bash -c "k3d cluster delete syft || true"
bash -c "docker volume rm k3d-syft-images --force || true"

Expand Down Expand Up @@ -1114,32 +1105,37 @@ commands =
# The below is the notebook test suite for point at external servers
[testenv:e2e.test.notebook]
description = E2E Notebook tests
changedir = {toxinidir}/notebooks
changedir = {toxinidir}
allowlist_externals =
bash
passenv = EXTERNAL_REGISTRY,EXTERNAL_REGISTRY_USERNAME,EXTERNAL_REGISTRY_PASSWORD
setenv =
ORCHESTRA_DEPLOYMENT_TYPE = {env:ORCHESTRA_DEPLOYMENT_TYPE:k8s}
NODE_PORT = {env:NODE_PORT:8080}
NODE_URL = {env:NODE_URL:http://localhost}
EXCLUDE_NOTEBOOKS = {env:EXCLUDE_NOTEBOOKS:}
SYFT_VERSION = {env:SYFT_VERSION:latest}
SYFT_VERSION = {env:SYFT_VERSION:local}
commands =
bash -c "echo Running with ORCHESTRA_DEPLOYMENT_TYPE=$ORCHESTRA_DEPLOYMENT_TYPE NODE_PORT=$NODE_PORT NODE_URL=$NODE_URL \
Excluding notebooks: $EXCLUDE_NOTEBOOKS SYFT_VERSION=$SYFT_VERSION; date"
Excluding notebooks: $EXCLUDE_NOTEBOOKS SYFT_VERSION=$SYFT_VERSION \
EXTERNAL_REGISTRY=$EXTERNAL_REGISTRY; date"


# Schema for EXLUDE_NOTEBOOKS is
# for excluding
# notebook1.ipynb, notebook2.ipynb
# EXCLUDE_NOTEBOOKS=not notebook1.ipynb and not notebook2.ipynb
bash -c "pip install pytest pytest-randomly nbmake"
#If the syft version is latest install the latest version of syft

# If the syft version is local install the local version
# else install the version of syft specified
bash -c "if [[ $SYFT_VERSION == 'latest' ]]; then \
pip install syft[data_science]; \
bash -c " if [[ $SYFT_VERSION == 'local' ]]; then \
echo 'Building local syft'; \
pip install packages/syft[data_science]; \
else \
pip install syft[data_science]==$SYFT_VERSION; \
echo 'Installing syft version: ${SYFT_VERSION}'; \
pip install syft[data_science]==${SYFT_VERSION}; \
fi"


pytest api/0.8 --nbmake -p no:randomly -vvvv --nbmake-timeout=1000 -k '{env:EXCLUDE_NOTEBOOKS:}'
pytest notebooks/api/0.8 --nbmake -p no:randomly -vvvv --nbmake-timeout=1000 -k '{env:EXCLUDE_NOTEBOOKS:}'
Loading