Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f90836d
CFN-6544: set Noble as default stemcell for acceptance tests
mike-jc Mar 4, 2026
8105406
CFN-6544: bump to the last bpm version
mike-jc Mar 4, 2026
14394dc
CFN-6544: fix Docker CPI image in pipeline
mike-jc Mar 5, 2026
c07aa62
CFN-6544: fixes
mike-jc Mar 9, 2026
6094de1
CFN-6544: rollback cgroup check change
mike-jc Mar 9, 2026
024e286
CFN-6544: new ops file (start with systemd)
mike-jc Mar 9, 2026
6ce8e76
CFN-6544: rollback new ops file (start with systemd) and add verbosity
mike-jc Mar 9, 2026
e78b590
CFN-6544: debug cgroups
mike-jc Mar 9, 2026
c05baf1
CFN-6544: rollback cgroups
mike-jc Mar 9, 2026
34dca32
CFN-6544: debugging
mike-jc Mar 10, 2026
afa66fe
CFN-6544: debugging one test
mike-jc Mar 10, 2026
bef1960
CFN-6544: debugging one test, fixes
mike-jc Mar 10, 2026
e4898b7
CFN-6544: rollback task log dumping
mike-jc Mar 10, 2026
30e7a0c
CFN-6544: outbound fixes
mike-jc Mar 10, 2026
6a20cd3
CFN-6544: outbound fixes
mike-jc Mar 10, 2026
a3a8866
CFN-6544: increase canary watch timeout
mike-jc Mar 10, 2026
65c6e0c
CFN-6544: increase canary watch timeout
mike-jc Mar 10, 2026
369fc83
CFN-6544: increase canary watch timeout for Bosh deployment
mike-jc Mar 10, 2026
267a285
CFN-6544: increase canary watch timeout for Bosh deployment
mike-jc Mar 10, 2026
bf45ecd
CFN-6544: rollback dns ops file
mike-jc Mar 10, 2026
c22ca23
CFN-6544: increase director db connection timeout
mike-jc Mar 10, 2026
30d5013
CFN-6544: extra param
mike-jc Mar 11, 2026
f1d2cd0
CFN-6544: cgroupns mode
mike-jc Mar 11, 2026
803e842
CFN-6544: privileged
mike-jc Mar 11, 2026
f4553ce
CFN-6544: rollback ops files
mike-jc Mar 11, 2026
8c85a98
CFN-6544: cgroupns mode for all VMs
mike-jc Mar 11, 2026
3fcf4bc
CFN-6544: cgroupfs driver
mike-jc Mar 11, 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ config/settings.yml
releases/*.tgz
releases/**/*.tgz
ci/scripts/stemcell/*.tgz
ci/scripts/stemcell-bionic/*.tgz
ci/scripts/stemcell-jammy/*.tgz
dev_releases
blobs/*
.blobs
Expand Down
12 changes: 7 additions & 5 deletions acceptance-tests/healthcheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ var _ = Describe("HTTP Health Check", func() {
haproxyBackendServers: []string{"127.0.0.1"},
deploymentName: backendDeploymentName,
}, []string{}, map[string]interface{}{}, true)
defer deleteDeployment(backendDeploymentName)
// defer deleteDeployment(backendDeploymentName)

closeLocalServer, backendLocalPort := startDefaultTestServer()
defer closeLocalServer()
_, backendLocalPort := startDefaultTestServer()
//closeLocalServer, backendLocalPort := startDefaultTestServer()
// defer closeLocalServer()

closeTunnel := setupTunnelFromHaproxyToTestServer(backendHaproxyInfo, haproxyBackendPort, backendLocalPort)
defer closeTunnel()
setupTunnelFromHaproxyToTestServer(backendHaproxyInfo, haproxyBackendPort, backendLocalPort)
//closeTunnel := setupTunnelFromHaproxyToTestServer(backendHaproxyInfo, haproxyBackendPort, backendLocalPort)
// defer closeTunnel()

// Now deploy test HAProxy with 'haproxy-backend' configured as backend
haproxyInfo, _ := deployHAProxy(baseManifestVars{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ import (
. "github.com/onsi/ginkgo/v2"
)

var _ = Describe("Bionic", func() {
It("Correctly proxies HTTP requests when using the Bionic stemcell", func() {
var _ = Describe("Jammy", func() {
It("Correctly proxies HTTP requests when using the Jammy stemcell", func() {

opsfileBionic := `---
# Configure Bionic stemcell
opsfileJammy := `---
# Configure Jammy stemcell
- type: replace
path: /stemcells/alias=default/os
value: ubuntu-bionic
value: ubuntu-jammy
`

haproxyBackendPort := 12000
haproxyInfo, _ := deployHAProxy(baseManifestVars{
haproxyBackendPort: haproxyBackendPort,
haproxyBackendServers: []string{"127.0.0.1"},
deploymentName: deploymentNameForTestNode(),
}, []string{opsfileBionic}, map[string]interface{}{}, true)
}, []string{opsfileJammy}, map[string]interface{}{}, true)

closeLocalServer, localPort := startDefaultTestServer()
defer closeLocalServer()
Expand Down
25 changes: 16 additions & 9 deletions acceptance-tests/run-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@
set -eu
REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)"
source "${REPO_DIR}/ci/scripts/functions-ci.sh"
FOCUS=""
PARALLELISM=""
KEEP_RUNNING=""

usage() {
echo -e "Usage: $0 [-F <ginkgo focus target>] [-k]
echo -e "Usage: $0 [-F <ginkgo focus target>] [-P <ginkgo nodes>] [-k]

-F Focus on a particular test. Expects a Ginkgo test name. Keep bosh running afterwards.
-P Set Ginkgo parallel node count. Default is '-p' (smart parallelism).
-k Keep bosh container running. Useful for debug." 1>&2; exit 1;
}

while getopts ":F:k" o; do
while getopts ":F:P:k" o; do
case "${o}" in
F)
FOCUS=${OPTARG}
KEEP_RUNNING=true
;;
P)
PARALLELISM=${OPTARG}
;;
k)
KEEP_RUNNING=true
;;
Expand All @@ -35,7 +41,7 @@ docker_mac_check_cgroupsv1() {
SETTINGS=~/Library/Group\ Containers/group.com.docker/settings.json

cgroupsV1Enabled=$(jq '.deprecatedCgroupv1' "$SETTINGS")
if [ "$cgroupsV1Enabled" != "true" ]; then
if [ "$cgroupsV1Enabled" != "true" ]; then
echo "deprecatedCgroupv1 should be enabled in $SETTINGS. Otherwise the acceptance tests will not run on Docker for Mac."
echo "Check in the README.md for a convenient script to set deprecatedCgroupv1 and restart Docker."
exit 1
Expand All @@ -45,8 +51,8 @@ docker_mac_check_cgroupsv1() {
check_required_files() {
PIDS=""
REQUIRED_FILE_PATTERNS=(
ci/scripts/stemcell/bosh-stemcell-*-ubuntu-jammy-*.tgz!https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-jammy-go_agent
ci/scripts/stemcell-bionic/bosh-stemcell-*-ubuntu-bionic-*.tgz!https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-bionic-go_agent
ci/scripts/stemcell/bosh-stemcell-*-ubuntu-noble.tgz!https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-noble
ci/scripts/stemcell-jammy/bosh-stemcell-*-ubuntu-jammy-*.tgz!https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-jammy-go_agent
)

for entry in "${REQUIRED_FILE_PATTERNS[@]}"; do
Expand All @@ -63,9 +69,10 @@ check_required_files() {
fi

(
echo "$filepattern not found, downloading latest."
echo "$filepattern not found, downloading."
cd "$folder" && \
resolved=$(curl -s --write-out '\n%{redirect_url}' "$url" | tail -n1) && \
resolved=$(curl -s --write-out '\n%{redirect_url}' "$url" | tail -n1 | tr -d '\n') && \
echo "Resolved URL: $resolved" && \
curl -s --remote-name --remote-header-name --location "$resolved" && \
echo "Downloaded '$url' successfully." && \
ls -1lh "$folder/"$filepattern
Expand Down Expand Up @@ -93,9 +100,9 @@ if [ -n "$KEEP_RUNNING" ] ; then
echo
echo "*** KEEP_RUNNING enabled. Please clean up docker scratch after removing containers: ${DOCKER_SCRATCH}"
echo
docker run --privileged -v "$REPO_DIR":/repo -v "${DOCKER_SCRATCH}":/scratch/docker -e REPO_ROOT=/repo -e FOCUS="$FOCUS" -e KEEP_RUNNING="${KEEP_RUNNING}" haproxy-boshrelease-testflight bash -c "cd /repo/ci/scripts && ./acceptance-tests ; sleep infinity"
docker run --privileged -v "$REPO_DIR":/repo -v "${DOCKER_SCRATCH}":/scratch/docker -e REPO_ROOT=/repo -e FOCUS="${FOCUS}" -e PARALLELISM="${PARALLELISM}" -e KEEP_RUNNING="${KEEP_RUNNING}" haproxy-boshrelease-testflight bash -c "cd /repo/ci/scripts && ./acceptance-tests ; sleep infinity"
else
docker run --rm --privileged -v "$REPO_DIR":/repo -v "${DOCKER_SCRATCH}":/scratch/docker -e REPO_ROOT=/repo -e KEEP_RUNNING="" haproxy-boshrelease-testflight bash -c "cd /repo/ci/scripts && ./acceptance-tests"
docker run --rm --privileged -v "$REPO_DIR":/repo -v "${DOCKER_SCRATCH}":/scratch/docker -e REPO_ROOT=/repo -e KEEP_RUNNING="" -e PARALLELISM="${PARALLELISM}" haproxy-boshrelease-testflight bash -c "cd /repo/ci/scripts && ./acceptance-tests"
echo "Cleaning up docker scratch: ${DOCKER_SCRATCH}"
sudo rm -rf "${DOCKER_SCRATCH}"
fi
18 changes: 14 additions & 4 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
FROM bosh/docker-cpi:main
FROM ghcr.io/cloudfoundry/bosh/docker-cpi:latest

# Install all necessary tools for haproxy testflight and dependency autobump
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y wget jq git vim nano python3-pip && \
apt-get install -y wget jq git vim nano python3-pip python3-venv && \
apt-get clean

# Set bosh env at login
RUN echo "source /tmp/local-bosh/director/docker-env" >> /root/.bashrc
RUN echo "source /tmp/local-bosh/director/env" >> /root/.bashrc

# Copy ops files
RUN mkdir -p /usr/local/bosh-deployment/haproxy-boshrelease
COPY ops/bosh-cgroup.yml /usr/local/bosh-deployment/haproxy-boshrelease/bosh-cgroup.yml
COPY ops/bosh-scaled-out.yml /usr/local/bosh-deployment/haproxy-boshrelease/bosh-scaled-out.yml
COPY ops/cloud-config-cgroup.yml /usr/local/bosh-deployment/haproxy-boshrelease/cloud-config-cgroup.yml
COPY ops/compilation.yml /usr/local/bosh-deployment/haproxy-boshrelease/compilation.yml

# Install Python libraries needed for scripts
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:${PATH}"
COPY scripts/requirements.txt /requirements.txt
RUN /usr/bin/python3 -m pip install -r /requirements.txt
RUN pip install -r /requirements.txt

# Install go dependencies
ENV GOBIN=/usr/local/bin
RUN go install github.com/geofffranks/spruce/cmd/spruce@latest
RUN go install github.com/geofffranks/spruce/cmd/spruce@latest
6 changes: 6 additions & 0 deletions ci/ops/bosh-cgroup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- type: replace
path: /instance_groups/name=bosh/properties/docker_cpi/container?/cgroupns_mode?
value: host
- type: replace
path: /instance_groups/name=bosh/properties/docker_cpi/container?/privileged?
value: true
3 changes: 3 additions & 0 deletions ci/ops/bosh-scaled-out.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- type: replace
path: /instance_groups/name=bosh/properties/director/workers?
value: 12
7 changes: 7 additions & 0 deletions ci/ops/cloud-config-cgroup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- type: replace
path: /vm_types/name=default/cloud_properties/privileged?
value: true
- type: replace
path: /vm_types/name=default/cloud_properties/cgroupns_mode?
value: host

File renamed without changes.
16 changes: 8 additions & 8 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
- in_parallel:
- { get: git, trigger: true, passed: [unit-tests] }
- { get: stemcell }
- { get: stemcell-bionic }
- { get: stemcell-jammy }
- get: haproxy-boshrelease-testflight
- task: acceptance-tests
privileged: true
Expand All @@ -131,7 +131,7 @@ jobs:
inputs:
- { name: git }
- { name: stemcell }
- { name: stemcell-bionic }
- { name: stemcell-jammy }
run:
path: ./git/ci/scripts/acceptance-tests
args: []
Expand All @@ -152,7 +152,7 @@ jobs:
- do:
- { get: git-pull-requests, trigger: true, version: every }
- { get: stemcell }
- { get: stemcell-bionic }
- { get: stemcell-jammy }
- get: haproxy-boshrelease-testflight
- put: git-pull-requests
params:
Expand All @@ -169,7 +169,7 @@ jobs:
inputs:
- { name: git-pull-requests }
- { name: stemcell }
- { name: stemcell-bionic }
- { name: stemcell-jammy }
run:
path: ./git-pull-requests/ci/scripts/acceptance-tests
args: []
Expand Down Expand Up @@ -403,15 +403,15 @@ resources:
- "dependabot"
- "CFN-CI"

- name: stemcell-bionic
- name: stemcell-jammy
type: bosh-io-stemcell
source:
name: bosh-warden-boshlite-ubuntu-bionic-go_agent
name: bosh-warden-boshlite-ubuntu-jammy-go_agent

- name: stemcell
type: bosh-io-stemcell
source:
name: bosh-warden-boshlite-ubuntu-jammy-go_agent
name: bosh-warden-boshlite-ubuntu-noble

- name: version
type: semver
Expand Down Expand Up @@ -453,7 +453,7 @@ resources:
- name: docker-cpi-image
type: docker-image
source:
repository: bosh/docker-cpi
repository: ghcr.io/cloudfoundry/bosh/docker-cpi

- name: git-ci
type: git
Expand Down
38 changes: 34 additions & 4 deletions ci/scripts/acceptance-tests
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -e
source "${REPO_ROOT}/ci/scripts/functions-ci.sh"
START_DIR="${PWD}" # Differs for CI and manual execution


FOCUS="Correctly starts if there is a healthy backend"

if [ -n "$FOCUS" ]; then
echo "------------------------------------------------------------------"
echo "FOCUS is set. Will only run tests matching '$FOCUS'"
Expand Down Expand Up @@ -35,11 +38,38 @@ echo "----- Running tests"
export PATH=$PATH:$GOPATH/bin
ginkgo version

PARALLELISM="-p"
if [ -n "$FOCUS" ]; then
echo "------------------------------------------------------------------"
if [ -n "${FOCUS:-}" ]; then
PARALLELISM="--nodes=1"
echo "FOCUS is set, thus PARALLELISM is set to '$PARALLELISM'"
elif [ -n "${PARALLELISM:-}" ]; then
PARALLELISM="--nodes=$PARALLELISM"
echo "PARALLELISM is set. Will run ginkgo with '$PARALLELISM'"
else
PARALLELISM="-p"
echo "PARALLELISM is not set. Using default '$PARALLELISM'"
fi
echo "------------------------------------------------------------------"

echo "------------------------------------------------------------------"
if [ "${VERBOSITY:-}" = "vv" ]; then
VERBOSITY_FLAG="-vv"
echo "VERBOSITY is set to 'vv'. Will run ginkgo with '$VERBOSITY_FLAG'"
else
VERBOSITY_FLAG="-v"
echo "VERBOSITY is not set or unrecognised. Using default '$VERBOSITY_FLAG'"
fi
echo "------------------------------------------------------------------"

echo "------------------------------------------------------------------"
if [ -n "${FLAKE_ATTEMPTS:-}" ]; then
echo "FLAKE_ATTEMPTS is set. Will run ginkgo with '--flake-attempts=$FLAKE_ATTEMPTS'"
else
FLAKE_ATTEMPTS=5
echo "FLAKE_ATTEMPTS is not set. Using default '$FLAKE_ATTEMPTS'"
fi
echo "------------------------------------------------------------------"

ginkgo -v "$PARALLELISM" -r --trace --show-node-events --randomize-all --flake-attempts 5 "${ADDITIONAL_ARGS[@]}"
ginkgo "$VERBOSITY_FLAG" "$PARALLELISM" -r --trace --show-node-events --randomize-all --flake-attempts "$FLAKE_ATTEMPTS" "${ADDITIONAL_ARGS[@]}"

keep_running_info
keep_running_info
14 changes: 7 additions & 7 deletions ci/scripts/functions-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@ function bosh_release() {
}

function bosh_assets() {
stemcell_jammy_path="$START_DIR/stemcell/*.tgz"
stemcell_bionic_path="$START_DIR/stemcell-bionic/*.tgz"
stemcell_noble_path="$START_DIR/stemcell/*.tgz"
stemcell_jammy_path="$START_DIR/stemcell-jammy/*.tgz"

echo "----- Uploading Noble stemcell"
bosh -n upload-stemcell $stemcell_noble_path

echo "----- Uploading Jammy stemcell"
bosh -n upload-stemcell $stemcell_jammy_path

echo "----- Uploading Bionic stemcell"
bosh -n upload-stemcell $stemcell_bionic_path

echo "----- Uploading os-conf (used for tests only)"
bosh -n upload-release --sha1 386293038ae3d00813eaa475b4acf63f8da226ef \
https://bosh.io/d/github.com/cloudfoundry/os-conf-release?v=22.1.2
bosh -n upload-release --sha1 sha256:efcf30754ce4c5f308aedab3329d8d679f5967b2a4c3c453204c7cb10c7c5ed9 \
https://bosh.io/d/github.com/cloudfoundry/os-conf-release?v=23.0.0

export BOSH_PATH=$(command -v bosh)
export BASE_MANIFEST_PATH="$PWD/manifests/haproxy.yml"
Expand Down
Loading