Skip to content

Commit f73001a

Browse files
authored
ci: Add multiarch to cockpit workflow (#327)
* add multiarch to cockpit workflow * replace amd image digest with manifest digest, also linter * add checkout action * update cargo version if PR * only set-version for stackable-cockpit
1 parent c85421f commit f73001a

File tree

2 files changed

+50
-4
lines changed

2 files changed

+50
-4
lines changed

.github/workflows/pr_cockpit.yml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,15 @@ jobs:
7070
core.setFailed('Committed Helm charts were not up to date, please regenerate and re-commit!')
7171
7272
publish:
73-
name: Publish Docker Image
73+
name: Publish ${{ matrix.runner.arch }} Image
7474
permissions:
7575
id-token: write
76-
runs-on: ubuntu-latest
76+
runs-on: ${{ matrix.runner.name }}
77+
strategy:
78+
matrix:
79+
runner:
80+
- {name: "ubuntu-latest", arch: "amd64"}
81+
- {name: "ubicloud-standard-8-arm", arch: "arm64"}
7782
env:
7883
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
7984
OCI_REGISTRY_SDP_PASSWORD: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
@@ -128,3 +133,40 @@ jobs:
128133
if: ${{ !github.event.pull_request.head.repo.fork }}
129134
name: Output Image Name and Tag
130135
run: echo "IMAGE_TAG=$(make -e print-docker-tag)" >> "$GITHUB_OUTPUT"
136+
137+
create_manifest_list:
138+
name: Build and publish manifest list
139+
needs:
140+
- publish
141+
runs-on: ubuntu-latest
142+
permissions:
143+
id-token: write
144+
env:
145+
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
146+
OCI_REGISTRY_SDP_PASSWORD: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }}
147+
OCI_REGISTRY_SDP_USERNAME: "robot$sdp+github-action-build"
148+
OCI_REGISTRY_SDP_CHARTS_PASSWORD: ${{ secrets.HARBOR_ROBOT_SDP_CHARTS_GITHUB_ACTION_BUILD_SECRET }}
149+
OCI_REGISTRY_SDP_CHARTS_USERNAME: "robot$sdp-charts+github-action-build"
150+
steps:
151+
- name: Install cosign
152+
uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 # v3.6.0
153+
- name: Checkout
154+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
155+
with:
156+
submodules: recursive
157+
# This step checks if the current run was triggered by a push to a pr (or a pr being created).
158+
# If this is the case it changes the version of this project in all Cargo.toml files to include the suffix
159+
# "-pr<prnumber>" so that the published artifacts can be linked to this PR.
160+
- uses: stackabletech/cargo-install-action@main
161+
with:
162+
crate: cargo-edit
163+
bin: cargo-set-version
164+
- name: Update version if PR
165+
if: ${{ github.event_name == 'pull_request' }}
166+
run: cargo set-version --offline --package stackable-cockpit 0.0.0-pr${{ github.event.pull_request.number }}
167+
- name: Build manifest list
168+
run: |
169+
# Creating manifest list
170+
make -e docker-manifest-list-build
171+
# Pushing and signing manifest list
172+
make -e docker-manifest-list-publish

docker/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Using inlined version of ubi8-rust-builder, ends at ## END OF ubi8-rust-builder
22
# Each modification (apart from removing ONBUILD clauses) should be preceded by a ## PATCH comment explaining the change
33
#FROM docker.stackable.tech/stackable/ubi8-rust-builder AS builder
4-
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7@sha256:3e1adcc31c6073d010b8043b070bd089d7bf37ee2c397c110211a6273453433f AS builder
4+
FROM registry.access.redhat.com/ubi8/ubi-minimal@sha256:987ae81ce046652ee4a2c3df54dad5e82faa1b078dab5d09f7cfaae11784ed30 AS builder
55
LABEL maintainer="Stackable GmbH"
66

77
# https://github.com/hadolint/hadolint/wiki/DL4006
88
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
99

1010
# Update image and install everything needed for Rustup & Rust
11+
# hadolint ignore=DL3041
1112
RUN microdnf update --disablerepo=* --enablerepo=ubi-8-appstream-rpms --enablerepo=ubi-8-baseos-rpms -y \
1213
&& rm -rf /var/cache/yum \
1314
&& microdnf install --disablerepo=* --enablerepo=ubi-8-appstream-rpms --enablerepo=ubi-8-baseos-rpms curl findutils gcc gcc-c++ make cmake openssl-devel pkg-config systemd-devel unzip tar xz clang krb5-libs libkadm5 -y \
@@ -57,8 +58,8 @@ COPY docker/ubi8-rust-builder/copy_artifacts.sh /
5758
WORKDIR /src
5859
COPY . /src
5960

60-
# hadolint ignore=SC1091
6161
## PATCH: disabled cyclonedx, run yarn install, build stackable-cockpitd with ui feature enabled
62+
# hadolint ignore=SC1091
6263
RUN . "$HOME/.cargo/env" && yarn && cargo build --release --workspace --features stackable-cockpitd/ui
6364
# ONBUILD RUN . "$HOME/.cargo/env" && cargo auditable build --release --workspace && cargo cyclonedx --output-pattern package --all --output-cdx
6465

@@ -79,6 +80,7 @@ RUN find /src/target/release \
7980
RUN echo "The following files will be copied to the runtime image: $(ls /app)"
8081
## END OF ubi8-rust-builder
8182

83+
# hadolint ignore=DL3006
8284
FROM registry.access.redhat.com/ubi8/ubi-minimal AS operator
8385

8486
ARG VERSION
@@ -93,12 +95,14 @@ LABEL name="Stackable Cockpit" \
9395
description="Deploy and manage Stackable clusters."
9496

9597
# Update image
98+
# hadolint ignore=DL3041
9699
RUN microdnf install -y yum \
97100
&& yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical \
98101
&& yum clean all \
99102
&& microdnf clean all
100103

101104
# Install kerberos client libraries
105+
# hadolint ignore=DL3041
102106
RUN microdnf install -y krb5-libs libkadm5 && microdnf clean all
103107

104108
#COPY LICENSE /licenses/LICENSE

0 commit comments

Comments
 (0)