From e93981e3fec847cf4d5e1493c8ebd2260dbd72a6 Mon Sep 17 00:00:00 2001 From: velotioaastha Date: Wed, 25 Sep 2024 12:21:03 +0530 Subject: [PATCH 1/4] Initial Commit for making Operator available on OperatorHub create clusterserviceversion for wandb operator runAsUser 1001 update minKubVersion and Desc add containerImage --- bundle.Dockerfile | 20 ++ .../apps.wandb.com_weightsandbiases.yaml | 71 +++++ .../operator.clusterserviceversion.yaml | 295 ++++++++++++++++++ bundle/metadata/annotations.yaml | 14 + bundle/tests/scorecard/config.yaml | 70 +++++ .../bases/operator.clusterserviceversion.yaml | 51 +++ 6 files changed, 521 insertions(+) create mode 100644 bundle.Dockerfile create mode 100644 bundle/manifests/apps.wandb.com_weightsandbiases.yaml create mode 100644 bundle/manifests/operator.clusterserviceversion.yaml create mode 100644 bundle/metadata/annotations.yaml create mode 100644 bundle/tests/scorecard/config.yaml create mode 100644 config/manifests/bases/operator.clusterserviceversion.yaml diff --git a/bundle.Dockerfile b/bundle.Dockerfile new file mode 100644 index 0000000..9751c54 --- /dev/null +++ b/bundle.Dockerfile @@ -0,0 +1,20 @@ +FROM scratch + +# Core bundle labels. +LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 +LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ +LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ +LABEL operators.operatorframework.io.bundle.package.v1=wandb-operator +LABEL operators.operatorframework.io.bundle.channels.v1=alpha +LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.37.0 +LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 +LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 + +# Labels for testing. +LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1 +LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/ + +# Copy files to locations specified by labels. +COPY bundle/manifests /manifests/ +COPY bundle/metadata /metadata/ +COPY bundle/tests/scorecard /tests/scorecard/ diff --git a/bundle/manifests/apps.wandb.com_weightsandbiases.yaml b/bundle/manifests/apps.wandb.com_weightsandbiases.yaml new file mode 100644 index 0000000..56c0c30 --- /dev/null +++ b/bundle/manifests/apps.wandb.com_weightsandbiases.yaml @@ -0,0 +1,71 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + creationTimestamp: null + name: weightsandbiases.apps.wandb.com +spec: + group: apps.wandb.com + names: + kind: WeightsAndBiases + listKind: WeightsAndBiasesList + plural: weightsandbiases + shortNames: + - wandb + singular: weightsandbiases + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: WeightsAndBiases is the Schema for the weightsandbiases API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: WeightsAndBiasesSpec defines the desired state of WeightsAndBiases + properties: + chart: + description: Unstructured values for rendering CDK8s Config. + type: object + x-kubernetes-preserve-unknown-fields: true + values: + description: Unstructured values for rendering CDK8s Config. + type: object + x-kubernetes-preserve-unknown-fields: true + type: object + status: + description: WeightsAndBiasesStatus defines the observed state of WeightsAndBiases + properties: + phase: + type: string + version: + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null diff --git a/bundle/manifests/operator.clusterserviceversion.yaml b/bundle/manifests/operator.clusterserviceversion.yaml new file mode 100644 index 0000000..8421d3b --- /dev/null +++ b/bundle/manifests/operator.clusterserviceversion.yaml @@ -0,0 +1,295 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: ClusterServiceVersion +metadata: + annotations: + alm-examples: |- + [ + { + "apiVersion": "apps.wandb.com/v1", + "kind": "WeightsAndBiases", + "metadata": { + "labels": { + "app.kubernetes.io/created-by": "wandb-operator", + "app.kubernetes.io/instance": "weightsandbiases-sample", + "app.kubernetes.io/managed-by": "kustomize", + "app.kubernetes.io/name": "weightsandbiases", + "app.kubernetes.io/part-of": "wandb-operator" + }, + "name": "weightsandbiases-sample" + }, + "spec": null + } + ] + capabilities: Basic Install + categories: "AI/Machine Learning,Developer Tools" + certified: "false" + repository: https://github.com/wandb/operator + containerImage: wandb/controller:latest + description: "Operator for Weights and Biases, enabling seamless integration and management of machine learning experiments in Kubernetes environments." + name: wandb-operator.v1.0.0 + namespace: placeholder +spec: + apiservicedefinitions: {} + customresourcedefinitions: + owned: + - kind: WeightsAndBiases + name: weightsandbiases.apps.wandb.com + version: v1 + description: WeightsAndBiases is a custom resource for managing W&B configurations. + displayName: Weights And Biases + description: |- + The Weights and Biases Operator simplifies the management of machine learning experiments, tracking, and infrastructure. It integrates with Kubernetes to deploy and manage Weights and Biases instances. + Features: + - Experiment Tracking + - Hyperparameter Tuning + - Model Management + - Integration with popular ML frameworks + displayName: Weights & Biases Operator + icon: + - base64data: "iVBORw0KGgoAAAANSUhEUgAAAbwAAABxCAMAAACZb+YzAAAAwFBMVEX///8AAAD/zDOVlZU+Pj7v7+/a2tr8/Pz/yib/yy2NjY339/f/yyr/yRb/yiF4eHjMzMzm5ub/+eu8vLz//fjg4ODCwsJlZWW0tLRtbW1gYGCmpqaIiIienp7S0tIVFRWtra1QUFD/4pv/9d7/78pHR0csLCz/3Yf/56xYWFh1dXUjIyNLS0v/12v/89j/8dA1NTX/6rj/5KP/0U7/2XT/zj7/1F8oKCgQEBD/2HH/0En/3Yb/7L3/4JP/+vAdHR3XioaIAAATAElEQVR4nO1dZ2MiLRA2GntN0Rhb1PTevXsvyd3//1evuizMwACDkvLB59NdZFmWYYZpDJmMwPHHc/b1v8dMfOw/zbLZ2dP+J3S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PMjXQma+3YfoDd0vQykJZCM4il2yLBlHJrTo+RbY3vTA71tSnEu9Zi3NWdG1/gFwiJ5IaM80Sxv2HsMXwz8ghUe4Qg0owbENq1AtoAvTd/4GHvlEqx70jMFvaJIugafKdpFi/JoB03W30rBhPHODSNRy/P5m/y0bRQPayEB3jZcLcwkJMzmJPHy/QetbyVySNpFczZHO2iSAtip3HtggNxk+o2JaMHWaW6vkC8Wi/l2azzQ9sWFuNN5b7tTYLA5dlbqxCu2uwNNXs7xT0nXryRehPtMwVJlawXqEW5eF0U9Kx6SgVAVG896g3GL2Mmq8xVQOTzVmw+GuRSD5oHxs2gE+qEzGxrBhbxp4CiEu5w4D/IsAT93Skk49iNUnNUCmYBnqZe0pC/cAnO0hsrDKeLONzKzIVpwHN7aEOU2U2lXjdmPSNkUkCtHmW8kgMqrO8oAYNeH9mY+nOq325Omgk8vZNceg9X5ozixJSUCbmBKHwmJXo6MS2gp4GLTQ1szlKS3MvGIun+Uke7JBwup+vciF0fDE65gQnxJSE55KjfDchQcjCRwoG9ntkrFKNtkNeI1Sat2SrCe+xRkWL1NUfe/HKvAo1Dkg7hITEDgm6pu2dkkNJE8reogx04w8R6aXav5bmbSugOsoZVu728XIYjbWGa/CKAFeH9TbmWfNQYvm1gmtGeLuu7pFYuWdIYtBg/bHJxODq4Gwy6lrALs1jXqeeQbqjHNMyn4IQg/8qeXl5cTroWeYDiZP3MTGCdNUN1r6trhZc5pcoy0ilPXV/2glRaG4xLSOD2h9C+v7v4DMDfLhrlKJdcfdwoc87I66vYX7YfjTjtiiVoS+zPFfN5DkCvcq7DBp+J+rj8uFcjah48aoTeabPD5+HtyMX16ZJAi7C6hDX4Ugm7x2uCHIeD+vA1+Gt7ZN1du8PPAvTN2g58I5m3NG/xI7E5n2dfbrzratYEF/wPFOCcI8KI0sAAAAABJRU5ErkJggg==" + mediatype: "image/png" + install: + spec: + clusterPermissions: + - rules: + - apiGroups: + - "" + resources: + - configmaps + - events + - persistentvolumeclaims + - secrets + - serviceaccounts + - services + verbs: + - create + - delete + - get + - list + - update + - watch + - apiGroups: + - "" + resources: + - namespaces + - nodes + - pods + - pods/log + - serviceaccounts + - services + verbs: + - get + - list + - apiGroups: + - apps + resources: + - controllerrevisions + - daemonsets + - deployments + - replicasets + - statefulsets + verbs: + - create + - delete + - get + - list + - update + - watch + - apiGroups: + - apps + resources: + - daemonsets/status + - deployments/status + - replicasets/status + - statefulsets/status + verbs: + - get + - apiGroups: + - apps.wandb.com + resources: + - weightsandbiases + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - apps.wandb.com + resources: + - weightsandbiases/finalizers + verbs: + - update + - apiGroups: + - apps.wandb.com + resources: + - weightsandbiases/status + verbs: + - get + - patch + - update + - apiGroups: + - autoscaling/v2 + resources: + - horizontalpodautoscalers + verbs: + - create + - delete + - get + - list + - update + - watch + - apiGroups: + - networking.k8s.io + resources: + - ingresses + - networkpolicies + verbs: + - create + - delete + - get + - list + - update + - watch + - apiGroups: + - rbac.authorization.k8s.io + resources: + - rolebindings + - roles + verbs: + - create + - delete + - get + - list + - update + - watch + serviceAccountName: operator-controller-manager + deployments: + - label: + app.kubernetes.io/component: manager + app.kubernetes.io/created-by: operator + app.kubernetes.io/instance: controller-manager + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: deployment + app.kubernetes.io/part-of: operator + control-plane: controller-manager + name: operator-controller-manager + spec: + replicas: 1 + selector: + matchLabels: + control-plane: controller-manager + strategy: {} + template: + metadata: + annotations: + kubectl.kubernetes.io/default-container: manager + labels: + control-plane: controller-manager + spec: + containers: + - args: + - --leader-elect + command: + - /manager + env: + - name: SERVICE_ACCOUNT_NAME + valueFrom: + fieldRef: + fieldPath: spec.serviceAccountName + image: wandb/controller:latest + livenessProbe: + httpGet: + path: /healthz + port: 8081 + initialDelaySeconds: 15 + periodSeconds: 20 + name: manager + readinessProbe: + httpGet: + path: /readyz + port: 8081 + initialDelaySeconds: 5 + periodSeconds: 10 + resources: + limits: + cpu: 500m + memory: 128Mi + requests: + cpu: 10m + memory: 64Mi + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + securityContext: + runAsNonRoot: true + runAsUser: 1001 + seccompProfile: + type: RuntimeDefault + serviceAccountName: operator-controller-manager + terminationGracePeriodSeconds: 10 + permissions: + - rules: + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - "" + resources: + - events + verbs: + - create + - patch + serviceAccountName: operator-controller-manager + strategy: deployment + installModes: + - supported: false + type: OwnNamespace + - supported: false + type: SingleNamespace + - supported: false + type: MultiNamespace + - supported: true + type: AllNamespaces + keywords: + - machine learning + - experiment tracking + - ML infrastructure + - weights and biases + links: + - name: Weights & Biases Documentation + url: https://docs.wandb.ai/ + maintainers: + - email: abhinav.garg@domain.com + name: Abhinav Garg + maturity: alpha + minKubeVersion: 1.23.0 + provider: + name: Weights & Biases + url: https://wandb.ai + version: 1.0.0 diff --git a/bundle/metadata/annotations.yaml b/bundle/metadata/annotations.yaml new file mode 100644 index 0000000..af6511b --- /dev/null +++ b/bundle/metadata/annotations.yaml @@ -0,0 +1,14 @@ +annotations: + # Core bundle annotations. + operators.operatorframework.io.bundle.mediatype.v1: registry+v1 + operators.operatorframework.io.bundle.manifests.v1: manifests/ + operators.operatorframework.io.bundle.metadata.v1: metadata/ + operators.operatorframework.io.bundle.package.v1: wandb-operator + operators.operatorframework.io.bundle.channels.v1: alpha + operators.operatorframework.io.metrics.builder: operator-sdk-v1.37.0 + operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 + operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3 + + # Annotations for testing. + operators.operatorframework.io.test.mediatype.v1: scorecard+v1 + operators.operatorframework.io.test.config.v1: tests/scorecard/ diff --git a/bundle/tests/scorecard/config.yaml b/bundle/tests/scorecard/config.yaml new file mode 100644 index 0000000..8cf7fae --- /dev/null +++ b/bundle/tests/scorecard/config.yaml @@ -0,0 +1,70 @@ +apiVersion: scorecard.operatorframework.io/v1alpha3 +kind: Configuration +metadata: + name: config +stages: +- parallel: true + tests: + - entrypoint: + - scorecard-test + - basic-check-spec + image: quay.io/operator-framework/scorecard-test:v1.28.1 + labels: + suite: basic + test: basic-check-spec-test + storage: + spec: + mountPath: {} + - entrypoint: + - scorecard-test + - olm-bundle-validation + image: quay.io/operator-framework/scorecard-test:v1.28.1 + labels: + suite: olm + test: olm-bundle-validation-test + storage: + spec: + mountPath: {} + - entrypoint: + - scorecard-test + - olm-crds-have-validation + image: quay.io/operator-framework/scorecard-test:v1.28.1 + labels: + suite: olm + test: olm-crds-have-validation-test + storage: + spec: + mountPath: {} + - entrypoint: + - scorecard-test + - olm-crds-have-resources + image: quay.io/operator-framework/scorecard-test:v1.28.1 + labels: + suite: olm + test: olm-crds-have-resources-test + storage: + spec: + mountPath: {} + - entrypoint: + - scorecard-test + - olm-spec-descriptors + image: quay.io/operator-framework/scorecard-test:v1.28.1 + labels: + suite: olm + test: olm-spec-descriptors-test + storage: + spec: + mountPath: {} + - entrypoint: + - scorecard-test + - olm-status-descriptors + image: quay.io/operator-framework/scorecard-test:v1.28.1 + labels: + suite: olm + test: olm-status-descriptors-test + storage: + spec: + mountPath: {} +storage: + spec: + mountPath: {} diff --git a/config/manifests/bases/operator.clusterserviceversion.yaml b/config/manifests/bases/operator.clusterserviceversion.yaml new file mode 100644 index 0000000..8550f51 --- /dev/null +++ b/config/manifests/bases/operator.clusterserviceversion.yaml @@ -0,0 +1,51 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: ClusterServiceVersion +metadata: + annotations: + alm-examples: '[]' + capabilities: Basic Install + name: operator.v0.0.0 + namespace: placeholder +spec: + apiservicedefinitions: {} + customresourcedefinitions: {} + description: |- + The Weights and Biases Operator simplifies the management of machine learning experiments, tracking, and infrastructure. It integrates with Kubernetes to deploy and manage Weights and Biases instances. + Features: + - Experiment Tracking + - Hyperparameter Tuning + - Model Management + - Integration with popular ML frameworks + displayName: Weights & Biases Operator + icon: + - base64data: "" + mediatype: "" + install: + spec: + deployments: null + strategy: "" + installModes: + - supported: false + type: OwnNamespace + - supported: false + type: SingleNamespace + - supported: false + type: MultiNamespace + - supported: true + type: AllNamespaces + keywords: + - machine learning + - experiment tracking + - ML infrastructure + - weights and biases + links: + - name: Weights & Biases Documentation + url: https://docs.wandb.ai/ + maintainers: + - email: abhinav.garg@domain.com + name: Abhinav Garg + maturity: alpha + provider: + name: Weights & Biases + url: https://wandb.ai + version: 0.0.0 From 43560288ed39f42afc2a741dd59e2402e3d8b610 Mon Sep 17 00:00:00 2001 From: velotioaastha Date: Wed, 16 Oct 2024 10:17:02 +0530 Subject: [PATCH 2/4] Add wandb-operator bundle version 1.0.0 --- bundle.Dockerfile | 11 ++- bundle/ci.yaml | 8 ++ ...c.authorization.k8s.io_v1_clusterrole.yaml | 22 +++++ ...rization.k8s.io_v1_clusterrolebinding.yaml | 16 +++ ...wandb-operator.clusterserviceversion.yaml} | 97 +++++++++++++++++-- bundle/metadata/annotations.yaml | 4 +- 6 files changed, 143 insertions(+), 15 deletions(-) create mode 100644 bundle/ci.yaml create mode 100644 bundle/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrole.yaml create mode 100644 bundle/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrolebinding.yaml rename bundle/manifests/{operator.clusterserviceversion.yaml => wandb-operator.clusterserviceversion.yaml} (85%) diff --git a/bundle.Dockerfile b/bundle.Dockerfile index 9751c54..06e44cf 100644 --- a/bundle.Dockerfile +++ b/bundle.Dockerfile @@ -5,7 +5,8 @@ LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ LABEL operators.operatorframework.io.bundle.package.v1=wandb-operator -LABEL operators.operatorframework.io.bundle.channels.v1=alpha +LABEL operators.operatorframework.io.bundle.channels.v1=stable +LABEL operators.operatorframework.io.bundle.channel.default.v1=stable LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.37.0 LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 @@ -15,6 +16,8 @@ LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1 LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/ # Copy files to locations specified by labels. -COPY bundle/manifests /manifests/ -COPY bundle/metadata /metadata/ -COPY bundle/tests/scorecard /tests/scorecard/ +COPY ./manifests /manifests/ +COPY ./metadata /metadata/ +COPY ./tests/scorecard /tests/scorecard/ + +LABEL com.redhat.openshift.versions=v4.12 diff --git a/bundle/ci.yaml b/bundle/ci.yaml new file mode 100644 index 0000000..b8f04d8 --- /dev/null +++ b/bundle/ci.yaml @@ -0,0 +1,8 @@ +--- +# Use `replaces-mode` or `semver-mode`. Once you switch to `semver-mode`, there is no easy way back. +updateGraph: replaces-mode +reviewers: + - danielpanzella + - jsbroks + - abhinavg6 + - velotioaastha \ No newline at end of file diff --git a/bundle/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrole.yaml b/bundle/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrole.yaml new file mode 100644 index 0000000..0a1f815 --- /dev/null +++ b/bundle/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrole.yaml @@ -0,0 +1,22 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/managed-by: olm + app.kubernetes.io/name: wandb-operator + app.kubernetes.io/part-of: wandb-operator + name: wandb-operator-manager-role +rules: + - apiGroups: + - rbac.authorization.k8s.io + resources: + - clusterroles + - clusterrolebindings + verbs: + - create + - delete + - get + - list + - patch + - update + - watch diff --git a/bundle/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrolebinding.yaml b/bundle/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrolebinding.yaml new file mode 100644 index 0000000..7ce6103 --- /dev/null +++ b/bundle/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrolebinding.yaml @@ -0,0 +1,16 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + app.kubernetes.io/managed-by: olm + app.kubernetes.io/name: wandb-operator + app.kubernetes.io/part-of: wandb-operator + name: wandb-operator-manager-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: wandb-operator-manager-role +subjects: +- kind: ServiceAccount + name: operator-controller-manager + namespace: wandb-system diff --git a/bundle/manifests/operator.clusterserviceversion.yaml b/bundle/manifests/wandb-operator.clusterserviceversion.yaml similarity index 85% rename from bundle/manifests/operator.clusterserviceversion.yaml rename to bundle/manifests/wandb-operator.clusterserviceversion.yaml index 8421d3b..3de6a71 100644 --- a/bundle/manifests/operator.clusterserviceversion.yaml +++ b/bundle/manifests/wandb-operator.clusterserviceversion.yaml @@ -2,6 +2,13 @@ apiVersion: operators.coreos.com/v1alpha1 kind: ClusterServiceVersion metadata: annotations: + features.operators.openshift.io/disconnected: "true" + features.operators.openshift.io/fips-compliant: "false" + features.operators.openshift.io/proxy-aware: "false" + features.operators.openshift.io/tls-profiles: "false" + features.operators.openshift.io/token-auth-aws: "false" + features.operators.openshift.io/token-auth-azure: "false" + features.operators.openshift.io/token-auth-gcp: "false" alm-examples: |- [ { @@ -11,7 +18,7 @@ metadata: "labels": { "app.kubernetes.io/created-by": "wandb-operator", "app.kubernetes.io/instance": "weightsandbiases-sample", - "app.kubernetes.io/managed-by": "kustomize", + "app.kubernetes.io/managed-by": "olm", "app.kubernetes.io/name": "weightsandbiases", "app.kubernetes.io/part-of": "wandb-operator" }, @@ -23,8 +30,11 @@ metadata: capabilities: Basic Install categories: "AI/Machine Learning,Developer Tools" certified: "false" + createdAt: "2024-10-10T14:46:54Z" + support: WeightsAndBiases repository: https://github.com/wandb/operator - containerImage: wandb/controller:latest + containerImage: quay.io/wandb_tools/wandb-k8s-operator:1.0.0 + operatorframework.io/suggested-namespace: wandb-system description: "Operator for Weights and Biases, enabling seamless integration and management of machine learning experiments in Kubernetes environments." name: wandb-operator.v1.0.0 namespace: placeholder @@ -52,6 +62,14 @@ spec: spec: clusterPermissions: - rules: + - apiGroups: + - security.openshift.io + resources: + - securitycontextconstraints + resourceNames: + - privileged + verbs: + - use - apiGroups: - "" resources: @@ -66,20 +84,33 @@ spec: - delete - get - list + - patch - update - watch - apiGroups: - "" resources: - namespaces + - namespaces/status - nodes + - nodes/metrics + - nodes/spec + - nodes/stats + - nodes/proxy - pods - pods/log + - pods/status - serviceaccounts - services + - endpoints + - ingresses + - resourcequotas + - replicationcontrollers + - replicationcontrollers/status verbs: - get - list + - watch - apiGroups: - apps resources: @@ -95,6 +126,7 @@ spec: - list - update - watch + - patch - apiGroups: - apps resources: @@ -131,7 +163,7 @@ spec: - patch - update - apiGroups: - - autoscaling/v2 + - autoscaling resources: - horizontalpodautoscalers verbs: @@ -141,6 +173,38 @@ spec: - list - update - watch + - apiGroups: + - batch + resources: + - cronjobs + - jobs + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - events.k8s.io + resources: + - events + verbs: + - watch + - list + - apiGroups: + - extensions + resources: + - daemonsets + - deployments + - ingresses + - replicasets + - ingresses/status + verbs: + - get + - list + - watch - apiGroups: - networking.k8s.io resources: @@ -151,8 +215,17 @@ spec: - delete - get - list + - patch - update - watch + - apiGroups: + - networking.k8s.io + resources: + - ingresses/status + verbs: + - get + - list + - watch - apiGroups: - rbac.authorization.k8s.io resources: @@ -165,15 +238,19 @@ spec: - list - update - watch + - nonResourceURLs: + - /metrics + verbs: + - get serviceAccountName: operator-controller-manager deployments: - label: app.kubernetes.io/component: manager - app.kubernetes.io/created-by: operator + app.kubernetes.io/created-by: wandb-operator app.kubernetes.io/instance: controller-manager - app.kubernetes.io/managed-by: kustomize - app.kubernetes.io/name: deployment - app.kubernetes.io/part-of: operator + app.kubernetes.io/managed-by: olm + app.kubernetes.io/name: wandb-operator + app.kubernetes.io/part-of: wandb-operator control-plane: controller-manager name: operator-controller-manager spec: @@ -199,7 +276,7 @@ spec: valueFrom: fieldRef: fieldPath: spec.serviceAccountName - image: wandb/controller:latest + image: quay.io/wandb_tools/wandb-k8s-operator:1.0.0 livenessProbe: httpGet: path: /healthz @@ -287,8 +364,8 @@ spec: maintainers: - email: abhinav.garg@domain.com name: Abhinav Garg - maturity: alpha - minKubeVersion: 1.23.0 + maturity: stable + minKubeVersion: 1.25.0 provider: name: Weights & Biases url: https://wandb.ai diff --git a/bundle/metadata/annotations.yaml b/bundle/metadata/annotations.yaml index af6511b..1cd7db6 100644 --- a/bundle/metadata/annotations.yaml +++ b/bundle/metadata/annotations.yaml @@ -1,10 +1,12 @@ annotations: + com.redhat.openshift.versions: v4.12 # Core bundle annotations. operators.operatorframework.io.bundle.mediatype.v1: registry+v1 operators.operatorframework.io.bundle.manifests.v1: manifests/ operators.operatorframework.io.bundle.metadata.v1: metadata/ operators.operatorframework.io.bundle.package.v1: wandb-operator - operators.operatorframework.io.bundle.channels.v1: alpha + operators.operatorframework.io.bundle.channels.v1: stable + operators.operatorframework.io.bundle.channel.default.v1: stable operators.operatorframework.io.metrics.builder: operator-sdk-v1.37.0 operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3 From 23ade7dcbba52b9319e9b05d48378683ddf28dd3 Mon Sep 17 00:00:00 2001 From: velotioaastha Date: Thu, 17 Oct 2024 18:07:48 +0530 Subject: [PATCH 3/4] add doc for olm guides --- docs/OLM_Bundle.md | 134 ++++++++++++++++++++++++++++++++++++++ docs/OLM_Testing_Guide.md | 79 ++++++++++++++++++++++ 2 files changed, 213 insertions(+) create mode 100644 docs/OLM_Bundle.md create mode 100644 docs/OLM_Testing_Guide.md diff --git a/docs/OLM_Bundle.md b/docs/OLM_Bundle.md new file mode 100644 index 0000000..7b9d798 --- /dev/null +++ b/docs/OLM_Bundle.md @@ -0,0 +1,134 @@ + +# OLM Bundle Overview + +Operator Lifecycle Manager (OLM) has updated the method for storing operator bundles. Bundles are now packaged as container images, which include operator manifests and associated metadata. These images are compliant with OCI (Open Container Initiative) specifications, enabling them to be stored and pulled from any OCI-compliant container registry. + +The operator bundle image is designed as a scratch-based (non-runnable) container image. This bundle is utilized by OLM to install operators in OLM-enabled clusters, ensuring a streamlined and automated deployment process. + +The directory structure for an operator bundle is as follows: + +``` +$ tree bundle + +bundle +├── ci.yaml +├── manifests +│ ├── apps.wandb.com_weightsandbiases.yaml +│ ├── wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrole.yaml +│ ├── wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrolebinding.yaml +│ └── wandb-operator.clusterserviceversion.yaml +├── metadata +│ └── annotations.yaml +└── tests + └── scorecard + └── config.yaml + +``` + +Each operator bundle must include a Cluster Service Version (CSV) file. Bundle metadata is stored in `bundle/metadata/annotations.yaml`, which provides essential information about the specific version of the operator available in the registry. + +Example content of `annotations.yaml`: + +``` +$ cat metadata/annotations.yaml + +annotations: + com.redhat.openshift.versions: v4.12 + # Core bundle annotations. + operators.operatorframework.io.bundle.mediatype.v1: registry+v1 + operators.operatorframework.io.bundle.manifests.v1: manifests/ + operators.operatorframework.io.bundle.metadata.v1: metadata/ + operators.operatorframework.io.bundle.package.v1: wandb-operator + operators.operatorframework.io.bundle.channels.v1: stable + operators.operatorframework.io.bundle.channel.default.v1: stable + operators.operatorframework.io.metrics.builder: operator-sdk-v1.37.0 + operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 + operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3 + + # Annotations for testing. + operators.operatorframework.io.test.mediatype.v1: scorecard+v1 + operators.operatorframework.io.test.config.v1: tests/scorecard/ +``` + +## Building the Operator Bundle Image + +You can create a bundle image using the following `Dockerfile`: + +``` +$ cat bundle.Dockerfile + +FROM scratch + +# Core bundle labels. +LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 +LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ +LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ +LABEL operators.operatorframework.io.bundle.package.v1=wandb-operator +LABEL operators.operatorframework.io.bundle.channels.v1=stable +LABEL operators.operatorframework.io.bundle.channel.default.v1=stable +LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.37.0 +LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 +LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 + +# Labels for testing. +LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1 +LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/ + +# Copy files to locations specified by labels. +COPY ./manifests /manifests/ +COPY ./metadata /metadata/ +COPY ./tests/scorecard /tests/scorecard/ + +LABEL com.redhat.openshift.versions=v4.12 +``` + +To build the image and push it to a public repository, use the following command: + +``` +docker build -f bundle.Dockerfile -t quay.io/wandb_tools/wandb-operator:v1.0.0 . +``` + +At this point, you have built the operator bundle image. To integrate it into Red Hat's certification pipeline, you can push the image for Red Hat verification. However, this image is not deployable as a CatalogSource on OpenShift yet. + +## Creating a CatalogSource for OpenShift + +To deploy the operator on OpenShift, you must create a `CatalogSource` from the bundle image. First, ensure that the `opm` tool is installed. + +Run the following command to create the `CatalogSource`: + +``` +opm index add --container-tool docker --bundles quay.io/wandb_tools/wandb-operator:v1.0.0 --tag quay.io/wandb_tools/wandb-operator-index:v1.0.0 +``` + +This will generate an image that can be used as a `CatalogSource`: `quay.io/wandb_tools/wandb-operator-index:v1.0.0`. + +### Updating CSVs for New Versions + +If you want to replace an old CSV with a new one in your catalog, you can use the following command to include both bundles: + +``` +opm index add --container-tool=docker --bundles=quay.io/wandb_tools/wandb-operator:v1.0.0,quay.io/wandb_tools/wandb-operator:v1.0.1 --tag quay.io/wandb_tools/wandb-operator-index:v1.0.1 +``` + +This command creates an image (`v1.0.1`) that supersedes the older CSV (`v1.0.0`). + +## OLM Catalog Source Upgrade Chain + +When managing multiple versions of an operator, it is crucial for OLM to automatically upgrade to the latest version. To achieve this, the `CSV` must include a `replaces` field, indicating which previous CSV version it is replacing. + +Consider the following example where the initial version (`v1.0.0`) of the operator is created: + +``` +opm index add --container-tool docker --bundles quay.io/wandb_tools/wandb-operator:v1.0.0 --tag quay.io/wandb_tools/wandb-operator-index:v1.0.0 +``` + +Once a new version (`v1.0.1`) is released, you can specify the `--from-index` option to ensure the upgrade chain links to the previous version: + +``` +opm index add --container-tool=docker --bundles=quay.io/wandb_tools/wandb-operator:v1.0.1 --from-index=quay.io/wandb_tools/wandb-operator-index:v1.0.0 --tag quay.io/wandb_tools/wandb-operator-index:v1.0.1 + +``` + +This ensures that `v1.0.1` will automatically replace `v1.0.0` when upgrading. + +You can continue this process for subsequent versions, and `opm` will manage the version upgrade chain via the `CSV` definitions. diff --git a/docs/OLM_Testing_Guide.md b/docs/OLM_Testing_Guide.md new file mode 100644 index 0000000..69d6b8e --- /dev/null +++ b/docs/OLM_Testing_Guide.md @@ -0,0 +1,79 @@ +# Testing Wandb on OLM + +## Introduction + +This guide is intended for new contributors who are beginning to work with Weights and Biases (Wandb) and are looking to test Wandb on the Operator Lifecycle Manager (OLM). +It provides a step-by-step walkthrough of each component within the OLM environment and demonstrates how to deploy Wandb using it. + + +## Installing Wandb on OLM via CatalogSource + +A `CatalogSource` is a registry in OLM that hosts operators in the form of bundles. For internal releases, we provide a `CatalogSource` image that hosts the bundle required for OLM to deploy the operator. + +To create a `CatalogSource` for version `v4.14` in the `openshift-marketplace` namespace, use the following configuration: + +```yaml +apiVersion: operators.coreos.com/v1alpha1 +kind: CatalogSource +metadata: + name: wandb-operator-catalog + labels: + app.kubernetes.io/part-of: wandb-operator +spec: + sourceType: grpc + image: quay.io/wandb_tools/wandb-operator-index: + updateStrategy: + registryPoll: + interval: 5m +``` + +Note: If you create the above CatalogSource in the openshift-marketplace namespace, the operator will be available cluster-wide. +If you create it in another namespace, it will only be available within that namespace. + + +## Installing Wandb on OLM. + +Once the CatalogSource is deployed, you should see a pod with the catalogsource name running, indicating that your operator is ready to be served. You can then navigate to the OpenShift UI and install the Weights and Biases operator by selecting it from the list of operators provided by your CatalogSource. Refer to the following image for guidance: + +![][operators] + +After selecting the operator, proceed with the installation of the Weights and Biases operator. Upon successful installation, you should see the following output: +![][Successful Installation] + +Next, you can create a Weights and Biases custom resource (CR) from the UI, and it should be deployed successfully: +![][Wandb Installation] + +## Debugging a Failed Wandb Install on OLM + +OLM follows a sequential process when installing an operator, which involves three key components. If any of these components fail, the installation will not proceed to the next stage: + +These are the three components: +1. Subscription +2. InstallPlan +3. ClusterServiceVersion + +If your installation fails, first verify if the InstallPlan exists. If it does, it indicates that the Subscription is functioning correctly. Next, check if the ClusterServiceVersion (CSV) exists. If the CSV is missing, the failure occurred at the InstallPlan level. To diagnose the issue, describe the InstallPlan and check for errors. + +If the CSV exists, the failure occurred at the CSV level. In this case, describe the CSV and look for errors to identify the cause. + +If the operator installation succeeds but the Wandb custom resource (CR) fails, check the operator logs and the Wandb CR status for further debugging information. + +Now, if your install failed you check that installplan exist or not, if it exists means that subscription is +fine. Now you check ClusterServiceVersion exists or not. If it does not exist it means the failure happen at +installplan level. Now describe the installplan and look for error. + + +[operators]: images/provider.png?raw=true "Community Operators" +[Successful Installation]: images/InstallSuccess.png?raw=true "Successful Installation" +[Wandb Installation]: images/WandbSuccess.png?raw=true "Wandb installed successfully" + +## OLM Integration Tests Locally + +You can install OLM on any Kubernetes cluster using the following command: + +```shell +operator-sdk olm install +``` + +## OLM Scorecard Tests Locally +OLM scorecard tests can be run locally to validate the functionality of your operator. From bb4e1c74b176edc5bfa29bcf9bccdbf6d921ea50 Mon Sep 17 00:00:00 2001 From: velotioaastha Date: Thu, 17 Oct 2024 20:24:01 +0530 Subject: [PATCH 4/4] Restructured project for improved maintainability and organization --- olm/Makefile | 26 +++++++++++++++++++ {docs => olm/docs}/OLM_Bundle.md | 0 {docs => olm/docs}/OLM_Testing_Guide.md | 0 .../olm-catalog/bundle.Dockerfile | 0 {bundle => olm/olm-catalog}/ci.yaml | 0 .../apps.wandb.com_weightsandbiases.yaml | 0 ...c.authorization.k8s.io_v1_clusterrole.yaml | 0 ...rization.k8s.io_v1_clusterrolebinding.yaml | 0 .../wandb-operator.clusterserviceversion.yaml | 0 .../olm-catalog}/metadata/annotations.yaml | 0 .../olm-catalog}/tests/scorecard/config.yaml | 0 olm/olm-sample-configs/catalogSource.yaml | 12 +++++++++ 12 files changed, 38 insertions(+) create mode 100644 olm/Makefile rename {docs => olm/docs}/OLM_Bundle.md (100%) rename {docs => olm/docs}/OLM_Testing_Guide.md (100%) rename bundle.Dockerfile => olm/olm-catalog/bundle.Dockerfile (100%) rename {bundle => olm/olm-catalog}/ci.yaml (100%) rename {bundle => olm/olm-catalog}/manifests/apps.wandb.com_weightsandbiases.yaml (100%) rename {bundle => olm/olm-catalog}/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrole.yaml (100%) rename {bundle => olm/olm-catalog}/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrolebinding.yaml (100%) rename {bundle => olm/olm-catalog}/manifests/wandb-operator.clusterserviceversion.yaml (100%) rename {bundle => olm/olm-catalog}/metadata/annotations.yaml (100%) rename {bundle => olm/olm-catalog}/tests/scorecard/config.yaml (100%) create mode 100644 olm/olm-sample-configs/catalogSource.yaml diff --git a/olm/Makefile b/olm/Makefile new file mode 100644 index 0000000..c263a30 --- /dev/null +++ b/olm/Makefile @@ -0,0 +1,26 @@ +# Makefile for building and pushing the WandB Operator image + +# Define variables +IMAGE ?= wandb-operator # Name of the Docker image +QUAY_DOCKER_REGISTRY ?= quay.io # Docker registry URL +QUAY_PROJECT ?= wandb_tools # Project name in the registry +VERSION ?= latest # Default version for the image +BRANCH ?= main # Default branch for tagging + +# Targets + +# Build the Docker image +build-image: + docker build -t $(QUAY_DOCKER_REGISTRY)/$(QUAY_PROJECT)/$(IMAGE):$(VERSION) \ + -f olm-catalog/bundle.Dockerfile olm-catalog/ + + docker tag $(QUAY_DOCKER_REGISTRY)/$(QUAY_PROJECT)/$(IMAGE):$(VERSION) \ + $(QUAY_DOCKER_REGISTRY)/$(QUAY_PROJECT)/$(IMAGE):$(BRANCH) + +# Build and push the Docker image to the registry +build-push: + docker push $(QUAY_DOCKER_REGISTRY)/$(QUAY_PROJECT)/$(IMAGE):$(VERSION) + docker push $(QUAY_DOCKER_REGISTRY)/$(QUAY_PROJECT)/$(IMAGE):$(BRANCH) + +# Specify that these targets do not represent files +.PHONY: build-image build-push diff --git a/docs/OLM_Bundle.md b/olm/docs/OLM_Bundle.md similarity index 100% rename from docs/OLM_Bundle.md rename to olm/docs/OLM_Bundle.md diff --git a/docs/OLM_Testing_Guide.md b/olm/docs/OLM_Testing_Guide.md similarity index 100% rename from docs/OLM_Testing_Guide.md rename to olm/docs/OLM_Testing_Guide.md diff --git a/bundle.Dockerfile b/olm/olm-catalog/bundle.Dockerfile similarity index 100% rename from bundle.Dockerfile rename to olm/olm-catalog/bundle.Dockerfile diff --git a/bundle/ci.yaml b/olm/olm-catalog/ci.yaml similarity index 100% rename from bundle/ci.yaml rename to olm/olm-catalog/ci.yaml diff --git a/bundle/manifests/apps.wandb.com_weightsandbiases.yaml b/olm/olm-catalog/manifests/apps.wandb.com_weightsandbiases.yaml similarity index 100% rename from bundle/manifests/apps.wandb.com_weightsandbiases.yaml rename to olm/olm-catalog/manifests/apps.wandb.com_weightsandbiases.yaml diff --git a/bundle/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrole.yaml b/olm/olm-catalog/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrole.yaml similarity index 100% rename from bundle/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrole.yaml rename to olm/olm-catalog/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrole.yaml diff --git a/bundle/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrolebinding.yaml b/olm/olm-catalog/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrolebinding.yaml similarity index 100% rename from bundle/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrolebinding.yaml rename to olm/olm-catalog/manifests/wandb-operator-manager_rbac.authorization.k8s.io_v1_clusterrolebinding.yaml diff --git a/bundle/manifests/wandb-operator.clusterserviceversion.yaml b/olm/olm-catalog/manifests/wandb-operator.clusterserviceversion.yaml similarity index 100% rename from bundle/manifests/wandb-operator.clusterserviceversion.yaml rename to olm/olm-catalog/manifests/wandb-operator.clusterserviceversion.yaml diff --git a/bundle/metadata/annotations.yaml b/olm/olm-catalog/metadata/annotations.yaml similarity index 100% rename from bundle/metadata/annotations.yaml rename to olm/olm-catalog/metadata/annotations.yaml diff --git a/bundle/tests/scorecard/config.yaml b/olm/olm-catalog/tests/scorecard/config.yaml similarity index 100% rename from bundle/tests/scorecard/config.yaml rename to olm/olm-catalog/tests/scorecard/config.yaml diff --git a/olm/olm-sample-configs/catalogSource.yaml b/olm/olm-sample-configs/catalogSource.yaml new file mode 100644 index 0000000..48914da --- /dev/null +++ b/olm/olm-sample-configs/catalogSource.yaml @@ -0,0 +1,12 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: CatalogSource +metadata: + name: wandb-operator-catalog + labels: + app.kubernetes.io/part-of: wandb-operator +spec: + sourceType: grpc + image: quay.io/wandb_tools/wandb-operator-index: + updateStrategy: + registryPoll: + interval: 5m