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

Fix CD #8446

Merged
merged 6 commits into from
Feb 2, 2024
Merged

Fix CD #8446

Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.8.4-beta.17
current_version = 0.8.4-beta.19
tag = False
tag_name = {new_version}
commit = True
Expand Down
75 changes: 38 additions & 37 deletions .github/workflows/cd-syft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
runs-on: ${{ matrix.runner }}

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

steps:
Expand Down Expand Up @@ -125,14 +125,27 @@ jobs:
python -m pip install --upgrade pip
pip install --upgrade bump2version tox

- name: Generate Release Metadata
id: release_metadata
- name: Get Release tag
id: get_release_tag
run: |
if [[ $(python packages/grid/VERSION) == *"beta"* ]]; then
echo "release_tag=beta" >> $GITHUB_OUTPUT
echo "release_tag=beta" >> $GITHUB_OUTPUT
else
echo "release_tag=latest" >> $GITHUB_OUTPUT
fi

- name: Bump the Version
if: steps.get_release_tag.outputs.release_tag == 'beta'
run: |
ls **/VERSION | xargs -I {} python {}
cat packages/grid/devspace.yaml | grep '0\.'
bump2version prenum --allow-dirty --no-commit
ls **/VERSION | xargs -I {} python {}
cat packages/grid/devspace.yaml | grep '0\.'

- name: Generate Release Metadata
id: release_metadata
run: |
if [[ ${{matrix.runner}} == *"x64"* ]]; then
echo "release_platform=linux/amd64" >> $GITHUB_OUTPUT
echo "short_release_platform=amd64" >> $GITHUB_OUTPUT
Expand All @@ -143,26 +156,15 @@ jobs:
echo "grid_version=$(python packages/grid/VERSION)" >> $GITHUB_OUTPUT
echo "seaweedfs_version=$(grep 'SEAWEEDFS_VERSION' packages/grid/default.env | cut -d '=' -f2)" >> $GITHUB_OUTPUT

- name: Bump the Version
id: bump-version
if: steps.release_metadata.outputs.release_tag == 'beta'
run: |
ls **/VERSION | xargs -I {} python {}
cat packages/grid/devspace.yaml | grep '0\.'
bump2version prenum --allow-dirty --no-commit
ls **/VERSION | xargs -I {} python {}
cat packages/grid/devspace.yaml | grep '0\.'

# TODO: Optimize redundant bump protocol version checks
- name: Check and Bump Protocol Version
run: |
if [[ $(python packages/grid/VERSION) != *"beta"* ]]; then
if [[ "${{ steps.get_release_tag.outputs.release_tag }}" == "latest" ]]; then
export BUMP=True
fi
tox -e syft.protocol.check

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker
Expand Down Expand Up @@ -253,6 +255,9 @@ jobs:

runs-on: sh-arc-linux-x64

outputs:
release_tag: ${{ needs.build-and-push-docker-images.outputs.release_tag }}

steps:
- name: Download digests
uses: actions/download-artifact@v4
Expand All @@ -262,7 +267,6 @@ jobs:
merge-multiple: true

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker
Expand Down Expand Up @@ -329,22 +333,8 @@ jobs:
python -m pip install --upgrade pip
pip install --upgrade tox setuptools wheel twine bump2version PyYAML

# Check if the version is a pre-release
- name: Check if the version is a pre-release and modify version string
id: release_checks
run: |
if [[ $(python packages/grid/VERSION) == *"beta"* ]]; then
echo "is_pre_release=true" >> $GITHUB_OUTPUT
echo "github_release_version=$(python packages/grid/VERSION | sed 's/-beta./b/')" >> $GITHUB_OUTPUT
else
echo "is_pre_release=false" >> $GITHUB_OUTPUT
echo "github_release_version=$(python packages/grid/VERSION)" >> $GITHUB_OUTPUT
fi
echo "future_stable_version=$(python packages/grid/VERSION | sed 's/-beta.*//')" >> $GITHUB_OUTPUT

- name: Bump the Version
id: bump-version
if: steps.release_checks.outputs.is_pre_release == 'true'
if: needs.merge-docker-images.outputs.release_tag == 'beta'
run: |
ls **/VERSION | xargs -I {} python {}
cat packages/grid/devspace.yaml | grep '0\.'
Expand All @@ -353,6 +343,17 @@ jobs:
cat packages/grid/devspace.yaml | grep '0\.'
python packages/hagrid/scripts/update_manifest.py $(python packages/grid/VERSION)

- name: Generate Release Metadata
id: release_checks
run: |
echo "github_release_version=$(python packages/grid/VERSION | sed 's/-beta./b/')" >> $GITHUB_OUTPUT
echo "future_stable_version=$(python packages/grid/VERSION | sed 's/-beta.*//')" >> $GITHUB_OUTPUT
if [[ ${{ needs.merge-docker-images.outputs.release_tag}} == "beta" ]]; then
echo "is_beta_release=true" >> $GITHUB_OUTPUT
else
echo "is_beta_release=false" >> $GITHUB_OUTPUT
fi

- name: Check Protocol Version
run: |
tox -e syft.protocol.check
Expand Down Expand Up @@ -383,7 +384,7 @@ jobs:

- name: Check and Bump Protocol Version
run: |
if [[ "${{ steps.release_checks.outputs.is_pre_release }}" == "false" ]]; then
if [[ "${{ needs.merge-docker-images.outputs.release_tag }}" == "latest" ]]; then
export BUMP=True
fi
tox -e syft.protocol.check
Expand All @@ -397,7 +398,7 @@ jobs:
tox -e lint || true

- name: Changes to commit to Syft Repo during beta release
if: steps.release_checks.outputs.is_pre_release == 'true'
if: needs.merge-docker-images.outputs.release_tag == 'beta'
uses: EndBug/add-and-commit@v9
with:
author_name: ${{ secrets.OM_BOT_NAME }}
Expand All @@ -406,7 +407,7 @@ jobs:
add: "['.bumpversion.cfg', 'VERSION', 'packages/grid/VERSION','packages/syft/PYPI.md', 'packages/grid/devspace.yaml', 'packages/syft/src/syft/VERSION', 'packages/syft/setup.cfg', 'packages/grid/frontend/package.json', 'packages/syft/src/syft/__init__.py', 'packages/hagrid/hagrid/manifest_template.yml', 'packages/grid/helm/syft/Chart.yaml','packages/grid/helm/repo', 'packages/hagrid/hagrid/deps.py', 'packages/grid/podman/podman-kube/podman-syft-kube.yaml' ,'packages/grid/podman/podman-kube/podman-syft-kube-config.yaml', 'packages/syftcli/manifest.yml', 'packages/syft/src/syft/protocol/protocol_version.json', 'packages/grid/backend/worker_cpu.dockerfile','packages/grid/helm/syft/values.yaml','packages/grid/helm/syft']"

- name: Changes to commit to Syft Repo during stable release
if: steps.release_checks.outputs.is_pre_release == 'false'
if: needs.merge-docker-images.outputs.release_tag == 'latest'
uses: EndBug/add-and-commit@v9
with:
author_name: ${{ secrets.OM_BOT_NAME }}
Expand Down Expand Up @@ -447,7 +448,7 @@ jobs:
# This step will copy the generated K8s manifest files to the correct directory in Infra repo
- name: Copy files to Infra Repo
run: |
if $is_pre_release; then
if [[ "${{ needs.merge-docker-images.outputs.release_tag }}" == "beta" ]]; then
rm -rf infrastructure/gitops/environments/pre_release/
mkdir -p infrastructure/gitops/environments/pre_release/
cp -R packages/grid/helm/syft/. infrastructure/gitops/environments/pre_release/
Expand Down Expand Up @@ -478,7 +479,7 @@ jobs:
with:
name: v${{ steps.release_checks.outputs.github_release_version }}
generate_release_notes: true
prerelease: ${{ steps.release_checks.outputs.is_pre_release }}
prerelease: ${{ steps.release_checks.outputs.is_beta_release }}
files: |
./packages/syftcli/manifest.yml
./build/syftcli-config/*
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Mono Repo Global Version
__version__ = "0.8.4-beta.17"
__version__ = "0.8.4-beta.19"
# elsewhere we can call this file: `python VERSION` and simply take the stdout

# stdlib
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Mono Repo Global Version
__version__ = "0.8.4-beta.17"
__version__ = "0.8.4-beta.19"
# elsewhere we can call this file: `python VERSION` and simply take the stdout

# stdlib
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/backend/worker_cpu.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Later we'd want to uninstall old python, and then install a new python runtime...
# ... but pre-built syft deps may break!

ARG SYFT_VERSION_TAG="0.8.4-beta.17"
ARG SYFT_VERSION_TAG="0.8.4-beta.19"
FROM openmined/grid-backend:${SYFT_VERSION_TAG}

ARG PYTHON_VERSION="3.11"
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ vars:
DEVSPACE_ENV_FILE: "default.env"
CONTAINER_REGISTRY: "docker.io"
NODE_NAME: "mynode"
VERSION: "0.8.4-beta.17"
VERSION: "0.8.4-beta.19"

# This is a list of `images` that DevSpace can build for this project
# We recommend to skip image building during development (devspace dev) as much as possible
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pygrid-ui",
"version": "0.8.4-beta.17",
"version": "0.8.4-beta.19",
"private": true,
"scripts": {
"dev": "pnpm i && vite dev --host --port 80",
Expand Down
Loading
Loading