From eeceb6c5ac0b85d73fa5f574d7cce8a589629632 Mon Sep 17 00:00:00 2001 From: Jeremy Felder Date: Wed, 11 Dec 2024 15:08:31 +0200 Subject: [PATCH] [FIX]: Add nodejs setup for release script (#690) --- .../workflows/build-release-docker-img.yml | 34 +++++++++++++++++++ .github/workflows/release.yml | 14 ++++++-- scripts/release/build_all.sh | 32 +++++++++++------ 3 files changed, 68 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/build-release-docker-img.yml diff --git a/.github/workflows/build-release-docker-img.yml b/.github/workflows/build-release-docker-img.yml new file mode 100644 index 000000000..ecdddb41f --- /dev/null +++ b/.github/workflows/build-release-docker-img.yml @@ -0,0 +1,34 @@ +name: Build Release Docker Images + +on: workflow_dispatch + +jobs: + build-and-publish: + name: Build and Publish Docker Images + runs-on: ubuntu-latest + strategy: + matrix: + images: + - ubuntu22 + - ubuntu20 + - ubi8 + - ubi9 + steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build, tag, and push docker image + uses: docker/build-push-action@v6 + with: + # this label connects the icicle repo with the built package + # See more: https://docs.github.com/en/packages/learn-github-packages/connecting-a-repository-to-a-package + labels: | + org.opencontainers.image.source=https://github.com/ingonyama-zk/icicle + file: ./scripts/release/Dockerfile.${{ matrix.images }} + tags: ghcr.io/ingonyama-zk/icicle-release-${{ matrix.images }}-cuda122:latest + push: true \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 46ec82fa2..f9f58318f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ on: jobs: release: name: Release - runs-on: [self-hosted, Linux, X64, icicle] + runs-on: [self-hosted, Linux, X64, icicle] steps: - name: Checkout uses: actions/checkout@v4 @@ -50,13 +50,17 @@ jobs: git config user.name release-bot git config user.email release-bot@ingonyama.com cargo workspaces version ${{ inputs.releaseType }} -y --no-individual-tags --no-git-push -m "Bump rust crates' version" + - uses: actions/setup-node@v4 + with: + node-version: 18 - name: Bump docs version id: bump-docs-version if: inputs.releaseType != 'patch' working-directory: ./docs run: | LATEST_TAG=$(git describe --tags --abbrev=0) - LATEST_VERSION=$LATEST_TAG:0:1 + LATEST_VERSION=${LATEST_TAG:1} + npm install npm run docusaurus docs:version $LATEST_VERSION git add --all git commit -m "Bump docs version" @@ -67,6 +71,12 @@ jobs: run: | LATEST_TAG=$(git describe --tags --abbrev=0) gh release create $LATEST_TAG --generate-notes -d --verify-tag -t "Release $LATEST_TAG" + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Upload release tars env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/release/build_all.sh b/scripts/release/build_all.sh index df6cb1522..973e45869 100755 --- a/scripts/release/build_all.sh +++ b/scripts/release/build_all.sh @@ -29,16 +29,11 @@ if [[ ! -d "./icicle" || ! -d "./scripts" ]]; then exit 1 fi -# Build Docker images -echo "Building Docker images..." -# Ubuntu 22.04, CUDA 12.2.2 -docker build -t icicle-release-ubuntu22-cuda122 -f ./scripts/release/Dockerfile.ubuntu22 . -# Ubuntu 20.04, CUDA 12.2.2 -docker build -t icicle-release-ubuntu20-cuda122 -f ./scripts/release/Dockerfile.ubuntu20 . -# ubi8 (rhel compatible), CUDA 12.2.2 -docker build -t icicle-release-ubi8-cuda122 -f ./scripts/release/Dockerfile.ubi8 . -# ubi9 (rhel compatible), CUDA 12.2.2 -docker build -t icicle-release-ubi9-cuda122 -f ./scripts/release/Dockerfile.ubi9 . +# Download latest build images +docker pull ghcr.io/ingonyama-zk/icicle-release-ubuntu22-cuda122:latest +docker pull ghcr.io/ingonyama-zk/icicle-release-ubuntu20-cuda122:latest +docker pull ghcr.io/ingonyama-zk/icicle-release-ubi8-cuda122:latest +docker pull ghcr.io/ingonyama-zk/icicle-release-ubi9-cuda122:latest # Compile and tar release in each @@ -57,6 +52,9 @@ docker run --rm --gpus all \ -v ./scripts:/scripts \ icicle-release-ubuntu22-cuda122 bash /scripts/release/build_release_and_tar.sh icicle_$version ubuntu22 cuda122 & +# obtain the last backgrounded process' pid +pid_ubuntu22=$! + # ubuntu 20 docker run --rm --gpus all \ -v ./icicle:/icicle \ @@ -64,6 +62,8 @@ docker run --rm --gpus all \ -v ./scripts:/scripts \ icicle-release-ubuntu20-cuda122 bash /scripts/release/build_release_and_tar.sh icicle_$version ubuntu20 cuda122 & +pid_ubuntu20=$! + # ubi 8 (rhel compatible) docker run --rm --gpus all \ -v ./icicle:/icicle \ @@ -71,9 +71,21 @@ docker run --rm --gpus all \ -v ./scripts:/scripts \ icicle-release-ubi8-cuda122 bash /scripts/release/build_release_and_tar.sh icicle_$version ubi8 cuda122 & +pid_ubi8=$! + # ubi 9 (rhel compatible) docker run --rm --gpus all \ -v ./icicle:/icicle \ -v "$output_dir:/output" \ -v ./scripts:/scripts \ icicle-release-ubi9-cuda122 bash /scripts/release/build_release_and_tar.sh icicle_$version ubi9 cuda122 & + +pid_ubi9=$! + +# NOTE: After launching all builds in background tasks, we wait for all to complete +# otherwise the script completes and the calling process (potentially github actions) +# continues and may exit before the builds finish +wait $pid_ubuntu22 +wait $pid_ubuntu20 +wait $pid_ubi8 +wait $pid_ubi9