Skip to content
Draft
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
73 changes: 14 additions & 59 deletions .github/workflows/golden-container-images-docker-build-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ name: golden-container-images-docker-build-rust
on:
workflow_dispatch:
inputs:
push_image:
description: 'Push the image to the registry'
push-image:
description: "Push the image to the registry"
default: true
required: true
type: boolean
tag:
description: 'Tag to use for the image'
default: 'latest'
required: true
description: "Tag to use for the image"
default: ""
required: false
type: string
rust-version:
description: "The rust version to use"
default: "stable"
required: false
type: string
pull_request:

permissions: {}

Expand All @@ -22,58 +26,8 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
check-changes:
name: golden-container-images-docker-build-rust/check-changes
permissions:
actions: 'read' # Required to read workflow run information
contents: 'read' # Required to checkout repository code
pull-requests: 'read' # Required to read pull request information
runs-on: ubuntu-latest
outputs:
changes-golden-rust: ${{ steps.filter.outputs.golden-rust }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
golden-rust:
- '.github/workflows/golden-container-images-docker-build-rust.yml'
- 'golden-container-images/rust-glibc/**'
- toolchain.txt
determine-tag:
name: golden-container-images-docker-build-rust/determine-tag
permissions:
actions: 'read' # Required to read workflow run information
contents: 'read' # Required to checkout repository code
pull-requests: 'read' # Required to read pull request information
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.set-tag.outputs.tag }}
steps:
- name: Checkout Project
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'
- id: set-tag
env:
TAG: ${{ github.event.inputs.tag }}
WORKSPACE: ${{ github.workspace }}
run: |
if [[ -n "${TAG}" ]]; then
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
else
if [[ -f "${WORKSPACE}/toolchain.txt" ]]; then
echo "tag=$(cat "${WORKSPACE}"/toolchain.txt)" >> "$GITHUB_OUTPUT"
fi
fi
build:
name: golden-container-images-docker-build-rust/build
needs: [check-changes, determine-tag]
if: ${{ needs.check-changes.outputs.changes-golden-rust == 'true' }}
uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@6c72e3dbc894744c1e228fb165f4c4d657e475b6 # v1.0.1
uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@a26bc8a5f372dd4f3e7b0c97d6ecdff059d6b03f # TODO: update this when merged: v1.0.1
secrets:
AWS_ACCESS_KEY_S3_USER: ${{ secrets.AWS_ACCESS_KEY_S3_USER }}
AWS_SECRET_KEY_S3_USER: ${{ secrets.AWS_SECRET_KEY_S3_USER }}
Expand All @@ -90,9 +44,10 @@ jobs:
with:
use-cgr-secrets: true
working-directory: "."
push_image: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.push_image == 'true' || github.event_name != 'workflow_dispatch' && true }}
push_image: ${{ inputs.push-image }}
image-name: "fhevm/gci/rust-glibc"
image-tag: ${{ needs.determine-tag.outputs.tag }}
image-tag: ${{ inputs.tag }}
rust-version: ${{ inputs.rust-version }}
docker-file: "./golden-container-images/rust-glibc/Dockerfile"
app-cache-dir: "fhevm-golden-rust"
ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/tags/{0}', github.event.inputs.tag) || '' }}
12 changes: 8 additions & 4 deletions .github/workflows/kms-connector-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
github.event_name == 'release'
|| (github.event_name != 'workflow_dispatch' && needs.check-changes.outputs.changes-db-migration == 'true')
|| (github.event_name == 'workflow_dispatch' && inputs.build_db_migration)
uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@6c72e3dbc894744c1e228fb165f4c4d657e475b6 # v1.0.1
uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@90f80e24a7d627ee96eb9257d8d23f1b9470deff # TODO: update this when merged: v1.0.1
secrets: &docker_secrets
AWS_ACCESS_KEY_S3_USER: ${{ secrets.AWS_ACCESS_KEY_S3_USER }}
AWS_SECRET_KEY_S3_USER: ${{ secrets.AWS_SECRET_KEY_S3_USER }}
Expand All @@ -123,14 +123,15 @@ jobs:
image-name: "fhevm/kms-connector/db-migration"
docker-file: "kms-connector/connector-db/Dockerfile"
app-cache-dir: "fhevm-kms-connector-db-migration"
rust-toolchain-file-path: kms-connector/rust-toolchain.toml

build-gw-listener:
needs: check-changes
if: |
github.event_name == 'release'
|| (github.event_name != 'workflow_dispatch' && needs.check-changes.outputs.changes-gw-listener == 'true')
|| (github.event_name == 'workflow_dispatch' && inputs.build_gw_listener)
uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@6c72e3dbc894744c1e228fb165f4c4d657e475b6 # v1.0.1
uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@90f80e24a7d627ee96eb9257d8d23f1b9470deff # TODO: update this when merged: v1.0.1
permissions: *docker_permissions
secrets: *docker_secrets
with:
Expand All @@ -139,14 +140,15 @@ jobs:
image-name: "fhevm/kms-connector/gw-listener"
docker-file: "./kms-connector/crates/gw-listener/Dockerfile"
app-cache-dir: "fhevm-kms-connector-gw-listener"
rust-toolchain-file-path: kms-connector/rust-toolchain.toml

build-kms-worker:
needs: check-changes
if: |
github.event_name == 'release'
|| (github.event_name != 'workflow_dispatch' && needs.check-changes.outputs.changes-kms-worker == 'true')
|| (github.event_name == 'workflow_dispatch' && inputs.build_kms_worker)
uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@6c72e3dbc894744c1e228fb165f4c4d657e475b6 # v1.0.1
uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@90f80e24a7d627ee96eb9257d8d23f1b9470deff # TODO: update this when merged: v1.0.1
permissions: *docker_permissions
secrets: *docker_secrets
with:
Expand All @@ -155,14 +157,15 @@ jobs:
image-name: "fhevm/kms-connector/kms-worker"
docker-file: "./kms-connector/crates/kms-worker/Dockerfile"
app-cache-dir: "fhevm-kms-connector-kms-worker"
rust-toolchain-file-path: kms-connector/rust-toolchain.toml

build-tx-sender:
needs: check-changes
if: |
github.event_name == 'release'
|| (github.event_name != 'workflow_dispatch' && needs.check-changes.outputs.changes-tx-sender == 'true')
|| (github.event_name == 'workflow_dispatch' && inputs.build_tx_sender)
uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@6c72e3dbc894744c1e228fb165f4c4d657e475b6 # v1.0.1
uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@90f80e24a7d627ee96eb9257d8d23f1b9470deff # TODO: update this when merged: v1.0.1
permissions: *docker_permissions
secrets: *docker_secrets
with:
Expand All @@ -171,6 +174,7 @@ jobs:
image-name: "fhevm/kms-connector/tx-sender"
docker-file: "./kms-connector/crates/tx-sender/Dockerfile"
app-cache-dir: "fhevm-kms-connector-tx-sender"
# rust-toolchain-file-path: kms-connector/rust-toolchain.toml

re-tag-db-migration-image:
needs: check-changes
Expand Down
Loading