Skip to content

Commit

Permalink
chore(bors): merge pull request #549
Browse files Browse the repository at this point in the history
549: feat(helm): add list of container images r=tiagolobocastro a=tiagolobocastro

Adds a list of container images which are used by the chart.
This list is contained in file: charts/images.txt

Sometimes the images can't be figured out using templates, and in such
cases we need to manually add them.
In some cases we might be able to do this using helm variables, which
is what we're doing with the localpv provisioner.

Github actions have been modified to verify the contents of the images
as well as testing them with a live cluster.
This is a pretty dumb test that just checks if the live pod images are
contained in the images files.

Co-authored-by: Tiago Castro <[email protected]>
  • Loading branch information
mayastor-bors and tiagolobocastro committed Feb 6, 2025
2 parents 6b0953d + b2f0376 commit e620241
Show file tree
Hide file tree
Showing 13 changed files with 417 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/bors.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
status = [ "bors-ci" ]
pr_status = [ "helm-chart-test", "submodule-branch", "commitlint", "DCO" ]
pr_status = [ "helm-chart-test", "helm-images", "submodule-branch", "commitlint", "DCO" ]
timeout_sec = 10000
required_approvals = 2
delete_merged_branches = true
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/develop-to-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@ jobs:
run: |
branch="${{ github.ref_name }}"
nix-shell --pure --run "./scripts/helm/publish-chart-yaml.sh --check-chart "$branch" --develop-to-release" ./scripts/helm/shell.nix
nix-shell --pure --run "SKIP_GIT=1 ./scripts/helm/generate-readme.sh" ./scripts/helm/shell.nix
- name: Check if the submodules are correct
run: |
branch="${{ github.ref_name }}"
./scripts/git/set-submodule-branches.sh --branch "$branch"
- name: Update the Chart Readme.md
run: nix-shell ./scripts/helm/shell.nix --pure --run "SKIP_GIT=1 ./scripts/helm/generate-readme.sh"
- name: Update the Chart images
run: |
nix-shell ./scripts/helm/shell.nix --pure --run "./scripts/helm/images.sh generate --dependency-update"
nix-shell ./scripts/helm/shell.nix --pure --run "./scripts/helm/images.sh patch"
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
Expand All @@ -36,14 +41,16 @@ jobs:
automated-pr
draft: false
signoff: true
token: ${{ secrets.ORG_CI_GITHUB }}
- name: Approve Pull Request by CI Bot
delete-branch: true
branch-suffix: "random"
token: ${{ github.token }}
- name: Approve Pull Request by CI User 1
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
gh pr review ${{ steps.cpr.outputs.pull-request-number }} --approve
env:
GH_TOKEN: ${{ github.token }}
- name: Approve Pull Request by CI User
GH_TOKEN: ${{ secrets.ORG_CI_GITHUB }}
- name: Approve Pull Request by CI User 2
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
gh pr review ${{ steps.cpr.outputs.pull-request-number }} --approve
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,35 @@ jobs:
run: nix-shell --run "./scripts/helm/generate-readme.sh" ./scripts/helm/shell.nix
- name: HelmChart Template
run: nix-shell --pure --run "./scripts/helm/test-template.sh" ./scripts/helm/shell.nix

helm-images:
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: DeterminateSystems/nix-installer-action@v11
with:
kvm: true
- uses: DeterminateSystems/magic-nix-cache-action@v6
- name: Setup Nix Path
run: |
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
- name: Pre-populate K8s nix-shell
run: nix-shell ./scripts/k8s/shell.nix --run "echo"
- name: Pre-populate helm nix-shell
run: nix-shell ./scripts/helm/shell.nix --run "echo"
- name: Generate image list
run: nix-shell ./scripts/helm/shell.nix --run "./scripts/helm/images.sh generate --dependency-update --exit-code"
- name: BootStrap k8s cluster
if: github.event_name != 'pull_request'
run: nix-shell ./scripts/k8s/shell.nix --run "./scripts/k8s/deployer.sh start --label"
- name: Install helm chart
if: github.event_name != 'pull_request'
run: nix-shell ./scripts/helm/shell.nix --run "./scripts/helm/install.sh --wait"
- name: Verify image list
if: github.event_name != 'pull_request'
run: nix-shell ./scripts/helm/shell.nix --run "./scripts/helm/images.sh verify"
- name: Patch chart/Chart.yaml
run: nix-shell ./scripts/helm/shell.nix --run "./scripts/helm/images.sh patch --exit-code"
4 changes: 2 additions & 2 deletions .github/workflows/k8s-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:

jobs:
k8s-ci:
runs-on: ubuntu-latest-16-cores
runs-on: ubuntu-latest-8-cores
steps:
- name: Bind mount /dev/sda1 to /nix
run: |
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
title: Test results

k8s-ci-vm:
runs-on: ubuntu-latest-16-cores
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v11
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ jobs:
delete-branch: true
branch-suffix: "random"
base: ${{ env.BASE_BRANCH }}
token: ${{ secrets.ORG_CI_GITHUB }}
- name: Approve Pull Request by CI Bot
token: ${{ github.token }}
- name: Approve Pull Request by CI User 1
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
gh pr review ${{ steps.cpr.outputs.pull-request-number }} --approve
env:
GH_TOKEN: ${{ github.token }}
- name: Approve Pull Request by CI User
GH_TOKEN: ${{ secrets.ORG_CI_GITHUB }}
- name: Approve Pull Request by CI User 2
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
gh pr review ${{ steps.cpr.outputs.pull-request-number }} --approve
Expand Down
4 changes: 3 additions & 1 deletion chart/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@
README.md.tmpl
# Nix Shell
*.nix
kubectl-plugin/
kubectl-plugin/
# Chart Metadata
images.txt
60 changes: 60 additions & 0 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,63 @@ dependencies:
version: 4.2.0
repository: https://openebs.github.io/dynamic-localpv-provisioner
condition: localpv-provisioner.enabled
annotations:
helm.sh/images: |
- name: bats
image: bats/bats:1.8.2
- name: etcd
image: docker.io/bitnami/etcd:3.5.6-debian-11-r10
- name: promtail
image: docker.io/grafana/promtail:2.8.3
- name: alpine-bash
image: docker.io/openebs/alpine-bash:4.1.0
- name: alpine-sh
image: docker.io/openebs/alpine-sh:4.1.0
- name: mayastor-agent-core
image: docker.io/openebs/mayastor-agent-core:develop
- name: mayastor-agent-ha-cluster
image: docker.io/openebs/mayastor-agent-ha-cluster:develop
- name: mayastor-agent-ha-node
image: docker.io/openebs/mayastor-agent-ha-node:develop
- name: mayastor-api-rest
image: docker.io/openebs/mayastor-api-rest:develop
- name: mayastor-csi-controller
image: docker.io/openebs/mayastor-csi-controller:develop
- name: mayastor-csi-node
image: docker.io/openebs/mayastor-csi-node:develop
- name: mayastor-io-engine
image: docker.io/openebs/mayastor-io-engine:develop
- name: mayastor-metrics-exporter-io-engine
image: docker.io/openebs/mayastor-metrics-exporter-io-engine:develop
- name: mayastor-obs-callhome
image: docker.io/openebs/mayastor-obs-callhome:develop
- name: mayastor-obs-callhome-stats
image: docker.io/openebs/mayastor-obs-callhome-stats:develop
- name: mayastor-operator-diskpool
image: docker.io/openebs/mayastor-operator-diskpool:develop
- name: loki
image: grafana/loki:2.6.1
- name: nats
image: nats:2.9.17-alpine
- name: nats-box
image: natsio/nats-box:0.13.8
- name: nats-server-config-reloader
image: natsio/nats-server-config-reloader:0.10.1
- name: prometheus-nats-exporter
image: natsio/prometheus-nats-exporter:0.11.0
- name: linux-utils
image: openebs/linux-utils:4.0.0
- name: provisioner-localpv
image: openebs/provisioner-localpv:4.1.2
- name: csi-attacher
image: registry.k8s.io/sig-storage/csi-attacher:v4.3.0
- name: csi-node-driver-registrar
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.10.0
- name: csi-provisioner
image: registry.k8s.io/sig-storage/csi-provisioner:v3.5.0
- name: csi-resizer
image: registry.k8s.io/sig-storage/csi-resizer:v1.9.3
- name: csi-snapshotter
image: registry.k8s.io/sig-storage/csi-snapshotter:v6.3.3
- name: snapshot-controller
image: registry.k8s.io/sig-storage/snapshot-controller:v6.3.3
29 changes: 29 additions & 0 deletions chart/images.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
bats/bats:1.8.2
docker.io/bitnami/etcd:3.5.6-debian-11-r10
docker.io/grafana/promtail:2.8.3
docker.io/openebs/alpine-bash:4.1.0
docker.io/openebs/alpine-sh:4.1.0
docker.io/openebs/mayastor-agent-core:develop
docker.io/openebs/mayastor-agent-ha-cluster:develop
docker.io/openebs/mayastor-agent-ha-node:develop
docker.io/openebs/mayastor-api-rest:develop
docker.io/openebs/mayastor-csi-controller:develop
docker.io/openebs/mayastor-csi-node:develop
docker.io/openebs/mayastor-io-engine:develop
docker.io/openebs/mayastor-metrics-exporter-io-engine:develop
docker.io/openebs/mayastor-obs-callhome-stats:develop
docker.io/openebs/mayastor-obs-callhome:develop
docker.io/openebs/mayastor-operator-diskpool:develop
grafana/loki:2.6.1
nats:2.9.17-alpine
natsio/nats-box:0.13.8
natsio/nats-server-config-reloader:0.10.1
natsio/prometheus-nats-exporter:0.11.0
openebs/linux-utils:4.1.0
openebs/provisioner-localpv:4.2.0
registry.k8s.io/sig-storage/csi-attacher:v4.3.0
registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.10.0
registry.k8s.io/sig-storage/csi-provisioner:v3.5.0
registry.k8s.io/sig-storage/csi-resizer:v1.9.3
registry.k8s.io/sig-storage/csi-snapshotter:v6.3.3
registry.k8s.io/sig-storage/snapshot-controller:v6.3.3
1 change: 1 addition & 0 deletions chart/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ pkgs.mkShell {
kubernetes-helm-wrapped
semver-tool
yq-go
jq
];
}
Loading

0 comments on commit e620241

Please sign in to comment.