Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildchain: test pulling image from cgr #4463

Draft
wants to merge 4 commits into
base: development/129.0
Choose a base branch
from
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
10 changes: 10 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_LOGIN }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
# - name: Login to Chainguard using pull token
# uses: docker/login-action@v2
# with:
# registry: cgr.dev
# username: ${{ secrets.CGR_DEV_TEST_LOGIN }}
# password: ${{ secrets.CGR_DEV_TEST_PASSWORD }}
- name: Login to Chainguard
uses: chainguard-dev/setup-chainctl@main
with:
identity: ${{ secrets.CGR_DEV_TEST_IDENTITY }}
- name: Checkout
uses: actions/checkout@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pre-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ on:
- "w/**"
- "q/*/**"

permissions:
contents: read
id-token: write

jobs:
changed-files:
runs-on: ubuntu-24.04
Expand Down
1 change: 1 addition & 0 deletions buildchain/buildchain/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
PROMETHEUS_REPOSITORY: str = "quay.io/prometheus"
THANOS_REPOSITORY: str = "quay.io/thanos"
CERT_MANAGER_REPOSITORY: str = "quay.io/jetstack"
CHAINGUARD_REPOSITORY: str = "cgr.dev/scality.com"

# Paths {{{

Expand Down
9 changes: 6 additions & 3 deletions buildchain/buildchain/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ def _local_image(name: str, **kwargs: Any) -> targets.LocalImage:
],
constants.K8S_REPOSITORY: [
"pause",
"etcd",
"kube-apiserver",
"kube-controller-manager",
"kube-proxy",
Expand All @@ -206,17 +205,21 @@ def _local_image(name: str, **kwargs: Any) -> targets.LocalImage:
constants.PROMETHEUS_REPOSITORY: [
"alertmanager",
"node-exporter",
"prometheus",
],
constants.THANOS_REPOSITORY: [
"thanos",
],
constants.CERT_MANAGER_REPOSITORY: [
"cert-manager-controller",
# "cert-manager-controller",
"cert-manager-webhook",
"cert-manager-cainjector",
"cert-manager-acmesolver",
],
constants.CHAINGUARD_REPOSITORY: [
"cert-manager-controller",
"etcd",
"prometheus",
],
}

REMOTE_NAMES: Dict[str, str] = {
Expand Down
14 changes: 7 additions & 7 deletions buildchain/buildchain/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def load_version_information() -> None:
"c464612ef7e3d54d658c3eaa4778b5cdc990ec7a4d9ab63b0f00c9994c6ce980"
)

ETCD_VERSION: str = "3.5.15"
ETCD_VERSION: str = "3.5.16"
ETCD_IMAGE_VERSION: str = f"{ETCD_VERSION}-0"
NGINX_IMAGE_VERSION: str = "1.27.0-alpine"
NODEJS_IMAGE_VERSION: str = "16.14.0"
Expand Down Expand Up @@ -136,8 +136,8 @@ def _version_prefix(version: str, prefix: str = "v") -> str:
),
Image(
name="etcd",
version=ETCD_IMAGE_VERSION,
digest="sha256:a6dc63e6e8cfa0307d7851762fa6b629afb18f28d8aa3fab5a6e91b4af60026a",
version=ETCD_VERSION,
digest="sha256:bf42a7470fc32872947ba769c2cc886affa726dec2d2bfeabd68050ef5487623",
),
Image(
name="grafana",
Expand Down Expand Up @@ -198,8 +198,8 @@ def _version_prefix(version: str, prefix: str = "v") -> str:
),
Image(
name="prometheus",
version="v2.55.0",
digest="sha256:378f4e03703557d1c6419e6caccf922f96e6d88a530f7431d66a4c4f4b1000fe",
version="2.55.0",
digest="sha256:c0907ae3a99e682698d7b539e61649f6479747a356038cbfdffb4ee56cae71b1",
),
Image(
name="prometheus-adapter",
Expand Down Expand Up @@ -274,8 +274,8 @@ def _version_prefix(version: str, prefix: str = "v") -> str:
),
Image(
name="cert-manager-controller",
version=_version_prefix(CERT_MANAGER_VERSION),
digest="sha256:eee34b3de2dd63f7e5ac459fc2d407662d433fd267d574557b76ee3c7d4bc44f",
version=_version_prefix(CERT_MANAGER_VERSION, ""),
digest="sha256:284cbab7a2a83a182efe4fac7b8efa2fc1074d7f1170f11eebd4c9d462189067",
),
Image(
name="cert-manager-webhook",
Expand Down
1 change: 1 addition & 0 deletions charts/cert-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ acmesolver:

image:
repository: '__image__(cert-manager-controller)'
tag: '1.15.3'

installCRDs: true

Expand Down
1 change: 1 addition & 0 deletions charts/kube-prometheus-stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ prometheus:
image:
registry: '__var__(repo.registry_endpoint)'
repository: '__image_no_reg__(prometheus)'
tag: 2.55.0

tolerations:
- key: 'node-role.kubernetes.io/bootstrap'
Expand Down
2 changes: 1 addition & 1 deletion salt/metalk8s/addons/cert-manager/deployed/chart.sls
Original file line number Diff line number Diff line change
Expand Up @@ -9741,7 +9741,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: {% endraw -%}{{ build_image_name("cert-manager-controller", False) }}{%- raw %}:v1.15.3
image: {% endraw -%}{{ build_image_name("cert-manager-controller", False) }}{%- raw %}:1.15.3
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 8
Expand Down
4 changes: 2 additions & 2 deletions salt/metalk8s/addons/prometheus-operator/deployed/chart.sls
Original file line number Diff line number Diff line change
Expand Up @@ -72118,7 +72118,7 @@ spec:
enableAdminAPI: {% endraw -%}{{ prometheus.spec.config.enable_admin_api }}{%- raw %}
externalUrl: http://prometheus-operator-prometheus.metalk8s-monitoring:9090
hostNetwork: false
image: {% endraw -%}{{ repo.registry_endpoint }}{%- raw %}/{% endraw -%}{{ build_image_name("prometheus", False, False) }}{%- raw %}:v2.55.0
image: {% endraw -%}{{ repo.registry_endpoint }}{%- raw %}/{% endraw -%}{{ build_image_name("prometheus", False, False) }}{%- raw %}:2.55.0
listenLocal: false
logFormat: logfmt
logLevel: info
Expand Down Expand Up @@ -72182,7 +72182,7 @@ spec:
operator: Exists
tsdb:
outOfOrderTimeWindow: 0s
version: v2.55.0
version: 2.55.0
walCompression: true
---
apiVersion: monitoring.coreos.com/v1
Expand Down
12 changes: 6 additions & 6 deletions scripts/backup.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ backup_cas() {
backup_etcd() {
local -r etcd_snapshot="etcd_snapshot_$(date -u +%Y%m%d_%H%M%S)"
local -r cmd=(
"ETCDCTL_API=3 etcdctl --endpoints https://127.0.0.1:2379"
"--cert /etc/kubernetes/pki/etcd/salt-master-etcd-client.crt"
"--key /etc/kubernetes/pki/etcd/salt-master-etcd-client.key"
"--cacert /etc/kubernetes/pki/etcd/ca.crt"
"snapshot save $etcd_snapshot"
"etcdctl" "--endpoints" "https://127.0.0.1:2379"
"--cert" "/etc/kubernetes/pki/etcd/salt-master-etcd-client.crt"
"--key" "/etc/kubernetes/pki/etcd/salt-master-etcd-client.key"
"--cacert" "/etc/kubernetes/pki/etcd/ca.crt"
"snapshot" "save" "$etcd_snapshot"
)
local etcd_container=''
echo "Snapshot etcd"
Expand All @@ -129,7 +129,7 @@ backup_etcd() {
--label io.kubernetes.container.name=etcd \
--state Running)"
echo "Running '${cmd[*]}' in etcd container $etcd_container"
crictl exec -i "$etcd_container" sh -c "${cmd[*]}"
crictl exec -i "$etcd_container" "${cmd[@]}"

local -r rootfs_v1="/run/containerd/io.containerd.runtime.v1.linux/k8s.io/${etcd_container}/rootfs"
local -r rootfs_v2="/run/containerd/io.containerd.runtime.v2.task/k8s.io/${etcd_container}/rootfs"
Expand Down
Loading