Skip to content

Commit

Permalink
Merge pull request #13 from NVIDIA/release-0.1
Browse files Browse the repository at this point in the history
Minor fixes pro first release cut
  • Loading branch information
ArangoGutierrez authored Feb 15, 2024
2 parents a7bd07b + d9a0722 commit 3957e15
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 26 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ name: Go

on:
push:
branches: [ "main" ]
branches:
- main
- release-*
pull_request:
branches: [ "main" ]
branches:
- main
- release-*

jobs:

Expand Down
16 changes: 13 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
.PHONY: build fmt verify
.PHONY: build fmt verify release

GO_CMD ?= go
GO_FMT ?= gofmt
Expand Down Expand Up @@ -40,16 +40,26 @@ verify:
exit 1; \
fi

release:
@rm -rf bin
@mkdir -p bin
@for os in linux darwin; do \
for arch in amd64 arm64; do \
echo "Building $$os-$$arch"; \
GOOS=$$os GOARCH=$$arch $(GO_CMD) build -o bin/$(BINARY_NAME)-$$os-$$arch cmd/main.go; \
done; \
done

.PHONY: generate
generate: controller-gen
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

CONTROLLER_GEN = $(PROJECT_DIR)/bin/controller-gen
.PHONY: controller-gen
controller-gen: ## Download controller-gen locally if necessary.
@GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on $(GO_CMD) install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.12.1
@GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on $(GO_CMD) install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0

# Generate manifests e.g. CRD, RBAC etc.
.PHONY: manifests
manifests: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
8 changes: 4 additions & 4 deletions api/holodeck/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ type EnvironmentSpec struct {
Instance `json:"instance"`

// +optional
NVDriver NVDriver `json:"nvDriver"`
NVIDIADriver NVIDIADriver `json:"nvidiaDriver"`
// +optional
ContainerRuntime ContainerRuntime `json:"containerRuntime"`
// +optional
NVContainerToolKit NVContainerToolKit `json:"nvContainerToolKit"`
NVIDIAContainerToolkit NVIDIAContainerToolkit `json:"nvidiaContainerToolkit"`
// +optional
Kubernetes Kubernetes `json:"kubernetes"`
}
Expand Down Expand Up @@ -134,7 +134,7 @@ type Auth struct {
PrivateKey string `json:"privateKey"`
}

type NVDriver struct {
type NVIDIADriver struct {
Install bool `json:"install"`
// If not set the latest stable version will be used
// +optional
Expand Down Expand Up @@ -189,7 +189,7 @@ type ExtraPortMapping struct {
HostPort int `json:"hostPort"`
}

type NVContainerToolKit struct {
type NVIDIAContainerToolkit struct {
Install bool `json:"install"`
// If not set the latest stable version will be used
// +optional
Expand Down
38 changes: 26 additions & 12 deletions api/holodeck/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hack/boilerplate.go.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
8 changes: 4 additions & 4 deletions pkg/provisioner/dependency.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func buildDependencyGraph(env v1alpha1.Environment) ([]ProvisionFunc, error) {
}

// if container toolkit is enabled then add container toolkit and nvdriver to kubeadm
if env.Spec.NVContainerToolKit.Install {
if env.Spec.NVIDIAContainerToolkit.Install {
graph["kubeadm"] = append(graph["kubeadm"], "containerToolkit")
graph["kubeadm"] = append(graph["kubeadm"], "nvdriver")

Expand All @@ -81,7 +81,7 @@ func buildDependencyGraph(env v1alpha1.Environment) ([]ProvisionFunc, error) {
graph["containerToolkit"] = append(graph["containerToolkit"], "containerToolkit")

// user might request to install container toolkit without nvdriver for testing purpose
if env.Spec.NVDriver.Install {
if env.Spec.NVIDIADriver.Install {
graph["containerToolkit"] = append(graph["containerToolkit"], "nvdriver")
}
}
Expand All @@ -107,7 +107,7 @@ func buildDependencyGraph(env v1alpha1.Environment) ([]ProvisionFunc, error) {
}

// If no kubernetes is requested, we move to container-toolkit
if env.Spec.NVContainerToolKit.Install {
if env.Spec.NVIDIAContainerToolkit.Install {
for _, f := range graph["containerToolkit"] {
ordered = append(ordered, functions[f])
}
Expand All @@ -134,7 +134,7 @@ func buildDependencyGraph(env v1alpha1.Environment) ([]ProvisionFunc, error) {
}

// If no container-runtime is requested, we move to nvdriver
if env.Spec.NVDriver.Install {
if env.Spec.NVIDIADriver.Install {
ordered = append(ordered, functions["nvdriver"])
return ordered, nil
}
Expand Down

0 comments on commit 3957e15

Please sign in to comment.