Skip to content

Commit f6d8f0b

Browse files
authored
Switch build and artifacts push from Azure Pipelines to GitHub Actions (#12035)
Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
1 parent 23c05da commit f6d8f0b

9 files changed

Lines changed: 135 additions & 138 deletions

File tree

.azure/build-pipeline.yaml

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -58,59 +58,59 @@ stages:
5858
architectures: ['amd64', 'arm64', 's390x', 'ppc64le']
5959

6060
# Push Strimzi containers -> run only on main branch
61-
- stage: push_containers
62-
displayName: Push Containers
63-
dependsOn:
64-
- build_strimzi
65-
- test_strimzi
66-
- build_containers
67-
- build_docs
68-
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/main'))
69-
jobs:
70-
- template: 'templates/jobs/build/push_containers.yaml'
71-
parameters:
72-
dockerTag: 'latest'
73-
artifactSource: 'current'
74-
artifactProject: 'strimzi'
75-
artifactPipeline: ''
76-
artifactRunVersion: ''
77-
artifactRunId: ''
78-
architectures: ['amd64', 'arm64', 's390x', 'ppc64le']
79-
80-
# Publish Strimzi docs to the website -> run only on main branch
81-
- stage: public_docs
82-
displayName: Publish Docs
83-
dependsOn:
84-
- build_strimzi
85-
- test_strimzi
86-
- build_containers
87-
- build_docs
88-
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/main'))
89-
jobs:
90-
- template: 'templates/jobs/build/publish_docs.yaml'
91-
parameters:
92-
dockerTag: 'latest'
93-
artifactSource: 'current'
94-
artifactProject: 'strimzi'
95-
artifactPipeline: ''
96-
artifactRunVersion: ''
97-
artifactRunId: ''
98-
99-
# Deploy Strimzi Java artifacts -> run only on main branch (where it deploys to OSS snapshot repos)
100-
- stage: deploy_strimzi_java
101-
displayName: Deploy Java artifacts
102-
dependsOn:
103-
- build_strimzi
104-
- test_strimzi
105-
- build_containers
106-
- build_docs
107-
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/main'))
108-
jobs:
109-
- template: 'templates/jobs/build/deploy_strimzi_java.yaml'
110-
parameters:
111-
dockerTag: 'latest'
112-
artifactSource: 'current'
113-
artifactProject: 'strimzi'
114-
artifactPipeline: ''
115-
artifactRunVersion: ''
116-
artifactRunId: ''
61+
# - stage: push_containers
62+
# displayName: Push Containers
63+
# dependsOn:
64+
# - build_strimzi
65+
# - test_strimzi
66+
# - build_containers
67+
# - build_docs
68+
# condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/main'))
69+
# jobs:
70+
# - template: 'templates/jobs/build/push_containers.yaml'
71+
# parameters:
72+
# dockerTag: 'latest'
73+
# artifactSource: 'current'
74+
# artifactProject: 'strimzi'
75+
# artifactPipeline: ''
76+
# artifactRunVersion: ''
77+
# artifactRunId: ''
78+
# architectures: ['amd64', 'arm64', 's390x', 'ppc64le']
79+
#
80+
# # Publish Strimzi docs to the website -> run only on main branch
81+
# - stage: public_docs
82+
# displayName: Publish Docs
83+
# dependsOn:
84+
# - build_strimzi
85+
# - test_strimzi
86+
# - build_containers
87+
# - build_docs
88+
# condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/main'))
89+
# jobs:
90+
# - template: 'templates/jobs/build/publish_docs.yaml'
91+
# parameters:
92+
# dockerTag: 'latest'
93+
# artifactSource: 'current'
94+
# artifactProject: 'strimzi'
95+
# artifactPipeline: ''
96+
# artifactRunVersion: ''
97+
# artifactRunId: ''
98+
#
99+
# # Deploy Strimzi Java artifacts -> run only on main branch (where it deploys to OSS snapshot repos)
100+
# - stage: deploy_strimzi_java
101+
# displayName: Deploy Java artifacts
102+
# dependsOn:
103+
# - build_strimzi
104+
# - test_strimzi
105+
# - build_containers
106+
# - build_docs
107+
# condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/main'))
108+
# jobs:
109+
# - template: 'templates/jobs/build/deploy_strimzi_java.yaml'
110+
# parameters:
111+
# dockerTag: 'latest'
112+
# artifactSource: 'current'
113+
# artifactProject: 'strimzi'
114+
# artifactPipeline: ''
115+
# artifactRunVersion: ''
116+
# artifactRunId: ''

.azure/scripts/setup-kind.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ rm -rf ~/.kube
66
KIND_VERSION=${KIND_VERSION:-"v0.29.0"}
77
KIND_CLOUD_PROVIDER_VERSION=${KIND_CLOUD_PROVIDER_VERSION:-"v0.6.0"}
88
# To properly upgrade Kind version check the releases in github https://github.com/kubernetes-sigs/kind/releases and use proper image based on Kind version
9-
KIND_DEFAULT_IMAGE="kindest/node:v1.33.1@sha256:050072256b9a903bd914c0b2866828150cb229cea0efe5892e2b644d5dd3b34f"
10-
KIND_NODE_IMAGE=${KIND_NODE_IMAGE:-$KIND_DEFAULT_IMAGE}
9+
KIND_LATEST_DEFAULT_IMAGE="kindest/node:v1.33.1@sha256:050072256b9a903bd914c0b2866828150cb229cea0efe5892e2b644d5dd3b34f"
10+
KIND_OLDEST_DEFAULT_IMAGE="kindest/node:v1.27.16@sha256:2d21a61643eafc439905e18705b8186f3296384750a835ad7a005dceb9546d20"
11+
KIND_NODE_IMAGE=${KIND_NODE_IMAGE:-$KIND_LATEST_DEFAULT_IMAGE}
1112
# Replace latest as one special version
1213
if [[ "${KIND_NODE_IMAGE}" == "latest" ]]; then
13-
KIND_NODE_IMAGE=$KIND_DEFAULT_IMAGE
14+
KIND_NODE_IMAGE=$KIND_LATEST_DEFAULT_IMAGE
15+
fi
16+
if [[ "${KIND_NODE_IMAGE}" == "oldest" ]]; then
17+
KIND_NODE_IMAGE=$KIND_OLDEST_DEFAULT_IMAGE
1418
fi
1519
COPY_DOCKER_LOGIN=${COPY_DOCKER_LOGIN:-"false"}
1620
DOCKER_CMD="${DOCKER_CMD:-docker}"

.github/actions/build/publish-docs/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inputs:
66
description: "Name of the documentation artifact to download"
77
required: false
88
default: "Documentation"
9-
githubDeployKey:
9+
websiteDeployKey:
1010
description: "GitHub deploy key for website publishing"
1111
required: true
1212

@@ -29,4 +29,4 @@ runs:
2929
env:
3030
BUILD_REASON: "IndividualCI"
3131
BRANCH: ${{ github.ref }}
32-
GITHUB_DEPLOY_KEY: ${{ inputs.githubDeployKey }}
32+
GITHUB_DEPLOY_KEY: ${{ inputs.websiteDeployKey }}

.github/docs/README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Build & Test Strimzi in GitHub Actions
22
The following lines put together basic information how is Strimzi built and tested via GitHub Actions.
3-
Currently, our main build system still lives on Azure Pipelines and running builds and tests on GHA is in experimental phase.
43
All the steps mentioned bellow re-use scripts from our [azure](../../.azure) directory and thus all the steps are more or less the same on both systems.
54

65
## Build jar artifacts
@@ -80,15 +79,6 @@ Utils actions:
8079
- [log-variables](../actions/utils/log-variables)
8180
- [determine-ref](../actions/utils/determine-ref)
8281

83-
To make the build 1:1 to Azure we miss few actions that do the missing steps:
84-
- Push docs (uncomment usage & properly test)
85-
- Push containers (uncomment usage & properly test)
86-
- Deploy Java artifacts (uncomment usage & properly test)
87-
88-
The actions also had to be put together into workflow as we have in Azure:
89-
- `build pipeline` -> `build workflow`
90-
- `operator-release pipeline` -> `operator-release workflow`
91-
9282
## Running system tests
9383
With GitHub Actions we are now able to propagate a specific parameters to our e2e jobs.
9484
That allow us to run a subset of tests for example or run it against different kubernetes version etc.

.github/workflows/build.yml

Lines changed: 65 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobs:
5050
- uses: ./.github/actions/build/test-strimzi
5151
with:
5252
runnerArch: "amd64"
53+
env:
54+
# Use the oldest supported kubernetes version within Kind
55+
KIND_NODE_IMAGE: "oldest"
5356

5457
# Builds Strimzi docs
5558
build-docs:
@@ -85,66 +88,66 @@ jobs:
8588
runnerArch: "amd64"
8689

8790
# Push Strimzi containers - run only on main branch
88-
# push-containers:
89-
# name: Push Containers
90-
# needs:
91-
# - build-strimzi
92-
# - test-strimzi
93-
# - build-containers
94-
# - build-docs
95-
# if: ${{ github.ref == 'refs/heads/main' }}
96-
# runs-on: ubuntu-latest
97-
# permissions:
98-
# contents: read
99-
# packages: write
100-
# # Required for keyless signing with GitHub OIDC
101-
# id-token: write
102-
# env:
103-
# DOCKER_REGISTRY: "quay.io"
104-
# DOCKER_ORG: "strimzi"
105-
# DOCKER_TAG: "latest"
106-
# steps:
107-
# - uses: actions/checkout@v5
108-
# - uses: ./.github/actions/build/containers-push
109-
# with:
110-
# architectures: "amd64,arm64,ppc64le,s390x"
111-
# runnerArch: "amd64"
112-
# quayUser: ${{ secrets.QUAY_USER }}
113-
# quayPass: ${{ secrets.QUAY_PASS }}
91+
push-containers:
92+
name: Push Containers
93+
needs:
94+
- build-strimzi
95+
- test-strimzi
96+
- build-containers
97+
- build-docs
98+
if: ${{ github.ref == 'refs/heads/main' }}
99+
runs-on: ubuntu-latest
100+
permissions:
101+
contents: read
102+
packages: write
103+
# Required for keyless signing with GitHub OIDC
104+
id-token: write
105+
env:
106+
DOCKER_REGISTRY: "quay.io"
107+
DOCKER_ORG: "strimzi"
108+
DOCKER_TAG: "latest"
109+
steps:
110+
- uses: actions/checkout@v5
111+
- uses: ./.github/actions/build/containers-push
112+
with:
113+
architectures: "amd64,arm64,ppc64le,s390x"
114+
runnerArch: "amd64"
115+
quayUser: ${{ secrets.QUAY_USER }}
116+
quayPass: ${{ secrets.QUAY_PASS }}
117+
118+
# Publish Strimzi docs to the website - run only on main branch
119+
publish-docs:
120+
name: Publish Docs
121+
needs:
122+
- build-strimzi
123+
- test-strimzi
124+
- build-containers
125+
- build-docs
126+
if: ${{ github.ref == 'refs/heads/main' }}
127+
runs-on: ubuntu-latest
128+
steps:
129+
- uses: actions/checkout@v5
130+
- uses: ./.github/actions/build/publish-docs
131+
with:
132+
artifactName: "documentation.tar"
133+
websiteDeployKey: ${{ secrets.WEBSITE_DEPLOY_KEY }}
114134

115-
# # Publish Strimzi docs to the website - run only on main branch
116-
# publish-docs:
117-
# name: Publish Docs
118-
# needs:
119-
# - build-strimzi
120-
# - test-strimzi
121-
# - build-containers
122-
# - build-docs
123-
# if: ${{ github.ref == 'refs/heads/main' }}
124-
# runs-on: ubuntu-latest
125-
# steps:
126-
# - uses: actions/checkout@v5
127-
# - uses: ./.github/actions/build/publish-docs
128-
# with:
129-
# artifactName: "documentation.tar"
130-
# githubDeployKey: ${{ secrets.GITHUB_DEPLOY_KEY }}
131-
#
132-
# # Deploy Strimzi Java artifacts - run only on main branch
133-
# deploy-java:
134-
# name: Deploy Java artifacts
135-
# needs:
136-
# - build-strimzi
137-
# - test-strimzi
138-
# - build-containers
139-
# - build-docs
140-
# if: ${{ github.ref == 'refs/heads/main' }}
141-
# runs-on: ubuntu-latest
142-
# steps:
143-
# - uses: actions/checkout@v5
144-
# - uses: ./.github/actions/build/deploy-java
145-
# with:
146-
# runnerArch: "amd64"
147-
# gpgPassphrase: ${{ secrets.GPG_PASSPHRASE }}
148-
# gpgSigningKey: ${{ secrets.GPG_SIGNING_KEY }}
149-
# centralUsername: ${{ secrets.CENTRAL_USERNAME }}
150-
# centralPassword: ${{ secrets.CENTRAL_PASSWORD }}
135+
# Deploy Strimzi Java artifacts - run only on main branch
136+
deploy-java:
137+
name: Deploy Java artifacts
138+
needs:
139+
- build-strimzi
140+
- test-strimzi
141+
- build-containers
142+
- build-docs
143+
if: ${{ github.ref == 'refs/heads/main' }}
144+
runs-on: ubuntu-latest
145+
steps:
146+
- uses: actions/checkout@v5
147+
- uses: ./.github/actions/build/deploy-java
148+
with:
149+
runnerArch: "amd64"
150+
gpgPassphrase: ${{ secrets.GPG_PASSPHRASE }}
151+
gpgSigningKey: ${{ secrets.GPG_SIGNING_KEY }}
152+
centralUsername: ${{ secrets.CENTRAL_USERNAME }}
153+
centralPassword: ${{ secrets.CENTRAL_PASSWORD }}

.github/workflows/run-system-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ jobs:
6363
STRIMZI_DEFAULT_LOG_LEVEL: DEBUG
6464
OPERATOR_IMAGE_PULL_POLICY: IfNotPresent
6565
COMPONENTS_IMAGE_PULL_POLICY: IfNotPresent
66-
# Kube version for Kind
67-
KIND_NODE_IMAGE: ${{ inputs.kubeVersion }}
66+
# Kube version for Kind - use the oldest supported kubernetes version within Kind
67+
KIND_NODE_IMAGE: ${{ inputs.kubeVersion || 'oldest' }}
6868
# Kube version for Minikube
6969
KUBE_VERSION: ${{ inputs.kubeVersion }}
7070
# Job steps

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Run Apache Kafka on Kubernetes and OpenShift
44

55
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/strimzi/strimzi-kafka-operator/badge)](https://scorecard.dev/viewer/?uri=github.com/strimzi/strimzi-kafka-operator)
6-
[![Build Status](https://dev.azure.com/cncf/strimzi/_apis/build/status/build?branchName=main)](https://dev.azure.com/cncf/strimzi/_build/latest?definitionId=16&branchName=main)
6+
[![Build Status](https://github.com/strimzi/strimzi-kafka-operator/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/strimzi/strimzi-kafka-operator/actions/workflows/build.yml?query=branch%3Amain)
77
[![GitHub release](https://img.shields.io/github/release/strimzi/strimzi-kafka-operator.svg)](https://github.com/strimzi/strimzi-kafka-operator/releases/latest)
88
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
99
[![Twitter Follow](https://img.shields.io/twitter/follow/strimziio?style=social)](https://twitter.com/strimziio)

development-docs/KAFKA_VERSIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ But these are some of the tasks you usually have to do.
2626
You will need to commit also all the files it updates before opening a PR.
2727
* Add a `CHANGELOG.md` record
2828
* Run unit tests
29-
* Run system tests (typically as part of the PR on Azure Pipelines)
29+
* Run system tests (typically as part of the PR on GitHub Actions)
3030

3131
You can also run unit and systems tests in an early stage on an Apache Kafka RC to validate it and report issues to the community before the GA.
3232
In order to so so, please follow the above steps but also add the Apache staging repository to the `pom.xml` file as follow:

development-docs/TESTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ However, since system tests use the command line `Executor` for some actions, ma
386386

387387
## Helper script
388388

389-
The `./systemtest/scripts/run_tests.sh` script can be used to run the `systemtests` using the same configuration as used in the Azure build.
389+
The `./systemtest/scripts/run_tests.sh` script can be used to run the `systemtests` using the very similar configuration as we use in the GitHub Actions.
390390
You can use this script to run the `systemtests` project efficiently.
391391

392392
Pass additional parameters to `mvn` by populating the `EXTRA_ARGS` env var.

0 commit comments

Comments
 (0)