Skip to content
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

wasi ci #1296

Merged
merged 7 commits into from
Jan 3, 2025
Merged

wasi ci #1296

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .github/workflows/wasi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,17 @@ env:

jobs:
build-test:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- 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: '20'
node-version: '22'

- name: Install
uses: pnpm/action-setup@v4
Expand All @@ -40,8 +36,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
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const defaultImageTag = '20241231-76748372'
const defaultImageTag = '20250102-0d5dc250'
export default defaultImageTag
4 changes: 3 additions & 1 deletion src/docker/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/docker/itk-wasm-base/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 1 addition & 28 deletions src/docker/itk-wasm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
16 changes: 11 additions & 5 deletions src/docker/push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ for param; do
debug=false
elif [[ $param == '--push-manifest' ]]; then
push_manifest=true
exe="buildah"
else
newparams+=("$param")
fi
Expand All @@ -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
Expand All @@ -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
}
Expand Down
Loading