Skip to content

Commit e107640

Browse files
authored
fix(kms-connector): move connector workflow (#57)
* fix(kms-connector): move connector workflow * fix(kms-connector): kms-connector workflow * fix(kms-connector): kms-connector workflow * fix(kms-connector): fix workflow concurrency * fix(kms-connector): fix for launching test and build * fix(kms-connector): fix path filter * fix(kms-connector): fix path filter * fix(kms-connector): fix checkout * fix(kms-connector): fix submodule path * fix(kms-connector): fix submodule path * fix(kms-connector): fix submodule path * fix(kms-connector): fix submodule path * fix(kms-connector): fix submodule path * fix(kms-connector): add submodule checkout independent * fix(kms-connector): add submodule checkout independent * fix(kms-connector): add submodule checkout independent * fix(kms-connector): add submodule checkout independent * fix(kms-connector): add submodule checkout independent * fix(kms-connector): add submodule checkout independent * fix(kms-connector): add submodule checkout independent * fix(kms-connector): add REPO_CHECKOUT_TOKEN * fix(kms-connector): add BLOCKCHAIN_ACTIONS_TOKEN * fix(kms-connector): fix gitlfs setup * fix(kms-connector): fix Dockerfile * fix(kms-connector): fix host-contracts folder * fix(kms-connector): fix host-contracts folder * fix(kms-connector): fix dockerfile * fix(kms-connector): remove helm wf * fix(kms-connector): change docker context * fix(kms-connector): change dockerfile * fix(kms-connector): change dockerfile * fix(kms-connector): change dockerfile * fix(kms-connector): change dockerfile
1 parent a2bcd69 commit e107640

16 files changed

+104
-365
lines changed

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "cargo"
4+
# Look for `Cargo.toml` and `Cargo.lock` in the root directory
5+
directory: "/"
6+
# Check for updates every Monday
7+
schedule:
8+
interval: "weekly"
9+
# Set to 0 to prevent version updates (i.e. require only security updates)
10+
open-pull-requests-limit: 0
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
# Check for updates every Monday
14+
schedule:
15+
interval: "weekly"
16+
# Set to 0 to prevent version updates (i.e. require only security updates)
17+
open-pull-requests-limit: 0

.github/workflows/coprocessor-gpu-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ jobs:
149149
with:
150150
node-version: 20.x
151151

152-
- run: cp ./contracts/.env.example ./contracts/.env
153-
- run: npm --prefix ./contracts ci --include=optional
154-
- run: "cd contracts && npm install && npx hardhat compile"
152+
- run: cp ./host-contracts/.env.example ./host-contracts/.env
153+
- run: npm --prefix ./host-contracts ci --include=optional
154+
- run: "cd host-contracts && npm install && npx hardhat compile"
155155

156156
- name: Run tests on GPU
157157
run: |

kms-connector/.github/workflows/common-docker-big-instance.yml renamed to .github/workflows/kms-connector-common-docker-big-instance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run Docker On Big Instance
1+
name: KMS Connector Run Docker On Big Instance
22
on:
33
workflow_call:
44
inputs:
@@ -71,7 +71,7 @@ jobs:
7171

7272
run-docker:
7373
needs: [start-amd64-runner]
74-
uses: ./.github/workflows/common-docker.yml
74+
uses: zama-ai/ci-templates/.github/workflows/common-docker.yml@4597dee06cf8e3e977f66aa8b1824ef4e1d84a22
7575
secrets:
7676
BLOCKCHAIN_ACTIONS_TOKEN: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }}
7777
AWS_ACCESS_KEY_S3_USER: ${{ secrets.AWS_ACCESS_KEY_S3_USER }}

kms-connector/.github/workflows/common-testing-big-instance.yml renamed to .github/workflows/kms-connector-common-testing-big-instance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run Testing On Big Instance
1+
name: KMS Connector Common Testing Big Instance
22
on:
33
workflow_call:
44
inputs:
@@ -90,7 +90,7 @@ jobs:
9090

9191
run-build:
9292
needs: start-runner
93-
uses: ./.github/workflows/common-testing.yml
93+
uses: ./.github/workflows/kms-connector-common-testing.yml
9494
secrets:
9595
BLOCKCHAIN_ACTIONS_TOKEN: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }}
9696
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

kms-connector/.github/workflows/common-testing.yml renamed to .github/workflows/kms-connector-common-testing.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Main build workflow that handles both x86 and ARM builds
2-
name: Compile Rust Project and Run Tests
2+
name: KMS Connector Common Testing
33

44
on:
55
workflow_call:
@@ -92,17 +92,23 @@ jobs:
9292
submodules: true
9393
token: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }}
9494

95+
- name: Setup Home
96+
if: "${{ !contains(inputs.runs-on, 'ubuntu') }}"
97+
run: echo "HOME=/home/ubuntu" >> "${GITHUB_ENV}"
98+
9599
# LFS files are needed for backward compatibility tests
96100
# Install git LFS before checkout does not seem possible on our self-hosted runners, so we
97101
# need to do it right after and then manually pull LFS files
98-
- name: Install git-lfs
102+
- name: setup gitlfs from binary
103+
env:
104+
GIT_LFS_VERSION: "3.6.1"
99105
run: |
100-
sudo apt-get update && sudo apt-get -y install git-lfs
106+
wget https://github.com/git-lfs/git-lfs/releases/download/v${{ env.GIT_LFS_VERSION }}/git-lfs-linux-amd64-v${{ env.GIT_LFS_VERSION }}.tar.gz
107+
tar -xzf git-lfs-linux-amd64-v${{ env.GIT_LFS_VERSION }}.tar.gz
108+
./git-lfs-${{ env.GIT_LFS_VERSION }}/install.sh
101109
git lfs pull
102110
103-
- name: Setup Home
104-
if: "${{ !contains(inputs.runs-on, 'ubuntu') }}"
105-
run: echo "HOME=/home/ubuntu" >> "${GITHUB_ENV}"
111+
106112
107113
# Needed to be able to pull some docker images for the simulator test
108114
- name: Login to GitHub Container Registry
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Release KMS Connector Create Docker Images"
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
ref:
9+
type: string
10+
description: 'Branch, tag or SHA to generate the Docker images from. (Default main)'
11+
required: false
12+
default: 'main'
13+
14+
jobs:
15+
docker-connector:
16+
uses: ./.github/workflows/kms-connector-common-docker-big-instance.yml
17+
permissions:
18+
contents: 'read'
19+
id-token: 'write'
20+
packages: 'write'
21+
with:
22+
working-directory: "./kms-connector"
23+
push_image: true
24+
image-name: 'kms-connector'
25+
ref: ${{ inputs.ref || '' }}
26+
app-cache-dir: 'kms-connector'
27+
docker-file: "./kms-connector/docker/Dockerfile"
28+
docker-context: "./kms-connector"
29+
secrets:
30+
BLOCKCHAIN_ACTIONS_TOKEN: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }}
31+
SLAB_ACTION_TOKEN: ${{ secrets.SLAB_ACTION_TOKEN }}
32+
SLAB_BASE_URL: ${{ secrets.SLAB_BASE_URL }}
33+
JOB_SECRET: ${{ secrets.JOB_SECRET }}
34+
AWS_ACCESS_KEY_S3_USER: ${{ secrets.AWS_ACCESS_KEY_S3_USER }}
35+
AWS_SECRET_KEY_S3_USER: ${{ secrets.AWS_SECRET_KEY_S3_USER }}

kms-connector/.github/workflows/global-common-workflow.yml renamed to .github/workflows/kms-connector-test-docker-build.yml

Lines changed: 15 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
# Main workflow for KMS Core that handles testing and build
22
# Triggers:
3-
# 1. Scheduled: Every weekday at 00:00 UTC (01:00 CET) for nightly tests and build
4-
# 2. Pull requests: For validation before merging
5-
# 3. Pushes: On main and release/* branches for building images
3+
# 1. Pull requests: For validation before merging
4+
# 2. Pushes: On main and release/* branches for building images
65
# IMPORTANT NOTES: The tests are only executed for components that have been changed
7-
name: "[Global Common Workflow] Pipeline Run"
6+
name: "KMS Connector Test Docker Build"
87

98
on:
10-
schedule:
11-
- cron: '0 0 * * 1-5' # Runs at midnight UTC (1 AM CET) Monday-Friday
129
pull_request:
1310
push:
1411
branches: ['main', 'release/*']
@@ -17,7 +14,7 @@ on:
1714
# - Groups runs by git ref
1815
# - Cancels in-progress runs for non-main/release branches
1916
concurrency:
20-
group: global-common-workflow-${{ github.ref }}
17+
group: kms-connector-test-docker-build-${{ github.ref }}
2118
cancel-in-progress: ${{ !contains(fromJSON('["release/", "main"]'),github.ref) }}
2219

2320
# Required permissions for workflow execution
@@ -37,15 +34,7 @@ jobs:
3734
runs-on: ubuntu-latest
3835
outputs:
3936
# Each output indicates if files in a specific component were modified
40-
changes-backup: ${{ steps.filter.outputs.backup }}
41-
changes-ci: ${{ steps.filter.outputs.ci }}
4237
changes-connector: ${{ steps.filter.outputs.connector }}
43-
changes-core-client: ${{ steps.filter.outputs.core-client }}
44-
changes-core-grpc: ${{ steps.filter.outputs.core-grpc }}
45-
changes-core-service: ${{ steps.filter.outputs.core-service }}
46-
changes-core-threshold: ${{ steps.filter.outputs.core-threshold }}
47-
changes-docs: ${{ steps.filter.outputs.docs }}
48-
changes-helm-chart: ${{ steps.filter.outputs.helm-chart }}
4938
steps:
5039
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5140
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
@@ -54,54 +43,12 @@ jobs:
5443
# Define paths that trigger specific component workflows
5544
# Changes to conf-trace affect multiple components
5645
filters: |
57-
ci:
58-
- '.github/workflows/global-common-workflow.yml'
5946
connector:
60-
- './**'
61-
docs:
62-
- 'docs/**'
63-
helm-chart:
64-
- 'charts/**'
65-
- '.github/workflows/helm-test.yml'
66-
- '.github/workflows/helm-lint.yml'
67-
68-
############################################################################
69-
# Helm chart pipeline
70-
# Triggered by:
71-
# - Changes to charts/**'
72-
############################################################################
73-
test-helm-chart:
74-
needs: check-changes
75-
if: needs.check-changes.outputs.changes-helm-chart == 'true'
76-
uses: ./.github/workflows/helm-test.yml
77-
78-
lint-helm-chart:
79-
needs: check-changes
80-
if: needs.check-changes.outputs.changes-helm-chart == 'true'
81-
uses: ./.github/workflows/helm-lint.yml
82-
83-
release-helm-chart:
84-
needs: check-changes
85-
if: github.ref == 'refs/heads/main' && needs.check-changes.outputs.changes-helm-chart == 'true'
86-
uses: ./.github/workflows/helm-release.yml
87-
88-
############################################################################
89-
# KMS Local Docs Link Check
90-
# Triggered by:
91-
# - Changes to docs/**
92-
# - Changes to workflow file itself
93-
############################################################################
94-
check-docs:
95-
needs: check-changes
96-
if: needs.check-changes.outputs.changes-docs == 'true'
97-
runs-on: ubuntu-latest
98-
container:
99-
image: python:3.10
100-
steps:
101-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
102-
- run: python3 -m pip install linkcheckmd
103-
- name: Check dead-link
104-
run: python3 ci/script/local_docs_link_check.py
47+
- '.github/workflows/kms-connector-*'
48+
- 'kms-connector/config/**'
49+
- 'kms-connector/docker/**'
50+
- 'kms-connector/src/**'
51+
- 'kms-connector/Cargo.toml'
10552
10653
10754
############################################################################
@@ -114,10 +61,10 @@ jobs:
11461
############################################################################
11562
test-connector:
11663
needs: check-changes
117-
if: needs.check-changes.outputs.changes-connector == 'true' || needs.check-changes.outputs.changes-ci == 'true'
118-
uses: ./.github/workflows/common-testing-big-instance.yml
64+
if: needs.check-changes.outputs.changes-connector == 'true'
65+
uses: ./.github/workflows/kms-connector-common-testing-big-instance.yml
11966
with:
120-
working-directory: './'
67+
working-directory: './kms-connector'
12168
package-name: 'kms-connector'
12269
app-cache-dir: 'kms-connector'
12370
secrets:
@@ -137,11 +84,11 @@ jobs:
13784
if: >-
13885
(startsWith(github.ref, 'refs/heads/release/') || github.ref == 'refs/heads/main') ||
13986
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'docker'))
140-
uses: ./.github/workflows/common-docker-big-instance.yml
87+
uses: ./.github/workflows/kms-connector-common-docker-big-instance.yml
14188
with:
142-
working-directory: "./kms-connector"
89+
working-directory: './kms-connector'
14390
push_image: true
144-
image-name: 'kms-connector'
91+
image-name: 'fhevm/kms-connector'
14592
app-cache-dir: 'kms-connector'
14693
secrets:
14794
BLOCKCHAIN_ACTIONS_TOKEN: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }}

0 commit comments

Comments
 (0)