-
Notifications
You must be signed in to change notification settings - Fork 8
ci: validate Dockerfile on PRs via source-check build #344
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
base: main
Are you sure you want to change the base?
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 | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,71 @@ | ||||||||||||||||||||||||||||||||||||||||
| name: Validate Dockerfile | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| # Fast, push-free Dockerfile validation for pull requests. The heavy | ||||||||||||||||||||||||||||||||||||||||
| # build-and-push (checkpoints + all pixi envs) only runs on main/tags in | ||||||||||||||||||||||||||||||||||||||||
| # docker.yml; this catches Dockerfile breakage — a bad COPY path, a dropped env | ||||||||||||||||||||||||||||||||||||||||
| # in the install list, a broken pixi bootstrap — before it reaches main. | ||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||
| # It builds the Dockerfile's `source-check` stage, which stops after the base | ||||||||||||||||||||||||||||||||||||||||
| # image and source COPY: no checkpoint pull, no `pixi install -e <env>`, no | ||||||||||||||||||||||||||||||||||||||||
| # push. That keeps it cheap while still exercising the parts of the Dockerfile | ||||||||||||||||||||||||||||||||||||||||
| # that change most often. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||
| - 'Dockerfile' | ||||||||||||||||||||||||||||||||||||||||
| - 'Dockerfile.astera' | ||||||||||||||||||||||||||||||||||||||||
| - 'docker-entrypoint.sh' | ||||||||||||||||||||||||||||||||||||||||
| - 'pyproject.toml' | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+17
to
+20
|
||||||||||||||||||||||||||||||||||||||||
| - 'pixi.lock' | ||||||||||||||||||||||||||||||||||||||||
| - 'run_grid_search.py' | ||||||||||||||||||||||||||||||||||||||||
| - 'run_experiments' | ||||||||||||||||||||||||||||||||||||||||
| - 'run_experiments.sh' | ||||||||||||||||||||||||||||||||||||||||
| - 'run_all_models.sh' | ||||||||||||||||||||||||||||||||||||||||
| - '.github/workflows/docker-validate.yml' | ||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||
| - 'Dockerfile' | ||||||||||||||||||||||||||||||||||||||||
| - 'Dockerfile.astera' | ||||||||||||||||||||||||||||||||||||||||
| - 'docker-entrypoint.sh' | ||||||||||||||||||||||||||||||||||||||||
| - 'pyproject.toml' | ||||||||||||||||||||||||||||||||||||||||
| - 'pixi.lock' | ||||||||||||||||||||||||||||||||||||||||
| - 'run_grid_search.py' | ||||||||||||||||||||||||||||||||||||||||
| - 'run_experiments' | ||||||||||||||||||||||||||||||||||||||||
| - 'run_experiments.sh' | ||||||||||||||||||||||||||||||||||||||||
| - 'run_all_models.sh' | ||||||||||||||||||||||||||||||||||||||||
| - '.github/workflows/docker-validate.yml' | ||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| concurrency: | ||||||||||||||||||||||||||||||||||||||||
| group: docker-validate-${{ github.ref }} | ||||||||||||||||||||||||||||||||||||||||
| cancel-in-progress: true | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||
| source-check: | ||||||||||||||||||||||||||||||||||||||||
| name: Dockerfile source-check (no push) | ||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 20 | ||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| persist-credentials: false | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Set up Docker Buildx | ||||||||||||||||||||||||||||||||||||||||
| uses: docker/setup-buildx-action@v3 | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - name: Build source-check stage | ||||||||||||||||||||||||||||||||||||||||
| uses: docker/build-push-action@v6 | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| context: . | ||||||||||||||||||||||||||||||||||||||||
| file: Dockerfile | ||||||||||||||||||||||||||||||||||||||||
| target: source-check | ||||||||||||||||||||||||||||||||||||||||
| push: false | ||||||||||||||||||||||||||||||||||||||||
| cache-from: type=gha | ||||||||||||||||||||||||||||||||||||||||
| cache-to: type=gha,mode=max | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+51
to
+71
Comment on lines
+63
to
+71
Contributor
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. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== workflow excerpt =="
sed -n '1,120p' .github/workflows/docker-validate.yml
echo
echo "== search docker build flags =="
rg -n "uses: docker/build-push-action|pull:|build-push-action@v6|docker build" .github/workflows/docker-validate.yml Dockerfile 2>/dev/null || true
echo
echo "== relevant Dockerfile lines =="
sed -n '1,80p' DockerfileRepository: diff-use/sampleworks Length of output: 5409 🌐 Web query:
💡 Result: In the docker/build-push-action v6 (and other versions), the Citations:
Force a base-image pull during validation.
Proposed fix file: Dockerfile
target: source-check
+ pull: true
push: false📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
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.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: diff-use/sampleworks
Length of output: 10605
Remove
Dockerfile.asterafrom the Dockerfile validation paths.When only
Dockerfile.asterachanges, this workflow still runs and builds the publicDockerfiletarget (file: Dockerfile), so Astera-only Dockerfile changes pass without exercising the overlay Dockerfile. Drop theDockerfile.asteraentries from bothon.push.pathsandon.pull_request.pathsunless a separate workflow is added that can validateDockerfile.astera’s published base image.Proposed fix
- - 'Dockerfile.astera'Remove this entry from both trigger lists.
📝 Committable suggestion
🤖 Prompt for AI Agents