Skip to content

Commit 3c62b61

Browse files
Move to GitHub hosting for images and add CI jobs to pull requests for benchmarks []
1 parent 683c55a commit 3c62b61

9 files changed

Lines changed: 129 additions & 21 deletions

File tree

‎.github/workflows/build-and-test-ci.yml‎

Lines changed: 100 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,22 @@
77
#
88
# edg-docker-test --posture=extensive --non-interactive
99
#
10-
# inside the edgcpp/ci-runner image. Jobs are staged so GitHub can schedule
10+
# inside the ghcr.io/edgcpp/ci-runner image. Jobs are staged so GitHub can schedule
1111
# them in parallel, with each test leg waiting only on its own build (and the
1212
# shared timestamp, which runs alongside the builds):
1313
#
1414
# prepare ───────────────┬──► test-gcc ──┐
1515
# build-gcc ─────────────┘ ├──► publish (on failure)
1616
# prepare ───────────────┬──► test-i686 ──┘
1717
# build-i686 ────────────┘
18+
# bench (pull requests only; independent)
1819
#
1920
# A shared run timestamp keeps results under the same tests/runs/<timestamp>/
2021
# tree; the publish job republishes failure artifacts from all test legs.
22+
# The bench job runs the cachegrind benchmarks the way
23+
# `edg-docker-bench --posture=release` does and uploads them as bench-results
24+
# (c/ and cpp/ runs, for comparison against the checked-in
25+
# benchmarks/baselines/project/release-{c,cpp}).
2126

2227
name: Build & Test CI
2328

@@ -46,7 +51,7 @@ jobs:
4651
runs-on: ubuntu-latest
4752
timeout-minutes: 120
4853
container:
49-
image: docker.io/edgcpp/ci-runner@sha256:73be12d128b8507f5feb9e73c25f48f14e6b041940ef165bce5fda8efe2b605c
54+
image: ghcr.io/edgcpp/ci-runner@sha256:14b3948c2ce12cfa5472e5a6c468393d15426f3a67685cc35d830ea5db2acdf8
5055
defaults:
5156
run:
5257
shell: edg-container-exec "bash -eo pipefail {0}"
@@ -87,7 +92,7 @@ jobs:
8792
runs-on: ubuntu-latest
8893
timeout-minutes: 120
8994
container:
90-
image: docker.io/edgcpp/ci-runner@sha256:73be12d128b8507f5feb9e73c25f48f14e6b041940ef165bce5fda8efe2b605c
95+
image: ghcr.io/edgcpp/ci-runner@sha256:14b3948c2ce12cfa5472e5a6c468393d15426f3a67685cc35d830ea5db2acdf8
9196
defaults:
9297
run:
9398
shell: edg-container-exec "bash -eo pipefail {0}"
@@ -134,7 +139,7 @@ jobs:
134139
- edg_x86_64
135140
- edg_x86_64_cp
136141
container:
137-
image: docker.io/edgcpp/ci-runner@sha256:73be12d128b8507f5feb9e73c25f48f14e6b041940ef165bce5fda8efe2b605c
142+
image: ghcr.io/edgcpp/ci-runner@sha256:14b3948c2ce12cfa5472e5a6c468393d15426f3a67685cc35d830ea5db2acdf8
138143
# Required for setarch ... -R (disable ASLR) used by the test harness.
139144
options: --privileged
140145
defaults:
@@ -202,7 +207,7 @@ jobs:
202207
- edg_x86_32
203208
- edg_x86_32_cp
204209
container:
205-
image: docker.io/edgcpp/ci-runner@sha256:73be12d128b8507f5feb9e73c25f48f14e6b041940ef165bce5fda8efe2b605c
210+
image: ghcr.io/edgcpp/ci-runner@sha256:14b3948c2ce12cfa5472e5a6c468393d15426f3a67685cc35d830ea5db2acdf8
206211
# Required for setarch ... -R (disable ASLR) used by the test harness.
207212
options: --privileged
208213
defaults:
@@ -277,10 +282,100 @@ jobs:
277282
path: aggregated-test-results
278283
merge-multiple: true
279284

285+
# Record which commit was tested so consumers of the artifact (e.g.
286+
# acknowledg-forge) can check out the matching tree. For pull requests
287+
# this is the merge commit, not the PR head.
288+
- name: Record CI metadata
289+
env:
290+
TESTED_SHA: ${{ github.sha }}
291+
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
292+
RUN_ID: ${{ github.run_id }}
293+
RUN_ATTEMPT: ${{ github.run_attempt }}
294+
run: |
295+
python3 - > aggregated-test-results/ci-meta.json <<'EOF'
296+
import json, os
297+
print(json.dumps({
298+
'tested_sha': os.environ['TESTED_SHA'],
299+
'head_sha': os.environ['HEAD_SHA'],
300+
'run_id': int(os.environ['RUN_ID']),
301+
'run_attempt': int(os.environ['RUN_ATTEMPT']),
302+
}, indent = 2))
303+
EOF
304+
280305
- name: Upload elist, elog, and .rt.tar.gz results
281306
uses: actions/upload-artifact@v7
282307
with:
283308
name: test-results-all
284309
path: aggregated-test-results/
285310
if-no-files-found: warn
286311
retention-days: 14
312+
313+
bench:
314+
name: Benchmark linux-gcc-release
315+
if: ${{ github.event_name == 'pull_request' }}
316+
# Benchmark infrastructure problems shouldn't fail a pull request's CI.
317+
continue-on-error: true
318+
runs-on: ubuntu-latest
319+
timeout-minutes: 120
320+
container:
321+
image: ghcr.io/edgcpp/ci-runner@sha256:14b3948c2ce12cfa5472e5a6c468393d15426f3a67685cc35d830ea5db2acdf8
322+
defaults:
323+
run:
324+
shell: edg-container-exec "bash -eo pipefail {0}"
325+
326+
steps:
327+
- name: Check out repository
328+
uses: actions/checkout@v7
329+
330+
- name: Configure linux-gcc-release
331+
env:
332+
EDG_BASE: ${{ github.workspace }}/bases/docker/dev-env/gcc
333+
run: cmake --preset linux-gcc-release
334+
335+
- name: Build linux-gcc-release
336+
env:
337+
EDG_BASE: ${{ github.workspace }}/bases/docker/dev-env/gcc
338+
run: cmake --build build/gcc-release --target cpfe cpfe-cp
339+
340+
- name: Run benchmarks
341+
env:
342+
EDG_BASE: ${{ github.workspace }}/bases/docker/dev-env/gcc
343+
EDG_BENCH_RUNS_KEPT: '0'
344+
run: |
345+
# Use the pull request's own benchmark tooling.
346+
export PATH="${GITHUB_WORKSPACE}/dev_tools/bin:${PATH}"
347+
export PYTHONPATH="${GITHUB_WORKSPACE}/dev_tools/pylibs"
348+
mkdir -p bench-results
349+
for run in c:bin/cpfe cpp:bin/cpfe-cp; do
350+
name="${run%%:*}"
351+
binary="${run#*:}"
352+
(cd build/gcc-release && source environment.sh &&
353+
edg-bench "${binary}")
354+
latest="$(ls -1d benchmarks/runs/*/ | sort | tail -n 1)"
355+
mv "${latest}" "bench-results/${name}"
356+
done
357+
358+
- name: Record CI metadata
359+
env:
360+
TESTED_SHA: ${{ github.sha }}
361+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
362+
RUN_ID: ${{ github.run_id }}
363+
RUN_ATTEMPT: ${{ github.run_attempt }}
364+
run: |
365+
python3 - > bench-results/ci-meta.json <<'EOF'
366+
import json, os
367+
print(json.dumps({
368+
'tested_sha': os.environ['TESTED_SHA'],
369+
'head_sha': os.environ['HEAD_SHA'],
370+
'run_id': int(os.environ['RUN_ID']),
371+
'run_attempt': int(os.environ['RUN_ATTEMPT']),
372+
}, indent = 2))
373+
EOF
374+
375+
- name: Upload benchmark results
376+
uses: actions/upload-artifact@v7
377+
with:
378+
name: bench-results
379+
path: bench-results/
380+
if-no-files-found: error
381+
retention-days: 14

‎.github/workflows/documentation.yml‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
# Build the Sphinx documentation in doc/ with warnings treated as errors, so
77
# documentation changes stay publishable.
88
#
9-
# The build runs in the edgcpp/sphinx-env image, which the site workflow
10-
# described below also builds the published documentation with. That image
11-
# installs the packages pinned in doc/requirements.txt, so after changing
12-
# them, rebuild it with build-edg-env sphinx-env and push it to Docker Hub.
9+
# The build runs in the ghcr.io/edgcpp/sphinx-env image, which the site
10+
# workflow described below also builds the published documentation with.
11+
# That image installs the packages pinned in doc/requirements.txt, so after
12+
# changing them, rebuild it with build-edg-env sphinx-env and push it to
13+
# ghcr.io/edgcpp.
1314
#
1415
# The documentation is published by the edgcpp/edgcpp.github.io site
1516
# workflow, not from here: it builds the release tag into
@@ -47,7 +48,7 @@ jobs:
4748
runs-on: ubuntu-latest
4849
timeout-minutes: 15
4950
container:
50-
image: docker.io/edgcpp/sphinx-env:latest
51+
image: ghcr.io/edgcpp/sphinx-env:latest
5152
steps:
5253
- name: Check out repository
5354
uses: actions/checkout@v7

‎.github/workflows/strict-build-check.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
runs-on: ubuntu-latest
152152
timeout-minutes: 120
153153
container:
154-
image: docker.io/edgcpp/ci-runner@sha256:73be12d128b8507f5feb9e73c25f48f14e6b041940ef165bce5fda8efe2b605c
154+
image: ghcr.io/edgcpp/ci-runner@sha256:14b3948c2ce12cfa5472e5a6c468393d15426f3a67685cc35d830ea5db2acdf8
155155
defaults:
156156
run:
157157
shell: edg-container-exec "bash -eo pipefail {0}"
@@ -176,7 +176,7 @@ jobs:
176176
runs-on: ubuntu-latest
177177
timeout-minutes: 120
178178
container:
179-
image: docker.io/edgcpp/ci-runner@sha256:73be12d128b8507f5feb9e73c25f48f14e6b041940ef165bce5fda8efe2b605c
179+
image: ghcr.io/edgcpp/ci-runner@sha256:14b3948c2ce12cfa5472e5a6c468393d15426f3a67685cc35d830ea5db2acdf8
180180
defaults:
181181
run:
182182
shell: edg-container-exec "bash -eo pipefail {0}"
@@ -201,7 +201,7 @@ jobs:
201201
runs-on: ubuntu-latest
202202
timeout-minutes: 120
203203
container:
204-
image: docker.io/edgcpp/ci-runner@sha256:73be12d128b8507f5feb9e73c25f48f14e6b041940ef165bce5fda8efe2b605c
204+
image: ghcr.io/edgcpp/ci-runner@sha256:14b3948c2ce12cfa5472e5a6c468393d15426f3a67685cc35d830ea5db2acdf8
205205
defaults:
206206
run:
207207
shell: edg-container-exec "bash -eo pipefail {0}"
@@ -226,7 +226,7 @@ jobs:
226226
runs-on: ubuntu-latest
227227
timeout-minutes: 120
228228
container:
229-
image: docker.io/edgcpp/ci-runner@sha256:73be12d128b8507f5feb9e73c25f48f14e6b041940ef165bce5fda8efe2b605c
229+
image: ghcr.io/edgcpp/ci-runner@sha256:14b3948c2ce12cfa5472e5a6c468393d15426f3a67685cc35d830ea5db2acdf8
230230
defaults:
231231
run:
232232
shell: edg-container-exec "bash -eo pipefail {0}"

‎dev_tools/docker/build-base/Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ RUN /edg/setup-scripts/run-all.sh && rm -rf /edg/setup-scripts/**
2020
RUN ln -sf /usr/bin/dash /usr/bin/sh
2121

2222
# Install native tools.
23-
COPY --from=edgcpp/native-tools:latest \
23+
COPY --from=ghcr.io/edgcpp/native-tools:latest \
2424
/edg/native-tools \
2525
/edg/native-tools
2626

2727
# Install softfloat tools.
28-
COPY --from=edgcpp/softfloat:latest \
28+
COPY --from=ghcr.io/edgcpp/softfloat:latest \
2929
/edg/softfloat \
3030
/edg/softfloat
3131

‎dev_tools/docker/ci-runner/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# See https://edgcpp.org/LICENSE.txt for license information.
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6-
FROM edgcpp/build-base:latest
6+
FROM ghcr.io/edgcpp/build-base:latest
77

88
RUN mkdir /edg/tools
99

‎dev_tools/docker/ci-runner/setup-scripts/install-software.sh‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ packages=()
1212
# Add required packages for checkout to function
1313
packages+=("nodejs")
1414

15+
# Add valgrind (cachegrind) for the CI benchmark job.
16+
packages+=("valgrind")
17+
1518
# Install the core packages (dnf fetches the package database on install,
1619
# so forcing an update here, particularly for development is counter
1720
# productive to image build time -- nearly doubling it on a MacBook Pro

‎dev_tools/docker/dev-env/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# See https://edgcpp.org/LICENSE.txt for license information.
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6-
FROM edgcpp/build-base:latest
6+
FROM ghcr.io/edgcpp/build-base:latest
77

88
RUN mkdir /edg/workspace && \
99
mkdir /edg/opt-software && \

‎dev_tools/docker/legacy-dev-env/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ RUN /edg/setup-scripts/run-all.sh
3030
COPY docker-tools/* /edg/docker-tools/
3131

3232
# Install native tools.
33-
COPY --from=edgcpp/legacy-native-tools:latest \
33+
COPY --from=ghcr.io/edgcpp/legacy-native-tools:latest \
3434
/edg/native-tools \
3535
/edg/native-tools
3636

‎dev_tools/pylibs/edgdocker/__init__.py‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@
5454
'ci-runner'
5555
)
5656

57+
# The registry namespace EDG images are published under (the GitHub
58+
# organization's container registry).
59+
IMAGE_NAMESPACE = 'ghcr.io/edgcpp'
60+
61+
def get_image_repository(image_name: str) -> str:
62+
'''Return the registry repository an internal image is published to.'''
63+
return f"{IMAGE_NAMESPACE}/{image_name}"
64+
5765
def get_docker_file_dir(image_name: str) -> Path:
5866
'''Return the expected directory of the Dockerfile for an image name.'''
5967
return _DOCKER_DIR / image_name
@@ -86,11 +94,12 @@ def get_latest_image_tag(image_name: str, *,
8694
their pinned name If you want the generic latest tag, use respect_pins =
8795
False. The default value is controlled by use_image_pinning(), for uses
8896
that expect a particular format, the caller should explicitly specify.'''
97+
repository = get_image_repository(image_name)
8998
if respect_pins and image_name in IMAGE_PINS:
9099
# This is an officially maintained image synchronized between developers.
91-
return f"docker.io/edgcpp/{image_name}@sha256:{IMAGE_PINS[image_name]}"
100+
return f"{repository}@sha256:{IMAGE_PINS[image_name]}"
92101
else:
93-
return f"docker.io/edgcpp/{image_name}:latest"
102+
return f"{repository}:latest"
94103

95104
def has_image_tagged(image_name: str) -> bool:
96105
'''Return TRUE if there is a docker image already build on this system.'''

0 commit comments

Comments
 (0)