Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
8e3bdb3
feat(byohctl): resolve agent bundle URL from byohctl's own version
indradhanush Jul 16, 2026
e24251b
build(ci): compute agent deb bundle version from git describe
indradhanush Jul 16, 2026
f801c5f
ci: publish agent deb bundle on every push to main
indradhanush Jul 16, 2026
d563a08
build: add make tag as the single source of truth for agent versioning
indradhanush Jul 16, 2026
aaeba47
build(byohctl,ci): derive version from the shared make tag target
indradhanush Jul 16, 2026
069e117
build: use 8-char abbreviated commit sha in git describe
indradhanush Jul 16, 2026
633ee7e
ci: simplify Print tag step to just make tag
indradhanush Jul 16, 2026
f6188b0
feat(ci): publish controller-manager image on every push to main
indradhanush Jul 16, 2026
e8a276f
ci: skip draft PRs, re-run on ready-for-review, publish on PR push
indradhanush Jul 16, 2026
f85d56d
fix(ci): pass --no-print-directory to make -C tag invocations
indradhanush Jul 16, 2026
633390b
ci(e2e): parallelize e2e workflow into a 7-way GINKGO_FOCUS matrix
indradhanush Jul 17, 2026
f7f3765
ci(e2e): set explicit job name to clean up matrix display in Actions UI
indradhanush Jul 17, 2026
27645ed
ci(e2e): switch e2e workflow to single job with GINKGO_NODES parallelism
indradhanush Jul 17, 2026
599df1d
fix(e2e): point default controller-manager image at new quay.io registry
indradhanush Jul 17, 2026
ae4db73
Merge branch 'dg/fix-all-e2e' into dg/feature/ci
indradhanush Jul 17, 2026
032d2ab
Merge branch 'main' into dg/feature/ci
indradhanush Jul 17, 2026
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
8 changes: 3 additions & 5 deletions .ci/build-push-agent-deb.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
set -ex
export BUILD_NUMBER
export MAJOR_MINOR_VERSION=0.1
export BYOH_DEB_VERSION=${MAJOR_MINOR_VERSION}.${BUILD_NUMBER}
export BYOH_DEB_VERSION=${BYOH_DEB_VERSION:-$(make tag)}

echo 'alias shasum="sha512sum"' >> ~/.bashrc
source ~/.bashrc
Expand All @@ -21,6 +19,6 @@ curl -LO https://github.com/carvel-dev/imgpkg/releases/download/v0.43.1/imgpkg-l
mv imgpkg-linux-amd64 imgpkg
chmod +x imgpkg

echo "pushing deb bundle to quay.io/platform9/byoh-deb:$BYOH_DEB_VERSION"
./imgpkg push -f build/pf9-byohost/debsrc/ -i quay.io/platform9/byoh-agent-deb:$BYOH_DEB_VERSION
echo "pushing deb bundle to quay.io/platform9/cluster-api-provider-bringyourownhost/agent:$BYOH_DEB_VERSION"
./imgpkg push -f build/pf9-byohost/debsrc/ -i quay.io/platform9/cluster-api-provider-bringyourownhost/agent:$BYOH_DEB_VERSION

31 changes: 19 additions & 12 deletions .ci/build-push-controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
# build-and-push.sh - CI script for building and publishing the byoh controller manager Docker image.
#
# Parameters:
# - IMAGE_REGISTRY Registry to publish the Docker image. By default 'quay.io/platform9/byoh-controller-manager' is used.
# - IMAGE_NAME Name to use for this image. By default 'byoh-controller-manager' is used.
# - IMAGE_TAG Tag to use for the image. By default '$BYOHCM_VERSION-$BUILD_NUMBER' is used.
# - IMAGE_REGISTRY URL (without scheme) pointing to quay
# - IMAGE_REGISTRY Registry to publish the Docker image. By default 'quay.io/platform9/cluster-api-provider-bringyourownhost' is used.
# - IMAGE_NAME Name to use for this image. By default 'controller-manager' is used.
# - IMAGE_TAG Tag to use for the image. By default the output of `make tag` (git describe) is used.
# - DRY_RUN If non-empty, no Docker image will be published.
# - CONTAINER_TAG Location of the container_tag file (used as an artifact in TeamCity)
# - DOCKER_USERNAME Username to login to quay.io.
# - DOCKER_PASSWORD Password to login to quay.io.
#
# Examples:
# - `USE_SYSTEM_GO=1 IMAGE_REGISTRY=quay.io IMAGE_NAME=platform9/byoh-controller-manager IMAGE_TAG=latest ./build-and-push.sh`: To test the script locally without gimme and push to Docker
# - `USE_SYSTEM_GO=1 IMAGE_REGISTRY=quay.io IMAGE_NAME=platform9/cluster-api-provider-bringyourownhost/controller-manager IMAGE_TAG=latest ./build-and-push.sh`: To test the script locally without gimme and push to Docker

set -o nounset
set -o errexit
Expand All @@ -25,15 +24,23 @@ CONTAINER_TAG=${CONTAINER_TAG:-${build_dir}/manager-container-tag}
CONTAINER_FULL_TAG=${CONTAINER_FULL_TAG:-${build_dir}/manager-container-full-tag}
GO_VERSION=${GO_VERSION:-1.22.5}

BUILD_NUMBER=${BUILD_NUMBER:-0}
BYOHCM_VERSION=${BYOHCM_VERSION:-0.1}

IMAGE_REGISTRY=${IMAGE_REGISTRY:-"quay.io/platform9"}
IMAGE_NAME=${IMAGE_NAME:-"byoh-controller-manager"}
IMAGE_TAG=${IMAGE_TAG:-${BYOHCM_VERSION}.${BUILD_NUMBER}}
IMAGE_REGISTRY=${IMAGE_REGISTRY:-"quay.io/platform9/cluster-api-provider-bringyourownhost"}
IMAGE_NAME=${IMAGE_NAME:-"controller-manager"}
IMAGE_TAG=${IMAGE_TAG:-$(make --no-print-directory -C "${project_root}" tag)}
IMAGE_NAME_TAG=${IMAGE_NAME}:${IMAGE_TAG}
IMAGE_REGISTRY_NAME_TAG=${IMAGE_REGISTRY}/${IMAGE_NAME_TAG}

# make -C implicitly enables --print-directory on some GNU Make versions
# (confirmed: not on this repo's dev-Mac Make 3.81, but yes on the Ubuntu
# CI runner's newer Make) -- without --no-print-directory above, the
# "Entering directory" chatter leaks into IMAGE_TAG via command
# substitution and corrupts the docker -t argument. Fail loud if it ever
# recurs instead of silently building/pushing a mistagged image.
if [[ "${IMAGE_TAG}" =~ [[:space:]] ]]; then
echo "ERROR: IMAGE_TAG contains whitespace, likely make output leaked into the tag: '${IMAGE_TAG}'" >&2
exit 1
fi


main() {
# Move to the project directory
Expand Down Expand Up @@ -95,7 +102,7 @@ on_exit() {

configure_docker_registry() {
repository=$1
if [ "${IMAGE_REGISTRY}" = "quay.io/platform9" ]; then
if [ "${IMAGE_REGISTRY}" = "quay.io/platform9/cluster-api-provider-bringyourownhost" ]; then
if [ -n "${DOCKER_PASSWORD:-}" ] ; then
echo -n "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin "${IMAGE_REGISTRY}"
else
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/build-push-agent-bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Publish Agent Bundle

on:
workflow_run:
workflows: ["CI"]
types: [completed]
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch: {}

jobs:
build-and-push:
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && !github.event.pull_request.draft) || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push') }}
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_sha || github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0

- name: Install fpm build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends ruby ruby-dev rubygems build-essential
sudo gem install --no-document fpm

- name: Log in to Quay
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Print tag
run: make tag

- name: Build and push agent deb bundle
run: bash .ci/build-push-agent-deb.sh
42 changes: 42 additions & 0 deletions .github/workflows/build-push-controller-manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Publish Controller Manager

on:
workflow_run:
workflows: ["CI"]
types: [completed]
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch: {}

jobs:
build-and-push:
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && !github.event.pull_request.draft) || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push') }}
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_sha || github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.24.5

- name: Log in to Quay
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Print tag
run: make tag

- name: Build and push controller manager image
env:
USE_SYSTEM_GO: "1"
run: bash .ci/build-push-controller.sh
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- 'SECURITY_CONTACTS'
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- '*.md'
- 'docs/**'
Expand All @@ -22,6 +23,7 @@ on:

jobs:
build-agent:
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-22.04
steps:
- name: Checkout code
Expand All @@ -36,6 +38,7 @@ jobs:
run: make host-agent-binaries

test:
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-22.04
steps:
- name: Check Docker Version
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
workflow_dispatch: {}

jobs:
e2e-pr-blocking:
e2e:
runs-on: ubuntu-22.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -22,21 +22,16 @@ jobs:
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v7
with:
go-version: 1.24.5

- name: Install ginkgo
run: go install github.com/onsi/ginkgo/v2/ginkgo@v2.9.2
go-version: 1.26.2
cache: true

- name: turn off swap
run: sudo swapoff -a

- name: Set netfilter conntrack max
run: sudo sysctl -w net.netfilter.nf_conntrack_max=131072

- name: Run Cluster Class e2e tests
run: yes | GINKGO_FOCUS="\[Cluster-Class\]" make test-e2e

- name: Run PR-Blocking e2e tests
run: yes | GINKGO_FOCUS="\[PR-Blocking\]" make test-e2e
- name: Run e2e tests
run: yes | GINKGO_NODES=4 make test-e2e
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
SHELL:=/usr/bin/env bash

# Define registries
STAGING_REGISTRY ?= gcr.io/k8s-staging-cluster-api
STAGING_REGISTRY ?= quay.io/platform9/cluster-api-provider-bringyourownhost

IMAGE_NAME ?= cluster-api-byoh-controller
IMAGE_NAME ?= controller-manager
TAG ?= dev
RELEASE_DIR := _dist

Expand All @@ -14,6 +14,18 @@ BYOH_BASE_IMG = byoh/node:e2e
BYOH_BASE_IMG_DEV = byoh/node:dev
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)

# GIT_VERSION is the single, predictable version string for every
# agent-side artifact built from a commit (agent bundle, byohctl) --
# matches kaapi's git-tag-based versioning philosophy
# (~/pf9/kaapi/Makefile). Distinct from TAG above, which is the
# controller-manager image tag (still static "dev" by default); unifying
# that is separate follow-up work.
GIT_VERSION := $(shell git describe --abbrev=8 --dirty --tags --match='v*' 2>/dev/null || echo "v0.0.0-$(shell git rev-parse --short=8 HEAD)")

.PHONY: tag
tag: ## Print the predictable git-derived version used for agent/byohctl artifacts
@echo $(GIT_VERSION)

REPO_ROOT := $(shell pwd)
GINKGO_FOCUS ?=
GINKGO_SKIP ?=
Expand Down
11 changes: 7 additions & 4 deletions cmd/byohctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
SHELL := /usr/bin/env bash

# Version information
MAJOR ?= 1
MINOR ?= 0
BUILD_NUMBER ?= 1
VERSION := $(MAJOR).$(MINOR).$(BUILD_NUMBER)
# VERSION defaults to the root Makefile's `make tag` target -- the single
# source of truth every agent-side artifact (byohctl, the agent bundle)
# derives its version from, so they always agree without either side
# hardcoding or independently recomputing anything.
# Override for one-off local testing: `make build VERSION=v9.9.9-test`.
REPO_ROOT := $(shell git rev-parse --show-toplevel)
VERSION ?= $(shell $(MAKE) --no-print-directory -C $(REPO_ROOT) tag)

# Build settings
BINARY_NAME := byohctl
Expand Down
4 changes: 2 additions & 2 deletions cmd/byohctl/service/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ var ensureRequiredPackages = func() error {
}

var downloadDebianPackage = func(tempDir string) (string, error) {
utils.LogInfo("Downloading BYOH agent Debian package from %s", ByohAgentDebPackageURL)
utils.LogInfo("Downloading BYOH agent Debian package from %s", byohAgentBundleURL())

imgpkgPath, _ := exec.LookPath("imgpkg")

// Use a buffer to capture the command output
var outputBuffer bytes.Buffer
pullCmd := exec.Command(imgpkgPath, "pull", "-i", ByohAgentDebPackageURL, "-o", tempDir)
pullCmd := exec.Command(imgpkgPath, "pull", "-i", byohAgentBundleURL(), "-o", tempDir)
pullCmd.Stdout = &outputBuffer
pullCmd.Stderr = &outputBuffer

Expand Down
Loading
Loading