Skip to content

adjust rbac to match mcad #240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5ae13d1
adjust rbac to match mcad
jbusche Aug 17, 2023
dcac680
revert go.mod and go.sum
jbusche Aug 17, 2023
67d902d
regenerate of role
jbusche Aug 17, 2023
1e3f7dc
more info on make manifests
jbusche Aug 17, 2023
c62b9b2
Apply MCAD CRD version replace for operator uninstall and undeploy
sutaakar Aug 15, 2023
3eeb618
Test support: return default status if Route is not initialized
sutaakar Aug 17, 2023
fd58cf7
Test support: return error if Ray API response code doesn't match
sutaakar Aug 22, 2023
50ccd1a
Test support: Return WriteRayJobLogs function
sutaakar Aug 23, 2023
be418f7
build(deps): bump github.com/onsi/gomega from 1.27.8 to 1.27.10
dependabot[bot] Aug 10, 2023
e9e4b85
Update dependency versions for release v0.2.0
anishasthana Aug 29, 2023
4d1e0b4
Automatically label issues as needing triage and add them to project …
anishasthana Aug 25, 2023
004d0e9
Fixing instascale version
Fiona-Waters Aug 30, 2023
ed54c77
Update dependency versions for release v0.2.2
anishasthana Aug 30, 2023
652510f
e2e tests: Reduce CPU requests for e2e test AppWrappers
sutaakar Aug 31, 2023
a0f7e7c
Change remaining is-latest references to stable
anishasthana Aug 30, 2023
e3c3114
Release workflow - replace any version value in Makefile
sutaakar Sep 1, 2023
02e7425
Remove custom-metrics-api
ChristianZaccaria Sep 4, 2023
a4eb235
Move AppWrapper API to workload.codeflare.dev group
astefanutti Aug 25, 2023
a204198
adjust rbac to match mcad
jbusche Aug 17, 2023
e5d10a7
revert go.mod and go.sum
jbusche Aug 17, 2023
578d891
Merge branch 'main' into jb-187-quotatree
jbusche Sep 5, 2023
de7ed65
config/rbac/role.yaml
jbusche Sep 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move AppWrapper API to workload.codeflare.dev group
  • Loading branch information
astefanutti authored and jbusche committed Sep 5, 2023
commit a4eb23528bdffc17cfee6540659dd7750d909835
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
51 changes: 17 additions & 34 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,26 +250,6 @@ rules:
- get
- list
- watch
- apiGroups:
- ibm.com
- mcad.ibm.com
resources:
- appwrappers
- appwrappers/finalizers
- appwrappers/status
- queuejobs
- quotasubtrees
- schedulingspecs
- xqueuejobs
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- machine.openshift.io
resources:
Expand All @@ -282,20 +262,6 @@ rules:
- 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 @@ -352,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;ibm.com,resources=xqueuejobs;queuejobs;schedulingspecs;appwrappers;appwrappers/finalizers;appwrappers/status;quotasubtrees,verbs=get;list;watch;create;update;patch;delete;deletecollection
// +kubebuilder:rbac:groups=workload.codeflare.dev,resources=xqueuejobs;queuejobs;schedulingspecs;appwrappers;appwrappers/finalizers;appwrappers/status;quotasubtrees,verbs=get;list;watch;create;update;patch;delete;deletecollection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think xqueuejobs CRD has been removed from recent MCAD versions.

// +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