Skip to content

Commit

Permalink
Move AppWrapper API to workload.codeflare.dev group
Browse files Browse the repository at this point in the history
  • Loading branch information
astefanutti authored and openshift-merge-robot committed Sep 5, 2023
1 parent bf0fd98 commit c6b0244
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ignore: |
bundle/manifests/mcad.ibm.com*
bundle/manifests/*
extends: default
rules:
line-length: disable
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ VERSION ?= v0.0.0-dev
BUNDLE_VERSION ?= $(VERSION:v%=%)

# INSTASCALE_VERSION defines the default version of the InstaScale controller
INSTASCALE_VERSION ?= v0.0.7
INSTASCALE_VERSION ?= dev

# MCAD_VERSION defines the default version of the MCAD controller
MCAD_VERSION ?= v1.34.0
MCAD_VERSION ?= main
# MCAD_REF, MCAD_REPO and MCAD_CRD define the reference to MCAD CRD resources
MCAD_REF ?= release-${MCAD_VERSION}
MCAD_REF ?= dev
MCAD_REPO ?= github.com/project-codeflare/multi-cluster-app-dispatcher
# Upstream MCAD is currently only creating release tags of the form `vX.Y.Z` (i.e the version)
# The image is still published using the MCAD_REF format (i.e release-vX.Y.Z)
Expand Down
2 changes: 1 addition & 1 deletion config/internal/instascale/clusterrole.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ rules:
- patch

- apiGroups:
- mcad.ibm.com
- workload.codeflare.dev
resources:
- appwrappers
verbs:
Expand Down
2 changes: 1 addition & 1 deletion config/internal/mcad/clusterrole_mcad-controller.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
codeflare.codeflare.dev/cr-namespace: {{.Namespace}}
rules:
- apiGroups:
- mcad.ibm.com
- workload.codeflare.dev
resources:
- queuejobs
- schedulingspecs
Expand Down
48 changes: 17 additions & 31 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,37 +262,6 @@ rules:
- patch
- update
- watch
- apiGroups:
- mcad.ibm.com
resources:
- appwrappers
- appwrappers/finalizers
- appwrappers/status
- queuejobs
- schedulingspecs
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- mcad.ibm.com
resources:
- appwrappers
- queuejobs
- schedulingspecs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- policy
resources:
Expand Down Expand Up @@ -349,3 +318,20 @@ rules:
- get
- list
- watch
- apiGroups:
- workload.codeflare.dev
resources:
- appwrappers
- appwrappers/finalizers
- appwrappers/status
- queuejobs
- schedulingspecs
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
4 changes: 2 additions & 2 deletions controllers/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ package controllers
// ***********************

const (
MCADImage = "quay.io/project-codeflare/mcad-controller:release-v1.34.0"
InstaScaleImage = "quay.io/project-codeflare/instascale-controller:v0.0.7"
MCADImage = "quay.io/project-codeflare/mcad-controller:dev"
InstaScaleImage = "quay.io/project-codeflare/instascale-controller:dev"
)
1 change: 0 additions & 1 deletion controllers/instascale_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ func (r *InstaScaleReconciler) Apply(owner mf.Owner, params *InstaScaleParams, t
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=roles;rolebindings,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterroles;clusterrolebindings,verbs=get;list;watch;create;update;delete
// +kubebuilder:rbac:groups=machine.openshift.io,resources=*,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=mcad.ibm.com,resources=appwrappers;queuejobs;schedulingspecs,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=config.openshift.io,resources=clusterversions,verbs=get;list

// Reconcile is part of the main kubernetes reconciliation loop which aims to
Expand Down
2 changes: 1 addition & 1 deletion controllers/mcad_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (r *MCADReconciler) DeleteResource(params *MCADParams, template string, fns
// +kubebuilder:rbac:groups=codeflare.codeflare.dev,resources=mcads,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=codeflare.codeflare.dev,resources=mcads/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=codeflare.codeflare.dev,resources=mcads/finalizers,verbs=update
// +kubebuilder:rbac:groups=mcad.ibm.com,resources=queuejobs;schedulingspecs;appwrappers;appwrappers/finalizers;appwrappers/status,verbs=get;list;watch;create;update;patch;delete;deletecollection
// +kubebuilder:rbac:groups=workload.codeflare.dev,resources=queuejobs;schedulingspecs;appwrappers;appwrappers/finalizers;appwrappers/status,verbs=get;list;watch;create;update;patch;delete;deletecollection
// +kubebuilder:rbac:groups=core,resources=pods;lists;namespaces,verbs=get;list;watch;create;update;patch;delete;deletecollection
// +kubebuilder:rbac:groups=core,resources=bindings;pods/binding,verbs=create
// +kubebuilder:rbac:groups=core,resources=kube-scheduler,verbs=get;update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ rules:
- delete
- patch
apiGroups:
- mcad.ibm.com
- workload.codeflare.dev
resources:
- appwrappers
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/openshift-eng/openshift-goimports v0.0.0-20230304234052-c70783e636f2
github.com/openshift/api v0.0.0-20230213134911-7ba313770556
github.com/openshift/client-go v0.0.0-20221019143426-16aed247da5c
github.com/project-codeflare/multi-cluster-app-dispatcher v1.34.0
github.com/project-codeflare/multi-cluster-app-dispatcher v1.34.1-0.20230831150053-05b1af83014c
github.com/ray-project/kuberay/ray-operator v0.0.0-20230830082034-e7fbf7d73576
go.uber.org/zap v1.24.0
k8s.io/api v0.26.3
Expand All @@ -21,6 +21,8 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.2.3
)

replace sigs.k8s.io/custom-metrics-apiserver => sigs.k8s.io/custom-metrics-apiserver v1.25.1-0.20230306170449-63d8c93851f3

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
github.com/project-codeflare/multi-cluster-app-dispatcher v1.34.0 h1:4J3vW+vuCBHyocd3huZy3FJhOw5acaBHFLYwutkTE/E=
github.com/project-codeflare/multi-cluster-app-dispatcher v1.34.0/go.mod h1:gtTl8Tsl+X+bGhqVudLoveINR6IkN+sVvH0J+VZIP40=
github.com/project-codeflare/multi-cluster-app-dispatcher v1.34.1-0.20230831150053-05b1af83014c h1:LjCgRcjtkd9byePczvxGBLjdM22M2BCTB76FoEk2fkU=
github.com/project-codeflare/multi-cluster-app-dispatcher v1.34.1-0.20230831150053-05b1af83014c/go.mod h1:gtTl8Tsl+X+bGhqVudLoveINR6IkN+sVvH0J+VZIP40=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/mnist_pytorch_mcad_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func TestMNISTPyTorchMCAD(t *testing.T) {
},
}

_, err = test.Client().MCAD().McadV1beta1().AppWrappers(namespace.Name).Create(test.Ctx(), aw, metav1.CreateOptions{})
_, err = test.Client().MCAD().WorkloadV1beta1().AppWrappers(namespace.Name).Create(test.Ctx(), aw, metav1.CreateOptions{})
test.Expect(err).NotTo(HaveOccurred())
test.T().Logf("Created MCAD %s/%s successfully", aw.Namespace, aw.Name)

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/mnist_rayjob_mcad_raycluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func TestMNISTRayJobMCADRayCluster(t *testing.T) {
},
}

aw, err = test.Client().MCAD().McadV1beta1().AppWrappers(namespace.Name).Create(test.Ctx(), aw, metav1.CreateOptions{})
aw, err = test.Client().MCAD().WorkloadV1beta1().AppWrappers(namespace.Name).Create(test.Ctx(), aw, metav1.CreateOptions{})
test.Expect(err).NotTo(HaveOccurred())
test.T().Logf("Created MCAD %s/%s successfully", aw.Namespace, aw.Name)

Expand Down
2 changes: 1 addition & 1 deletion test/support/mcad.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

func AppWrapper(t Test, namespace *corev1.Namespace, name string) func(g gomega.Gomega) *mcadv1beta1.AppWrapper {
return func(g gomega.Gomega) *mcadv1beta1.AppWrapper {
aw, err := t.Client().MCAD().McadV1beta1().AppWrappers(namespace.Name).Get(t.Ctx(), name, metav1.GetOptions{})
aw, err := t.Client().MCAD().WorkloadV1beta1().AppWrappers(namespace.Name).Get(t.Ctx(), name, metav1.GetOptions{})
g.Expect(err).NotTo(gomega.HaveOccurred())
return aw
}
Expand Down

0 comments on commit c6b0244

Please sign in to comment.