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

Use Chainguard's minio, rqlite, and dex images #4191

Merged
merged 14 commits into from
Dec 4, 2023
Merged
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
53 changes: 20 additions & 33 deletions .github/workflows/alpha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
path: ./kurl_proxy/bin


build_go_api:
build-kots:
runs-on: ubuntu-20.04
needs: [build_web, build_kurl_proxy, generate-tag]
steps:
Expand Down Expand Up @@ -133,39 +133,26 @@ jobs:
- name: Upload Go API artifact
uses: actions/upload-artifact@v3
with:
name: go_api
name: kots
path: ./bin


release_go_api_alpha:
build-kotsadm:
runs-on: ubuntu-20.04
needs: [build_web, build_go_api, generate-tag]
needs: [generate-tag]
permissions:
id-token: write # required to be able to assume the GCP SA identity to pull Chainguard packages.
steps:

- name: Checkout
uses: actions/checkout@v4

- name: Download go_api artifact
uses: actions/download-artifact@v3
with:
name: go_api
path: ./bin

- name: Add executable permissions
run: |
chmod a+x ./bin/kotsadm
chmod a+x ./bin/kots

- uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build alpha release
env:
GIT_TAG: ${{ needs.generate-tag.outputs.tag }}
run: |
mapfile -t envs < <(grep -v '#.*' < .image.env) && export "${envs[@]}" && make build-alpha
- uses: actions/checkout@v4
- uses: ./.github/actions/build-push-kotsadm-image
with:
chainguard-gcp-wif-pool: ${{ secrets.CHAINGUARD_GCP_WIF_POOL }}
chainguard-gcp-sa: ${{ secrets.CHAINGUARD_GCP_SA }}
chainguard-gcp-project-id: ${{ secrets.CHAINGUARD_GCP_PROJECT_ID }}
image-name: index.docker.io/kotsadm/kotsadm:alpha
git-tag: ${{ needs.generate-tag.outputs.tag }}
registry-username: ${{ secrets.DOCKERHUB_USER }}
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}


build_kurl_proxy_alpha:
Expand Down Expand Up @@ -210,7 +197,7 @@ jobs:
id: scan
uses: aquasecurity/trivy-action@master
with:
image-ref: "rqlite/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }}"
image-ref: "cgr.dev/chainguard/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }}"
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'rqlite-scan-output.sarif'
Expand All @@ -237,7 +224,7 @@ jobs:
id: scan
uses: aquasecurity/trivy-action@master
with:
image-ref: "docker.io/minio/minio:${{ steps.dotenv.outputs.minio_tag }}"
image-ref: "cgr.dev/chainguard/minio:${{ steps.dotenv.outputs.minio_tag }}"
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'minio-scan-output.sarif'
Expand Down Expand Up @@ -265,7 +252,7 @@ jobs:
id: scan
uses: aquasecurity/trivy-action@master
with:
image-ref: "ghcr.io/dexidp/dex:${{ steps.dotenv.outputs.dex_tag }}"
image-ref: "cgr.dev/chainguard/dex:${{ steps.dotenv.outputs.dex_tag }}"
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'dex-scan-output.sarif'
Expand Down Expand Up @@ -330,7 +317,7 @@ jobs:

scan_kotsadm:
runs-on: ubuntu-20.04
needs: [release_go_api_alpha]
needs: [build-kotsadm]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ jobs:

- name: push minio for e2e
run: |
docker pull minio/minio:${{ steps.dotenv.outputs.minio_tag }}
docker tag minio/minio:${{ steps.dotenv.outputs.minio_tag }} ttl.sh/automated-${{ github.run_id }}/minio:${{ steps.dotenv.outputs.minio_tag }}
docker pull cgr.dev/chainguard/minio:${{ steps.dotenv.outputs.minio_tag }}
docker tag cgr.dev/chainguard/minio:${{ steps.dotenv.outputs.minio_tag }} ttl.sh/automated-${{ github.run_id }}/minio:${{ steps.dotenv.outputs.minio_tag }}
docker push ttl.sh/automated-${{ github.run_id }}/minio:${{ steps.dotenv.outputs.minio_tag }}


Expand All @@ -450,8 +450,8 @@ jobs:

- name: push rqlite for CI
run: |
docker pull rqlite/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }}
docker tag rqlite/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }} ttl.sh/automated-${{ github.run_id }}/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }}
docker pull cgr.dev/chainguard/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }}
docker tag cgr.dev/chainguard/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }} ttl.sh/automated-${{ github.run_id }}/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }}
docker push ttl.sh/automated-${{ github.run_id }}/rqlite:${{ steps.dotenv.outputs.RQLITE_TAG }}


Expand All @@ -469,7 +469,8 @@ jobs:

- name: push dex for CI
run: |
docker build --pull -f deploy/dex.Dockerfile -t ttl.sh/automated-${{ github.run_id }}/dex:${{ steps.dotenv.outputs.DEX_TAG }} --build-arg TAG=${{ steps.dotenv.outputs.DEX_TAG }} .
docker pull cgr.dev/chainguard/dex:${{ steps.dotenv.outputs.DEX_TAG }}
docker tag cgr.dev/chainguard/dex:${{ steps.dotenv.outputs.DEX_TAG }} ttl.sh/automated-${{ github.run_id }}/dex:${{ steps.dotenv.outputs.DEX_TAG }}
docker push ttl.sh/automated-${{ github.run_id }}/dex:${{ steps.dotenv.outputs.DEX_TAG }}


Expand Down Expand Up @@ -2178,7 +2179,7 @@ jobs:

validate-min-kots-version:
runs-on: ubuntu-20.04
needs: [ enable-tests, can-run-ci, build-e2e, build-kotsadm, build-kurl-proxy, build-migrations, push-minio, push-rqlite, generate-tag ]
needs: [ enable-tests, can-run-ci, build-e2e, build-kots, build-kotsadm, build-kurl-proxy, build-migrations, push-minio, push-rqlite, generate-tag ]
env:
APP_SLUG: min-kots-version
strategy:
Expand Down Expand Up @@ -2248,7 +2249,7 @@ jobs:

validate-target-kots-version:
runs-on: ubuntu-20.04
needs: [ enable-tests, can-run-ci, build-e2e, build-kotsadm, build-kurl-proxy, build-migrations, push-minio, push-rqlite, generate-tag ]
needs: [ enable-tests, can-run-ci, build-e2e, build-kots, build-kotsadm, build-kurl-proxy, build-migrations, push-minio, push-rqlite, generate-tag ]
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -2315,7 +2316,7 @@ jobs:

validate-range-kots-version:
runs-on: ubuntu-20.04
needs: [ enable-tests, can-run-ci, build-e2e, build-kotsadm, build-kurl-proxy, build-migrations, push-minio, push-rqlite, generate-tag ]
needs: [ enable-tests, can-run-ci, build-e2e, build-kots, build-kotsadm, build-kurl-proxy, build-migrations, push-minio, push-rqlite, generate-tag ]
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -3497,7 +3498,7 @@ jobs:

validate-replicated-sdk:
runs-on: ubuntu-20.04
needs: [ enable-tests, can-run-ci, build-kotsadm, build-kurl-proxy, build-migrations, push-minio, push-rqlite ]
needs: [ enable-tests, can-run-ci, build-kots, build-kotsadm, build-kurl-proxy, build-migrations, push-minio, push-rqlite ]
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -3807,7 +3808,7 @@ jobs:

validate-support-bundle:
runs-on: ubuntu-20.04
needs: [ enable-tests, can-run-ci, build-push-kotsadm-image, build-e2e, build-kurl-proxy, build-migrations, push-minio, push-rqlite ]
needs: [ enable-tests, can-run-ci, build-kots, build-kotsadm, build-e2e, build-kurl-proxy, build-migrations, push-minio, push-rqlite ]
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ jobs:
id-token: write # required to be able to assume the GCP SA identity to pull Chainguard packages.
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: ./.github/actions/build-push-kotsadm-image
with:
chainguard-gcp-wif-pool: ${{ secrets.CHAINGUARD_GCP_WIF_POOL }}
Expand Down
4 changes: 2 additions & 2 deletions .image.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated file, do not modify. This file is generated from a text file containing a list of images. The
# most recent tag is interpolated from the source repository and used to generate a fully qualified image
# name.
MINIO_TAG='RELEASE.2023-11-11T08-14-41Z'
MINIO_TAG='0.20231101-dev'
RQLITE_TAG='7.21.4'
DEX_TAG='v2.37.0'
DEX_TAG='2.37.0'
SCHEMAHERO_TAG='0.16.0'
LVP_TAG='v0.5.5'
39 changes: 22 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include Makefile.build.mk
CURRENT_USER := $(shell id -u -n)
MINIO_TAG ?= RELEASE.2023-11-11T08-14-41Z
MINIO_TAG ?= 0.20231101-dev
RQLITE_TAG ?= 7.21.4
DEX_TAG ?= v2.37.0
DEX_TAG ?= 2.37.0
LVP_TAG ?= v0.5.5

define sendMetrics
Expand Down Expand Up @@ -118,31 +118,36 @@ build-ttl.sh: build
all-ttl.sh: build-ttl.sh
source .image.env && IMAGE=ttl.sh/${CURRENT_USER}/kotsadm-migrations:24h make -C migrations build_schema

docker pull minio/minio:${MINIO_TAG}
docker tag minio/minio:${MINIO_TAG} ttl.sh/${CURRENT_USER}/minio:${MINIO_TAG}
docker pull cgr.dev/chainguard/minio:${MINIO_TAG}
docker tag cgr.dev/chainguard/minio:${MINIO_TAG} ttl.sh/${CURRENT_USER}/minio:${MINIO_TAG}
docker push ttl.sh/${CURRENT_USER}/minio:${MINIO_TAG}

docker pull rqlite/rqlite:${RQLITE_TAG}
docker tag rqlite/rqlite:${RQLITE_TAG} ttl.sh/${CURRENT_USER}/rqlite:${RQLITE_TAG}
docker pull cgr.dev/chainguard/rqlite:${RQLITE_TAG}
docker tag cgr.dev/chainguard/rqlite:${RQLITE_TAG} ttl.sh/${CURRENT_USER}/rqlite:${RQLITE_TAG}
docker push ttl.sh/${CURRENT_USER}/rqlite:${RQLITE_TAG}

.PHONY: build-alpha
build-alpha:
docker build --pull -f deploy/Dockerfile --build-arg version=${GIT_TAG} -t kotsadm/kotsadm:alpha .
docker push kotsadm/kotsadm:alpha

.PHONY: build-release
build-release:
mkdir -p bin/docker-archive/kotsadm
skopeo copy docker://kotsadm/kotsadm:${GIT_TAG} docker-archive:bin/docker-archive/kotsadm/${GIT_TAG}

docker build --pull -f deploy/dex.Dockerfile -t kotsadm/dex:${DEX_TAG} --build-arg TAG=${DEX_TAG} .
docker push kotsadm/dex:${DEX_TAG}
mkdir -p bin/docker-archive/dex
skopeo copy docker://kotsadm/dex:${DEX_TAG} docker-archive:bin/docker-archive/dex/${DEX_TAG}

mkdir -p bin/docker-archive/minio
skopeo copy docker://minio/minio:${MINIO_TAG} docker-archive:bin/docker-archive/minio/${MINIO_TAG}
docker pull cgr.dev/chainguard/minio:${MINIO_TAG}
docker tag cgr.dev/chainguard/minio:${MINIO_TAG} kotsadm/minio:${MINIO_TAG}
docker push kotsadm/minio:${MINIO_TAG}
skopeo copy docker-daemon:kotsadm/minio:${MINIO_TAG} docker-archive:bin/docker-archive/minio/${MINIO_TAG}

mkdir -p bin/docker-archive/rqlite
docker pull cgr.dev/chainguard/rqlite:${RQLITE_TAG}
docker tag cgr.dev/chainguard/rqlite:${RQLITE_TAG} kotsadm/rqlite:${RQLITE_TAG}
docker push kotsadm/rqlite:${RQLITE_TAG}
skopeo copy docker-daemon:kotsadm/rqlite:${RQLITE_TAG} docker-archive:bin/docker-archive/rqlite/${RQLITE_TAG}

mkdir -p bin/docker-archive/dex
docker pull cgr.dev/chainguard/dex:${DEX_TAG}
docker tag cgr.dev/chainguard/dex:${DEX_TAG} kotsadm/dex:${DEX_TAG}
docker push kotsadm/dex:${DEX_TAG}
skopeo copy docker-daemon:kotsadm/dex:${DEX_TAG} docker-archive:bin/docker-archive/dex/${DEX_TAG}

mkdir -p bin/docker-archive/local-volume-provider
skopeo copy docker://replicated/local-volume-provider:${LVP_TAG} docker-archive:bin/docker-archive/local-volume-provider/${LVP_TAG}
Expand Down
18 changes: 9 additions & 9 deletions cmd/imagedeps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,27 @@ is useful to restrict release tags to a major version, or to filter out garbage

| Name | Image URI | Matcher Regexp (Optional) |
|------|--------------------|----------|
| Name of the image for example **minio** | Untagged image reference **ghcr.io/dexidp/dex**| An optional regular expression, only matching tags will be included. |
| Name of the image for example **minio** | Untagged image reference **cgr.dev/chainguard/minio**| An optional regular expression, only matching tags will be included. |

### Sample image-spec
```text
minio minio/minio
rqlite rqlite/rqlite
dex ghcr.io/dexidp/dex
minio cgr.dev/chainguard/minio
rqlite cgr.dev/chainguard/rqlite
dex cgr.dev/chainguard/dex
```
The preceding image spec will produce the following environment and Go files.
```shell
MINIO_TAG='RELEASE.2021-09-15T04-54-25Z'
RQLITE_TAG='7.7.0'
MINIO_TAG='0.20231025-dev'
RQLITE_TAG='7.21.4'
DEX_TAG='v2.30.0'
```
```go
package image

const (
Minio = "minio/minio:RELEASE.2021-09-15T04-54-25Z"
Rqlite = "rqlite/rqlite:7.7.0"
Dex = "ghcr.io/dexidp/dex:v2.30.0"
Minio = "cgr.dev/chainguard/minio:0.20231025-dev"
Rqlite = "cgr.dev/chainguard/rqlite:7.21.4"
Dex = "cgr.dev/chainguard/dex:2.30.0"
)
```

Expand Down
6 changes: 3 additions & 3 deletions cmd/imagedeps/image-spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
minio minio/minio
rqlite rqlite/rqlite ^([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)$
dex ghcr.io/dexidp/dex
minio cgr.dev/chainguard/minio ^\b0\.\d+\b-dev$
rqlite cgr.dev/chainguard/rqlite ^([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)$
dex cgr.dev/chainguard/dex ^([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)$
schemahero schemahero/schemahero ^([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)$
lvp replicated/local-volume-provider ^v([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)\.([0-9]|[1-9][0-9]*)$
Loading
Loading