@@ -12,25 +12,23 @@ 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.6
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.33.0
19
- # MCAD_REF, MCAD_REPO and MCAD_CRD define the reference to MCAD CRD resources
20
- MCAD_REF ?= release-${MCAD_VERSION}
19
+ MCAD_VERSION ?= 725a614debe3d34d1547c1659ef5ad49f8f6c5df
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)
27
- KUBERAY_VERSION ?= v0.5 .0
25
+ KUBERAY_VERSION ?= v0.6 .0
28
26
29
27
# RAY_VERSION defines the default version of Ray (used for testing)
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.6.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 := tests/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,24 +188,28 @@ endif
249
188
250
189
.PHONY : install
251
190
install : manifests kustomize # # Install CRDs into the K8s cluster specified in ~/.kube/config.
252
- $(KUSTOMIZE ) fn run config/crd/mcad --image gcr.io/kpt-fn/apply-setters:v0.2.0 -- MCAD_CRD= $( MCAD_CRD )
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.
197
+ $(SED ) -i -E " s|(- )\$ {MCAD_REPO}.*|\1\$ {MCAD_CRD}|" config/crd/mcad/kustomization.yaml
258
198
$(KUSTOMIZE ) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found ) -f -
199
+ git restore config/*
259
200
260
201
.PHONY : deploy
261
202
deploy : manifests kustomize # # Deploy controller to the K8s cluster specified in ~/.kube/config.
262
- $(KUSTOMIZE ) fn run config/crd/mcad --image gcr.io/kpt-fn/apply-setters:v0.2.0 -- MCAD_CRD= $( MCAD_CRD )
203
+ $(SED ) -i -E " s|(- ) \$ {MCAD_REPO}.*|\1 \$ {MCAD_CRD}| " config/crd/mcad/kustomization.yaml
263
204
cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
264
205
$(KUSTOMIZE ) build config/default | kubectl apply -f -
265
206
git restore config/*
266
207
267
208
.PHONY : undeploy
268
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.
210
+ $(SED ) -i -E " s|(- )\$ {MCAD_REPO}.*|\1\$ {MCAD_CRD}|" config/crd/mcad/kustomization.yaml
269
211
$(KUSTOMIZE ) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found ) -f -
212
+ git restore config/*
270
213
271
214
# #@ Build Dependencies
272
215
@@ -277,15 +220,12 @@ $(LOCALBIN):
277
220
278
221
# # Tool Binaries
279
222
KUSTOMIZE ?= $(LOCALBIN ) /kustomize
280
- APPLYCONFIGURATION_GEN ?= $(LOCALBIN ) /applyconfiguration-gen
281
- CLIENT_GEN ?= $(LOCALBIN ) /client-gen
282
- LISTER_GEN ?= $(LOCALBIN ) /lister-gen
283
- INFORMER_GEN ?= $(LOCALBIN ) /informer-gen
284
223
CONTROLLER_GEN ?= $(LOCALBIN ) /controller-gen
285
224
ENVTEST ?= $(LOCALBIN ) /setup-envtest
286
225
OPENSHIFT-GOIMPORTS ?= $(LOCALBIN ) /openshift-goimports
287
226
OPERATOR_SDK ?= $(LOCALBIN ) /operator-sdk
288
227
GH_CLI ?= $(LOCALBIN ) /gh
228
+ SED ?= /usr/bin/sed
289
229
290
230
# # Tool Versions
291
231
KUSTOMIZE_VERSION ?= v4.5.4
@@ -311,29 +251,6 @@ $(GH_CLI): $(LOCALBIN)
311
251
rm -rf $(GH_CLI_DL_FILENAME )
312
252
rm $(GH_CLI_DL_FILENAME ) .tar.gz
313
253
314
- .PHONY : code-generator
315
- code-generator : $(APPLYCONFIGURATION_GEN ) $(CLIENT_GEN ) $(LISTER_GEN ) $(INFORMER_GEN )
316
-
317
- .PHONY : applyconfiguration-gen
318
- applyconfiguration-gen : $(APPLYCONFIGURATION_GEN )
319
- $(APPLYCONFIGURATION_GEN ) : $(LOCALBIN )
320
- test -s $(LOCALBIN ) /applyconfiguration-gen || GOBIN=$(LOCALBIN ) go install k8s.io/code-generator/cmd/applyconfiguration-gen@$(CODEGEN_VERSION )
321
-
322
- .PHONY : client-gen
323
- client-gen : $(CLIENT_GEN )
324
- $(CLIENT_GEN ) : $(LOCALBIN )
325
- test -s $(LOCALBIN ) /client-gen || GOBIN=$(LOCALBIN ) go install k8s.io/code-generator/cmd/client-gen@$(CODEGEN_VERSION )
326
-
327
- .PHONY : lister-gen
328
- lister-gen : $(LISTER_GEN )
329
- $(LISTER_GEN ) : $(LOCALBIN )
330
- test -s $(LOCALBIN ) /lister-gen || GOBIN=$(LOCALBIN ) go install k8s.io/code-generator/cmd/lister-gen@$(CODEGEN_VERSION )
331
-
332
- .PHONY : informer-gen
333
- informer-gen : $(INFORMER_GEN )
334
- $(INFORMER_GEN ) : $(LOCALBIN )
335
- test -s $(LOCALBIN ) /informer-gen || GOBIN=$(LOCALBIN ) go install k8s.io/code-generator/cmd/informer-gen@$(CODEGEN_VERSION )
336
-
337
254
.PHONY : controller-gen
338
255
controller-gen : $(CONTROLLER_GEN ) # # Download controller-gen locally if necessary.
339
256
$(CONTROLLER_GEN ) : $(LOCALBIN )
@@ -363,7 +280,7 @@ validate-bundle: install-operator-sdk
363
280
.PHONY : bundle
364
281
bundle : defaults manifests kustomize install-operator-sdk # # Generate bundle manifests and metadata, then validate generated files.
365
282
$(OPERATOR_SDK ) generate kustomize manifests -q
366
- $(KUSTOMIZE ) fn run config/crd/mcad --image gcr.io/kpt-fn/apply-setters:v0.2.0 -- MCAD_CRD= $( MCAD_CRD )
283
+ $(SED ) -i -E " s|(- ) \$ {MCAD_REPO}.*|\1 \$ {MCAD_CRD}| " config/crd/mcad/kustomization.yaml
367
284
cd config/manager && $(KUSTOMIZE ) edit set image controller=$(IMG )
368
285
cd config/manifests && $(KUSTOMIZE ) edit add patch --patch ' [{"op":"add", "path":"/metadata/annotations/containerImage", "value": "$(IMG)" }]' --kind ClusterServiceVersion
369
286
cd config/manifests && $(KUSTOMIZE ) edit add patch --patch ' [{"op":"add", "path":"/spec/replaces", "value": "codeflare-operator.$(PREVIOUS_VERSION)" }]' --kind ClusterServiceVersion
@@ -430,7 +347,7 @@ catalog-build-from-index: opm ## Build a catalog image.
430
347
mkdir catalog
431
348
$(OPM ) render $(CATALOG_BASE_IMG ) -o yaml > catalog/bundles.yaml
432
349
$(OPM ) render $(BUNDLE_IMG ) $(OPM_BUNDLE_OPT ) > catalog/codeflare-operator-bundle.yaml
433
- 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
434
351
$(OPM ) validate catalog
435
352
$(OPM ) generate dockerfile catalog
436
353
podman build . -f catalog.Dockerfile -t $(CATALOG_IMG )
@@ -441,7 +358,7 @@ catalog-push: ## Push a catalog image.
441
358
podman push $(CATALOG_IMG ) $(CATALOG_PUSH_OPT )
442
359
443
360
.PHONY : test-unit
444
- test-unit : defaults manifests generate fmt vet envtest # # Run unit tests.
361
+ test-unit : defaults manifests fmt vet envtest # # Run unit tests.
445
362
KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) --bin-dir $( LOCALBIN) -p path) " go test $(go list ./... | grep -v /test/ ) -coverprofile cover.out
446
363
447
364
.PHONY : test-e2e
@@ -463,3 +380,7 @@ imports: openshift-goimports ## Organize imports in go files using openshift-goi
463
380
.PHONY : verify-imports
464
381
verify-imports : openshift-goimports # # Run import verifications.
465
382
./hack/verify-imports.sh $(OPENSHIFT-GOIMPORTS )
383
+
384
+ .PHONY : scorecard-bundle
385
+ scorecard-bundle : install-operator-sdk # # Run scorecard tests on bundle image.
386
+ $(OPERATOR_SDK ) scorecard bundle
0 commit comments