build(gitea): reconstruct tests packaging images and release lanes (Refs #1)
This commit is contained in:
1 parent
21f0530b6c
commit
ad2a582b63
43 files changed
+10898
-646
No files matched your search
+15
-57
@@ -1,63 +1,21 @@
|
||||
# Build stage
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS build
|
||||
# CPU agent: use glibc for ONNX native dependencies. GPU variants need a
|
||||
# separately validated .NET/native-library runtime and are not published here.
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble@sha256:0d99ebf1ccad15037b5c98c9fe8979d6b8dbac23812feae2277a0b277b5c5ffa AS build
|
||||
WORKDIR /src
|
||||
|
||||
# Version injectée par la CI (GitVersion.Agent.yml) — ex. docker build --build-arg VERSION=1.0.0
|
||||
ARG VERSION=0.0.0-local
|
||||
|
||||
COPY *.slnx .
|
||||
COPY Directory.Build.props .
|
||||
COPY src/Heimdall.Domain.Primitives/*.csproj src/Heimdall.Domain.Primitives/
|
||||
COPY src/Heimdall.Domain/*.csproj src/Heimdall.Domain/
|
||||
COPY src/Heimdall.Application/*.csproj src/Heimdall.Application/
|
||||
COPY src/Heimdall.Infrastructure/*.csproj src/Heimdall.Infrastructure/
|
||||
COPY src/Heimdall.Agent/*.csproj src/Heimdall.Agent/
|
||||
|
||||
RUN dotnet restore src/Heimdall.Agent/Heimdall.Agent.csproj
|
||||
|
||||
COPY src/ src/
|
||||
|
||||
RUN dotnet publish src/Heimdall.Agent/Heimdall.Agent.csproj -c Release -o /app -p:Version=$VERSION
|
||||
|
||||
# Modèle YOLOv8n pré-converti en ONNX et committé dans le repo (voir models/)
|
||||
# (ultralytics ne distribue plus d'.onnx prêt ; torch/OpenCV s'installent mal en
|
||||
# CI — trop lent + deps libGL/libxcb absentes. On committe le .onnx une fois.)
|
||||
|
||||
# --- GPU Runtime variants (multi-arch, GPU-aware) ---
|
||||
# NVIDIA CUDA runtime (GPU acceleration for ONNX Runtime)
|
||||
FROM nvidia/cuda:12.6-runtime-ubuntu22.04 AS runtime-nvidia
|
||||
WORKDIR /app
|
||||
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/compat:$LD_LIBRARY_PATH
|
||||
|
||||
# AMD ROCm runtime (GPU acceleration for ONNX Runtime)
|
||||
FROM rocm/rocm-runtime:6.3.3-ubuntu22.04 AS runtime-amd
|
||||
WORKDIR /app
|
||||
ENV HSA_OVERRIDE_GFX_VERSION=10.3.0
|
||||
|
||||
# Intel VAAPI / iGPU runtime (GPU acceleration for ONNX Runtime via DirectML/OpenVINO)
|
||||
FROM intel/intel-extension-for-pytorch:2.3.0-ubuntu22.04 AS runtime-intel
|
||||
WORKDIR /app
|
||||
ENV LIBVA_DRIVER_NAME=iHD
|
||||
ENV LIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri
|
||||
|
||||
# CPU-only fallback (original alpine image)
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS runtime-cpu
|
||||
WORKDIR /app
|
||||
RUN apk add --no-cache icu-libs libstdc++ ffmpeg krb5 wget
|
||||
|
||||
# Select runtime based on build argument (default: cpu)
|
||||
ARG TARGET_RUNTIME=cpu
|
||||
FROM runtime-${TARGET_RUNTIME} AS runtime
|
||||
RUN test "$TARGET_RUNTIME" = cpu
|
||||
COPY global.json Directory.Build.props Directory.Build.targets ./
|
||||
COPY src/ ./src/
|
||||
RUN dotnet restore src/Heimdall.Agent/Heimdall.Agent.csproj --locked-mode
|
||||
RUN dotnet publish src/Heimdall.Agent/Heimdall.Agent.csproj -c Release --no-restore -o /out -p:Version=$VERSION -p:ContinuousIntegrationBuild=true
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble@sha256:d5633778c754e89a386882eddf8dbee6942447a8a4b8267c19cf1e1158d0b0ac
|
||||
WORKDIR /app
|
||||
|
||||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
|
||||
RUN apt-get update -qq && apt-get install -y --no-install-recommends ffmpeg wget libgomp1 tzdata && rm -rf /var/lib/apt/lists/*
|
||||
ENV ASPNETCORE_URLS=http://+:8080
|
||||
|
||||
COPY --from=build /app .
|
||||
# Modèle YOLOv8n ONNX committé dans le repo (contexte de build = racine repo)
|
||||
COPY models/yolov8n.onnx models/yolov8n.onnx
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/healthz || exit 1
|
||||
|
||||
COPY --from=build /out/ ./
|
||||
COPY models/yolov8n.onnx ./models/yolov8n.onnx
|
||||
EXPOSE 8080
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s CMD wget -q --spider http://localhost:8080/healthz || exit 1
|
||||
ENTRYPOINT ["dotnet", "Heimdall.Agent.dll"]
|
||||
Reference in new issue
Block a user