Push model to docker registry
ci/woodpecker/manual/e2e-convert-jetson Pipeline was successful
ci/woodpecker/manual/e2e-smoke-jetson Pipeline was successful

This commit is contained in:
Roman Meshko
2026-05-04 23:01:20 +03:00
parent a09c181b08
commit 9640d82908
3 changed files with 76 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
FROM alpine:3.20
COPY . /models/
CMD ["sh"]
+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
set -euo pipefail
COMPOSE="${COMPOSE:-docker compose -f docker-compose.test.yml --profile jetson}"
REGISTRY_HOST="${REGISTRY_HOST:?REGISTRY_HOST is required}"
ENGINE_REPOSITORY="${JETSON_ENGINE_REPOSITORY:-$REGISTRY_HOST/azaion/detections-jetson-engine}"
BRANCH="${CI_COMMIT_BRANCH:-local}"
ENGINE_TAG="${JETSON_ENGINE_TAG:-$(printf '%s' "$BRANCH" | tr -c 'A-Za-z0-9_.-' '-')}"
OUT_DIR="${JETSON_ENGINE_OUT_DIR:-results/jetson-engine}"
mkdir -p "$OUT_DIR/models"
loader_id="$($COMPOSE ps -q mock-loader)"
if [[ -z "$loader_id" ]]; then
echo "ERROR: mock-loader container is not running"
exit 1
fi
docker cp "$loader_id:/models/models/." "$OUT_DIR/models/"
find "$OUT_DIR/models" -maxdepth 1 -type f ! -name 'azaion*.engine' -delete
engine_count="$(find "$OUT_DIR/models" -maxdepth 1 -type f -name 'azaion*.engine' | wc -l | tr -d ' ')"
if [[ "$engine_count" == "0" ]]; then
echo "ERROR: no converted TensorRT engine found in mock-loader /models/models"
find "$OUT_DIR/models" -maxdepth 2 -type f -print
exit 1
fi
echo "--- Converted TensorRT engine files:"
find "$OUT_DIR/models" -maxdepth 1 -type f -name 'azaion*.engine' -print -exec ls -lh {} \;
image="$ENGINE_REPOSITORY:$ENGINE_TAG"
echo "--- Building Jetson engine artifact image: $image"
docker build -f engine-artifact.Dockerfile -t "$image" "$OUT_DIR/models"
docker push "$image"
if [[ -n "${CI_COMMIT_SHA:-}" ]]; then
sha_tag="$(printf '%s' "$CI_COMMIT_SHA" | cut -c1-12)"
docker tag "$image" "$ENGINE_REPOSITORY:$sha_tag"
docker push "$ENGINE_REPOSITORY:$sha_tag"
fi
echo "--- Published Jetson engine artifact image: $image"
+28
View File
@@ -0,0 +1,28 @@
#!/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}"
ENGINE_TAG="${JETSON_ENGINE_TAG:-$(printf '%s' "$BRANCH" | tr -c 'A-Za-z0-9_.-' '-')}"
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 {} \;