From e0dd0f1d3feb74ea70c9e08b65b6283f3f2fe77b Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 31 Dec 2024 18:21:00 -0500 Subject: [PATCH 1/7] ci(wasi): build sequencially Avoid running out of memory (?) in the GitHub Action runner. --- .github/workflows/wasi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wasi.yml b/.github/workflows/wasi.yml index 6f6253ba7..5185def63 100644 --- a/.github/workflows/wasi.yml +++ b/.github/workflows/wasi.yml @@ -40,8 +40,8 @@ jobs: - name: Build run: | - pnpm run --aggregate-output build:wasi:debug + pnpm run --sequential --aggregate-output build:wasi:debug - name: Test run: | - pnpm run --aggregate-output test:wasi + pnpm run --sequential --aggregate-output test:wasi From 3214b49a23b7d040a6c62ab01e864229da2e079e Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 31 Dec 2024 18:21:47 -0500 Subject: [PATCH 2/7] ci(wasi): bump node version to 22 --- .github/workflows/wasi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wasi.yml b/.github/workflows/wasi.yml index 5185def63..c4b8e3850 100644 --- a/.github/workflows/wasi.yml +++ b/.github/workflows/wasi.yml @@ -31,7 +31,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: '20' + node-version: '22' - name: Install uses: pnpm/action-setup@v4 From dc82fa290df503f6899f761a9e8d84dbf562dfac Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 31 Dec 2024 18:22:02 -0500 Subject: [PATCH 3/7] ci(wasi): bump runner to ubuntu-24.04 --- .github/workflows/wasi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wasi.yml b/.github/workflows/wasi.yml index c4b8e3850..9b6cf0cee 100644 --- a/.github/workflows/wasi.yml +++ b/.github/workflows/wasi.yml @@ -17,7 +17,7 @@ env: jobs: build-test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 From 709ec1dda0b5059d7a0d38fc3bd97752fd9e40fc Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 2 Jan 2025 09:07:45 -0500 Subject: [PATCH 4/7] ci(wasi): do not explicitly pull docker images We do need the debug images for the debug builds. We do not want the emscripten images to save disk space. --- .github/workflows/wasi.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/wasi.yml b/.github/workflows/wasi.yml index 9b6cf0cee..d85b956e2 100644 --- a/.github/workflows/wasi.yml +++ b/.github/workflows/wasi.yml @@ -25,10 +25,6 @@ jobs: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main - - name: Pull latest Docker images - run: | - ./src/docker/pull.sh --no-debug - - uses: actions/setup-node@v4 with: node-version: '22' From 5540a61d1babff02201504e43155a167d614b3e5 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 2 Jan 2025 15:48:28 -0500 Subject: [PATCH 5/7] build(docker): use manifest-tool with docker Instead of `buildah manifest`, which is throwing weird errors most of the time stating that reference hashes are not found. --- src/docker/RELEASE.md | 4 +++- src/docker/itk-wasm-base/build.sh | 2 -- src/docker/itk-wasm/build.sh | 29 +---------------------------- src/docker/push.sh | 16 +++++++++++----- 4 files changed, 15 insertions(+), 36 deletions(-) diff --git a/src/docker/RELEASE.md b/src/docker/RELEASE.md index c60c995f6..ab730f81e 100644 --- a/src/docker/RELEASE.md +++ b/src/docker/RELEASE.md @@ -10,7 +10,9 @@ pixi run build-docker-images --with-debug ./src/docker/push.sh # on a linux arm64 system -pixi run build-docker-images --with-debug --multiarch +export OCI_EXE=docker +pixi run build-docker-images --with-debug +# requires manifest-tool, see https://github.com/estesp/manifest-tool/releases/ ./src/docker/push.sh --push-manifest pnpm build && pnpm test diff --git a/src/docker/itk-wasm-base/build.sh b/src/docker/itk-wasm-base/build.sh index 2eb7b3e36..6342b12f7 100755 --- a/src/docker/itk-wasm-base/build.sh +++ b/src/docker/itk-wasm-base/build.sh @@ -22,8 +22,6 @@ for param; do debug=true elif [[ $param == '--with-wasi' ]]; then wasi=true - elif [[ $param == '--multiarch' ]]; then - echo "Multiarch not supported" elif [[ $param == '--version-tag' ]]; then version_tag=true else diff --git a/src/docker/itk-wasm/build.sh b/src/docker/itk-wasm/build.sh index 0ee02078d..22b0be89b 100755 --- a/src/docker/itk-wasm/build.sh +++ b/src/docker/itk-wasm/build.sh @@ -27,14 +27,11 @@ version_tag=false build_cmd="build" tag_flag="--tag" host_arch=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') -create_manifest=false for param; do if [[ $param == '--with-debug' ]]; then debug=true elif [[ $param == '--with-wasi' ]]; then wasi=true - elif [[ $param == '--multiarch' ]]; then - create_manifest=true elif [[ $param == '--version-tag' ]]; then version_tag=true else @@ -139,28 +136,4 @@ if $debug; then fi -rm -rf ITKWebAssemblyInterfaceModuleCopy median-filter-pipelineCopy - -if $create_manifest; then - for list in quay.io/itkwasm/emscripten:latest \ - quay.io/itkwasm/emscripten:${TAG} \ - quay.io/itkwasm/emscripten:latest-debug \ - quay.io/itkwasm/emscripten:${TAG}-debug \ - quay.io/itkwasm/wasi:latest \ - quay.io/itkwasm/wasi:${TAG} \ - quay.io/itkwasm/wasi:latest-debug \ - quay.io/itkwasm/wasi:${TAG}-debug; do - if [ "$(buildah images -q $list 2>/dev/null)" != "" ]; then - if ! $(buildah manifest exists $list); then - buildah rmi $list - fi - fi - if $(buildah manifest exists $list); then - buildah manifest rm $list - fi - buildah manifest create $list - buildah manifest add ${list} ${list}-amd64 - buildah pull $list-arm64 - buildah manifest add ${list} ${list}-arm64 - done -fi +rm -rf ITKWebAssemblyInterfaceModuleCopy median-filter-pipelineCopy \ No newline at end of file diff --git a/src/docker/push.sh b/src/docker/push.sh index 6ca9892b5..d7c2eca33 100755 --- a/src/docker/push.sh +++ b/src/docker/push.sh @@ -13,7 +13,6 @@ for param; do debug=false elif [[ $param == '--push-manifest' ]]; then push_manifest=true - exe="buildah" else newparams+=("$param") fi @@ -22,6 +21,7 @@ set -- "${newparams[@]}" # overwrites the original positional params TAG=$(date '+%Y%m%d')-$(git rev-parse --short HEAD) host_arch=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/') +other_arch=$(if [ "$host_arch" == "amd64" ]; then echo "arm64"; else echo "amd64"; fi) if test ! -z ${DOCKERHUB_ITKWasm_PASSWORD+x}; then echo $DOCKERHUB_ITKWasm_PASSWORD | $exe login --username "$DOCKERHUB_ITKWasm_USERNAME" --password-stdin @@ -35,20 +35,26 @@ function push_image() { $exe tag quay.io/${image}:${tag}-${host_arch} docker.io/${image}:${tag}-${host_arch} $exe push docker.io/${image}:${tag}-${host_arch} $exe push quay.io/${image}:${tag}-${host_arch} + if $push_manifest; then + $exe pull quay.io/${image}:${tag}-${other_arch} + fi if $debug; then $exe tag quay.io/${image}:${tag}-debug-${host_arch} docker.io/${image}:${tag}-debug-${host_arch} $exe push docker.io/${image}:${tag}-debug-${host_arch} $exe push quay.io/${image}:${tag}-debug-${host_arch} + if $push_manifest; then + $exe pull quay.io/${image}:${tag}-debug-${other_arch} + fi fi if $push_manifest; then - $exe manifest push --all --format v2s2 quay.io/${image}:${tag} docker://docker.io/${image}:${tag} - $exe manifest push --all --format v2s2 quay.io/${image}:${tag} docker://quay.io/${image}:${tag} + manifest-tool push from-args --platforms linux/amd64,linux/arm64 --template quay.io/${image}:${tag}-ARCH --target quay.io/${image}:${tag} + manifest-tool push from-args --platforms linux/amd64,linux/arm64 --template docker.io/${image}:${tag}-ARCH --target docker.io/${image}:${tag} if $debug; then - $exe manifest push --all --format v2s2 quay.io/${image}:${tag}-debug docker://docker.io/${image}:${tag}-debug - $exe manifest push --all --format v2s2 quay.io/${image}:${tag}-debug docker://quay.io/${image}:${tag}-debug + manifest-tool push from-args --platforms linux/amd64,linux/arm64 --template quay.io/${image}:${tag}-debug-ARCH --target quay.io/${image}:${tag}-debug + manifest-tool push from-args --platforms linux/amd64,linux/arm64 --template docker.io/${image}:${tag}-debug-ARCH --target docker.io/${image}:${tag}-debug fi fi } From 0d5dc250247c90418467677b081201667ec851ae Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 2 Jan 2025 16:09:03 -0500 Subject: [PATCH 6/7] feat(itk-wasm-cli): Update default Docker image for 20250102-709ec1dd --- packages/core/typescript/itk-wasm/src/cli/default-image-tag.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/typescript/itk-wasm/src/cli/default-image-tag.js b/packages/core/typescript/itk-wasm/src/cli/default-image-tag.js index 549ad65a1..27d202dfc 100644 --- a/packages/core/typescript/itk-wasm/src/cli/default-image-tag.js +++ b/packages/core/typescript/itk-wasm/src/cli/default-image-tag.js @@ -1,2 +1,2 @@ -const defaultImageTag = '20241231-76748372' +const defaultImageTag = '20250102-709ec1dd' export default defaultImageTag From cb036a6445f6a08eaa963736f5596624ca532fb5 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 2 Jan 2025 22:06:04 -0500 Subject: [PATCH 7/7] feat(itk-wasm-cli): Update default Docker image for 20250102-0d5dc250 --- packages/core/typescript/itk-wasm/src/cli/default-image-tag.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/typescript/itk-wasm/src/cli/default-image-tag.js b/packages/core/typescript/itk-wasm/src/cli/default-image-tag.js index 27d202dfc..5c364ca58 100644 --- a/packages/core/typescript/itk-wasm/src/cli/default-image-tag.js +++ b/packages/core/typescript/itk-wasm/src/cli/default-image-tag.js @@ -1,2 +1,2 @@ -const defaultImageTag = '20250102-709ec1dd' +const defaultImageTag = '20250102-0d5dc250' export default defaultImageTag