mirror of
https://github.com/azaion/detections.git
synced 2026-06-21 16:51:09 +00:00
31 lines
1.0 KiB
Bash
31 lines
1.0 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [[ -z "${REGISTRY_HOST:-}" ]]; then
|
|
echo "--- REGISTRY_HOST is not set; skipping Jetson engine artifact pull"
|
|
exit 0
|
|
fi
|
|
|
|
ENGINE_REPOSITORY="${JETSON_ENGINE_REPOSITORY:-$REGISTRY_HOST/azaion/detections-jetson-engine}"
|
|
BRANCH="${CI_COMMIT_BRANCH:-local}"
|
|
default_tag="$(printf '%s' "$BRANCH" | sed 's#^refs/heads/##; s#^refs/tags/##; s#[^A-Za-z0-9_.-]#-#g; s#^-*##; s#-*$##')"
|
|
default_tag="${default_tag:-local}"
|
|
ENGINE_TAG="${JETSON_ENGINE_TAG:-$default_tag}"
|
|
TARGET_DIR="${JETSON_ENGINE_TARGET_DIR:-fixtures/models}"
|
|
image="$ENGINE_REPOSITORY:$ENGINE_TAG"
|
|
|
|
echo "--- Pulling Jetson engine artifact image: $image"
|
|
if ! docker pull "$image"; then
|
|
echo "--- Jetson engine artifact image not found; smoke will use ONNX fallback"
|
|
exit 0
|
|
fi
|
|
|
|
cid="$(docker create "$image")"
|
|
trap 'docker rm -f "$cid" >/dev/null 2>&1 || true' EXIT
|
|
|
|
mkdir -p "$TARGET_DIR"
|
|
docker cp "$cid:/models/." "$TARGET_DIR/"
|
|
|
|
echo "--- Installed Jetson engine files:"
|
|
find "$TARGET_DIR" -maxdepth 1 -type f -name 'azaion*.engine' -print -exec ls -lh {} \;
|