@@ -12,15 +12,13 @@ VERSION ?= v0.0.0-dev
12
12
BUNDLE_VERSION ?= $(VERSION:v%=% )
13
13
14
14
# 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
16
17
17
18
# 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
21
20
MCAD_REPO ?= github.com/project-codeflare/multi-cluster-app-dispatcher
22
21
# 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)
24
22
MCAD_CRD ?= ${MCAD_REPO}/config/crd?ref=${MCAD_VERSION}
25
23
26
24
# KUBERAY_VERSION defines the default version of the KubeRay operator (used for testing)
@@ -30,7 +28,7 @@ KUBERAY_VERSION ?= v0.6.0
30
28
RAY_VERSION ?= 2.5.0
31
29
32
30
# 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
34
32
35
33
# OPERATORS_REPO_ORG points to GitHub repository organization where bundle PR is opened against
36
34
# 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
66
64
# codeflare.dev/codeflare-operator-bundle:$VERSION and codeflare.dev/codeflare-operator-catalog:$VERSION.
67
65
IMAGE_TAG_BASE ?= $(IMAGE_ORG_BASE ) /codeflare-operator
68
66
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
-
75
67
# RAY_IMAGE defines the default container image for Ray (used for testing)
76
68
RAY_IMAGE ?= rayproject/ray:$(RAY_VERSION )
77
69
@@ -129,25 +121,10 @@ help: ## Display this help.
129
121
130
122
# #@ Development
131
123
132
- DEFAULTS_FILE := controllers/defaults.go
133
124
DEFAULTS_TEST_FILE := test/support/defaults.go
134
125
135
126
.PHONY : defaults
136
127
defaults :
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
-
151
128
$(info Regenerating $(DEFAULTS_TEST_FILE ) )
152
129
@echo " package support" > $(DEFAULTS_TEST_FILE )
153
130
@echo " " >> $(DEFAULTS_TEST_FILE )
@@ -163,51 +140,11 @@ defaults:
163
140
@echo " )" >> $(DEFAULTS_TEST_FILE )
164
141
@echo " " >> $(DEFAULTS_TEST_FILE )
165
142
166
- gofmt -w $(DEFAULTS_FILE) $( DEFAULTS_TEST_FILE)
143
+ gofmt -w $(DEFAULTS_TEST_FILE)
167
144
168
145
.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=" ./..."
211
148
212
149
.PHONY : fmt
213
150
fmt : # # Run go fmt against code.
@@ -223,14 +160,16 @@ vet: ## Run go vet against code.
223
160
.PHONY : modules
224
161
modules : # # Update Go dependencies.
225
162
go get $(MCAD_REPO ) @$(MCAD_VERSION )
163
+ go get $(INSTASCALE_REPO ) @$(INSTASCALE_VERSION )
226
164
go get github.com/ray-project/kuberay/ray-operator
165
+ go mod tidy
227
166
228
167
.PHONY : build
229
- build : modules defaults generate fmt vet # # Build manager binary.
168
+ build : modules defaults fmt vet # # Build manager binary.
230
169
go build -o bin/manager main.go
231
170
232
171
.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.
234
173
go run ./main.go
235
174
236
175
.PHONY : image-build
@@ -249,26 +188,26 @@ endif
249
188
250
189
.PHONY : install
251
190
install : 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
253
192
$(KUSTOMIZE ) build config/crd | kubectl apply -f -
254
193
git restore config/*
255
194
256
195
.PHONY : uninstall
257
196
uninstall : 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
259
198
$(KUSTOMIZE ) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found ) -f -
260
199
git restore config/*
261
200
262
201
.PHONY : deploy
263
202
deploy : 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
265
204
cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
266
205
$(KUSTOMIZE ) build config/default | kubectl apply -f -
267
206
git restore config/*
268
207
269
208
.PHONY : undeploy
270
209
undeploy : # # 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
272
211
$(KUSTOMIZE ) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found ) -f -
273
212
git restore config/*
274
213
@@ -281,15 +220,12 @@ $(LOCALBIN):
281
220
282
221
# # Tool Binaries
283
222
KUSTOMIZE ?= $(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
288
223
CONTROLLER_GEN ?= $(LOCALBIN ) /controller-gen
289
224
ENVTEST ?= $(LOCALBIN ) /setup-envtest
290
225
OPENSHIFT-GOIMPORTS ?= $(LOCALBIN ) /openshift-goimports
291
226
OPERATOR_SDK ?= $(LOCALBIN ) /operator-sdk
292
227
GH_CLI ?= $(LOCALBIN ) /gh
228
+ SED ?= /usr/bin/sed
293
229
294
230
# # Tool Versions
295
231
KUSTOMIZE_VERSION ?= v4.5.4
@@ -315,29 +251,6 @@ $(GH_CLI): $(LOCALBIN)
315
251
rm -rf $(GH_CLI_DL_FILENAME )
316
252
rm $(GH_CLI_DL_FILENAME ) .tar.gz
317
253
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
-
341
254
.PHONY : controller-gen
342
255
controller-gen : $(CONTROLLER_GEN ) # # Download controller-gen locally if necessary.
343
256
$(CONTROLLER_GEN ) : $(LOCALBIN )
@@ -367,7 +280,7 @@ validate-bundle: install-operator-sdk
367
280
.PHONY : bundle
368
281
bundle : defaults manifests kustomize install-operator-sdk # # Generate bundle manifests and metadata, then validate generated files.
369
282
$(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
371
284
cd config/manager && $(KUSTOMIZE ) edit set image controller=$(IMG )
372
285
cd config/manifests && $(KUSTOMIZE ) edit add patch --patch ' [{"op":"add", "path":"/metadata/annotations/containerImage", "value": "$(IMG)" }]' --kind ClusterServiceVersion
373
286
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.
434
347
mkdir catalog
435
348
$(OPM ) render $(CATALOG_BASE_IMG ) -o yaml > catalog/bundles.yaml
436
349
$(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
438
351
$(OPM ) validate catalog
439
352
$(OPM ) generate dockerfile catalog
440
353
podman build . -f catalog.Dockerfile -t $(CATALOG_IMG )
@@ -445,11 +358,11 @@ catalog-push: ## Push a catalog image.
445
358
podman push $(CATALOG_IMG ) $(CATALOG_PUSH_OPT )
446
359
447
360
.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.
449
362
KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) --bin-dir $( LOCALBIN) -p path) " go test $(go list ./... | grep -v /test/ ) -coverprofile cover.out
450
363
451
364
.PHONY : test-e2e
452
- test-e2e : defaults manifests generate fmt vet # # Run e2e tests.
365
+ test-e2e : defaults manifests fmt vet # # Run e2e tests.
453
366
go test -timeout 30m -v ./test/e2e
454
367
455
368
.PHONY : kind-e2e
0 commit comments