Skip to content

Commit 0539049

Browse files
committed
Cache prod and staging images for ubuntu-24.04 and dind
1 parent 082504d commit 0539049

3 files changed

Lines changed: 41 additions & 13 deletions

File tree

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,34 @@ name: Build, Push, and Deploy
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
7+
- staging
8+
pull_request:
9+
branches:
10+
- staging
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
16+
17+
env:
18+
REGISTRY: rg.fr-par.scw.cloud/funcscwriseriscvrunnerappqdvknz9s
19+
IMAGE: riscv-runner
20+
RELEASE_ENVIRONMENT: ${{ (github.ref == 'refs/heads/main' && 'prod') || (github.ref == 'refs/heads/staging' && 'staging') || '' }}
621

722
jobs:
823
build-and-deploy:
924
runs-on: ubuntu-latest
1025
steps:
11-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1227

1328
- name: Login to Scaleway Container Registry
1429
if: github.repository_owner == 'riseproject-dev'
1530
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
1631
with:
17-
registry: rg.fr-par.scw.cloud/funcscwriseriscvrunnerappqdvknz9s
32+
registry: ${{ env.REGISTRY }}
1833
username: nologin
1934
password: ${{ secrets.SCW_SECRET_KEY }}
2035

Makefile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
IMAGE_REPO ?= rg.fr-par.scw.cloud/funcscwriseriscvrunnerappqdvknz9s/riscv-runner
2-
GOARCH ?= riscv64
1+
REGISTRY ?= rg.fr-par.scw.cloud/funcscwriseriscvrunnerappqdvknz9s
2+
IMAGE ?= riscv-runner
3+
GOARCH ?= riscv64
34

45
.PHONY: build
56
build: build-device-plugin build-node-labeller
@@ -17,24 +18,24 @@ container-build: container-build-device-plugin container-build-node-labeller
1718

1819
.PHONY: container-build-device-plugin
1920
container-build-device-plugin:
20-
docker build --platform linux/riscv64 -f Dockerfile -t $(IMAGE_REPO):device-plugin-latest .
21+
docker build --platform linux/riscv64 -f Dockerfile -t $(REGISTRY)/$(IMAGE):device-plugin-latest .
2122

2223
.PHONY: container-build-node-labeller
2324
container-build-node-labeller:
24-
docker build --platform linux/riscv64 -f labeller.Dockerfile -t $(IMAGE_REPO):node-labeller-latest .
25+
docker build --platform linux/riscv64 -f labeller.Dockerfile -t $(REGISTRY)/$(IMAGE):node-labeller-latest .
2526

2627
.PHONY: container-push
2728
container-push: container-push-device-plugin container-push-node-labeller
2829

2930
.PHONY: container-push-device-plugin
3031
container-push-device-plugin:
31-
docker build --platform linux/riscv64 -f Dockerfile -t $(IMAGE_REPO):device-plugin-latest .
32-
docker push $(IMAGE_REPO):device-plugin-latest
32+
docker build --platform linux/riscv64 -f Dockerfile -t $(REGISTRY)/$(IMAGE):device-plugin-latest .
33+
docker push $(REGISTRY)/$(IMAGE):device-plugin-latest
3334

3435
.PHONY: container-push-node-labeller
3536
container-push-node-labeller:
36-
docker build --platform linux/riscv64 -f labeller.Dockerfile -t $(IMAGE_REPO):node-labeller-latest .
37-
docker push $(IMAGE_REPO):node-labeller-latest
37+
docker build --platform linux/riscv64 -f labeller.Dockerfile -t $(REGISTRY)/$(IMAGE):node-labeller-latest .
38+
docker push $(REGISTRY)/$(IMAGE):node-labeller-latest
3839

3940
.PHONY: kubectl-apply
4041
kubectl-apply: kubectl-apply-device-plugin kubectl-apply-node-labeller

k8s-ds-device-plugin.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,20 @@ spec:
2525
kubernetes.io/arch: riscv64
2626
priorityClassName: system-node-critical
2727
initContainers:
28-
- name: ubuntu-2404-image-cache
29-
image: rg.fr-par.scw.cloud/funcscwriseriscvrunnerappqdvknz9s/riscv-runner:ubuntu-24.04-2.331.0
28+
- name: ubuntu-2404-latest-image-cache
29+
image: rg.fr-par.scw.cloud/funcscwriseriscvrunnerappqdvknz9s/riscv-runner:ubuntu-24.04-latest
30+
imagePullPolicy: Always
31+
command: ["true"]
32+
- name: ubuntu-2404-staging-image-cache
33+
image: rg.fr-par.scw.cloud/funcscwriseriscvrunnerappqdvknz9s/riscv-runner:ubuntu-24.04-staging
34+
imagePullPolicy: Always
35+
command: ["true"]
36+
- name: dind-latest-image-cache
37+
image: rg.fr-par.scw.cloud/funcscwriseriscvrunnerappqdvknz9s/riscv-runner:dind-latest
38+
imagePullPolicy: Always
39+
command: ["true"]
40+
- name: dind-staging-image-cache
41+
image: rg.fr-par.scw.cloud/funcscwriseriscvrunnerappqdvknz9s/riscv-runner:dind-staging
3042
imagePullPolicy: Always
3143
command: ["true"]
3244
containers:

0 commit comments

Comments
 (0)