Skip to content

Commit c6e03c0

Browse files
committed
Merge branch 'main' into modernize-libarchive-install
2 parents a21c9ce + 9888c11 commit c6e03c0

File tree

382 files changed

+41197
-24919
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

382 files changed

+41197
-24919
lines changed

.github/actions/clp-execution-image-build/action.yaml renamed to .github/actions/clp-build-runtime-image/action.yaml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
name: "clp-execution-image-build"
2-
description: "Builds a container image that contains the dependencies necessary
3-
to run the CLP package."
1+
name: "clp-build-runtime-image"
2+
description: "Builds a container image to be used for running CLP."
43

54
inputs:
5+
image_type:
6+
description: "Type of image to build"
7+
required: true
68
image_registry:
79
default: "ghcr.io"
810
description: "Container image registry"
@@ -17,11 +19,11 @@ inputs:
1719
required: false
1820
platform_id:
1921
description: "Platform ID of the container (e.g. ubuntu)"
20-
required: true
22+
required: false
2123
platform_version_id:
2224
description: "Platform VERSION_ID / VERSION_CODENAME of the container
2325
(e.g. jammy, focal, etc.)"
24-
required: true
26+
required: false
2527

2628
runs:
2729
using: "composite"
@@ -45,20 +47,37 @@ runs:
4547
echo "REPOSITORY=$(echo '${{github.repository}}' | tr '[:upper:]' '[:lower:]')" \
4648
>> "$GITHUB_OUTPUT"
4749
48-
- name: "Update Metadata"
49-
id: "meta"
50+
- name: "Compute metadata"
51+
id: "compute-meta"
52+
shell: "bash"
53+
run: |
54+
base_path="./tools/docker-images"
55+
56+
if [[ "${{inputs.image_type}}" == "execution" ]]; then
57+
platform="${{inputs.platform_id}}-${{inputs.platform_version_id}}"
58+
dockerfile_path="$base_path/clp-execution-base-$platform/Dockerfile"
59+
image_name="clp-${{inputs.image_type}}-$platform"
60+
else
61+
dockerfile_path="$base_path/clp-package/Dockerfile"
62+
image_name="clp-${{inputs.image_type}}"
63+
fi
64+
65+
echo "DOCKERFILE=$dockerfile_path" >> "$GITHUB_OUTPUT"
66+
echo "IMAGE_NAME=$image_name" >> "$GITHUB_OUTPUT"
67+
68+
- name: "Extract GitHub Metadata"
69+
id: "extract-gh-meta"
5070
uses: "docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804"
5171
with:
5272
images: "${{inputs.image_registry}}/${{steps.sanitization.outputs.REPOSITORY}}\
53-
/clp-execution-x86-${{inputs.platform_id}}-${{inputs.platform_version_id}}"
73+
/${{steps.compute-meta.outputs.IMAGE_NAME}}"
5474

5575
- name: "Build and Push"
5676
if: "github.event_name != 'pull_request' && github.ref == 'refs/heads/main'"
5777
uses: "docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4"
5878
with:
5979
context: "./"
60-
file: "./tools/docker-images/\
61-
clp-execution-base-${{inputs.platform_id}}-${{inputs.platform_version_id}}/Dockerfile"
80+
file: "${{steps.compute-meta.outputs.DOCKERFILE}}"
6281
push: true
63-
tags: "${{steps.meta.outputs.tags}}"
64-
labels: "${{steps.meta.outputs.labels}}"
82+
tags: "${{steps.extract-gh-meta.outputs.tags}}"
83+
labels: "${{steps.extract-gh-meta.outputs.labels}}"

.github/actions/run-on-image/action.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ runs:
4242
- run: "./tools/scripts/deps-download/init.sh"
4343
shell: "bash"
4444

45+
# `--env npm_config_cache` overrides the default `/.npm` to avoid permission issues.
4546
- run: >-
4647
docker run
4748
--user $(id -u):$(id -g)
49+
--env npm_config_cache=/tmp/.npm
4850
--volume "$GITHUB_WORKSPACE":/mnt/repo
4951
--workdir /mnt/repo
5052
${{steps.get_image_props.outputs.qualified_image_name}}

.github/workflows/clp-core-build.yaml renamed to .github/workflows/clp-artifact-build.yaml

Lines changed: 195 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
1-
name: "clp-core-build"
1+
name: "clp-artifact-build"
22

33
on:
44
pull_request:
5-
paths:
6-
- ".github/actions/clp-core-build-containers/action.yaml"
7-
- ".github/actions/run-on-image/action.yaml"
8-
- ".github/workflows/clp-core-build.yaml"
9-
- ".gitmodules"
10-
- "components/core/**"
11-
- "taskfile.yaml"
12-
- "taskfiles/**"
13-
- "tools/scripts/deps-download/**"
14-
- "!components/core/tools/scripts/lib_install/macos/**"
5+
paths-ignore: &ignored_paths
6+
- ".github/*"
7+
- ".github/ISSUE_TEMPLATE/**"
8+
- "components/core/tools/scripts/lib_install/macos/**"
9+
- "docs/**"
1510
push:
16-
paths:
17-
- ".github/actions/clp-core-build-containers/action.yaml"
18-
- ".github/actions/run-on-image/action.yaml"
19-
- ".github/workflows/clp-core-build.yaml"
20-
- ".gitmodules"
21-
- "components/core/**"
22-
- "taskfile.yaml"
23-
- "taskfiles/**"
24-
- "tools/scripts/deps-download/**"
25-
- "!components/core/tools/scripts/lib_install/macos/**"
11+
paths-ignore: *ignored_paths
2612
schedule:
2713
# Run daily at 00:15 UTC (the 15 is to avoid periods of high load)
2814
- cron: "15 0 * * *"
@@ -45,6 +31,8 @@ jobs:
4531
runs-on: "ubuntu-24.04"
4632
outputs:
4733
centos_stream_9_image_changed: "${{steps.filter.outputs.centos_stream_9_image}}"
34+
manylinux_2_28_x86_64_image_changed: "${{steps.filter.outputs.manylinux_2_28_x86_64_image}}"
35+
musllinux_1_2_x86_64_image_changed: "${{steps.filter.outputs.musllinux_1_2_x86_64_image}}"
4836
ubuntu_jammy_image_changed: "${{steps.filter.outputs.ubuntu_jammy_image}}"
4937
clp_changed: "${{steps.filter.outputs.clp}}"
5038
steps:
@@ -72,19 +60,31 @@ jobs:
7260
filters: |
7361
centos_stream_9_image:
7462
- ".github/actions/**"
75-
- ".github/workflows/clp-core-build.yaml"
63+
- ".github/workflows/clp-artifact-build.yaml"
7664
- "components/core/tools/scripts/lib_install/*.sh"
7765
- "components/core/tools/docker-images/clp-env-base-centos-stream-9/**"
7866
- "components/core/tools/scripts/lib_install/centos-stream-9/**"
67+
manylinux_2_28_x86_64_image:
68+
- ".github/actions/**"
69+
- ".github/workflows/clp-artifact-build.yaml"
70+
- "components/core/tools/scripts/lib_install/*.sh"
71+
- "components/core/tools/docker-images/clp-env-base-manylinux_2_28-x86_64/**"
72+
- "components/core/tools/scripts/lib_install/manylinux_2_28/**"
73+
musllinux_1_2_x86_64_image:
74+
- ".github/actions/**"
75+
- ".github/workflows/clp-artifact-build.yaml"
76+
- "components/core/tools/scripts/lib_install/*.sh"
77+
- "components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/**"
78+
- "components/core/tools/scripts/lib_install/musllinux_1_2/**"
7979
ubuntu_jammy_image:
8080
- ".github/actions/**"
81-
- ".github/workflows/clp-core-build.yaml"
81+
- ".github/workflows/clp-artifact-build.yaml"
8282
- "components/core/tools/scripts/lib_install/*.sh"
8383
- "components/core/tools/docker-images/clp-env-base-ubuntu-jammy/**"
8484
- "components/core/tools/scripts/lib_install/ubuntu-jammy/**"
8585
clp:
8686
- ".github/actions/**"
87-
- ".github/workflows/clp-core-build.yaml"
87+
- ".github/workflows/clp-artifact-build.yaml"
8888
- ".gitmodules"
8989
- "components/core/cmake/**"
9090
- "components/core/CMakeLists.txt"
@@ -121,6 +121,58 @@ jobs:
121121
${{github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}
122122
token: "${{secrets.GITHUB_TOKEN}}"
123123

124+
manylinux_2_28-x86_64-deps-image:
125+
name: "manylinux_2_28-x86_64-deps-image"
126+
if: "needs.filter-relevant-changes.outputs.manylinux_2_28_x86_64_image_changed == 'true'"
127+
needs: "filter-relevant-changes"
128+
runs-on: "ubuntu-24.04"
129+
steps:
130+
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
131+
with:
132+
submodules: "recursive"
133+
134+
- name: "Work around actions/runner-images/issues/6775"
135+
run: "chown $(id -u):$(id -g) -R ."
136+
shell: "bash"
137+
138+
- uses: "./.github/actions/clp-core-build-containers"
139+
env:
140+
OS_NAME: "manylinux_2_28"
141+
with:
142+
image_name: "${{env.DEPS_IMAGE_NAME_PREFIX}}${{env.OS_NAME}}"
143+
docker_context: "components/core"
144+
docker_file: "components/core/tools/docker-images/clp-env-base-${{env.OS_NAME}}-x86_64\
145+
/Dockerfile"
146+
push_deps_image: >-
147+
${{github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}
148+
token: "${{secrets.GITHUB_TOKEN}}"
149+
150+
musllinux_1_2-x86_64-deps-image:
151+
name: "musllinux_1_2-x86_64-deps-image"
152+
if: "needs.filter-relevant-changes.outputs.musllinux_1_2_x86_64_image_changed == 'true'"
153+
needs: "filter-relevant-changes"
154+
runs-on: "ubuntu-24.04"
155+
steps:
156+
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
157+
with:
158+
submodules: "recursive"
159+
160+
- name: "Work around actions/runner-images/issues/6775"
161+
run: "chown $(id -u):$(id -g) -R ."
162+
shell: "bash"
163+
164+
- uses: "./.github/actions/clp-core-build-containers"
165+
env:
166+
OS_NAME: "musllinux_1_2"
167+
with:
168+
image_name: "${{env.DEPS_IMAGE_NAME_PREFIX}}${{env.OS_NAME}}"
169+
docker_context: "components/core"
170+
docker_file: "components/core/tools/docker-images/clp-env-base-${{env.OS_NAME}}-x86_64\
171+
/Dockerfile"
172+
push_deps_image: >-
173+
${{github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}
174+
token: "${{secrets.GITHUB_TOKEN}}"
175+
124176
ubuntu-jammy-deps-image:
125177
name: "ubuntu-jammy-deps-image"
126178
if: "needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed == 'true'"
@@ -186,6 +238,86 @@ jobs:
186238
--build-dir /mnt/repo/components/core/build
187239
--num-jobs $(getconf _NPROCESSORS_ONLN)
188240
241+
manylinux_2_28-x86_64-binaries:
242+
# Run if the ancestor jobs succeeded OR they were skipped and clp was changed.
243+
if: >-
244+
success()
245+
|| (!cancelled() && !failure() && needs.filter-relevant-changes.outputs.clp_changed == 'true')
246+
needs:
247+
- "manylinux_2_28-x86_64-deps-image"
248+
- "filter-relevant-changes"
249+
strategy:
250+
matrix:
251+
use_shared_libs: [true, false]
252+
name: >-
253+
manylinux_2_28-x86_64-${{matrix.use_shared_libs == true && 'dynamic' || 'static'}}-linked-bins
254+
continue-on-error: true
255+
runs-on: "ubuntu-24.04"
256+
steps:
257+
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
258+
with:
259+
submodules: "recursive"
260+
261+
- name: "Work around actions/runner-images/issues/6775"
262+
run: "chown $(id -u):$(id -g) -R ."
263+
shell: "bash"
264+
265+
- uses: "./.github/actions/run-on-image"
266+
env:
267+
OS_NAME: "manylinux_2_28"
268+
with:
269+
image_name: "${{env.DEPS_IMAGE_NAME_PREFIX}}${{env.OS_NAME}}"
270+
use_published_image: >-
271+
${{needs.filter-relevant-changes.outputs.manylinux_2_28_x86_64_image_changed == 'false'
272+
|| (github.event_name != 'pull_request' && github.ref == 'refs/heads/main')}}
273+
run_command: >-
274+
CLP_CORE_MAX_PARALLELISM_PER_BUILD_TASK=$(getconf _NPROCESSORS_ONLN) task deps:core
275+
&& python3 /mnt/repo/components/core/tools/scripts/utils/build-and-run-unit-tests.py
276+
${{matrix.use_shared_libs == true && '--use-shared-libs' || ''}}
277+
--source-dir /mnt/repo/components/core
278+
--build-dir /mnt/repo/components/core/build
279+
--num-jobs $(getconf _NPROCESSORS_ONLN)
280+
281+
musllinux_1_2-x86_64-binaries:
282+
# Run if the ancestor jobs succeeded OR they were skipped and clp was changed.
283+
if: >-
284+
success()
285+
|| (!cancelled() && !failure() && needs.filter-relevant-changes.outputs.clp_changed == 'true')
286+
needs:
287+
- "musllinux_1_2-x86_64-deps-image"
288+
- "filter-relevant-changes"
289+
strategy:
290+
matrix:
291+
use_shared_libs: [true, false]
292+
name: >-
293+
musllinux_1_2-x86_64-${{matrix.use_shared_libs == true && 'dynamic' || 'static'}}-linked-bins
294+
continue-on-error: true
295+
runs-on: "ubuntu-24.04"
296+
steps:
297+
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
298+
with:
299+
submodules: "recursive"
300+
301+
- name: "Work around actions/runner-images/issues/6775"
302+
run: "chown $(id -u):$(id -g) -R ."
303+
shell: "bash"
304+
305+
- uses: "./.github/actions/run-on-image"
306+
env:
307+
OS_NAME: "musllinux_1_2"
308+
with:
309+
image_name: "${{env.DEPS_IMAGE_NAME_PREFIX}}${{env.OS_NAME}}"
310+
use_published_image: >-
311+
${{needs.filter-relevant-changes.outputs.musllinux_1_2_x86_64_image_changed == 'false'
312+
|| (github.event_name != 'pull_request' && github.ref == 'refs/heads/main')}}
313+
run_command: >-
314+
CLP_CORE_MAX_PARALLELISM_PER_BUILD_TASK=$(getconf _NPROCESSORS_ONLN) task deps:core
315+
&& python3 /mnt/repo/components/core/tools/scripts/utils/build-and-run-unit-tests.py
316+
${{matrix.use_shared_libs == true && '--use-shared-libs' || ''}}
317+
--source-dir /mnt/repo/components/core
318+
--build-dir /mnt/repo/components/core/build
319+
--num-jobs $(getconf _NPROCESSORS_ONLN)
320+
189321
ubuntu-jammy-binaries:
190322
# Run if the ancestor jobs succeeded OR they were skipped and clp was changed.
191323
if: >-
@@ -374,3 +506,42 @@ jobs:
374506
.task/checksum/utils-cpp-lint-clang-tidy-*
375507
build/lint-clang-tidy
376508
key: "${{steps.cache-restore-lint-check-cpp-static-full.outputs.cache-primary-key}}"
509+
510+
package-image:
511+
name: "package-image"
512+
if: >-
513+
!cancelled() && !failure() && (
514+
needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed == 'false' ||
515+
needs.ubuntu-jammy-deps-image.result == 'success'
516+
)
517+
needs:
518+
- "filter-relevant-changes"
519+
- "ubuntu-jammy-deps-image"
520+
runs-on: "ubuntu-24.04"
521+
steps:
522+
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
523+
with:
524+
submodules: "recursive"
525+
526+
- name: "Workaround actions/runner-images/issues/6775"
527+
shell: "bash"
528+
run: "chown $(id -u):$(id -g) -R ."
529+
530+
- name: "Build the package"
531+
uses: "./.github/actions/run-on-image"
532+
env:
533+
OS_NAME: "ubuntu-jammy"
534+
with:
535+
image_name: "${{env.DEPS_IMAGE_NAME_PREFIX}}${{env.OS_NAME}}"
536+
use_published_image: >-
537+
${{needs.filter-relevant-changes.outputs.ubuntu_jammy_image_changed == 'false'
538+
|| (github.event_name != 'pull_request' && github.ref == 'refs/heads/main')}}
539+
run_command: >-
540+
CLP_CORE_MAX_PARALLELISM_PER_BUILD_TASK=$(getconf _NPROCESSORS_ONLN) task package
541+
542+
- uses: "./.github/actions/clp-build-runtime-image"
543+
with:
544+
image_type: "package"
545+
image_registry: "ghcr.io"
546+
image_registry_username: "${{github.actor}}"
547+
image_registry_password: "${{secrets.GITHUB_TOKEN}}"

.github/workflows/clp-core-build-macos.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
strategy:
4646
matrix:
4747
os:
48+
- "macos-14"
4849
- "macos-15"
4950
use_shared_libs:
5051
- true
@@ -66,6 +67,12 @@ jobs:
6667
rm -f /usr/local/bin/pydoc3*
6768
rm -f /usr/local/bin/python3*
6869
70+
- name: "Remove preinstalled programs which will conflict with the pipx-installed packages"
71+
run: |
72+
if brew list --formula cmake >/dev/null 2>&1; then
73+
brew uninstall --force cmake
74+
fi
75+
6976
- name: "Install dependencies"
7077
run: "./components/core/tools/scripts/lib_install/macos/install-all.sh"
7178

0 commit comments

Comments
 (0)