Skip to content

Commit 59a052b

Browse files
committed
fixed push of final image and codeql sequence
1 parent fab1f4a commit 59a052b

3 files changed

Lines changed: 19 additions & 14 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,7 @@ jobs:
5454
steps:
5555
- name: Checkout repository
5656
uses: actions/checkout@v4
57-
- name: Fix Ownership
58-
run: |
59-
# recent versions of Git refuse to touch a repository whose on-disk owner
60-
# doesn’t match the UID that is running the command
61-
# mark the workspace (and any nested path) as safe
62-
git config --global --add safe.directory "$GITHUB_WORKSPACE"
63-
git config --global --add safe.directory "$GITHUB_WORKSPACE"/src
64-
57+
6558
# Add any setup steps before running the `GitHub/codeql-action/init` action.
6659
# This includes steps like installing compilers or runtimes (`actions/setup-node`
6760
# or others). This is typically only required for manual builds.
@@ -92,7 +85,8 @@ jobs:
9285
shell: bash
9386
run: |
9487
echo "Starting manual build for CodeQL..."
95-
chmod +x ./ci/build.sh
88+
DOCKER_ENTRYPOINT_SOURCE_ONLY=1 . /usr/local/bin/docker-entrypoint.sh \
89+
module load geant4/11.4.0 \
9690
./ci/build.sh
9791
echo "Manual build finished."
9892

.github/workflows/docker.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ jobs:
135135
UPSTREAM_REV=${{ env.UPSTREAM_REV }}
136136
context: .
137137
file: ./Dockerfile.generated
138+
target: final
138139
platforms: ${{ matrix.platform }}
139140
push: true
140141
# Add suffix to the arch-specific image tag
@@ -145,18 +146,20 @@ jobs:
145146
# publishes the BuildKit cache to your container registry under that tag
146147
cache-to: ${{ env.CACHE_REF }},mode=max
147148

149+
148150
# export logs from the logs-export stage in the dockerfile to the runner’s filesystem (no docker pull)
149-
- name: Export logs
151+
- name: Export logs (runner artifact)
150152
uses: docker/build-push-action@v5
151153
with:
154+
pull: true
152155
context: .
153156
file: ./Dockerfile.generated
154157
target: logs-export
155-
platforms: ${{ matrix.platform }}
156158
push: false
157159
cache-from: ${{ env.CACHE_REF }}
158160
outputs: type=local,dest=${{ runner.temp }}/artifacts/${{ matrix.logs_dir }}
159161

162+
160163
- name: Upload logs artifact
161164
uses: actions/upload-artifact@v4
162165
with:
@@ -222,7 +225,7 @@ jobs:
222225
echo ""
223226
echo "Includes:"
224227
if docker buildx imagetools inspect "${IMAGE}:${TAG}-amd64" >/dev/null 2>&1; then echo "- amd64"; fi
225-
if docker buildx imagetools inspect "${IMAGE}:${TAG}-arm64" >/dev/null 2>&1; then echo "- arm64"; else echo "- arm64 (skipped)"; fi
228+
if docker buildx imagetools inspect "${IMAGE}:${TAG}-arm64" >/dev/null 2>&1; then echo "- arm64"; else echo "no arm64. Run with --platform=linux/amd64 in arm64 CPUs"; fi
226229
echo ""
227230
echo "### Pull"
228231
echo '```bash'

ci/dockerfile_creator.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ def available_images() -> str:
1616
return ', '.join(sorted(valid_images))
1717

1818

19+
def remote_startup_dir() -> str:
20+
return '/usr/local/bin'
21+
1922
def remote_entrypoint():
20-
return f'/usr/local/bin/docker-entrypoint.sh'
23+
return f'{remote_startup_dir()}/docker-entrypoint.sh'
24+
25+
def remote_entrypoint_addon():
26+
return f'{remote_startup_dir()}/additional-entrycommands.sh'
27+
2128

2229
def docker_header(image: str, image_tag: str, geant4_tag: str) -> str:
2330
commands = f"FROM {g4_registry}:{geant4_tag}-{image}-{image_tag} as final\n"
@@ -38,7 +45,8 @@ def install_gemc(geant4_version: str, gemc_version: str) -> str:
3845
commands += f' && cd /root/src \\\n'
3946
commands += f" && DOCKER_ENTRYPOINT_SOURCE_ONLY=1 . {remote_entrypoint()} \\\n"
4047
commands += f' && module load geant4/{geant4_version} \\\n'
41-
commands += f' && ./ci/build.sh \n'
48+
commands += f' && ./ci/build.sh \\\n'
49+
commands += f' && echo "module load gemc" >> {remote_entrypoint_addon()} \n'
4250
return commands
4351

4452

0 commit comments

Comments
 (0)