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 docker release #1851

Merged
merged 1 commit into from
Nov 7, 2024
Merged
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
106 changes: 98 additions & 8 deletions .github/workflows/_release_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ jobs:
name: Build and Publish Docker Images
runs-on: ubuntu-latest

steps:
- name: Check out the code
uses: actions/checkout@v3name: _Release 5 - Publish Docker Images to Docker Hub
on:
workflow_call:
workflow_dispatch:

permissions:
contents: read
packages: write

jobs:
publish-docker:
name: Build and Publish Docker Images
runs-on: ubuntu-latest

strategy:
matrix:
platform: [amd64, arm64]

steps:
- name: Check out the code
uses: actions/checkout@v3
Expand Down Expand Up @@ -41,6 +61,72 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Build and push the base image with Rust version tag for each platform
- name: Build and push raphtory_base Docker image
uses: docker/build-push-action@v4
with:
context: .
file: docker/base/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
build-args: |
BASE_IMAGE=${{ secrets.DOCKERHUB_USERNAME }}/raphtory_base:${{ env.RUST_VERSION }}-${{ matrix.platform }}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/raphtory_base:${{ env.RUST_VERSION }}-${{ matrix.platform }}

# Build and push Python Docker image with package version and platform-specific tags
- name: Build and push Python Docker image
uses: docker/build-push-action@v4
with:
context: .
file: docker/dockerfile
platforms: linux/amd64,linux/arm64
push: true
build-args: |
BASE_IMAGE=${{ secrets.DOCKERHUB_USERNAME }}/raphtory_base:${{ env.RUST_VERSION }}-${{ matrix.platform }}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/raphtory:${{ env.PACKAGE_VERSION }}-python-${{ matrix.platform }}

# Build and push Rust Docker image with package version and platform-specific tags
- name: Build and push Rust Docker image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
build-args: |
BASE_IMAGE=${{ secrets.DOCKERHUB_USERNAME }}/raphtory_base:${{ env.RUST_VERSION }}-${{ matrix.platform }}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/raphtory:${{ env.PACKAGE_VERSION }}-rust-${{ matrix.platform }}

- name: Extract Package and Rust Versions
id: version_extraction
run: |
PACKAGE_VERSION=$(grep -m 1 '^version' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
RUST_VERSION=$(grep -m 1 '^rust-version' Cargo.toml | sed 's/rust-version = "\(.*\)"/\1/')
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
echo "RUST_VERSION=$RUST_VERSION" >> $GITHUB_ENV
shell: bash

- name: Deactivate Private Storage
run: |
chmod +x ./scripts/deactivate_private_storage.py
./scripts/deactivate_private_storage.py

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up QEMU for multi-platform builds
uses: docker/setup-qemu-action@v2

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

# Build and push the base image with Rust version tag for each platform
- name: Build and push raphtory_base Docker image
uses: docker/build-push-action@v4
with:
Expand All @@ -49,27 +135,31 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/raphtory_base:${{ env.RUST_VERSION }}
${{ secrets.DOCKERHUB_USERNAME }}/raphtory_base:latest
${{ secrets.DOCKERHUB_USERNAME }}/raphtory_base:${{ env.RUST_VERSION }}-amd64
${{ secrets.DOCKERHUB_USERNAME }}/raphtory_base:${{ env.RUST_VERSION }}-arm64

- name: Build and push Python Docker image (pyraphtory)
# Build and push Python Docker image with package version and platform-specific tags
- name: Build and push Python Docker image
uses: docker/build-push-action@v4
with:
context: .
file: docker/dockerfile
platforms: linux/amd64,linux/arm64
push: true
build-args:
BASE_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/raphtory_base:${{ env.RUST_VERSION }}-${{ matrix.platform }}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/pyraphtory:${{ env.PACKAGE_VERSION }}
${{ secrets.DOCKERHUB_USERNAME }}/pyraphtory:latest
${{ secrets.DOCKERHUB_USERNAME }}/raphtory:${{ env.PACKAGE_VERSION }}-python-amd64
${{ secrets.DOCKERHUB_USERNAME }}/raphtory:${{ env.PACKAGE_VERSION }}-python-arm64

- name: Build and push Rust Docker image (raphtory)
# Build and push Rust Docker image with package version and platform-specific tags
- name: Build and push Rust Docker image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/raphtory:${{ env.PACKAGE_VERSION }}
${{ secrets.DOCKERHUB_USERNAME }}/raphtory:latest
${{ secrets.DOCKERHUB_USERNAME }}/raphtory:${{ env.PACKAGE_VERSION }}-rust-amd64
${{ secrets.DOCKERHUB_USERNAME }}/raphtory:${{ env.PACKAGE_VERSION }}-rust-arm64
Loading