forked from bpfman/bpfman
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request bpfman#1158 from Billy99/billy99-mv-oper-images
multiarch: Move multiarch building to bpfman-operator repo
- Loading branch information
Showing
6 changed files
with
35 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -272,81 +272,43 @@ jobs: | |
filename: linux-x86_64 | ||
- arch: arm64 | ||
filename: linux-arm64 | ||
# - arch: ppc64le | ||
# filename: linux-ppc64le | ||
# - arch: s390x | ||
# filename: linux-s390x | ||
- arch: ppc64le | ||
filename: linux-ppc64le | ||
- arch: s390x | ||
filename: linux-s390x | ||
runs-on: ubuntu-latest | ||
# k8s codegen requires this to be set | ||
env: | ||
GOPATH: ${{ github.workspace }} | ||
defaults: | ||
run: | ||
## For us to run the controller-gen generate commands from within | ||
## github actions the package name MUST match the directory layout | ||
## (i.e `GOPATH/src/github.com/bpfman/bpfman`). Otherwise when | ||
## running `make generate` generated code is deposited at | ||
## `home/runner/work/bpfman/bpfman/bpfman-operator/PKG_NAME` instead | ||
## of in `home/runner/work/bpfman/bpfman/bpfman-operator/pkg/client/...`. | ||
## This is annoying and gross but cannot be resolved until | ||
## https://github.com/kubernetes/kubernetes/issues/86753 is properly | ||
## addressed. | ||
working-directory: ${{ env.GOPATH }}/src/github.com/bpfman/bpfman/bpfman-operator | ||
steps: | ||
- name: Checkout bpfman | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ${{ env.GOPATH }}/src/github.com/bpfman/bpfman | ||
|
||
- name: Install go | ||
uses: actions/setup-go@v5 | ||
with: | ||
# prettier-ignore | ||
## `make verify` failing on 1.22, so leave at 1.21 until issue determined. | ||
go-version: '1.21' # yamllint disable-line rule:quoted-strings | ||
go-version: '1.22' # yamllint disable-line rule:quoted-strings | ||
|
||
- name: Go mod check | ||
# Only need to run go mod once, so just pick one of the arch to run on. | ||
if: ${{ matrix.arch.arch == 'amd64' }} | ||
run: | | ||
go mod tidy | ||
git diff --exit-code ../go.mod ../go.sum | ||
git diff --exit-code go.mod go.sum | ||
- name: Lint | ||
# Only need to lint the code once, so just pick one of the arch to run on. | ||
if: ${{ matrix.arch.arch == 'amd64' }} | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
## https://github.com/golangci/golangci-lint-action/issues/369 | ||
working-directory: ${{ env.GOPATH }}/src/github.com/bpfman/bpfman | ||
version: v1.54.2 | ||
skip-cache: true | ||
skip-save-cache: true | ||
args: -v --timeout 5m | ||
|
||
- name: Build Examples | ||
run: | | ||
CGO_ENABLED=0 GOOS=linux GOARCH=${{ matrix.arch.arch }} go build ./... | ||
- name: Build Operator | ||
run: GOARCH=${{ matrix.arch.arch }} make build | ||
|
||
- name: Verify Autogenerated Code | ||
# Only need to run verify once, so just pick one of the arch to run on. | ||
if: ${{ matrix.arch.arch == 'amd64' }} | ||
run: make verify | ||
|
||
- name: Run Tests | ||
run: make test | ||
|
||
- name: Archive Go code coverage results | ||
# Only need to run the test coverage for once, so just pick one of the arch to run on. | ||
if: ${{ matrix.arch.arch == 'amd64' }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-go | ||
path: ${{ env.GOPATH }}/src/github.com/bpfman/bpfman/bpfman-operator/cover.out | ||
if-no-files-found: error | ||
cd examples | ||
GOARCH=${{ matrix.arch.arch }} make build | ||
build-docs: | ||
runs-on: ubuntu-latest | ||
|
@@ -418,9 +380,6 @@ jobs: | |
- name: Run the bpfman installer | ||
run: sudo ./scripts/setup.sh install | ||
|
||
- name: Give certs time to be created | ||
run: sleep 5 | ||
|
||
- name: Verify the bpfman systemd service is active | ||
run: systemctl is-active bpfman.socket | ||
|
||
|
@@ -438,109 +397,10 @@ jobs: | |
- name: Run integration tests | ||
run: cargo xtask integration-test | ||
|
||
kubernetes-integration-tests: | ||
needs: [build, build-go, build-docs] | ||
runs-on: ubuntu-latest | ||
env: | ||
BPFMAN_IMG: quay.io/bpfman/bpfman:int-test | ||
BPFMAN_AGENT_IMG: quay.io/bpfman/bpfman-agent:int-test | ||
BPFMAN_OPERATOR_IMG: quay.io/bpfman/bpfman-operator:int-test | ||
XDP_PASS_PRIVATE_IMAGE_CREDS: ${{ secrets.XDP_PASS_PRIVATE_IMAGE_CREDS }} | ||
steps: | ||
- name: Check disk space | ||
run: df -h | ||
|
||
- name: Free up space | ||
run: | | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /opt/ghc | ||
sudo rm -rf "/usr/local/share/boost" | ||
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
sudo rm -rf /usr/local/lib/android | ||
# The following are additional commands that could be run to free up | ||
# more space if necessary: | ||
# | ||
# sudo apt-get update | ||
# sudo eatmydata apt-get purge --auto-remove -y \ | ||
# azure-cli aspnetcore-* dotnet-* ghc-* firefox \ | ||
# google-chrome-stable \ | ||
# llvm-* microsoft-edge-stable mono-* \ | ||
# msbuild mysql-server-core-* php-* php7* \ | ||
# powershell temurin-* zulu-* | ||
# sudo apt-get autoremove -y | ||
# sudo apt-get autoclean -y | ||
# sudo docker system prune -a -f --volumes | ||
|
||
- name: Check disk space again | ||
run: df -h | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -qy \ | ||
git \ | ||
clang \ | ||
llvm \ | ||
gcc-multilib \ | ||
libbpf-dev | ||
- name: setup golang | ||
uses: actions/setup-go@v5 | ||
with: | ||
# prettier-ignore | ||
go-version: '1.22' # yamllint disable-line rule:quoted-strings | ||
|
||
- name: cache go modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-codegen- | ||
- name: checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
## TODO(astoycos) Currently this is just done to ensure we have coverage | ||
## on all image builds. Ultimately we should be running the integration | ||
## tests with these locally built bytecode images. | ||
- name: build example bytecode images | ||
run: | | ||
go install github.com/cilium/ebpf/cmd/[email protected] | ||
cd examples | ||
make build-all-images | ||
- name: build images | ||
run: cd bpfman-operator && make build-images | ||
|
||
- name: run integration tests | ||
run: cd bpfman-operator && make test-integration | ||
|
||
- name: Check disk space | ||
run: df -h | ||
|
||
## Upload diagnostics if integration test step failed. | ||
- name: upload diagnostics | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: kubernetes-integration-test-diag | ||
path: /tmp/ktf-diag* | ||
if-no-files-found: ignore | ||
|
||
coverage: | ||
needs: [build, build-go] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download golang coverage artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: coverage-go | ||
|
||
- name: Download rust coverage artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
|
@@ -549,7 +409,7 @@ jobs: | |
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
files: ./cover.out,./lcov.info | ||
files: ./lcov.info | ||
verbose: true | ||
|
||
# Creates Release | ||
|
@@ -608,7 +468,6 @@ jobs: | |
build-docs, | ||
coverage, | ||
basic-integration-tests, | ||
kubernetes-integration-tests, | ||
] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,48 +35,6 @@ jobs: | |
# set latest tag for default branch | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- registry: quay.io | ||
# build_language: go - Not building locally, so don't install go tools | ||
repository: bpfman | ||
image: bpfman-agent | ||
dockerfile: ./bpfman-operator/Containerfile.bpfman-agent | ||
context: . | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
type=sha,format=long | ||
# set latest tag for default branch | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- registry: quay.io | ||
# build_language: go - Not building locally, so don't install go tools | ||
repository: bpfman | ||
image: bpfman-operator | ||
dockerfile: ./bpfman-operator/Containerfile.bpfman-operator | ||
context: . | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
type=sha,format=long | ||
# set latest tag for default branch | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- registry: quay.io | ||
# build_language: go - Not building locally, so don't install go tools | ||
repository: bpfman | ||
image: bpfman-operator-bundle | ||
context: ./bpfman-operator | ||
dockerfile: ./bpfman-operator/Containerfile.bundle | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
type=sha,format=long | ||
# set latest tag for default branch | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- registry: quay.io | ||
# build_language: go - Not building locally, so don't install go tools | ||
repository: bpfman-userspace | ||
|
@@ -183,11 +141,6 @@ jobs: | |
- name: Install cosign | ||
uses: sigstore/[email protected] | ||
|
||
- name: Generate olm bundle on disk | ||
if: ${{ matrix.image.image == 'bpfman-operator-bundle' }} | ||
run: | | ||
cd bpfman-operator && make bundle | ||
- name: Login to quay.io/bpfman | ||
uses: redhat-actions/podman-login@v1 | ||
if: ${{ github.event_name == 'push' && matrix.image.repository == 'bpfman'}} | ||
|
@@ -204,14 +157,6 @@ jobs: | |
username: ${{ secrets.BPFMAN_USERSPACE_USERNAME }} | ||
password: ${{ secrets.BPFMAN_USERSPACE_ROBOT_TOKEN }} | ||
|
||
- name: Login to quay.io/bpfman-bytecode | ||
uses: redhat-actions/podman-login@v1 | ||
if: ${{ github.event_name == 'push' && matrix.image.repository == 'bpfman-bytecode' }} | ||
with: | ||
registry: ${{ matrix.image.registry }} | ||
username: ${{ secrets.BPFMAN_BYTECODE_USERNAME }} | ||
password: ${{ secrets.BPFMAN_BYTECODE_ROBOT_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for image | ||
id: meta | ||
uses: docker/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters