Skip to content

Commit f58c24a

Browse files
authored
Merge branch 'main' into ryan/streamtool
2 parents 72bd750 + 51b4cd7 commit f58c24a

File tree

4 files changed

+80
-1
lines changed

4 files changed

+80
-1
lines changed

Earthfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
#######################################################################
17+
# 🚨 DEPRECATION NOTICE 🚨
18+
#
19+
# This Earthfile is being replaced by docker
20+
# This file is kept temporarily for backward compatibility but will
21+
# be removed in a future release. Please migrate to the new system.
22+
#######################################################################
23+
1624
VERSION 0.8
1725

1826
############### ARTIFACTS TARGETS ##############################

deploy/cloud/operator/Dockerfile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Base stage - Common setup for all stages
5+
FROM golang:1.24 AS base
6+
7+
# Docker buildx automatically provides these
8+
ARG TARGETOS=linux
9+
ARG TARGETARCH=amd64
10+
11+
RUN echo "Building for ${TARGETOS}/${TARGETARCH}"
12+
13+
# Install common dependencies
14+
RUN apt-get update && apt-get install -y git && apt-get clean && rm -rf /var/lib/apt/lists/*
15+
16+
WORKDIR /workspace
17+
18+
# Copy go mod and sum files first for better layer caching
19+
COPY go.mod go.sum ./
20+
RUN go mod download
21+
22+
# Copy source code
23+
COPY . .
24+
25+
# Lint stage
26+
FROM base AS linter
27+
28+
# Install golangci-lint using go install (builds with current Go version)
29+
RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
30+
31+
# Run linting
32+
RUN golangci-lint run --timeout=5m
33+
34+
# Test stage
35+
FROM base AS tester
36+
37+
# Install make if not present
38+
RUN apt-get update && apt-get install -y make && apt-get clean && rm -rf /var/lib/apt/lists/*
39+
40+
# Run tests using Makefile
41+
RUN make test
42+
43+
# Build stage - depends on successful lint and test
44+
FROM base AS builder
45+
46+
# Build the binary
47+
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o manager ./cmd/main.go
48+
49+
# Runtime stage
50+
FROM nvcr.io/nvidia/distroless/go:v3.1.12
51+
WORKDIR /
52+
COPY --from=builder /workspace/manager .
53+
USER 65532:65532
54+
55+
ENTRYPOINT ["./manager"]

deploy/cloud/operator/Earthfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
#######################################################################
17+
# 🚨 DEPRECATION NOTICE 🚨
18+
#
19+
# This Earthfile for the operator is being replaced by docker
20+
# This file is kept temporarily for backward compatibility but will
21+
# be removed in a future release. Please migrate to the new system.
22+
#######################################################################
23+
1624
VERSION 0.8
1725

1826
# Base container for both build and test

docs/guides/dynamo_deploy/installation_guide.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,15 @@ export IMAGE_TAG=${RELEASE_VERSION}
100100

101101
# 2. Build operator
102102
cd deploy/cloud/operator
103-
earthly --push +docker --DOCKER_SERVER=$DOCKER_SERVER --IMAGE_TAG=$IMAGE_TAG
103+
104+
# 2.1 Alternative 1 : Build and push the operator image for multiple platforms
105+
docker buildx create --name multiplatform --driver docker-container --bootstrap
106+
docker buildx use multiplatform
107+
docker buildx build --platform linux/amd64,linux/arm64 -t $DOCKER_SERVER/dynamo-operator:$IMAGE_TAG --push .
108+
109+
# 2.2 Alternative 2 : Build and push the operator image for a single platform
110+
docker build -t $DOCKER_SERVER/dynamo-operator:$IMAGE_TAG . && docker push $DOCKER_SERVER/dynamo-operator:$IMAGE_TAG
111+
104112
cd -
105113

106114
# 3. Create namespace and secrets to be able to pull the operator image

0 commit comments

Comments
 (0)