Skip to content

Commit dc9e30a

Browse files
committed
chore: temporary compose bisect for issue 5
1 parent 9c383fa commit dc9e30a

2 files changed

Lines changed: 49 additions & 28 deletions

File tree

‎.github/workflows/scratch-issue5.yml‎

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,28 @@ permissions:
88
contents: read
99

1010
jobs:
11-
minimal:
11+
bisect:
1212
runs-on: ubuntu-latest
1313
timeout-minutes: 20
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
include:
18+
- {version: "", mode: plain}
19+
- {version: "", mode: nobake}
20+
- {version: "", mode: buildfirst}
21+
- {version: v2.36.2, mode: plain}
22+
- {version: v2.37.0, mode: plain}
23+
- {version: v2.37.1, mode: plain}
24+
- {version: v2.37.3, mode: plain}
25+
- {version: v2.38.2, mode: plain}
26+
- {version: v2.39.0, mode: plain}
27+
- {version: v2.39.4, mode: plain}
28+
- {version: v2.40.3, mode: plain}
29+
- {version: v5.0.0, mode: plain}
1430
steps:
1531
- uses: actions/checkout@v7
16-
- run: scratch/minimal.sh
17-
18-
hosted:
19-
runs-on: ubuntu-latest
20-
timeout-minutes: 45
21-
steps:
22-
- uses: actions/checkout@v7
23-
- name: Install Ansible
24-
run: |
25-
set -euo pipefail
26-
python3 -m venv "${RUNNER_TEMP}/venv"
27-
"${RUNNER_TEMP}/venv/bin/pip" install --quiet --prefer-binary ansible-core
28-
"${RUNNER_TEMP}/venv/bin/ansible-galaxy" collection install -r ansible/requirements.yml -p "${RUNNER_TEMP}/collections"
29-
echo "${RUNNER_TEMP}/venv/bin" >> "$GITHUB_PATH"
30-
docker compose version
31-
- name: Hosted scenario with the preinstalled Compose
32-
env:
33-
ANSIBLE_COLLECTIONS_PATH: ${{ runner.temp }}/collections
34-
GRTEST_WORK: ${{ runner.temp }}/grtest-mesh
35-
GRTEST_DIAG: "1"
36-
GRTEST_DIAG_OUT: ${{ runner.temp }}/diag
37-
run: mkdir -p "$GRTEST_DIAG_OUT" && tests/mesh/run.sh hosted
38-
- if: always()
39-
uses: actions/upload-artifact@v4
40-
with:
41-
name: diag
42-
path: ${{ runner.temp }}/diag
32+
- env:
33+
COMPOSE_VERSION: ${{ matrix.version }}
34+
MODE: ${{ matrix.mode }}
35+
run: scratch/bisect.sh

‎scratch/bisect.sh‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
# Temporary: does `up` twice (and a third time) recreate a built service, for the Compose version in $COMPOSE_VERSION (empty: the runner's own), with $MODE.
3+
set -uo pipefail
4+
repo="$(cd "$(dirname "$0")/.." && pwd)"
5+
if [ -n "${COMPOSE_VERSION:-}" ]; then
6+
mkdir -p "$HOME/.docker/cli-plugins"
7+
curl -fsSL -o "$HOME/.docker/cli-plugins/docker-compose" "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-linux-x86_64"
8+
chmod +x "$HOME/.docker/cli-plugins/docker-compose"
9+
fi
10+
docker compose version; docker buildx version
11+
w="$(mktemp -d)"; mkdir -p "$w/k3s" "$w/kubeconfig"
12+
cp "$repo/roles/github_runner_cluster/files/docker-compose.yml" "$w/"
13+
cp "$repo/roles/github_runner_cluster/files/k3s/Dockerfile" "$repo/roles/github_runner_cluster/files/k3s/node-entrypoint.sh" "$w/k3s/"
14+
printf 'K3S_TOKEN=dummy\nK3S_VERSION=latest\nK3S_TLS_SAN_LIST=n1\nK3S_NODE_NAME=n1\n' > "$w/.env"
15+
cd "$w"
16+
dc() { docker compose -p grtest --profile server "$@"; }
17+
st() { docker inspect github-runner-k3s --format '{{.State.StartedAt}} imglabel={{index .Config.Labels "com.docker.compose.image"}}'; }
18+
case "${MODE:-plain}" in
19+
nobake) export COMPOSE_BAKE=false ;;
20+
buildfirst) dc build -q >/dev/null 2>&1 ;;
21+
esac
22+
dc up -d --quiet-pull >/dev/null 2>&1; a=$(st)
23+
dc up -d >/dev/null 2>&1; b=$(st)
24+
dc up -d >/dev/null 2>&1; c=$(st)
25+
echo "RESULT compose=$(docker compose version --short) mode=${MODE:-plain}"
26+
echo " first: $a"; echo " second: $b"; echo " third: $c"
27+
if [ "${a%% *}" = "${b%% *}" ]; then echo " VERDICT second up kept the container"; else echo " VERDICT second up RECREATED"; fi
28+
if [ "${b%% *}" = "${c%% *}" ]; then echo " VERDICT third up kept the container"; else echo " VERDICT third up RECREATED"; fi

0 commit comments

Comments
 (0)