Skip to content

Switch Squid image to Alpine to remove Berkeley DB/Sleepycat components#6507

Merged
lpcox merged 3 commits into
mainfrom
copilot/remove-berkeley-db-from-squid-image
Jul 22, 2026
Merged

Switch Squid image to Alpine to remove Berkeley DB/Sleepycat components#6507
lpcox merged 3 commits into
mainfrom
copilot/remove-berkeley-db-from-squid-image

Conversation

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

AWF’s published Squid image inherited Ubuntu’s Berkeley DB (libdb5.3t64 / libdb-5.3.so) transitively, which causes enterprise license-governance rejection despite not being a direct Squid runtime dependency. This PR moves the Squid image build to an Alpine-based runtime to eliminate that package lineage while preserving AWF’s Squid runtime contract.

  • Image base + package graph

    • Replaced ubuntu/squid:latest with alpine:3.24 in containers/squid/Dockerfile.
    • Removed Ubuntu-specific apt mirror/retry/install logic and installed Squid + required runtime utilities via apk.
  • Runtime compatibility retained

    • Preserved non-root execution model and explicit proxy ownership of /var/log/squid, /var/spool/squid, /var/run/squid, and /etc/squid.
    • Kept compatibility with existing compose preflight drop-privilege path by including bash + shadow.
    • Enforced proxy user/group UID/GID = 13 to maintain existing ownership expectations (including ARC/DinD log-dir behavior).
  • Documentation alignment

    • Updated docs/architecture.md to reflect the Squid container’s Alpine base.
FROM alpine:3.24

RUN apk add --no-cache \
      bash bind-tools curl net-tools netcat-openbsd openssl shadow squid && \
    groupmod -g 13 proxy || addgroup -S -g 13 proxy && \
    usermod -u 13 -g 13 proxy || adduser -S -D -H -u 13 -G proxy proxy

Copilot AI changed the title [WIP] Remove Sleepycat-licensed Berkeley DB from Squid image Switch Squid image to Alpine to remove Berkeley DB/Sleepycat components Jul 22, 2026
Copilot finished work on behalf of lpcox July 22, 2026 19:16
Copilot AI requested a review from lpcox July 22, 2026 19:16
@lpcox
lpcox marked this pull request as ready for review July 22, 2026 20:16
Copilot AI review requested due to automatic review settings July 22, 2026 20:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Switches the Squid runtime from Ubuntu to Alpine to eliminate Berkeley DB lineage while preserving AWF’s runtime contract.

Changes:

  • Installs Squid and runtime utilities using apk.
  • Attempts to preserve the proxy UID/GID 13 contract.
  • Updates architecture documentation.
Show a summary per file
File Description
containers/squid/Dockerfile Replaces Ubuntu Squid with Alpine packages.
docs/architecture.md Documents the Alpine-based Squid image.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment thread containers/squid/Dockerfile Outdated
Comment on lines +17 to +20
if getent group proxy >/dev/null 2>&1; then \
groupmod -g 13 proxy; \
else \
addgroup -S -g 13 proxy; \
@@ -1,66 +1,30 @@
FROM ubuntu/squid:latest
FROM alpine:3.24
@lpcox

lpcox commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

- Dockerfile: remove Alpine 'news' account (GID 13) before creating proxy
  at UID/GID 13 using shadow-utils userdel/groupdel + groupadd/useradd
- Add .github/workflows/test-squid-image.yml that builds the squid image
  for both linux/amd64 and linux/arm64 on every PR touching containers/squid/**
  and asserts: no Berkeley DB/Sleepycat packages, no libdb*.so* shared
  libraries, proxy user at UID 13, proxy group at GID 13, squid binary present

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Both review issues are addressed in commit fix(squid): fix UID/GID 13 conflict and add multi-arch image validation:

UID/GID 13 conflict (containers/squid/Dockerfile:17-20): Alpine's base image assigns GID 13 to the news group (UID 9 to the news user). The old conditional addgroup -S -g 13 proxy hit GID-in-use and aborted under set -e. The fix removes the news account via shadow-utils userdel/groupdel before creating proxy at UID/GID 13 with groupadd -r -g 13 proxy and useradd -r -u 13 -g proxy -M -s /sbin/nologin proxy.

Multi-arch image validation (containers/squid/Dockerfile:1): Added .github/workflows/test-squid-image.yml — triggered on every PR that touches containers/squid/**, it builds the image separately for linux/amd64 and linux/arm64 (using QEMU emulation for arm64) and asserts:

  • No Berkeley DB / Sleepycat packages are installed (apk info check)
  • No libdb*.so* shared libraries exist in the filesystem
  • proxy user is present at UID 13
  • proxy group is present at GID 13
  • squid binary is present and executable

@github-actions

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation build failed for this PR. View logs.

Built from commit eaf3c85

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Security Guard failed. Please review the logs for details.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

Contribution check complete: the PR includes a clear description with issue reference, updates architecture docs, adds a validation workflow for the Squid image change, and keeps the new workflow file in the expected CI location. No guideline issues found.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 98.99% 99.02% 📈 +0.03%
Statements 98.92% 98.95% 📈 +0.03%
Functions 99.40% 99.40% ➡️ +0.00%
Branches 95.34% 95.34% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) — PASS

  • ✅ MCP connectivity (GitHub API)
  • ✅ GitHub.com reachability (HTTP 200)
  • ✅ File I/O operations
  • ✅ Direct BYOK inference via api-proxy → api.githubcopilot.com

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) with credential injection via api-proxy sidecar.

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smoke Test Results — Auth mode: PAT (COPILOT_GITHUB_TOKEN)

Test Result
GitHub MCP connectivity ✅ (filtered response confirms auth)
GitHub.com HTTP ⚠️ Pre-step data not resolved (template vars unexpanded)
File write/read ⚠️ Pre-step data not resolved (template vars unexpanded)

Overall: PARTIAL — MCP auth confirmed; pre-computed step outputs were not injected into the prompt (template substitution issue in workflow).

cc @lpcox

🔑 PAT report filed by Smoke Copilot PAT
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test: Copilot Network Isolation Egress Enforcement

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com): HTTP 200
  • ✅ Blocked domain (example.com): 403 / connection blocked

Overall status: PASS

@lpcox — both egress checks passed.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Status
API ✅ PASS
GH ✅ PASS
File ✅ PASS

Overall result: ✅ PASS

Generated by Smoke Claude for #6507 · 54.4 AIC · ⊞ 6.4K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results

Test Status
GitHub MCP connectivity ✅ PASS (response received)
GitHub.com HTTP ⚠️ N/A (template vars unexpanded)
File write/read ⚠️ N/A (template vars unexpanded)

Overall: PARTIAL — MCP connectivity confirmed. Pre-computed test data unavailable due to unexpanded workflow template variables (${{ steps.smoke-data.outputs.* }}).

PR author: @lpcox

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Services Connectivity

  • Redis PING: ❌ (host.docker.internal DNS resolution failed)
  • PostgreSQL pg_isready: ❌ (no response)
  • PostgreSQL SELECT 1: ❌ (DNS resolution failed)

Overall: FAILhost.docker.internal is not resolvable in this environment.

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Gemini Smoke Test Results

Overall status: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox

  • GitHub MCP connectivity ✅
  • GitHub.com connectivity ✅
  • File write/read ✅
  • Direct BYOK inference ✅

Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra

Overall: PASS

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Smoke Test: API Proxy OpenTelemetry Tracing

Scenario Status Notes
1. Module Loading otel.js loads successfully; exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled and internal helpers
2. Test Suite 39 tests passed in otel.test.js + 20 tests passed in otel-fanout.test.js (59 total, 0 failures)
3. Env Var Forwarding src/services/agent-environment-credentials.ts forwards OTEL_* vars to containers; tests in agent-environment-credentials.test.ts cover OTEL_SERVICE_NAME, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, and related vars
4. Token Tracker Integration onUsage callback exists in token-tracker-http.js as the OTEL hook point; invoked after normalized usage extraction
5. OTEL Diagnostics otel.js supports graceful degradation: falls back to file exporter (/var/log/api-proxy/otel.jsonl) when no OTLP endpoint configured; fan-out mode available via GH_AW_OTLP_ENDPOINTS
6. Graceful Degradation Test confirms FileSpanExporter is used when no OTLP config present — no errors

Summary: All 6 scenarios pass. The OTEL integration is fully implemented with 59 passing tests covering span creation, token attributes (GenAI semantic conventions), parent context propagation, OTLP export via Squid proxy, fan-out multi-endpoint support, and graceful fallback to file export.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Chroot Version Smoke Test Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.13
Node.js v24.18.0 v24.18.0
Go go1.22.12 go1.22.12

All tests passed — chroot environment versions match the host.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Smoke test results:

  • Patch transitive fast-uri in docs-site lockfile to close host-confusion advisories
  • fix(deps): update fast-uri to 3.1.4 (GHSA-4c8g-83qw-93j6, GHSA-v2hh-gcrm-f6hx)
  • GitHub reads: ✅
  • Playwright title check: ✅
  • File write/readback: ✅
  • Build: ✅
  • Discussion query/comment: skipped (helper unavailable)
  • Overall: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx passed ✅ PASS
Node.js execa passed ✅ PASS
Node.js p-limit passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for #6507 · 47.2 AIC · ⊞ 8.2K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox

  • GitHub MCP Testing: ✅
  • GitHub.com Connectivity: ✅
  • File I/O: ✅
  • BYOK Inference: ✅

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)

PASS

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test: Docker Sbx Validation

Test Result
GitHub MCP connectivity
GitHub.com HTTP connectivity
File write/read (smoke-test-docker-sbx-29956127831.txt)

Overall: PASS

📰 BREAKING: Report filed by Smoke Docker Sbx
Add label ready-for-aw to run again

@lpcox
lpcox merged commit 038ab8c into main Jul 22, 2026
141 of 144 checks passed
@lpcox
lpcox deleted the copilot/remove-berkeley-db-from-squid-image branch July 22, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a Squid image without Sleepycat-licensed Berkeley DB

3 participants