Unverified Commit dfc0377a authored by Tushar Sharma's avatar Tushar Sharma Committed by GitHub
Browse files

build: disable cache export for frontend build in ci (#5365)


Signed-off-by: default avatarTushar Sharma <tusharma@nvidia.com>
Signed-off-by: default avatarDillon Cullinan <dcullinan92@gmail.com>
Co-authored-by: default avatarDillon Cullinan <dcullinan92@gmail.com>
parent a713270c
......@@ -108,12 +108,15 @@ runs:
# Collect optional overrides provided by the workflow
# Set base cache args and set --cache-to if this is a main commit
# TODO: Fix this - Skip cache for frontend target - a different docker driver is used for the EPP build, which causes issues with cache export
EXTRA_ARGS=""
EXTRA_ARGS="--cache-to type=inline "
EXTRA_ARGS+="--cache-from type=registry,ref=${ECR_HOSTNAME}/ai-dynamo/dynamo:${{ inputs.framework }}-cuda${CUDA_VERSION_MAJOR}-${PLATFORM##*/}-cache "
EXTRA_ARGS+="--cache-from type=registry,ref=${ECR_HOSTNAME}/ai-dynamo/dynamo:main-${{ inputs.framework }}-cuda${CUDA_VERSION_MAJOR}-${PLATFORM##*/} "
if [[ "$GITHUB_REF_NAME" == "main" ]]; then
EXTRA_ARGS+="--cache-to type=registry,ref=${ECR_HOSTNAME}/ai-dynamo/dynamo:${{ inputs.framework }}-cuda${CUDA_VERSION_MAJOR}-${PLATFORM##*/}-cache,mode=max "
if [[ "${{ inputs.target }}" != "frontend" ]]; then
EXTRA_ARGS="--cache-to type=inline "
EXTRA_ARGS+="--cache-from type=registry,ref=${ECR_HOSTNAME}/ai-dynamo/dynamo:${{ inputs.framework }}-cuda${CUDA_VERSION_MAJOR}-${PLATFORM##*/}-cache "
EXTRA_ARGS+="--cache-from type=registry,ref=${ECR_HOSTNAME}/ai-dynamo/dynamo:main-${{ inputs.framework }}-cuda${CUDA_VERSION_MAJOR}-${PLATFORM##*/} "
if [[ "$GITHUB_REF_NAME" == "main" ]]; then
EXTRA_ARGS+="--cache-to type=registry,ref=${ECR_HOSTNAME}/ai-dynamo/dynamo:${{ inputs.framework }}-cuda${CUDA_VERSION_MAJOR}-${PLATFORM##*/}-cache,mode=max "
fi
fi
echo "$EXTRA_ARGS"
......
......@@ -8,6 +8,7 @@ on:
branches:
- main
- release/*.*.*
- "pull-request/[0-9]+"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name == 'main' && github.run_id || github.ref_name }}
......
......@@ -17,13 +17,14 @@
# Dockerfile.epp - Custom Dockerfile for GAIE EPP. This is to be used with the deploy/inference-gateway/build-epp-dynamo.sh
ARG BUILDER_IMAGE=golang:1.24
ARG BASE_IMAGE=ubuntu:22.04
ARG DOCKER_PROXY
ARG BUILDER_IMAGE="golang:1.24"
ARG BASE_IMAGE="ubuntu:22.04"
############################
# Builder
############################
FROM ${BUILDER_IMAGE} AS builder
FROM ${DOCKER_PROXY}${BUILDER_IMAGE} AS builder
ENV CGO_ENABLED=1
# be explicit; helps cgo when linking libstdc++
......@@ -66,7 +67,7 @@ RUN go build \
############################
# Runtime
############################
FROM ${BASE_IMAGE} AS runtime
FROM ${DOCKER_PROXY}${BASE_IMAGE} AS runtime
ARG DYNAMO_COMMIT_SHA
ENV DYNAMO_COMMIT_SHA=$DYNAMO_COMMIT_SHA
......
......@@ -997,6 +997,12 @@ if [[ ${TARGET^^} == "FRONTEND" ]]; then
export GAIE_DIR="${GAIE_CLONE_DIR}"
export DYNAMO_DIR="${BUILD_CONTEXT}"
# Set DOCKER_PROXY from ECR_HOSTNAME if available (for pulling base images through proxy)
if [[ -n "${ECR_HOSTNAME}" ]]; then
export DOCKER_PROXY="${ECR_HOSTNAME}/dockerhub/"
echo "Using DOCKER_PROXY: ${DOCKER_PROXY}"
fi
$RUN_PREFIX bash ${DYNAMO_DIR}/deploy/inference-gateway/build-epp-dynamo.sh
# Set EPP image tag (matches what build-epp-dynamo.sh produces)
......
......@@ -97,6 +97,14 @@ fi
# Step 6: Build the EPP image
echo "Building the custom EPP image for GAIE..."
make dynamo-image-local-load
# Build make args - pass DOCKER_PROXY if set (e.g., from ECR_HOSTNAME)
MAKE_ARGS=""
if [[ -n "${DOCKER_PROXY}" ]]; then
echo "Using DOCKER_PROXY: ${DOCKER_PROXY}"
MAKE_ARGS+="DOCKER_PROXY=${DOCKER_PROXY} "
fi
make ${MAKE_ARGS} dynamo-image-local-load
echo "EPP image with Dynamo KV routing built"
......@@ -41,7 +41,7 @@ diff --git a/Makefile b/Makefile
index dee7e99..d3f9ec7 100644
--- a/Makefile
+++ b/Makefile
@@ -170,6 +170,48 @@ verify-all:
@@ -170,6 +170,49 @@ verify-all:
##@ Build
......@@ -67,6 +67,7 @@ index dee7e99..d3f9ec7 100644
+dynamo-image-build: ## Build the Dynamo EPP image using Docker Buildx with CGO support.
+ $(IMAGE_BUILD_CMD) -f Dockerfile.dynamo -t $(IMAGE_TAG) \
+ --platform=$(PLATFORMS) \
+ --build-arg DOCKER_PROXY=$(DOCKER_PROXY) \
+ --build-arg BASE_IMAGE=ubuntu:24.04 \
+ --build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \
+ --build-arg COMMIT_SHA=${GIT_COMMIT_SHA} \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment