@@ -12,15 +12,13 @@ VERSION ?= v0.0.0-dev
1212BUNDLE_VERSION ?= $(VERSION:v%=% )
1313
1414# INSTASCALE_VERSION defines the default version of the InstaScale controller
15- INSTASCALE_VERSION ?= v0.0.8
15+ INSTASCALE_VERSION ?= v0.0.9
16+ INSTASCALE_REPO ?= github.com/project-codeflare/instascale
1617
1718# MCAD_VERSION defines the default version of the MCAD controller
18- MCAD_VERSION ?= v1.34.1
19- # MCAD_REF, MCAD_REPO and MCAD_CRD define the reference to MCAD CRD resources
20- MCAD_REF ?= release-${MCAD_VERSION}
19+ MCAD_VERSION ?= v1.35.0
2120MCAD_REPO ?= github.com/project-codeflare/multi-cluster-app-dispatcher
2221# Upstream MCAD is currently only creating release tags of the form `vX.Y.Z` (i.e the version)
23- # The image is still published using the MCAD_REF format (i.e release-vX.Y.Z)
2422MCAD_CRD ?= ${MCAD_REPO}/config/crd?ref=${MCAD_VERSION}
2523
2624# KUBERAY_VERSION defines the default version of the KubeRay operator (used for testing)
@@ -30,7 +28,7 @@ KUBERAY_VERSION ?= v0.6.0
3028RAY_VERSION ?= 2.5.0
3129
3230# CODEFLARE_SDK_VERSION defines the default version of the CodeFlare SDK
33- CODEFLARE_SDK_VERSION ?= 0.7.1
31+ CODEFLARE_SDK_VERSION ?= 0.8.0
3432
3533# OPERATORS_REPO_ORG points to GitHub repository organization where bundle PR is opened against
3634# OPERATORS_REPO_FORK_ORG points to GitHub repository fork organization where bundle build is pushed to
@@ -66,12 +64,6 @@ IMAGE_ORG_BASE ?= quay.io/project-codeflare
6664# codeflare.dev/codeflare-operator-bundle:$VERSION and codeflare.dev/codeflare-operator-catalog:$VERSION.
6765IMAGE_TAG_BASE ?= $(IMAGE_ORG_BASE ) /codeflare-operator
6866
69- # MCAD_IMAGE defines the default container image for the MCAD controller
70- MCAD_IMAGE ?= $(IMAGE_ORG_BASE ) /mcad-controller:$(MCAD_REF )
71-
72- # INSTASCALE_IMAGE defines the default container image for the InstaScale controller
73- INSTASCALE_IMAGE ?= $(IMAGE_ORG_BASE ) /instascale-controller:$(INSTASCALE_VERSION )
74-
7567# RAY_IMAGE defines the default container image for Ray (used for testing)
7668RAY_IMAGE ?= rayproject/ray:$(RAY_VERSION )
7769
@@ -129,25 +121,10 @@ help: ## Display this help.
129121
130122# #@ Development
131123
132- DEFAULTS_FILE := controllers/defaults.go
133124DEFAULTS_TEST_FILE := test/support/defaults.go
134125
135126.PHONY : defaults
136127defaults :
137- $(info Regenerating $(DEFAULTS_FILE ) )
138- @echo " package controllers" > $(DEFAULTS_FILE )
139- @echo " " >> $(DEFAULTS_FILE )
140- @echo " // ***********************" >> $(DEFAULTS_FILE )
141- @echo " // DO NOT EDIT THIS FILE" >> $(DEFAULTS_FILE )
142- @echo " // ***********************" >> $(DEFAULTS_FILE )
143- @echo " " >> $(DEFAULTS_FILE )
144- @echo " const (" >> $(DEFAULTS_FILE )
145- @echo " MCADImage = \" $( MCAD_IMAGE) \" " >> $(DEFAULTS_FILE )
146- @echo " InstaScaleImage = \" $( INSTASCALE_IMAGE) \" " >> $(DEFAULTS_FILE )
147- @echo " " >> $(DEFAULTS_FILE )
148- @echo " )" >> $(DEFAULTS_FILE )
149- @echo " " >> $(DEFAULTS_FILE )
150-
151128 $(info Regenerating $(DEFAULTS_TEST_FILE ) )
152129 @echo " package support" > $(DEFAULTS_TEST_FILE )
153130 @echo " " >> $(DEFAULTS_TEST_FILE )
@@ -163,51 +140,11 @@ defaults:
163140 @echo " )" >> $(DEFAULTS_TEST_FILE )
164141 @echo " " >> $(DEFAULTS_TEST_FILE )
165142
166- gofmt -w $(DEFAULTS_FILE) $( DEFAULTS_TEST_FILE)
143+ gofmt -w $(DEFAULTS_TEST_FILE)
167144
168145.PHONY : manifests
169- manifests : controller-gen # # Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
170- $(CONTROLLER_GEN ) rbac:roleName=manager-role crd webhook paths=" ./..." output:crd:artifacts:config=config/crd/bases
171-
172- .PHONY : generate
173- generate : controller-gen # # Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
174- $(CONTROLLER_GEN ) object:headerFile=" hack/boilerplate.go.txt" paths=" ./..."
175-
176- .PHONY : generate-client # # Generate client packages and organize the goimports
177- generate-client : generate-client-files imports
178-
179- .PHONY : generate-client-files
180- generate-client-files : code-generator
181- rm -rf client
182- $(APPLYCONFIGURATION_GEN ) \
183- --input-dirs=" github.com/project-codeflare/codeflare-operator/api/codeflare/v1alpha1" \
184- --go-header-file=" hack/boilerplate.go.txt" \
185- --output-package=" github.com/project-codeflare/codeflare-operator/client/applyconfiguration" \
186- --output-base=" ." \
187- --trim-path-prefix " github.com/project-codeflare/codeflare-operator"
188- $(CLIENT_GEN ) \
189- --input=" codeflare/v1alpha1" \
190- --input-base=" github.com/project-codeflare/codeflare-operator/api" \
191- --apply-configuration-package=" github.com/project-codeflare/codeflare-operator/client/applyconfiguration" \
192- --go-header-file=" hack/boilerplate.go.txt" \
193- --clientset-name " versioned" \
194- --output-package=" github.com/project-codeflare/codeflare-operator/client/clientset" \
195- --output-base=" ." \
196- --trim-path-prefix " github.com/project-codeflare/codeflare-operator"
197- $(LISTER_GEN ) \
198- --input-dirs=" github.com/project-codeflare/codeflare-operator/api/codeflare/v1alpha1" \
199- --go-header-file=" hack/boilerplate.go.txt" \
200- --output-base=" ." \
201- --output-package=" github.com/project-codeflare/codeflare-operator/client/listers" \
202- --trim-path-prefix " github.com/project-codeflare/codeflare-operator"
203- $(INFORMER_GEN ) \
204- --input-dirs=" github.com/project-codeflare/codeflare-operator/api/codeflare/v1alpha1" \
205- --versioned-clientset-package=" github.com/project-codeflare/codeflare-operator/client/clientset/versioned" \
206- --listers-package=" github.com/project-codeflare/codeflare-operator/client/listers" \
207- --go-header-file=" hack/boilerplate.go.txt" \
208- --output-base=" ." \
209- --output-package=" github.com/project-codeflare/codeflare-operator/client/informer" \
210- --trim-path-prefix " github.com/project-codeflare/codeflare-operator"
146+ manifests : controller-gen # # Generate RBAC objects.
147+ $(CONTROLLER_GEN ) rbac:roleName=manager-role webhook paths=" ./..."
211148
212149.PHONY : fmt
213150fmt : # # Run go fmt against code.
@@ -223,14 +160,16 @@ vet: ## Run go vet against code.
223160.PHONY : modules
224161modules : # # Update Go dependencies.
225162 go get $(MCAD_REPO ) @$(MCAD_VERSION )
163+ go get $(INSTASCALE_REPO ) @$(INSTASCALE_VERSION )
226164 go get github.com/ray-project/kuberay/ray-operator
165+ go mod tidy
227166
228167.PHONY : build
229- build : modules defaults generate fmt vet # # Build manager binary.
168+ build : modules defaults fmt vet # # Build manager binary.
230169 go build -o bin/manager main.go
231170
232171.PHONY : run
233- run : modules defaults manifests generate fmt vet # # Run a controller from your host.
172+ run : modules defaults manifests fmt vet # # Run a controller from your host.
234173 go run ./main.go
235174
236175.PHONY : image-build
@@ -249,26 +188,26 @@ endif
249188
250189.PHONY : install
251190install : manifests kustomize # # Install CRDs into the K8s cluster specified in ~/.kube/config.
252- sed -i -E " s|(- )\$ {MCAD_REPO}.*|\1\$ {MCAD_CRD}|" config/crd/mcad/kustomization.yaml
191+ $( SED ) -i -E " s|(- )\$ {MCAD_REPO}.*|\1\$ {MCAD_CRD}|" config/crd/mcad/kustomization.yaml
253192 $(KUSTOMIZE ) build config/crd | kubectl apply -f -
254193 git restore config/*
255194
256195.PHONY : uninstall
257196uninstall : manifests kustomize # # Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
258- sed -i -E " s|(- )\$ {MCAD_REPO}.*|\1\$ {MCAD_CRD}|" config/crd/mcad/kustomization.yaml
197+ $( SED ) -i -E " s|(- )\$ {MCAD_REPO}.*|\1\$ {MCAD_CRD}|" config/crd/mcad/kustomization.yaml
259198 $(KUSTOMIZE ) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found ) -f -
260199 git restore config/*
261200
262201.PHONY : deploy
263202deploy : manifests kustomize # # Deploy controller to the K8s cluster specified in ~/.kube/config.
264- sed -i -E " s|(- )\$ {MCAD_REPO}.*|\1\$ {MCAD_CRD}|" config/crd/mcad/kustomization.yaml
203+ $( SED ) -i -E " s|(- )\$ {MCAD_REPO}.*|\1\$ {MCAD_CRD}|" config/crd/mcad/kustomization.yaml
265204 cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
266205 $(KUSTOMIZE ) build config/default | kubectl apply -f -
267206 git restore config/*
268207
269208.PHONY : undeploy
270209undeploy : # # Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
271- sed -i -E " s|(- )\$ {MCAD_REPO}.*|\1\$ {MCAD_CRD}|" config/crd/mcad/kustomization.yaml
210+ $( SED ) -i -E " s|(- )\$ {MCAD_REPO}.*|\1\$ {MCAD_CRD}|" config/crd/mcad/kustomization.yaml
272211 $(KUSTOMIZE ) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found ) -f -
273212 git restore config/*
274213
@@ -281,15 +220,12 @@ $(LOCALBIN):
281220
282221# # Tool Binaries
283222KUSTOMIZE ?= $(LOCALBIN ) /kustomize
284- APPLYCONFIGURATION_GEN ?= $(LOCALBIN ) /applyconfiguration-gen
285- CLIENT_GEN ?= $(LOCALBIN ) /client-gen
286- LISTER_GEN ?= $(LOCALBIN ) /lister-gen
287- INFORMER_GEN ?= $(LOCALBIN ) /informer-gen
288223CONTROLLER_GEN ?= $(LOCALBIN ) /controller-gen
289224ENVTEST ?= $(LOCALBIN ) /setup-envtest
290225OPENSHIFT-GOIMPORTS ?= $(LOCALBIN ) /openshift-goimports
291226OPERATOR_SDK ?= $(LOCALBIN ) /operator-sdk
292227GH_CLI ?= $(LOCALBIN ) /gh
228+ SED ?= /usr/bin/sed
293229
294230# # Tool Versions
295231KUSTOMIZE_VERSION ?= v4.5.4
@@ -315,29 +251,6 @@ $(GH_CLI): $(LOCALBIN)
315251 rm -rf $(GH_CLI_DL_FILENAME )
316252 rm $(GH_CLI_DL_FILENAME ) .tar.gz
317253
318- .PHONY : code-generator
319- code-generator : $(APPLYCONFIGURATION_GEN ) $(CLIENT_GEN ) $(LISTER_GEN ) $(INFORMER_GEN )
320-
321- .PHONY : applyconfiguration-gen
322- applyconfiguration-gen : $(APPLYCONFIGURATION_GEN )
323- $(APPLYCONFIGURATION_GEN ) : $(LOCALBIN )
324- test -s $(LOCALBIN ) /applyconfiguration-gen || GOBIN=$(LOCALBIN ) go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION )
325-
326- .PHONY : client-gen
327- client-gen : $(CLIENT_GEN )
328- $(CLIENT_GEN ) : $(LOCALBIN )
329- test -s $(LOCALBIN ) /client-gen || GOBIN=$(LOCALBIN ) go install k8s.io/code-generator/cmd/client-gen@$(CODEGEN_VERSION )
330-
331- .PHONY : lister-gen
332- lister-gen : $(LISTER_GEN )
333- $(LISTER_GEN ) : $(LOCALBIN )
334- test -s $(LOCALBIN ) /lister-gen || GOBIN=$(LOCALBIN ) go install k8s.io/code-generator/cmd/lister-gen@$(CODEGEN_VERSION )
335-
336- .PHONY : informer-gen
337- informer-gen : $(INFORMER_GEN )
338- $(INFORMER_GEN ) : $(LOCALBIN )
339- test -s $(LOCALBIN ) /informer-gen || GOBIN=$(LOCALBIN ) go install k8s.io/code-generator/cmd/informer-gen@$(CODEGEN_VERSION )
340-
341254.PHONY : controller-gen
342255controller-gen : $(CONTROLLER_GEN ) # # Download controller-gen locally if necessary.
343256$(CONTROLLER_GEN ) : $(LOCALBIN )
@@ -367,7 +280,7 @@ validate-bundle: install-operator-sdk
367280.PHONY : bundle
368281bundle : defaults manifests kustomize install-operator-sdk # # Generate bundle manifests and metadata, then validate generated files.
369282 $(OPERATOR_SDK ) generate kustomize manifests -q
370- sed -i -E " s|(- )\$ {MCAD_REPO}.*|\1\$ {MCAD_CRD}|" config/crd/mcad/kustomization.yaml
283+ $( SED ) -i -E " s|(- )\$ {MCAD_REPO}.*|\1\$ {MCAD_CRD}|" config/crd/mcad/kustomization.yaml
371284 cd config/manager && $(KUSTOMIZE ) edit set image controller=$(IMG )
372285 cd config/manifests && $(KUSTOMIZE ) edit add patch --patch ' [{"op":"add", "path":"/metadata/annotations/containerImage", "value": "$(IMG)" }]' --kind ClusterServiceVersion
373286 cd config/manifests && $(KUSTOMIZE ) edit add patch --patch ' [{"op":"add", "path":"/spec/replaces", "value": "codeflare-operator.$(PREVIOUS_VERSION)" }]' --kind ClusterServiceVersion
@@ -434,7 +347,7 @@ catalog-build-from-index: opm ## Build a catalog image.
434347 mkdir catalog
435348 $(OPM ) render $(CATALOG_BASE_IMG ) -o yaml > catalog/bundles.yaml
436349 $(OPM ) render $(BUNDLE_IMG ) $(OPM_BUNDLE_OPT ) > catalog/codeflare-operator-bundle.yaml
437- sed -i -E " s/(.*)(- name: codeflare-operator.$( PREVIOUS_VERSION) .*)/\1- name: codeflare-operator.$( VERSION) \n replaces: codeflare-operator.$( PREVIOUS_VERSION) \n\2/" catalog/bundles.yaml
350+ $( SED ) -i -E " s/(.*)(- name: codeflare-operator.$( PREVIOUS_VERSION) .*)/\1- name: codeflare-operator.$( VERSION) \n replaces: codeflare-operator.$( PREVIOUS_VERSION) \n\2/" catalog/bundles.yaml
438351 $(OPM ) validate catalog
439352 $(OPM ) generate dockerfile catalog
440353 podman build . -f catalog.Dockerfile -t $(CATALOG_IMG )
@@ -445,11 +358,11 @@ catalog-push: ## Push a catalog image.
445358 podman push $(CATALOG_IMG ) $(CATALOG_PUSH_OPT )
446359
447360.PHONY : test-unit
448- test-unit : defaults manifests generate fmt vet envtest # # Run unit tests.
361+ test-unit : defaults manifests fmt vet envtest # # Run unit tests.
449362 KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) --bin-dir $( LOCALBIN) -p path) " go test $(go list ./... | grep -v /test/ ) -coverprofile cover.out
450363
451364.PHONY : test-e2e
452- test-e2e : defaults manifests generate fmt vet # # Run e2e tests.
365+ test-e2e : defaults manifests fmt vet # # Run e2e tests.
453366 go test -timeout 30m -v ./test/e2e
454367
455368.PHONY : kind-e2e
0 commit comments