-
Notifications
You must be signed in to change notification settings - Fork 881
feat: replace Earthly #2154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: replace Earthly #2154
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e84283b
feat: replace Earthly
julienmancuso 9102535
feat: replace earthly
julienmancuso ae867ca
feat: replace earthly
julienmancuso 4e1afb4
feat: replace earthly
julienmancuso cb14fd7
feat: replace earthly
julienmancuso 8ac3538
feat: replace earthly
julienmancuso 363fd8c
Merge branch 'main' into jsm/dep-20
julienmancuso f9c6424
Merge branch 'main' into jsm/dep-20
julienmancuso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
feat: replace Earthly
- Loading branch information
commit e84283bb1983a782b93d38d9f666d136464872f6
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,177 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # Variables | ||
julienmancuso marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| DOCKER_SERVER ?= my-registry | ||
| IMAGE_TAG ?= latest | ||
| RUST_TARGET_DIR ?= target | ||
| PYTHON_VERSION ?= 3.12 | ||
|
|
||
| # Docker image names | ||
| DYNAMO_BASE_IMAGE ?= $(DOCKER_SERVER)/dynamo-base:$(IMAGE_TAG) | ||
| DYNAMO_OPERATOR_IMAGE ?= $(DOCKER_SERVER)/dynamo-operator:$(IMAGE_TAG) | ||
|
|
||
| .PHONY: help | ||
| help: ## Display this help message | ||
| @echo "Available targets:" | ||
| @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST) | ||
|
|
||
| ##@ Development | ||
| .PHONY: clean | ||
| clean: ## Clean build artifacts | ||
| cargo clean | ||
| rm -rf dist/ | ||
| rm -rf lib/bindings/python/dist/ | ||
| find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true | ||
| find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true | ||
|
|
||
| .PHONY: install-deps | ||
| install-deps: ## Install development dependencies | ||
| @echo "Installing Rust toolchain..." | ||
| @if ! command -v rustup >/dev/null 2>&1; then \ | ||
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; \ | ||
| source $$HOME/.cargo/env; \ | ||
| fi | ||
| @echo "Installing UV..." | ||
| @if ! command -v uv >/dev/null 2>&1; then \ | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh; \ | ||
| fi | ||
|
|
||
| ##@ Build | ||
| .PHONY: build-rust | ||
| build-rust: ## Build Rust components | ||
| @echo "Building Rust components..." | ||
| cargo build --release --locked --features llamacpp,cuda | ||
|
|
||
| .PHONY: build-python-runtime | ||
| build-python-runtime: build-rust ## Build ai-dynamo-runtime Python wheel | ||
| @echo "Building ai-dynamo-runtime wheel..." | ||
| mkdir -p deploy/sdk/src/dynamo/sdk/cli/bin/ | ||
| rm -f deploy/sdk/src/dynamo/sdk/cli/bin/* | ||
| ln -sf $(PWD)/$(RUST_TARGET_DIR)/release/dynamo-run deploy/sdk/src/dynamo/sdk/cli/bin/dynamo-run | ||
| cd lib/bindings/python && uv build --wheel --out-dir ../../../dist --python $(PYTHON_VERSION) | ||
|
|
||
| .PHONY: build-python-main | ||
| build-python-main: build-python-runtime ## Build ai-dynamo Python wheel | ||
| @echo "Building ai-dynamo wheel..." | ||
| uv build --wheel --out-dir dist --python $(PYTHON_VERSION) | ||
|
|
||
| .PHONY: build-wheels | ||
| build-wheels: build-python-main ## Build all Python wheels | ||
| @echo "All wheels built in dist/" | ||
| @ls -la dist/ | ||
|
|
||
| .PHONY: build-operator | ||
| build-operator: ## Build operator binary | ||
| @echo "Building operator..." | ||
| cd deploy/cloud/operator && CGO_ENABLED=0 go build -o bin/manager ./cmd/main.go | ||
|
|
||
| .PHONY: build | ||
| build: build-wheels build-operator ## Build all components | ||
|
|
||
| ##@ Docker | ||
| .PHONY: docker-build | ||
| docker-build: ## Build main Docker image | ||
| @echo "Building dynamo base Docker image..." | ||
| docker build -t $(DYNAMO_BASE_IMAGE) -f Dockerfile . | ||
|
|
||
| .PHONY: docker-build-operator | ||
| docker-build-operator: ## Build operator Docker image | ||
| @echo "Building operator Docker image..." | ||
| docker build -t $(DYNAMO_OPERATOR_IMAGE) -f deploy/cloud/operator/Dockerfile deploy/cloud/operator/ | ||
|
|
||
| .PHONY: docker-push | ||
| docker-push: ## Push main Docker image | ||
| docker push $(DYNAMO_BASE_IMAGE) | ||
|
|
||
| .PHONY: docker-push-operator | ||
| docker-push-operator: ## Push operator Docker image | ||
| docker push $(DYNAMO_OPERATOR_IMAGE) | ||
|
|
||
| .PHONY: docker-all | ||
julienmancuso marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| docker-all: docker-build docker-build-operator ## Build all Docker images | ||
|
|
||
| .PHONY: docker-push-all | ||
| docker-push-all: docker-push docker-push-operator ## Push all Docker images | ||
|
|
||
| ##@ Testing | ||
| .PHONY: test-rust | ||
| test-rust: ## Run Rust tests | ||
| cargo test | ||
|
|
||
| .PHONY: test-python | ||
| test-python: ## Run Python tests | ||
| @echo "Running Python tests..." | ||
| uv run pytest tests/ | ||
|
|
||
| .PHONY: test-operator | ||
| test-operator: ## Run operator tests | ||
| cd deploy/cloud/operator && make test | ||
|
|
||
| .PHONY: test | ||
| test: test-rust test-python test-operator ## Run all tests | ||
|
|
||
| ##@ Linting | ||
| .PHONY: lint-rust | ||
| lint-rust: ## Lint Rust code | ||
| cargo clippy -- -D warnings | ||
| cargo fmt --check | ||
|
|
||
| .PHONY: lint-python | ||
| lint-python: ## Lint Python code | ||
| uv run ruff check . | ||
| uv run ruff format --check . | ||
|
|
||
| .PHONY: lint-operator | ||
| lint-operator: ## Lint operator Go code | ||
| cd deploy/cloud/operator && make lint | ||
|
|
||
| .PHONY: lint | ||
| lint: lint-rust lint-python lint-operator ## Run all linting | ||
|
|
||
| ##@ Formatting | ||
| .PHONY: format-rust | ||
| format-rust: ## Format Rust code | ||
| cargo fmt | ||
|
|
||
| .PHONY: format-python | ||
| format-python: ## Format Python code | ||
| uv run ruff format . | ||
| uv run ruff check --fix . | ||
|
|
||
| .PHONY: format | ||
| format: format-rust format-python ## Format all code | ||
|
|
||
| ##@ CI/CD | ||
| .PHONY: ci-build | ||
| ci-build: clean lint test build docker-all ## Full CI build pipeline | ||
|
|
||
| .PHONY: ci-release | ||
| ci-release: ci-build docker-push-all ## Full release pipeline | ||
|
|
||
| ##@ Development shortcuts | ||
| .PHONY: dev-setup | ||
| dev-setup: install-deps ## Set up development environment | ||
| @echo "Creating Python virtual environment..." | ||
| uv venv .venv --python $(PYTHON_VERSION) | ||
| @echo "Installing Python dependencies..." | ||
| uv pip install -r container/deps/requirements.txt | ||
| @echo "Development environment ready!" | ||
| @echo "Activate with: source .venv/bin/activate" | ||
|
|
||
| .PHONY: quick-build | ||
| quick-build: build-rust build-python-main ## Quick build for development | ||
|
|
||
| # Variables for override | ||
| EARTHLY_ARGS ?= | ||
|
|
||
| ##@ Migration helpers (temporary) | ||
| .PHONY: earthly-test | ||
| earthly-test: ## Run tests using current Earthly (for comparison) | ||
| @echo "WARNING: This is deprecated. Use 'make test' instead." | ||
| earthly +all-test $(EARTHLY_ARGS) | ||
|
|
||
| .PHONY: earthly-docker | ||
| earthly-docker: ## Build Docker using current Earthly (for comparison) | ||
| @echo "WARNING: This is deprecated. Use 'make docker-all' instead." | ||
| earthly +all-docker $(EARTHLY_ARGS) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # Build stage | ||
| FROM golang:1.24 as builder | ||
|
|
||
| # Docker buildx automatically provides these | ||
| ARG TARGETOS=linux | ||
| ARG TARGETARCH=amd64 | ||
|
|
||
| RUN echo "Building for ${TARGETOS}/${TARGETARCH}" | ||
|
|
||
| RUN apt-get update && apt-get install -y git && apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR /workspace | ||
| # Copy go mod and sum files | ||
| COPY go.mod go.sum ./ | ||
| # Download dependencies | ||
| RUN go mod download | ||
|
|
||
| # Copy the source code | ||
| COPY . . | ||
|
|
||
| # Build | ||
| RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o manager ./cmd/main.go | ||
|
|
||
| # Runtime stage | ||
| FROM nvcr.io/nvidia/distroless/go:v3.1.12 | ||
| WORKDIR / | ||
| COPY --from=builder /workspace/manager . | ||
| USER 65532:65532 | ||
|
|
||
| ENTRYPOINT ["./manager"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.