Skip to content

Commit 67cdec0

Browse files
ci: install PyYAML from PyPI instead of apt (#1539)
A stalled Ubuntu mirror failed test-ingress-modes three times in a row: make is already in the image, and apt only ran for python3-yaml. Both jobs now use a pinned cimg/python image and a hash-pinned PyYAML.
1 parent fd6dfec commit 67cdec0

2 files changed

Lines changed: 19 additions & 23 deletions

File tree

‎.circleci/custom.yml‎

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,30 +48,25 @@ jobs:
4848
# Separate containers/checkouts: fixed-name render files and local tool
4949
# downloads are never shared between shards. Each shard runs serially.
5050
parallelism: 4
51-
# cimg/base: CircleCI's convenience image (no custom entrypoint, passwordless
52-
# sudo). We install a recent Helm here rather than reuse the lint-chart ct
53-
# image — ct v3.0.0-rc.1 bundles Helm ~3.3, which predates OCI dependency
51+
# cimg/python: CircleCI's convenience image (cimg/base with Python and pip,
52+
# no custom entrypoint, passwordless sudo). We install a recent Helm here
53+
# rather than reuse the lint-chart ct image — ct v3.0.0-rc.1 bundles Helm ~3.3, which predates OCI dependency
5454
# support (GA in Helm 3.8), so `helm dependency build` of the oci:// sub-charts
5555
# fails with "no repository definition for oci://…".
5656
docker:
57-
- image: cimg/base:current
57+
- image: cimg/python:3.14.10@sha256:308765615c69cf91df2ab259dcb91ccc198603cd7cf1b9de0b8a48fd1a3ecc1c
5858
steps:
5959
- checkout
6060
- run:
61-
name: install helm + kyverno + make + PyYAML
61+
name: install helm + kyverno + PyYAML
6262
command: |
63-
# python3 is in cimg/base, PyYAML is not: tests/verify-kagent-crds.py
64-
# and tests/verify-kyverno.py parse rendered objects (and the kagent
65-
# line's CRDs) with it. Every network call here is bounded and retried:
66-
# a stalled apt mirror or get.helm.sh download used to sit silently until
67-
# CircleCI's 10-minute no-output timeout killed the job (twice on one PR,
68-
# 2026-09-11) — `set -x` shows which command a future stall is in.
63+
# PyYAML comes from PyPI, hash-pinned (tests/requirements.txt):
64+
# tests/verify-kagent-crds.py and tests/verify-kyverno.py parse rendered
65+
# objects (and the kagent line's CRDs) with it. make is in the image, so
66+
# there is no apt call. Every network call here is bounded and retried,
67+
# and `set -x` shows which command a stall is in.
6968
set -x
70-
for attempt in 1 2 3; do
71-
(command -v make >/dev/null 2>&1 && python3 -c 'import yaml' 2>/dev/null) && break
72-
(sudo timeout 180 apt-get update -qq && sudo timeout 180 apt-get install -y -qq make python3-yaml) && break
73-
echo "apt attempt $attempt failed or stalled; retrying" >&2; sleep 15
74-
done
69+
timeout 300 python3 -m pip install --no-cache-dir --disable-pip-version-check --retries 5 --timeout 30 --require-hashes -r tests/requirements.txt
7570
command -v make && python3 -c 'import yaml'
7671
# Pinned (not `main`) so a mid-queue Helm minor can't change behaviour;
7772
# 3.17.x is well past OCI dependency GA (3.8). Avoids the curl|bash pattern.
@@ -120,18 +115,14 @@ jobs:
120115
# range and the BOM resolve to, the pullability proof) and PyYAML (the roster
121116
# and the BOM are read from values.yaml and examples/customer-bom.yaml).
122117
docker:
123-
- image: cimg/base:current
118+
- image: cimg/python:3.14.10@sha256:308765615c69cf91df2ab259dcb91ccc198603cd7cf1b9de0b8a48fd1a3ecc1c
124119
steps:
125120
- checkout
126121
- run:
127-
name: install helm + make + PyYAML
122+
name: install helm + PyYAML
128123
command: |
129124
set -x
130-
for attempt in 1 2 3; do
131-
(command -v make >/dev/null 2>&1 && python3 -c 'import yaml' 2>/dev/null) && break
132-
(sudo timeout 180 apt-get update -qq && sudo timeout 180 apt-get install -y -qq make python3-yaml) && break
133-
echo "apt attempt $attempt failed or stalled; retrying" >&2; sleep 15
134-
done
125+
timeout 300 python3 -m pip install --no-cache-dir --disable-pip-version-check --retries 5 --timeout 30 --require-hashes -r tests/requirements.txt
135126
command -v make && python3 -c 'import yaml'
136127
curl -fsSL --connect-timeout 20 --max-time 180 --retry 5 --retry-delay 10 --retry-all-errors https://get.helm.sh/helm-v3.17.3-linux-amd64.tar.gz | tar xz -C /tmp
137128
sudo mv /tmp/linux-amd64/helm /usr/local/bin/helm

‎tests/requirements.txt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Python packages the verify-* targets import, installed by the CircleCI jobs
2+
# with --require-hashes.
3+
pyyaml==6.0.3 \
4+
--hash=sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5 \
5+
--hash=sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f

0 commit comments

Comments
 (0)