Skip to content

Commit

Permalink
Merge pull request #1234 from thewtex/downsample-native
Browse files Browse the repository at this point in the history
build(downsample): add native pixi build-test configuration
  • Loading branch information
thewtex authored Sep 17, 2024
2 parents b31b8f9 + 787c8e0 commit a4062f3
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 30 deletions.
9 changes: 6 additions & 3 deletions itk_wasm_env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ export ITK_WASM_ITK_BUILD_DIR=${ITK_WASM_ITK_BUILD_DIR:-${ITK_WASM_NATIVE_WORKSP
mkdir -p ${ITK_WASM_ITK_BUILD_DIR} || die "Could not create ITK build directory"


export ITK_WASM_DICOM_TEST_DATA_HASH=${ITK_WASM_DICOM_TEST_DATA_HASH:-$(cat packages/dicom/package.json | jq -e -r '."itk-wasm"."test-data-hash"')}
export ITK_WASM_DICOM_TEST_DATA_URLS=${ITK_WASM_DICOM_TEST_DATA_URLS:-$(cat packages/dicom/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')}

export ITK_WASM_COMPARE_IMAGES_TEST_DATA_HASH=${ITK_WASM_COMPARE_IMAGES_TEST_DATA_HASH:-$(cat packages/compare-images/package.json | jq -e -r '."itk-wasm"."test-data-hash"')}
export ITK_WASM_COMPARE_IMAGES_TEST_DATA_URLS=${ITK_WASM_COMPARE_IMAGES_TEST_DATA_URLS:-$(cat packages/compare-images/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')}

Expand All @@ -37,5 +34,11 @@ export ITK_WASM_COMPARE_MESHES_TEST_DATA_URLS=${ITK_WASM_COMPARE_MESHES_TEST_DAT
export ITK_WASM_COMPRESS_STRINGIFY_TEST_DATA_HASH=${ITK_WASM_COMPRESS_STRINGIFY_TEST_DATA_HASH:-$(cat packages/compress-stringify/package.json | jq -e -r '."itk-wasm"."test-data-hash"')}
export ITK_WASM_COMPRESS_STRINGIFY_TEST_DATA_URLS=${ITK_WASM_COMPRESS_STRINGIFY_TEST_DATA_URLS:-$(cat packages/compress-stringify/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')}

export ITK_WASM_DICOM_TEST_DATA_HASH=${ITK_WASM_DICOM_TEST_DATA_HASH:-$(cat packages/dicom/package.json | jq -e -r '."itk-wasm"."test-data-hash"')}
export ITK_WASM_DICOM_TEST_DATA_URLS=${ITK_WASM_DICOM_TEST_DATA_URLS:-$(cat packages/dicom/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')}

export ITK_WASM_DOWNSAMPLE_TEST_DATA_HASH=${ITK_WASM_DOWNSAMPLE_TEST_DATA_HASH:-$(cat packages/downsample/package.json | jq -e -r '."itk-wasm"."test-data-hash"')}
export ITK_WASM_DOWNSAMPLE_TEST_DATA_URLS=${ITK_WASM_DOWNSAMPLE_TEST_DATA_URLS:-$(cat packages/downsample/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')}

export ITK_WASM_MESH_IO_TEST_DATA_HASH=${ITK_WASM_MESH_IO_TEST_DATA_HASH:-$(cat packages/mesh-io/package.json | jq -e -r '."itk-wasm"."test-data-hash"')}
export ITK_WASM_MESH_IO_TEST_DATA_URLS=${ITK_WASM_MESH_IO_TEST_DATA_URLS:-$(cat packages/mesh-io/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')}
5 changes: 5 additions & 0 deletions packages/downsample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"itk-wasm": {
"emscripten-docker-image": "itkwasm/emscripten:latest",
"wasi-docker-image": "itkwasm/wasi:latest",
"test-data-hash": "bafkreic7utwwa32sc7ekhouzdlnla4kffytphcwc7qwam5ndhixwjulydq",
"test-data-urls": [
"https://github.com/InsightSoftwareConsortium/ITK-Wasm/releases/download/itk-wasm-v1.0.0-b.163/itkwasm-downsample-test-data.tar.gz https://w3s.link/ipfs/bafybeifwebok64osjl2i3zc6rkn3izgon333wsjotqzqlxorkkvrbldjcy/data.tar.gz",
"https://w3s.link/ipfs/bafybeifwebok64osjl2i3zc6rkn3izgon333wsjotqzqlxorkkvrbldjcy/data.tar.gz"
],
"typescript-package-name": "@itk-wasm/downsample",
"python-package-name": "itkwasm-downsample",
"package-description": "Pipelines for downsampling images.",
Expand Down
81 changes: 54 additions & 27 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ scripts = ["itk_wasm_env.bash"]
clean = "git clean -fdx"
pnpm-install = { cmd = "pnpm install", description = "Install Node.js dependencies" }

[tasks.dicom-test-data-download]
cmd = "npx dam download test/data test/data.tar.gz $ITK_WASM_DICOM_TEST_DATA_HASH $ITK_WASM_DICOM_TEST_DATA_URLS"
cwd = "packages/dicom"
depends-on = ["pnpm-install"]
outputs = ["packages/dicom/test/data.tar.gz"]
description = "Download DICOM test data"

[tasks.compare-images-test-data-download]
cmd = "npx dam download test/data test/data.tar.gz $ITK_WASM_COMPARE_IMAGES_TEST_DATA_HASH $ITK_WASM_COMPARE_IMAGES_TEST_DATA_URLS"
cwd = "packages/compare-images"
Expand All @@ -43,6 +36,20 @@ depends-on = ["pnpm-install"]
outputs = ["packages/compress-stringify/test/data.tar.gz"]
description = "Download compress-stringify test data"

[tasks.dicom-test-data-download]
cmd = "npx dam download test/data test/data.tar.gz $ITK_WASM_DICOM_TEST_DATA_HASH $ITK_WASM_DICOM_TEST_DATA_URLS"
cwd = "packages/dicom"
depends-on = ["pnpm-install"]
outputs = ["packages/dicom/test/data.tar.gz"]
description = "Download DICOM test data"

[tasks.downsample-test-data-download]
cmd = "npx dam download test/data test/data.tar.gz $ITK_WASM_DOWNSAMPLE_TEST_DATA_HASH $ITK_WASM_DOWNSAMPLE_TEST_DATA_URLS"
cwd = "packages/downsample"
depends-on = ["pnpm-install"]
outputs = ["packages/downsample/test/data.tar.gz"]
description = "Download downsample test data"

[tasks.mesh-io-test-data-download]
cmd = "npx dam download test/data test/data.tar.gz $ITK_WASM_MESH_IO_TEST_DATA_HASH $ITK_WASM_MESH_IO_TEST_DATA_URLS"
cwd = "packages/mesh-io"
Expand Down Expand Up @@ -162,26 +169,6 @@ cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/ITK-Wasm-build"
depends-on = ["build-itk-wasm"]
description = "Test ITK-Wasm"

[feature.native.tasks.configure-native-dicom]
cmd = '''cmake -B$ITK_WASM_NATIVE_WORKSPACE/dicom-build -Spackages/dicom -GNinja
-DITK_DIR:PATH=$ITK_WASM_ITK_BUILD_DIR
-DBUILD_TESTING:BOOL=ON
-DCMAKE_CXX_STANDARD:STRING=20
-DCMAKE_BUILD_TYPE:STRING=Debug'''
depends-on = ["build-itk-wasm", "dicom-test-data-download"]
outputs = ["native/dicom-build/CMakeFiles/"]
description = "Configure dicom native binaries"

[feature.native.tasks.build-native-dicom]
cmd = "cmake --build $ITK_WASM_NATIVE_WORKSPACE/dicom-build"
depends-on = ["configure-native-dicom"]
description = "Build dicom native binaries"

[feature.native.tasks.test-native-dicom]
cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/dicom-build"
depends-on = ["build-native-dicom"]
description = "Test dicom native binaries"

[feature.native.tasks.configure-native-compare-images]
cmd = '''cmake -B$ITK_WASM_NATIVE_WORKSPACE/compare-images-build -Spackages/compare-images -GNinja
-DITK_DIR:PATH=$ITK_WASM_ITK_BUILD_DIR
Expand Down Expand Up @@ -242,6 +229,46 @@ cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/compress-stringify-build"
depends-on = ["build-native-compress-stringify"]
description = "Test compress-stringify native binaries"

[feature.native.tasks.configure-native-dicom]
cmd = '''cmake -B$ITK_WASM_NATIVE_WORKSPACE/dicom-build -Spackages/dicom -GNinja
-DITK_DIR:PATH=$ITK_WASM_ITK_BUILD_DIR
-DBUILD_TESTING:BOOL=ON
-DCMAKE_CXX_STANDARD:STRING=20
-DCMAKE_BUILD_TYPE:STRING=Debug'''
depends-on = ["build-itk-wasm", "dicom-test-data-download"]
outputs = ["native/dicom-build/CMakeFiles/"]
description = "Configure dicom native binaries"

[feature.native.tasks.build-native-dicom]
cmd = "cmake --build $ITK_WASM_NATIVE_WORKSPACE/dicom-build"
depends-on = ["configure-native-dicom"]
description = "Build dicom native binaries"

[feature.native.tasks.test-native-dicom]
cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/dicom-build"
depends-on = ["build-native-dicom"]
description = "Test dicom native binaries"

[feature.native.tasks.configure-native-downsample]
cmd = '''cmake -B$ITK_WASM_NATIVE_WORKSPACE/downsample-build -Spackages/downsample -GNinja
-DITK_DIR:PATH=$ITK_WASM_ITK_BUILD_DIR
-DBUILD_TESTING:BOOL=ON
-DCMAKE_CXX_STANDARD:STRING=20
-DCMAKE_BUILD_TYPE:STRING=Debug'''
depends-on = ["build-itk-wasm", "downsample-test-data-download"]
outputs = ["native/downsample-build/CMakeFiles/"]
description = "Configure downsample native binaries"

[feature.native.tasks.build-native-downsample]
cmd = "cmake --build $ITK_WASM_NATIVE_WORKSPACE/downsample-build"
depends-on = ["configure-native-downsample"]
description = "Build downsample native binaries"

[feature.native.tasks.test-native-downsample]
cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/downsample-build"
depends-on = ["build-native-downsample"]
description = "Test downsample native binaries"

[feature.native.tasks.configure-native-mesh-io]
cmd = '''cmake -B$ITK_WASM_NATIVE_WORKSPACE/mesh-io-build -Spackages/mesh-io -GNinja
-DITK_DIR:PATH=$ITK_WASM_ITK_BUILD_DIR
Expand Down

0 comments on commit a4062f3

Please sign in to comment.