Skip to content

Commit

Permalink
[FIX]: Add nodejs setup for release script (#690)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyfelder authored Dec 11, 2024
1 parent ec25b2a commit eeceb6c
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 12 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build-release-docker-img.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 12 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -50,13 +50,17 @@ jobs:
git config user.name release-bot
git config user.email [email protected]
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"
Expand All @@ -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 }}
Expand Down
32 changes: 22 additions & 10 deletions scripts/release/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -57,23 +52,40 @@ 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 \
-v "$output_dir:/output" \
-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 \
-v "$output_dir:/output" \
-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

0 comments on commit eeceb6c

Please sign in to comment.