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,13 +108,16 @@ runs: ...@@ -108,13 +108,16 @@ runs:
# Collect optional overrides provided by the workflow # Collect optional overrides provided by the workflow
# Set base cache args and set --cache-to if this is a main commit # 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=""
if [[ "${{ inputs.target }}" != "frontend" ]]; then
EXTRA_ARGS="--cache-to type=inline " 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:${{ 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##*/} " 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 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 " EXTRA_ARGS+="--cache-to type=registry,ref=${ECR_HOSTNAME}/ai-dynamo/dynamo:${{ inputs.framework }}-cuda${CUDA_VERSION_MAJOR}-${PLATFORM##*/}-cache,mode=max "
fi fi
fi
echo "$EXTRA_ARGS" echo "$EXTRA_ARGS"
# Collect optional overrides provided by the workflow # Collect optional overrides provided by the workflow
......
...@@ -8,6 +8,7 @@ on: ...@@ -8,6 +8,7 @@ on:
branches: branches:
- main - main
- release/*.*.* - release/*.*.*
- "pull-request/[0-9]+"
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref_name == 'main' && github.run_id || github.ref_name }} group: ${{ github.workflow }}-${{ github.ref_name == 'main' && github.run_id || github.ref_name }}
......
...@@ -17,13 +17,14 @@ ...@@ -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 # 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 DOCKER_PROXY
ARG BASE_IMAGE=ubuntu:22.04 ARG BUILDER_IMAGE="golang:1.24"
ARG BASE_IMAGE="ubuntu:22.04"
############################ ############################
# Builder # Builder
############################ ############################
FROM ${BUILDER_IMAGE} AS builder FROM ${DOCKER_PROXY}${BUILDER_IMAGE} AS builder
ENV CGO_ENABLED=1 ENV CGO_ENABLED=1
# be explicit; helps cgo when linking libstdc++ # be explicit; helps cgo when linking libstdc++
...@@ -66,7 +67,7 @@ RUN go build \ ...@@ -66,7 +67,7 @@ RUN go build \
############################ ############################
# Runtime # Runtime
############################ ############################
FROM ${BASE_IMAGE} AS runtime FROM ${DOCKER_PROXY}${BASE_IMAGE} AS runtime
ARG DYNAMO_COMMIT_SHA ARG DYNAMO_COMMIT_SHA
ENV DYNAMO_COMMIT_SHA=$DYNAMO_COMMIT_SHA ENV DYNAMO_COMMIT_SHA=$DYNAMO_COMMIT_SHA
......
...@@ -997,6 +997,12 @@ if [[ ${TARGET^^} == "FRONTEND" ]]; then ...@@ -997,6 +997,12 @@ if [[ ${TARGET^^} == "FRONTEND" ]]; then
export GAIE_DIR="${GAIE_CLONE_DIR}" export GAIE_DIR="${GAIE_CLONE_DIR}"
export DYNAMO_DIR="${BUILD_CONTEXT}" 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 $RUN_PREFIX bash ${DYNAMO_DIR}/deploy/inference-gateway/build-epp-dynamo.sh
# Set EPP image tag (matches what build-epp-dynamo.sh produces) # Set EPP image tag (matches what build-epp-dynamo.sh produces)
......
...@@ -97,6 +97,14 @@ fi ...@@ -97,6 +97,14 @@ fi
# Step 6: Build the EPP image # Step 6: Build the EPP image
echo "Building the custom EPP image for GAIE..." 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" echo "EPP image with Dynamo KV routing built"
...@@ -41,7 +41,7 @@ diff --git a/Makefile b/Makefile ...@@ -41,7 +41,7 @@ diff --git a/Makefile b/Makefile
index dee7e99..d3f9ec7 100644 index dee7e99..d3f9ec7 100644
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -170,6 +170,48 @@ verify-all: @@ -170,6 +170,49 @@ verify-all:
##@ Build ##@ Build
...@@ -67,6 +67,7 @@ index dee7e99..d3f9ec7 100644 ...@@ -67,6 +67,7 @@ index dee7e99..d3f9ec7 100644
+dynamo-image-build: ## Build the Dynamo EPP image using Docker Buildx with CGO support. +dynamo-image-build: ## Build the Dynamo EPP image using Docker Buildx with CGO support.
+ $(IMAGE_BUILD_CMD) -f Dockerfile.dynamo -t $(IMAGE_TAG) \ + $(IMAGE_BUILD_CMD) -f Dockerfile.dynamo -t $(IMAGE_TAG) \
+ --platform=$(PLATFORMS) \ + --platform=$(PLATFORMS) \
+ --build-arg DOCKER_PROXY=$(DOCKER_PROXY) \
+ --build-arg BASE_IMAGE=ubuntu:24.04 \ + --build-arg BASE_IMAGE=ubuntu:24.04 \
+ --build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \ + --build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \
+ --build-arg COMMIT_SHA=${GIT_COMMIT_SHA} \ + --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