Skip to content

Commit fdad63e

Browse files
authored
Merge pull request #298 from matter-labs/yaml
feat(ci): switch to GitHub Container Registry for images
2 parents 542e3a9 + 3257f31 commit fdad63e

12 files changed

Lines changed: 43 additions & 42 deletions

File tree

.github/workflows/nix.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: nix
22

33
on:
44
pull_request:
5-
branches: [ "main" ]
5+
branches: ["main"]
66
push:
7-
branches: [ "main" ]
8-
tags: [ "*" ]
7+
branches: ["main"]
8+
tags: ["*"]
99

1010
concurrency:
1111
group: ${{ github.workflow }}-${{ github.ref }}
@@ -34,7 +34,7 @@ jobs:
3434

3535
build:
3636
needs: check
37-
runs-on: [ matterlabs-default-infra-runners ]
37+
runs-on: [matterlabs-default-infra-runners]
3838
steps:
3939
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
4040
- uses: cachix/install-nix-action@v30
@@ -56,7 +56,7 @@ jobs:
5656

5757
push_to_docker:
5858
needs: build
59-
runs-on: [ matterlabs-default-infra-runners ]
59+
runs-on: [matterlabs-default-infra-runners]
6060
concurrency:
6161
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.nixpackage }}
6262
cancel-in-progress: true
@@ -90,11 +90,12 @@ jobs:
9090
cache: tee-pot
9191
token: ${{ secrets.ATTIC_TOKEN }}
9292

93-
- name: Log in to Docker Hub
94-
uses: docker/login-action@v3
93+
- name: Login to GitHub Container Registry
94+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
9595
with:
96-
username: ${{ secrets.DOCKERHUB_USER }}
97-
password: ${{ secrets.DOCKERHUB_TOKEN }}
96+
registry: ghcr.io
97+
username: ${{ github.actor }}
98+
password: ${{ secrets.GITHUB_TOKEN }}
9899

99100
- name: Load container
100101
id: build
@@ -106,21 +107,21 @@ jobs:
106107
107108
- name: Push container
108109
run: |
109-
echo "Pushing image ${{ steps.build.outputs.IMAGE_TAG }} to Docker Hub"
110-
docker tag "${{ steps.build.outputs.IMAGE_TAG }}" matterlabsrobot/"${{ steps.build.outputs.IMAGE_TAG }}"
111-
docker push matterlabsrobot/"${{ steps.build.outputs.IMAGE_TAG }}"
110+
echo "Pushing image ${{ steps.build.outputs.IMAGE_TAG }} to GitHub Container Registry"
111+
docker tag "${{ steps.build.outputs.IMAGE_TAG }}" "ghcr.io/${{ github.repository_owner }}"/"${{ steps.build.outputs.IMAGE_TAG }}"
112+
docker push "ghcr.io/${{ github.repository_owner }}"/"${{ steps.build.outputs.IMAGE_TAG }}"
112113
113114
- name: Tag container as latest
114115
if: ${{ github.event_name == 'push' }}
115116
run: |
116-
docker tag "${{ steps.build.outputs.IMAGE_TAG }}" matterlabsrobot/"${{ steps.build.outputs.IMAGE_NAME }}:latest"
117-
docker push matterlabsrobot/"${{ steps.build.outputs.IMAGE_NAME }}:latest"
117+
docker tag "${{ steps.build.outputs.IMAGE_TAG }}" "ghcr.io/${{ github.repository_owner }}"/"${{ steps.build.outputs.IMAGE_NAME }}:latest"
118+
docker push "ghcr.io/${{ github.repository_owner }}"/"${{ steps.build.outputs.IMAGE_NAME }}:latest"
118119
119120
- name: Tag container with tag
120121
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
121122
run: |
122-
docker tag "${{ steps.build.outputs.IMAGE_TAG }}" matterlabsrobot/"${{ steps.build.outputs.IMAGE_NAME }}:$GITHUB_REF_NAME"
123-
docker push matterlabsrobot/"${{ steps.build.outputs.IMAGE_NAME }}:$GITHUB_REF_NAME"
123+
docker tag "${{ steps.build.outputs.IMAGE_TAG }}" "ghcr.io/${{ github.repository_owner }}"/"${{ steps.build.outputs.IMAGE_NAME }}:$GITHUB_REF_NAME"
124+
docker push "ghcr.io/${{ github.repository_owner }}"/"${{ steps.build.outputs.IMAGE_NAME }}:$GITHUB_REF_NAME"
124125
125126
- name: Generate build ID for Flux Image Automation
126127
id: flux

assets/gcloud-deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ gcloud compute instances create tdx-pilot \
4545
--maintenance-policy=TERMINATE \
4646
--image-project=tdx-pilot \
4747
--project tdx-pilot \
48-
--metadata=container_hub="docker.io",container_image="matterlabsrobot/test-tdx:117p5y281limw0w7b03v802ij00c5gzw" \
48+
--metadata=container_hub="docker.io",container_image="ghcr.io/matter-labs/test-tdx:117p5y281limw0w7b03v802ij00c5gzw" \
4949
--metadata-from-file=container_config=$BASE_DIR/config.json \
5050
--image tdx-img-f-"${NO}"

bin/tee-self-attestation-test/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# self-attestation-test
22

3-
Optionally build and load the containers (remove the `matterlabsrobot/` repo from the commands below then)
3+
Optionally build and load the containers (remove the `ghcr.io/matter-labs/` repo from the commands below then)
44

55
```bash
66
$ nix build -L .#container-verify-attestation-sgx && docker load -i result
@@ -12,9 +12,9 @@ $ nix build -L .#container-self-attestation-test-sgx-azure && docker load -i res
1212

1313
```bash
1414
❯ docker run -i --init --rm --privileged --device /dev/sgx_enclave \
15-
matterlabsrobot/teepot-self-attestation-test-sgx-azure:latest \
15+
ghcr.io/matter-labs/teepot-self-attestation-test-sgx-azure:latest \
1616
| base64 -d --ignore-garbage \
17-
| docker run -i --rm matterlabsrobot/verify-attestation-sgx:latest -
17+
| docker run -i --rm ghcr.io/matter-labs/verify-attestation-sgx:latest -
1818

1919
aesm_service: warning: Turn to daemon. Use "--no-daemon" option to execute in foreground.
2020
Gramine is starting. Parsing TOML manifest file, this may take some time...
@@ -31,9 +31,9 @@ reportdata: 00000000000000000000000000000000000000000000000000000000000000000000
3131

3232
```bash
3333
❯ docker run -i --init --rm --privileged --device /dev/sgx_enclave \
34-
matterlabsrobot/teepot-self-attestation-test-sgx-dcap:latest \
34+
ghcr.io/matter-labs/teepot-self-attestation-test-sgx-dcap:latest \
3535
| base64 -d --ignore-garbage \
36-
| docker run -i --rm matterlabsrobot/verify-attestation-sgx:latest -
36+
| docker run -i --rm ghcr.io/matter-labs/verify-attestation-sgx:latest -
3737

3838
aesm_service: warning: Turn to daemon. Use "--no-daemon" option to execute in foreground.
3939
Gramine is starting. Parsing TOML manifest file, this may take some time...
@@ -48,9 +48,9 @@ On an outdated machine, this might look like this:
4848

4949
```bash
5050
❯ docker run -i --init --rm --privileged --device /dev/sgx_enclave \
51-
matterlabsrobot/teepot-self-attestation-test-sgx-dcap:latest \
51+
ghcr.io/matter-labs/teepot-self-attestation-test-sgx-dcap:latest \
5252
| base64 -d --ignore-garbage \
53-
| docker run -i --rm matterlabsrobot/verify-attestation-sgx:latest -
53+
| docker run -i --rm ghcr.io/matter-labs/verify-attestation-sgx:latest -
5454

5555
aesm_service: warning: Turn to daemon. Use "--no-daemon" option to execute in foreground.
5656
Gramine is starting. Parsing TOML manifest file, this may take some time...
@@ -73,9 +73,9 @@ reportdata: 00000000000000000000000000000000000000000000000000000000000000000000
7373

7474
```bash
7575
❯ podman run -i --rm --group-add=keep-groups -v /var/run/aesmd:/var/run/aesmd -v /dev/sgx_enclave:/dev/sgx_enclave \
76-
matterlabsrobot/teepot-self-attestation-test-sgx-dcap:latest \
76+
ghcr.io/matter-labs/teepot-self-attestation-test-sgx-dcap:latest \
7777
| base64 -d --ignore-garbage \
7878
| podman run -i --rm --net host \
7979
-v /etc/sgx_default_qcnl.conf:/etc/sgx_default_qcnl.conf \
80-
matterlabsrobot/verify-attestation-sgx-dcap:latest
80+
ghcr.io/matter-labs/verify-attestation-sgx-dcap:latest
8181
```

examples/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Passphrase:
121121
Find out the `mr_enclave` value of the teepot-vault-admin-sgx-azure enclave and extract the sigstruct file:
122122

123123
```bash
124-
❯ docker run -v .:/mnt --pull always -it matterlabsrobot/teepot-vault-admin-sgx-azure:latest 'gramine-sgx-sigstruct-view teepot-vault-admin-sgx-azure.sig; cp teepot-vault-admin-sgx-azure.sig /mnt'
124+
❯ docker run -v .:/mnt --pull always -it ghcr.io/matter-labs/teepot-vault-admin-sgx-azure:latest 'gramine-sgx-sigstruct-view teepot-vault-admin-sgx-azure.sig; cp teepot-vault-admin-sgx-azure.sig /mnt'
125125
[...]
126126
Attributes:
127127
mr_signer: c5591a72b8b86e0d8814d6e8750e3efe66aea2d102b8ba2405365559b858697d
@@ -226,18 +226,18 @@ Next is to sign the admin tee with the vault-admin tool:
226226
```
227227

228228
Then replace `teepot-vault-admin-sgx-azure.sig` with `teepot-vault-admin-sgx-azure-new.sig` in the container
229-
image `matterlabsrobot/teepot-vault-admin-sgx-azure:latest` with this Dockerfile:
229+
image `ghcr.io/matter-labs/teepot-vault-admin-sgx-azure:latest` with this Dockerfile:
230230

231231
```Dockerfile
232-
FROM matterlabsrobot/teepot-vault-admin-sgx-azure:latest
232+
FROM ghcr.io/matter-labs/teepot-vault-admin-sgx-azure:latest
233233
COPY teepot-vault-admin-sgx-azure-new.sig /app/teepot-vault-admin-sgx-azure.sig
234234
```
235235

236236
Build and push the new image:
237237

238238
```bash
239-
❯ docker build -t matterlabsrobot/teepot-vault-admin-sgx-azure-signed:latest .
240-
❯ docker push matterlabsrobot/teepot-vault-admin-sgx-azure-signed:latest
239+
❯ docker build -t ghcr.io/matter-labs/teepot-vault-admin-sgx-azure-signed:latest .
240+
❯ docker push ghcr.io/matter-labs/teepot-vault-admin-sgx-azure-signed:latest
241241
```
242242

243243
Delete the old vault-admin pod and start the new one:

examples/k8s/vault-1-pod.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ spec:
2727
imagePullSecrets:
2828
- name: docker-regcred
2929
containers:
30-
- image: matterlabsrobot/teepot-vault-sgx-azure:latest
30+
- image: ghcr.io/matter-labs/teepot-vault-sgx-azure:latest
3131
name: vault
3232
imagePullPolicy: Always
3333
env:
@@ -62,7 +62,7 @@ spec:
6262
volumeMounts:
6363
- mountPath: /opt/vault/data
6464
name: data-1
65-
- image: matterlabsrobot/teepot-vault-unseal-sgx-azure:latest
65+
- image: ghcr.io/matter-labs/teepot-vault-unseal-sgx-azure:latest
6666
name: vault-unseal
6767
imagePullPolicy: Always
6868
env:

examples/k8s/vault-2-pod.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ spec:
2727
imagePullSecrets:
2828
- name: docker-regcred
2929
containers:
30-
- image: matterlabsrobot/teepot-vault-sgx-azure:latest
30+
- image: ghcr.io/matter-labs/teepot-vault-sgx-azure:latest
3131
name: vault
3232
imagePullPolicy: Always
3333
env:
@@ -62,7 +62,7 @@ spec:
6262
volumeMounts:
6363
- mountPath: /opt/vault/data
6464
name: data-2
65-
- image: matterlabsrobot/teepot-vault-unseal-sgx-azure:latest
65+
- image: ghcr.io/matter-labs/teepot-vault-unseal-sgx-azure:latest
6666
name: vault-unseal
6767
imagePullPolicy: Always
6868
env:

examples/k8s/vault-3-pod.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ spec:
2727
imagePullSecrets:
2828
- name: docker-regcred
2929
containers:
30-
- image: matterlabsrobot/teepot-vault-sgx-azure:latest
30+
- image: ghcr.io/matter-labs/teepot-vault-sgx-azure:latest
3131
name: vault
3232
imagePullPolicy: Always
3333
env:
@@ -62,7 +62,7 @@ spec:
6262
volumeMounts:
6363
- mountPath: /opt/vault/data
6464
name: data-3
65-
- image: matterlabsrobot/teepot-vault-unseal-sgx-azure:latest
65+
- image: ghcr.io/matter-labs/teepot-vault-unseal-sgx-azure:latest
6666
name: vault-unseal
6767
imagePullPolicy: Always
6868
env:

examples/k8s/vault-unseal-pod-0.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
operator: Exists
1212
effect: NoSchedule
1313
containers:
14-
- image: matterlabsrobot/teepot-vault-unseal-sgx-azure:latest
14+
- image: ghcr.io/matter-labs/teepot-vault-unseal-sgx-azure:latest
1515
name: vault-unseal
1616
imagePullPolicy: Always
1717
env:

examples/k8s/vault-unseal-pod-1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
operator: Exists
1212
effect: NoSchedule
1313
containers:
14-
- image: matterlabsrobot/teepot-vault-unseal-sgx-azure:latest
14+
- image: ghcr.io/matter-labs/teepot-vault-unseal-sgx-azure:latest
1515
name: vault-unseal
1616
imagePullPolicy: Always
1717
env:

examples/k8s/vault-unseal-pod-2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
operator: Exists
1212
effect: NoSchedule
1313
containers:
14-
- image: matterlabsrobot/teepot-vault-unseal-sgx-azure:latest
14+
- image: ghcr.io/matter-labs/teepot-vault-unseal-sgx-azure:latest
1515
name: vault-unseal
1616
imagePullPolicy: Always
1717
env:

0 commit comments

Comments
 (0)