-
Notifications
You must be signed in to change notification settings - Fork 2
feat(acs-ci): use gcloud storage for Prow results #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -70,6 +70,17 @@ RUN curl -fsSL "https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_$ | |||||||||||||||||
| && install -m 0755 /tmp/gh-extract/gh /usr/bin/gh \ | ||||||||||||||||||
| && rm -rf /tmp/gh-extract /tmp/gh.tgz | ||||||||||||||||||
|
|
||||||||||||||||||
| # Google Cloud CLI for read-only Prow result access. Use the standalone | ||||||||||||||||||
| # archive so the version and checksum are explicit; credentials remain | ||||||||||||||||||
| # provider-owned and are resolved through OpenShell's GCP metadata emulator. | ||||||||||||||||||
| ARG GCLOUD_VERSION=585.0.0 | ||||||||||||||||||
| ARG GCLOUD_SHA256_AMD64=82be040c2d899ddb7560c1532e809a685e2c605b97b8c24570a68638d634dcbf | ||||||||||||||||||
| RUN curl -fsSL "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz" -o /tmp/google-cloud-cli.tgz \ | ||||||||||||||||||
| && echo "${GCLOUD_SHA256_AMD64} /tmp/google-cloud-cli.tgz" | sha256sum -c - \ | ||||||||||||||||||
|
Comment on lines
+76
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🌐 Web query:
💡 Result: <search_synthesis> <source_evidence> Citations:
🏁 Script executed: #!/bin/bash
set -u
printf '%s\n' '--- Dockerfile context ---'
sed -n '74,84p' images/stackrox/sandbox-stackrox-ci/Dockerfile
printf '%s\n' '--- archive candidates ---'
for name in \
google-cloud-cli-585.0.0-linux-x86_64.tar.gz \
google-cloud-sdk-585.0.0-linux-x86_64.tar.gz; do
url="https://storage.googleapis.com/cloud-sdk-release/${name}"
printf '%s ' "$url"
curl -L -sS -o /dev/null -w 'http=%{http_code} size=%{size_download} type=%{content_type}\n' "$url" || true
done
printf '%s\n' '--- official bucket listing entries for 585.0.0 ---'
curl -L -sS 'https://storage.googleapis.com/storage/v1/b/cloud-sdk-release/o?prefix=google-cloud-&maxResults=1000' |
python3 -c 'import json,sys; d=json.load(sys.stdin); print("\n".join(x["name"] for x in d.get("items",[]) if "585.0.0" in x["name"]))' || trueRepository: stackrox/harness-openshell Length of output: 1311 🌐 Web query:
💡 Result: <search_synthesis> <source_evidence> Citations:
🏁 Script executed: #!/bin/bash
set -u
expected=82be040c2d899ddb7560c1532e809a685e2c605b97b8c24570a68638d634dcbf
for name in \
google-cloud-cli-585.0.0-linux-x86_64.tar.gz \
google-cloud-sdk-585.0.0-linux-x86_64.tar.gz; do
url="https://storage.googleapis.com/cloud-sdk-release/${name}"
tmp=$(mktemp)
trap 'rm -f "$tmp"' EXIT
curl -L -sS "$url" -o "$tmp"
hash=$(sha256sum "$tmp" | awk '{print $1}')
printf '%s sha256=%s expected_match=%s\n' "$name" "$hash" "$([ "$hash" = "$expected" ] && echo yes || echo no)"
printf '%s metadata:\n' "$name"
tar -tzf "$tmp" 2>/dev/null | grep -E '(^|/)(VERSION|version|properties$|lib/googlecloudsdk/core/config.py)$' | head -20 || true
rm -f "$tmp"
trap - EXIT
doneRepository: stackrox/harness-openshell Length of output: 908 🏁 Script executed: #!/bin/bash
set -u
expected=82be040c2d899ddb7560c1532e809a685e2c605b97b8c24570a68638d634dcbf
for name in \
google-cloud-cli-585.0.0-linux-x86_64.tar.gz \
google-cloud-sdk-585.0.0-linux-x86_64.tar.gz; do
url="https://storage.googleapis.com/cloud-sdk-release/${name}"
tmp=$(mktemp)
curl -L -sS "$url" -o "$tmp"
hash=$(sha256sum "$tmp" | awk '{print $1}')
version=$(tar -xOzf "$tmp" google-cloud-sdk/VERSION 2>/dev/null || true)
printf '%s version=%s sha256=%s expected_match=%s\n' "$name" "$version" "$hash" "$([ "$hash" = "$expected" ] && echo yes || echo no)"
rm -f "$tmp"
done
rapid=$(mktemp)
curl -L -sS 'https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz' -o "$rapid"
rapid_hash=$(sha256sum "$rapid" | awk '{print $1}')
rapid_version=$(tar -xOzf "$rapid" google-cloud-sdk/VERSION 2>/dev/null || true)
printf 'rapid version=%s sha256=%s expected_match=%s\n' "$rapid_version" "$rapid_hash" "$([ "$rapid_hash" = "$expected" ] && echo yes || echo no)"
rm -f "$rapid"Repository: stackrox/harness-openshell Length of output: 579 Pin the archive and checksum together. The rapid URL currently serves Use the official versioned archive and its matching checksum. Proposed fix-ARG GCLOUD_SHA256_AMD64=82be040c2d899ddb7560c1532e809a685e2c605b97b8c24570a68638d634dcbf
+ARG GCLOUD_SHA256_AMD64=7b97198ef306f5400b67f057f7415a46bd9a34367eeabd87516ee3f74bc76a36
-RUN curl -fsSL "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz" -o /tmp/google-cloud-cli.tgz \
+RUN curl -fsSL "https://storage.googleapis.com/cloud-sdk-release/google-cloud-cli-${GCLOUD_VERSION}-linux-x86_64.tar.gz" -o /tmp/google-cloud-cli.tgz \📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| && tar -xzf /tmp/google-cloud-cli.tgz --no-same-owner --no-same-permissions -C /opt \ | ||||||||||||||||||
| && test -x /opt/google-cloud-sdk/bin/gcloud \ | ||||||||||||||||||
| && rm -f /tmp/google-cloud-cli.tgz | ||||||||||||||||||
|
|
||||||||||||||||||
| # Use the same uv-managed Python contract as the community base image. The | ||||||||||||||||||
| # rox-ci-image system Python is 3.9, while current MCP integrations require | ||||||||||||||||||
| # 3.10+. | ||||||||||||||||||
|
|
@@ -81,10 +92,9 @@ ENV UV_PYTHON_INSTALL_DIR=/sandbox/.uv/python | |||||||||||||||||
| RUN uv python install "${PYTHON_VERSION}" \ | ||||||||||||||||||
| && uv cache clean | ||||||||||||||||||
|
|
||||||||||||||||||
| # gsutil currently supports Python through 3.13, while the shared image uses | ||||||||||||||||||
| # Python 3.14 for its other integrations. Keep the Prow client isolated in a | ||||||||||||||||||
| # compatible, root-owned environment so ACS CI triage can read test results | ||||||||||||||||||
| # without adding gcloud or service-account files to the image. | ||||||||||||||||||
| # Keep the legacy standalone gsutil client available during migration. It is | ||||||||||||||||||
| # isolated in a root-owned environment so older workflows can still read | ||||||||||||||||||
| # results while ACS CI moves to gcloud storage. | ||||||||||||||||||
| ARG GSUTIL_PYTHON_VERSION=3.13.7 | ||||||||||||||||||
| ARG GSUTIL_VERSION=5.35 | ||||||||||||||||||
| RUN install -d -o root -g root /opt/gsutil-python /opt/gsutil \ | ||||||||||||||||||
|
|
@@ -160,7 +170,7 @@ RUN curl -fsSL "https://github.com/googleworkspace/cli/releases/download/v${GWS_ | |||||||||||||||||
| && rm -rf /tmp/gws-extract \ | ||||||||||||||||||
| && rm -f /tmp/gws.tgz | ||||||||||||||||||
|
|
||||||||||||||||||
| ENV PATH="/sandbox/.venv/bin:/opt/gsutil/bin:/usr/local/go/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" \ | ||||||||||||||||||
| ENV PATH="/opt/google-cloud-sdk/bin:/sandbox/.venv/bin:/opt/gsutil/bin:/usr/local/go/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" \ | ||||||||||||||||||
| VIRTUAL_ENV=/sandbox/.venv \ | ||||||||||||||||||
| GOPATH=/sandbox/.cache/go \ | ||||||||||||||||||
| GOCACHE=/sandbox/.cache/go-build \ | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The download URL for the Google Cloud CLI is not version-pinned. This could lead to a checksum mismatch if the file at the ".../rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz" URL is updated. To ensure the build is reproducible, please use a version-specific URL, for example: https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-${GCLOUD_VERSION}-linux-x86_64.tar.gz.