Skip to content

Commit

Permalink
Merge pull request #9018 from OpenMined/refactor/syft-error-handling-…
Browse files Browse the repository at this point in the history
…services

Refactor/syft error handling services
  • Loading branch information
tcp authored Jul 12, 2024
2 parents 7618dd4 + b1669db commit 1501092
Show file tree
Hide file tree
Showing 429 changed files with 15,964 additions and 15,323 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/cd-syft-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ jobs:
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}

- name: Set Grid package version
id: grid
- name: Set Server package version
id: server
shell: bash
run: |
echo "GRID_VERSION=$(python packages/grid/VERSION)" >> $GITHUB_OUTPUT
echo "SERVER_VERSION=$(python packages/grid/VERSION)" >> $GITHUB_OUTPUT
- name: Build and push `syft` image to registry
uses: docker/build-push-action@v6
Expand All @@ -92,53 +92,53 @@ jobs:
tags: |
${{ secrets.ACR_SERVER }}/openmined/syft-client:dev
${{ secrets.ACR_SERVER }}/openmined/syft-client:dev-${{ github.sha }}
${{ secrets.ACR_SERVER }}/openmined/syft-client:${{ steps.grid.outputs.GRID_VERSION }}
${{ secrets.ACR_SERVER }}/openmined/syft-client:${{ steps.server.outputs.SERVER_VERSION }}
- name: Build and push `grid-backend` image to registry
- name: Build and push `syft-backend` image to registry
uses: docker/build-push-action@v6
with:
context: ./packages
file: ./packages/grid/backend/backend.dockerfile
push: true
target: backend
tags: |
${{ secrets.ACR_SERVER }}/openmined/grid-backend:dev
${{ secrets.ACR_SERVER }}/openmined/grid-backend:dev-${{ github.sha }}
${{ secrets.ACR_SERVER }}/openmined/grid-backend:${{ steps.grid.outputs.GRID_VERSION }}
${{ secrets.ACR_SERVER }}/openmined/syft-backend:dev
${{ secrets.ACR_SERVER }}/openmined/syft-backend:dev-${{ github.sha }}
${{ secrets.ACR_SERVER }}/openmined/syft-backend:${{ steps.syft.outputs.SERVER_VERSION }}
- name: Build and push `grid-frontend` image to registry
- name: Build and push `syft-frontend` image to registry
uses: docker/build-push-action@v6
with:
context: ./packages/grid/frontend
file: ./packages/grid/frontend/frontend.dockerfile
push: true
tags: |
${{ secrets.ACR_SERVER }}/openmined/grid-frontend:dev
${{ secrets.ACR_SERVER }}/openmined/grid-frontend:dev-${{ github.sha }}
${{ secrets.ACR_SERVER }}/openmined/grid-frontend:${{ steps.grid.outputs.GRID_VERSION }}
target: grid-ui-development
${{ secrets.ACR_SERVER }}/openmined/syft-frontend:dev
${{ secrets.ACR_SERVER }}/openmined/syft-frontend:dev-${{ github.sha }}
${{ secrets.ACR_SERVER }}/openmined/syft-frontend:${{ steps.syft.outputs.SERVER_VERSION }}
target: syft-ui-development

- name: Build and push `grid-seaweedfs` image to registry
- name: Build and push `syft-seaweedfs` image to registry
uses: docker/build-push-action@v6
with:
context: ./packages/grid/seaweedfs
file: ./packages/grid/seaweedfs/seaweedfs.dockerfile
push: true
tags: |
${{ secrets.ACR_SERVER }}/openmined/grid-seaweedfs:dev
${{ secrets.ACR_SERVER }}/openmined/grid-seaweedfs:dev-${{ github.sha }}
${{ secrets.ACR_SERVER }}/openmined/grid-seaweedfs:${{ steps.grid.outputs.GRID_VERSION }}
${{ secrets.ACR_SERVER }}/openmined/syft-seaweedfs:dev
${{ secrets.ACR_SERVER }}/openmined/syft-seaweedfs:dev-${{ github.sha }}
${{ secrets.ACR_SERVER }}/openmined/syft-seaweedfs:${{ steps.syft.outputs.SERVER_VERSION }}
- name: Build and push `grid-enclave-attestation` image to registry
- name: Build and push `syft-enclave-attestation` image to registry
uses: docker/build-push-action@v6
with:
context: ./packages/grid/enclave/attestation
file: ./packages/grid/enclave/attestation/attestation.dockerfile
push: true
tags: |
${{ secrets.ACR_SERVER }}/openmined/grid-enclave-attestation:dev
${{ secrets.ACR_SERVER }}/openmined/grid-enclave-attestation:dev-${{ github.sha }}
${{ secrets.ACR_SERVER }}/openmined/grid-enclave-attestation:${{ steps.grid.outputs.GRID_VERSION }}
${{ secrets.ACR_SERVER }}/openmined/syft-enclave-attestation:dev
${{ secrets.ACR_SERVER }}/openmined/syft-enclave-attestation:dev-${{ github.sha }}
${{ secrets.ACR_SERVER }}/openmined/syft-enclave-attestation:${{ steps.syft.outputs.SERVER_VERSION }}
- name: Build Helm Chart & Copy to infra
if: github.ref == 'refs/heads/dev' || github.event.inputs.deploy-helm == 'true'
Expand Down
128 changes: 64 additions & 64 deletions .github/workflows/cd-syft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:

outputs:
release_tag: ${{ steps.get_release_tag.outputs.release_tag }}
grid_version: ${{ steps.release_metadata.outputs.grid_version }}
server_version: ${{ steps.release_metadata.outputs.server_version }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
echo "release_platform=linux/arm64" >> $GITHUB_OUTPUT
echo "short_release_platform=arm64" >> $GITHUB_OUTPUT
fi
echo "grid_version=$(python packages/grid/VERSION)" >> $GITHUB_OUTPUT
echo "server_version=$(python packages/grid/VERSION)" >> $GITHUB_OUTPUT
# TODO: Optimize redundant bump protocol version checks
- name: Check and Bump Protocol Version
Expand All @@ -185,79 +185,79 @@ jobs:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push `grid-backend` image to DockerHub
id: grid-backend-build
- name: Build and push `syft-backend` image to DockerHub
id: syft-backend-build
uses: docker/build-push-action@v6
with:
context: ./packages
file: ./packages/grid/backend/backend.dockerfile
platforms: ${{ steps.release_metadata.outputs.release_platform }}
target: backend
outputs: type=image,name=openmined/grid-backend,push-by-digest=true,name-canonical=true,push=true
cache-from: type=registry,ref=openmined/grid-backend:cache-${{ steps.release_metadata.outputs.short_release_platform }}
cache-to: type=registry,ref=openmined/grid-backend:cache-${{ steps.release_metadata.outputs.short_release_platform }},mode=max
outputs: type=image,name=openmined/syft-backend,push-by-digest=true,name-canonical=true,push=true
cache-from: type=registry,ref=openmined/syft-backend:cache-${{ steps.release_metadata.outputs.short_release_platform }}
cache-to: type=registry,ref=openmined/syft-backend:cache-${{ steps.release_metadata.outputs.short_release_platform }},mode=max

- name: Export digest for grid-backend
- name: Export digest for syft-backend
run: |
mkdir -p /tmp/digests/grid-backend
digest="${{ steps.grid-backend-build.outputs.digest }}"
touch "/tmp/digests/grid-backend/${digest#sha256:}"
mkdir -p /tmp/digests/syft-backend
digest="${{ steps.syft-backend-build.outputs.digest }}"
touch "/tmp/digests/syft-backend/${digest#sha256:}"
- name: Build and push `grid-frontend` image to DockerHub
id: grid-frontend-build
- name: Build and push `syft-frontend` image to DockerHub
id: syft-frontend-build
uses: docker/build-push-action@v6
with:
context: ./packages/grid/frontend
file: ./packages/grid/frontend/frontend.dockerfile
platforms: ${{ steps.release_metadata.outputs.release_platform }}
outputs: type=image,name=openmined/grid-frontend,push-by-digest=true,name-canonical=true,push=true
target: grid-ui-development
cache-from: type=registry,ref=openmined/grid-frontend:cache-${{ steps.release_metadata.outputs.short_release_platform }}
cache-to: type=registry,ref=openmined/grid-frontend:cache-${{ steps.release_metadata.outputs.short_release_platform}},mode=max
outputs: type=image,name=openmined/syft-frontend,push-by-digest=true,name-canonical=true,push=true
target: syft-ui-development
cache-from: type=registry,ref=openmined/syft-frontend:cache-${{ steps.release_metadata.outputs.short_release_platform }}
cache-to: type=registry,ref=openmined/syft-frontend:cache-${{ steps.release_metadata.outputs.short_release_platform}},mode=max

- name: Export digest for grid-frontend
- name: Export digest for syft-frontend
run: |
mkdir -p /tmp/digests/grid-frontend
digest="${{ steps.grid-frontend-build.outputs.digest }}"
touch "/tmp/digests/grid-frontend/${digest#sha256:}"
mkdir -p /tmp/digests/syft-frontend
digest="${{ steps.syft-frontend-build.outputs.digest }}"
touch "/tmp/digests/syft-frontend/${digest#sha256:}"
- name: Build and push `grid-seaweedfs` image to DockerHub
id: grid-seaweedfs-build
- name: Build and push `syft-seaweedfs` image to DockerHub
id: syft-seaweedfs-build
uses: docker/build-push-action@v6
with:
context: ./packages/grid/seaweedfs
file: ./packages/grid/seaweedfs/seaweedfs.dockerfile
platforms: ${{ steps.release_metadata.outputs.release_platform }}
outputs: type=image,name=openmined/grid-seaweedfs,push-by-digest=true,name-canonical=true,push=true
cache-from: type=registry,ref=openmined/grid-seaweedfs:cache-${{ steps.release_metadata.outputs.short_release_platform }}
cache-to: type=registry,ref=openmined/grid-seaweedfs:cache-${{ steps.release_metadata.outputs.short_release_platform}},mode=max
outputs: type=image,name=openmined/syft-seaweedfs,push-by-digest=true,name-canonical=true,push=true
cache-from: type=registry,ref=openmined/syft-seaweedfs:cache-${{ steps.release_metadata.outputs.short_release_platform }}
cache-to: type=registry,ref=openmined/syft-seaweedfs:cache-${{ steps.release_metadata.outputs.short_release_platform}},mode=max

- name: Export digest for grid-seaweedfs
- name: Export digest for syft-seaweedfs
run: |
mkdir -p /tmp/digests/grid-seaweedfs
digest="${{ steps.grid-seaweedfs-build.outputs.digest }}"
touch "/tmp/digests/grid-seaweedfs/${digest#sha256:}"
mkdir -p /tmp/digests/syft-seaweedfs
digest="${{ steps.syft-seaweedfs-build.outputs.digest }}"
touch "/tmp/digests/syft-seaweedfs/${digest#sha256:}"
# Some of the dependencies of grid-enclave-attestation are not available for arm64
# Hence, we are building grid-enclave-attestation only for x64 (see the `if` conditional)
- name: Build and push `grid-enclave-attestation` image to DockerHub
# Some of the dependencies of syft-enclave-attestation are not available for arm64
# Hence, we are building syft-enclave-attestation only for x64 (see the `if` conditional)
- name: Build and push `syft-enclave-attestation` image to DockerHub
if: ${{ endsWith(matrix.runner, '-x64') }}
id: grid-enclave-attestation-build
id: syft-enclave-attestation-build
uses: docker/build-push-action@v6
with:
context: ./packages/grid/enclave/attestation
file: ./packages/grid/enclave/attestation/attestation.dockerfile
platforms: ${{ steps.release_metadata.outputs.release_platform }}
outputs: type=image,name=openmined/grid-enclave-attestation,push-by-digest=true,name-canonical=true,push=true
cache-from: type=registry,ref=openmined/grid-enclave-attestation:cache-${{ steps.release_metadata.outputs.short_release_platform }}
cache-to: type=registry,ref=openmined/grid-enclave-attestation:cache-${{ steps.release_metadata.outputs.short_release_platform}},mode=max
outputs: type=image,name=openmined/syft-enclave-attestation,push-by-digest=true,name-canonical=true,push=true
cache-from: type=registry,ref=openmined/syft-enclave-attestation:cache-${{ steps.release_metadata.outputs.short_release_platform }}
cache-to: type=registry,ref=openmined/syft-enclave-attestation:cache-${{ steps.release_metadata.outputs.short_release_platform}},mode=max

- name: Export digest for grid-enclave-attestation
- name: Export digest for syft-enclave-attestation
if: ${{ endsWith(matrix.runner, '-x64') }}
run: |
mkdir -p /tmp/digests/grid-enclave-attestation
digest="${{ steps.grid-enclave-attestation-build.outputs.digest }}"
touch "/tmp/digests/grid-enclave-attestation/${digest#sha256:}"
mkdir -p /tmp/digests/syft-enclave-attestation
digest="${{ steps.syft-enclave-attestation-build.outputs.digest }}"
touch "/tmp/digests/syft-enclave-attestation/${digest#sha256:}"
- name: Build and push `syft` image to registry
id: syft-build
Expand All @@ -279,7 +279,7 @@ jobs:
- name: Upload digests
uses: actions/upload-artifact@v4
with:
name: digests-${{ steps.release_metadata.outputs.grid_version }}-${{ steps.release_metadata.outputs.short_release_platform }}
name: digests-${{ steps.release_metadata.outputs.server_version }}-${{ steps.release_metadata.outputs.short_release_platform }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
Expand All @@ -299,7 +299,7 @@ jobs:
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-${{ needs.build-and-push-docker-images.outputs.grid_version }}-*
pattern: digests-${{ needs.build-and-push-docker-images.outputs.server_version }}-*
merge-multiple: true

- name: Set up Docker Buildx
Expand All @@ -311,43 +311,43 @@ jobs:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Create manifest list and push for grid-backend
working-directory: /tmp/digests/grid-backend
- name: Create manifest list and push for syft-backend
working-directory: /tmp/digests/syft-backend
run: |
docker buildx imagetools create \
-t openmined/grid-backend:${{ needs.build-and-push-docker-images.outputs.grid_version }} \
-t openmined/grid-backend:${{ needs.build-and-push-docker-images.outputs.release_tag }} \
$(printf 'openmined/grid-backend@sha256:%s ' *)
-t openmined/syft-backend:${{ needs.build-and-push-docker-images.outputs.server_version }} \
-t openmined/syft-backend:${{ needs.build-and-push-docker-images.outputs.release_tag }} \
$(printf 'openmined/syft-backend@sha256:%s ' *)
- name: Create manifest list and push for grid-frontend
working-directory: /tmp/digests/grid-frontend
- name: Create manifest list and push for syft-frontend
working-directory: /tmp/digests/syft-frontend
run: |
docker buildx imagetools create \
-t openmined/grid-frontend:${{ needs.build-and-push-docker-images.outputs.grid_version }} \
-t openmined/grid-frontend:${{ needs.build-and-push-docker-images.outputs.release_tag }} \
$(printf 'openmined/grid-frontend@sha256:%s ' *)
-t openmined/syft-frontend:${{ needs.build-and-push-docker-images.outputs.server_version }} \
-t openmined/syft-frontend:${{ needs.build-and-push-docker-images.outputs.release_tag }} \
$(printf 'openmined/syft-frontend@sha256:%s ' *)
- name: Create manifest list and push for grid-seaweedfs
working-directory: /tmp/digests/grid-seaweedfs
- name: Create manifest list and push for syft-seaweedfs
working-directory: /tmp/digests/syft-seaweedfs
run: |
docker buildx imagetools create \
-t openmined/grid-seaweedfs:${{ needs.build-and-push-docker-images.outputs.grid_version }} \
-t openmined/grid-seaweedfs:${{ needs.build-and-push-docker-images.outputs.release_tag }} \
$(printf 'openmined/grid-seaweedfs@sha256:%s ' *)
-t openmined/syft-seaweedfs:${{ needs.build-and-push-docker-images.outputs.server_version }} \
-t openmined/syft-seaweedfs:${{ needs.build-and-push-docker-images.outputs.release_tag }} \
$(printf 'openmined/syft-seaweedfs@sha256:%s ' *)
- name: Create manifest list and push for grid-enclave-attestation
working-directory: /tmp/digests/grid-enclave-attestation
- name: Create manifest list and push for syft-enclave-attestation
working-directory: /tmp/digests/syft-enclave-attestation
run: |
docker buildx imagetools create \
-t openmined/grid-enclave-attestation:${{ needs.build-and-push-docker-images.outputs.grid_version }} \
-t openmined/grid-enclave-attestation:${{ needs.build-and-push-docker-images.outputs.release_tag }} \
$(printf 'openmined/grid-enclave-attestation@sha256:%s ' *)
-t openmined/syft-enclave-attestation:${{ needs.build-and-push-docker-images.outputs.server_version }} \
-t openmined/syft-enclave-attestation:${{ needs.build-and-push-docker-images.outputs.release_tag }} \
$(printf 'openmined/syft-enclave-attestation@sha256:%s ' *)
- name: Create manifest list and push for syft
working-directory: /tmp/digests/syft
run: |
docker buildx imagetools create \
-t openmined/syft-client:${{ needs.build-and-push-docker-images.outputs.grid_version }} \
-t openmined/syft-client:${{ needs.build-and-push-docker-images.outputs.server_version }} \
-t openmined/syft-client:${{ needs.build-and-push-docker-images.outputs.release_tag }} \
$(printf 'openmined/syft-client@sha256:%s ' *)
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/conda-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Conda Install - PySyft

on:
workflow_call:

workflow_dispatch:
inputs:
none:
description: "Run Version Tests Manually"
required: false

jobs:
constall-install-syft:
strategy:
max-parallel: 99
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.12"]
fail-fast: false

runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
activate-environment: syft_conda_env
python-version: ${{ matrix.python-version }}
- name: Install syft (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
python -m pip install ./packages/syft
$expectedVersion = python packages/grid/VERSION
$syftVersion = python -c 'import syft; print(syft.__version__)'
# Compare the versions
if ($expectedVersion -ne $syftVersion) {
Write-Output "Expected version: $expectedVersion"
Write-Output "Actual version: $syftVersion"
Write-Output "Version mismatch."
exit 1
}
- name: Install syft (MacOS or Linux)
if: matrix.os != 'windows-latest'
shell: bash -el {0}
run: |
python -m pip install ./packages/syft
EXPECTED_VERSION=$(python packages/grid/VERSION)
SYFT_VERSION=$(python -c 'import syft; print(syft.__version__)')
# Compare the versions
if [ "$EXPECTED_VERSION" != "$SYFT_VERSION" ]; then
echo "Expected version: $EXPECTED_VERSION"
echo "Actual version: $SYFT_VERSION"
echo "Version mismatch."
exit 1
fi
Loading

0 comments on commit 1501092

Please sign in to comment.