Repository navigation
A deployment can turn off self-service document sources #13820
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: docker-smoke | |
| # release/** too: a supported line's patches get the same checks. | |
| on: | |
| push: | |
| branches: [main, "release/**"] | |
| paths: | |
| [ | |
| "Dockerfile", | |
| "extractor/**", | |
| "compose.yaml", | |
| "server/**", | |
| "schemas/**", | |
| "scripts/gates/docker*", | |
| "scripts/gates/cell_trigger_acceptance.py", | |
| "scripts/gates/testsupport/cell_trigger/**", | |
| "bench/cell_trigger_gate.py", | |
| "tests/unit/test_cell_trigger_ci_creator.py", | |
| "scripts/gates/sandbox-requirements.*", | |
| "frontend/**", | |
| "tests/fixtures/docker_provider_app.py", | |
| "scripts/install-code-toolchains.sh", | |
| "scripts/code-toolchains/**", | |
| "scripts/serve.sh", | |
| "scripts/scip_harness/**", | |
| "scripts/release/build_stack_bundle.py", | |
| "scripts/release/prepare.py", | |
| "scripts/gates/installer_rehearsal.py", | |
| "scripts/gates/previous_release_files.sh", | |
| "dev/clickhouse_release.sh", | |
| "deploy/standalone/**", | |
| "deploy/clickhouse-config/**", | |
| "deploy/apparmor/**", | |
| "dev/seccomp/**", | |
| "dev/docker-compose.colour.yml", | |
| "dev/apparmor_check.sh", | |
| "dev/sandbox_probe.sh", | |
| "tests/unit/test_repo_job_sandbox*.py", | |
| "tests/unit/test_scip_checkout_fetch_ref.py", | |
| "install.sh", | |
| "pyproject.toml", | |
| "uv.lock", | |
| "dev/clickhouse-ci/log_queries_readonly.xml", | |
| "dev/clickhouse-ci/custom_settings_prefixes.xml", | |
| ".github/workflows/docker-smoke.yml", | |
| ] | |
| pull_request: | |
| branches: [main, "release/**"] | |
| paths: | |
| [ | |
| "Dockerfile", | |
| "extractor/**", | |
| "compose.yaml", | |
| "server/**", | |
| "schemas/**", | |
| "scripts/gates/docker*", | |
| "scripts/gates/cell_trigger_acceptance.py", | |
| "scripts/gates/testsupport/cell_trigger/**", | |
| "bench/cell_trigger_gate.py", | |
| "tests/unit/test_cell_trigger_ci_creator.py", | |
| "scripts/gates/sandbox-requirements.*", | |
| "frontend/**", | |
| "tests/fixtures/docker_provider_app.py", | |
| "scripts/install-code-toolchains.sh", | |
| "scripts/code-toolchains/**", | |
| "scripts/serve.sh", | |
| "scripts/scip_harness/**", | |
| "scripts/release/build_stack_bundle.py", | |
| "scripts/release/prepare.py", | |
| "scripts/gates/installer_rehearsal.py", | |
| "scripts/gates/previous_release_files.sh", | |
| "dev/clickhouse_release.sh", | |
| "deploy/standalone/**", | |
| "deploy/clickhouse-config/**", | |
| "deploy/apparmor/**", | |
| "dev/seccomp/**", | |
| "dev/docker-compose.colour.yml", | |
| "dev/apparmor_check.sh", | |
| "dev/sandbox_probe.sh", | |
| "tests/unit/test_repo_job_sandbox*.py", | |
| "tests/unit/test_scip_checkout_fetch_ref.py", | |
| "install.sh", | |
| "pyproject.toml", | |
| "uv.lock", | |
| "dev/clickhouse-ci/log_queries_readonly.xml", | |
| "dev/clickhouse-ci/custom_settings_prefixes.xml", | |
| ".github/workflows/docker-smoke.yml", | |
| ] | |
| # Weekly, so a critical CVE fixed upstream fails here before a release's scan. | |
| schedule: | |
| - cron: "17 4 * * 1" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: docker-smoke-${{ github.event_name == 'pull_request' && github.ref || github.sha }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| clickhouse: | |
| name: the ClickHouse release this run tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| outputs: | |
| image: ${{ steps.resolve.outputs.image }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| # Both architectures install the release `latest` names now. | |
| - id: resolve | |
| run: | | |
| image=$(bash dev/clickhouse_release.sh) | |
| echo "image=$image" >> "$GITHUB_OUTPUT" | |
| quickstart: | |
| name: Quickstart (${{ matrix.arch }}) | |
| needs: clickhouse | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| runner: ubuntu-latest | |
| - arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| # An uncached build (weekly, dispatched) about doubles the build; the | |
| # installer rehearsal adds about a quarter of an hour. | |
| timeout-minutes: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 75 || 45 }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 # the release tags, for the previous release's installer | |
| - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 | |
| - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | |
| with: | |
| node-version: "22" | |
| package-manager-cache: false | |
| - name: Install dashboard browser-test dependencies | |
| working-directory: frontend | |
| run: | | |
| npm ci --no-audit --no-fund | |
| npx playwright install --with-deps chromium | |
| - name: Build the production image | |
| id: server | |
| uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 | |
| with: | |
| context: . | |
| load: true | |
| tags: loom:docker-smoke | |
| # The weekly or dispatched scan sees the packages the archives serve today. | |
| no-cache: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | |
| platforms: linux/${{ matrix.arch }} | |
| cache-from: type=gha,scope=docker-smoke-${{ matrix.arch }} | |
| cache-to: type=gha,mode=max,scope=docker-smoke-${{ matrix.arch }} | |
| - name: Build the extractor image | |
| id: extractor | |
| uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 | |
| with: | |
| context: . | |
| file: extractor/Dockerfile | |
| load: true | |
| tags: loom-extractor:docker-smoke | |
| # The weekly or dispatched scan sees the packages the archives serve today. | |
| no-cache: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | |
| platforms: linux/${{ matrix.arch }} | |
| cache-from: type=gha,scope=docker-smoke-extractor-${{ matrix.arch }} | |
| cache-to: type=gha,mode=max,scope=docker-smoke-extractor-${{ matrix.arch }} | |
| - name: Fresh installer, compiler indexing and dashboard provider recovery | |
| env: | |
| CLICKHOUSE_IMAGE: ${{ needs.clickhouse.outputs.image }} | |
| run: | | |
| python3 scripts/gates/docker_quickstart_smoke.py --image loom:docker-smoke \ | |
| --extractor-image loom-extractor:docker-smoke \ | |
| --clickhouse-image "$CLICKHOUSE_IMAGE" | |
| # The one-liner in clean Debian, Ubuntu and Alpine containers, from files | |
| # built as a release builds them: install, round trip, re-run, a refused | |
| # downgrade under each distribution's own sh and awk, and an upgrade over | |
| # the release that is out, by its own installer and bundle. | |
| - name: The one-line installer in clean containers | |
| env: | |
| CLICKHOUSE_IMAGE: ${{ needs.clickhouse.outputs.image }} | |
| run: | | |
| version=$(python3 -c 'import server; print(server.__version__)') | |
| python3 scripts/release/build_stack_bundle.py build --version "$version" \ | |
| --clickhouse-image "$CLICKHOUSE_IMAGE" --output-dir "$RUNNER_TEMP/release" | |
| python3 scripts/gates/installer_rehearsal.py --release-dir "$RUNNER_TEMP/release" --upgrade \ | |
| --image loom:docker-smoke --extractor-image loom-extractor:docker-smoke | |
| # Trivy copies a loaded image out of the daemon into /tmp; a hosted runner | |
| # has no room for the server image beside the toolchains it carries. | |
| - name: Make room for the image scans | |
| if: ${{ !cancelled() && steps.server.outcome == 'success' }} | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL | |
| docker buildx prune -af >/dev/null | |
| df -h / | |
| # The release refuses a fixed critical CVE; only a weekly or dispatched run fails on one here. | |
| - name: Scan the server image with the release's scan settings | |
| if: ${{ !cancelled() && steps.server.outcome == 'success' }} | |
| uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 | |
| continue-on-error: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }} | |
| env: | |
| TRIVY_PLATFORM: linux/${{ matrix.arch }} | |
| with: | |
| image-ref: loom:docker-smoke | |
| severity: CRITICAL | |
| ignore-unfixed: true | |
| exit-code: "1" | |
| - name: Scan the extractor image with the release's scan settings | |
| if: ${{ !cancelled() && steps.extractor.outcome == 'success' }} | |
| uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 | |
| continue-on-error: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }} | |
| env: | |
| TRIVY_PLATFORM: linux/${{ matrix.arch }} | |
| with: | |
| image-ref: loom-extractor:docker-smoke | |
| severity: CRITICAL | |
| ignore-unfixed: true | |
| exit-code: "1" | |
| sandbox-profile: | |
| # Where the shipped AppArmor profile first runs: the colours' security | |
| # options (dev/docker-compose.colour.yml) on Ubuntu 24.04 with its | |
| # unprivileged user-namespace restriction left on, the probe and the | |
| # hostile suite inside the production image. ci.yml's sandbox job runs on | |
| # the host with that restriction off and tests bubblewrap, not the profile. | |
| name: Repository-job sandbox under the shipped profiles | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 | |
| - name: Build the production image | |
| uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 | |
| with: | |
| context: . | |
| load: true | |
| tags: loom:sandbox-ci | |
| platforms: linux/amd64 | |
| cache-from: type=gha,scope=docker-smoke-amd64 | |
| - name: Load the profile, keeping the user-namespace restriction on | |
| run: | | |
| sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=1 | |
| sudo apparmor_parser -r -W deploy/apparmor/loom-repo-sandbox | |
| dev/apparmor_check.sh dev/docker-compose.colour.yml | |
| # The image has no test runner; the versions are uv.lock's. | |
| - name: Install pytest for the container | |
| run: | | |
| python3 -m pip install --target "$RUNNER_TEMP/pylib" --require-hashes --only-binary=:all: -r scripts/gates/sandbox-requirements.txt | |
| - name: Probe and hostile suite under the profile | |
| run: | | |
| opts=(--rm --network none --user loom | |
| --security-opt seccomp=dev/seccomp/loom-repo-sandbox.json | |
| --security-opt apparmor=loom-repo-sandbox | |
| --security-opt systempaths=unconfined) | |
| docker run "${opts[@]}" -w /app --entrypoint python loom:sandbox-ci -c \ | |
| 'from server.code.app.index import sandbox as s; raise SystemExit(0 if s.sandbox_available() else 1)' | |
| docker run "${opts[@]}" -w /src -v "$PWD:/src:ro" -v "$RUNNER_TEMP/pylib:/pylib:ro" \ | |
| -e PYTHONPATH=/pylib -e PYTHONDONTWRITEBYTECODE=1 -e LOOM_ENV_FILE= -e LOOM_TEST_REQUIRE_SANDBOX=1 \ | |
| --entrypoint python loom:sandbox-ci \ | |
| -m pytest -q -p no:cacheprovider tests/unit/test_repo_job_sandbox.py tests/unit/test_repo_job_sandbox_hostile.py | |
| # The runners' git does not refuse a foreign-owned source in upload-pack, so these | |
| # skip in ci.yml; the image's git does. | |
| - name: Foreign-owned repositories with the image's git | |
| run: | | |
| docker run --rm --network none --user loom -w /src -v "$PWD:/src:ro" \ | |
| -v "$RUNNER_TEMP/pylib:/pylib:ro" -e PYTHONPATH=/pylib -e PYTHONDONTWRITEBYTECODE=1 \ | |
| -e LOOM_ENV_FILE= -e LOOM_TEST_REQUIRE_OWNER_CHECK=1 --entrypoint python loom:sandbox-ci \ | |
| -m pytest -q -p no:cacheprovider tests/unit/test_scip_checkout_fetch_ref.py |