From bb0cb8969173b1ee7fdc592e1770b3fb20e76146 Mon Sep 17 00:00:00 2001 From: GiladShapira94 <100074049+GiladShapira94@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:01:30 +0300 Subject: [PATCH] [FIX] Support non admin installations and fix minio S3 endpoint (#82) --- charts/mlrun-ce/Chart.yaml | 2 +- .../mlrun-ce/admin_installation_values.yaml | 45 ++++++++++++++ ..._admin_cluster_ip_installation_values.yaml | 60 +++++++++++++++++++ .../non_admin_installation_values.yaml | 60 +++++++++++++++++++ charts/mlrun-ce/requirements.lock | 6 +- charts/mlrun-ce/requirements.yaml | 4 +- charts/mlrun-ce/templates/NOTES.txt | 19 +++--- charts/mlrun-ce/templates/_helpers.tpl | 7 ++- .../config/jupyter-env-configmap.yaml | 10 ++++ .../templates/config/mlrun-env-configmap.yaml | 3 +- .../config/mlrun-pipelines-config.yaml | 2 +- .../jupyter-notebook/deployment.yaml | 11 ++++ .../configmaps/pipeline-install-config.yaml | 2 +- .../workflow-controller-configmap.yaml | 2 +- .../crd/applications.app.k8s.io.yaml | 2 +- .../clusterworkflowtemplates.argoproj.io.yaml | 2 +- .../crd/cronworkflows.argoproj.io.yaml | 2 +- .../crd/scheduledworkflows.kubeflow.org.yaml | 2 +- .../pipelines/crd/viewers.kubeflow.org.yaml | 2 +- .../workfloweventbindings.argoproj.io.yaml | 2 +- .../pipelines/crd/workflows.argoproj.io.yaml | 2 +- .../crd/workflowtaskresults.argoproj.io.yaml | 2 +- .../crd/workflowtasksets.argoproj.io.yaml | 2 +- .../crd/workflowtemplates.argoproj.io.yaml | 2 +- .../pipelines/deployments/ml-pipeline-ui.yaml | 6 +- .../ml-pipeline-visualizationserver.yaml | 4 -- .../pipelines/deployments/mysql.yaml | 2 +- .../workflow-controller.yaml | 3 +- .../pipelines/services/ml-pipeline-ui.yaml | 4 +- charts/mlrun-ce/values.yaml | 29 ++++----- tests/compare.py | 43 +++++++++++++ 31 files changed, 287 insertions(+), 57 deletions(-) create mode 100644 charts/mlrun-ce/admin_installation_values.yaml create mode 100644 charts/mlrun-ce/non_admin_cluster_ip_installation_values.yaml create mode 100644 charts/mlrun-ce/non_admin_installation_values.yaml create mode 100644 charts/mlrun-ce/templates/config/jupyter-env-configmap.yaml create mode 100644 tests/compare.py diff --git a/charts/mlrun-ce/Chart.yaml b/charts/mlrun-ce/Chart.yaml index 48cf0bd1..434e3580 100644 --- a/charts/mlrun-ce/Chart.yaml +++ b/charts/mlrun-ce/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -version: 0.6.3-rc3 +version: 0.6.3-rc4 name: mlrun-ce description: MLRUn Open Source Stack home: https://iguazio.com diff --git a/charts/mlrun-ce/admin_installation_values.yaml b/charts/mlrun-ce/admin_installation_values.yaml new file mode 100644 index 00000000..d146e591 --- /dev/null +++ b/charts/mlrun-ce/admin_installation_values.yaml @@ -0,0 +1,45 @@ +# Use this Values file for installing MLRun CE cluster resources such as: crd, cluster role on a namespace that will not use for +# the deployment's installation. +# After you installed the helm chart using this values file you will need to use the non_admin_cluster_ip_installtion_values.yaml +# or the non_admin__installtion_values.yaml for installing the mlrun ce deployments (support MLRun. mpi, nuclio and kfp pipeline installation) + +# We use global values scope to multiplex the docker-registry details to both mlrun and nuclio +global: + # External host/ip to reach the k8s node. This might take various values if k8s is run in a VM or a cloud env + registry: + url: false + +nuclio: + # coupled with mlrun.nuclio.dashboardName template in mlrun chart + controller: + enabled: false + dashboard: + enabled: false + rbac: + create: false + platform: false + +mlrun: + enabled: false + +jupyterNotebook: + enabled: false + +mpi-operator: + rbac: + namespaced: + create: false + deployment: + create: false + +minio: + enabled: false + +spark-operator: + enabled: false + +pipelines: + enabled: false + +kube-prometheus-stack: + enabled: false diff --git a/charts/mlrun-ce/non_admin_cluster_ip_installation_values.yaml b/charts/mlrun-ce/non_admin_cluster_ip_installation_values.yaml new file mode 100644 index 00000000..8f819a67 --- /dev/null +++ b/charts/mlrun-ce/non_admin_cluster_ip_installation_values.yaml @@ -0,0 +1,60 @@ +# Use this Values file for installing MLRun CE resources such as: deployments, non cluster resources (.e.g. crd, cluter role) and installing service as clusterIP. +# remember to use a different namespace that used for the cluster resource installation. (support MLRun. mpi, nuclio and kfp pipeline installation) + +# We use global values scope to multiplex the docker-registry details to both mlrun and nuclio +global: + nuclio: + dashboard: + nodePort: "" + +nuclio: + crd: + create: false + +mlrun: + api: + service: + type: ClusterIP + nodePort: "" + ui: + service: + type: ClusterIP + nodePort: "" +jupyterNotebook: + service: + type: ClusterIP + nodePort: "" + port: 8888 + +mpi-operator: + fullnameOverride: mpi-operator + crd: + create: false + rbac: + clusterResources: + create: false + +minio: + service: + type: ClusterIP + port: 9000 + nodePort: "" + consoleService: + type: ClusterIP + port: 9001 + nodePort: "" + +spark-operator: + enabled: false + +pipelines: + service: + type : ClusterIP + nodePort: "" + crd: + enabled: false + priority_class: + enabled: false + +kube-prometheus-stack: + enabled: false diff --git a/charts/mlrun-ce/non_admin_installation_values.yaml b/charts/mlrun-ce/non_admin_installation_values.yaml new file mode 100644 index 00000000..e4d4827a --- /dev/null +++ b/charts/mlrun-ce/non_admin_installation_values.yaml @@ -0,0 +1,60 @@ +# Use this Values file for installing MLRun CE resources such as: deployments, non cluster resources (.e.g. crd, cluter role) and installing service as clusterIP. +# remember to use a different namespace that used for the cluster resource installation. (support MLRun. mpi, nuclio and kfp pipeline installation) + +# We use global values scope to multiplex the docker-registry details to both mlrun and nuclio +global: + nuclio: + dashboard: + nodePort: 30050 + +nuclio: + crd: + create: false + +mlrun: + api: + service: + type: NodePort + nodePort: 30070 + ui: + service: + type: NodePort + nodePort: 30060 +jupyterNotebook: + service: + type: NodePort + nodePort: 30040 + port: 8888 + +mpi-operator: + fullnameOverride: mpi-operator + crd: + create: false + rbac: + clusterResources: + create: false + +minio: + service: + type: NodePort + port: 9000 + nodePort: 30080 + consoleService: + type: NodePort + port: 9001 + nodePort: 30090 + +spark-operator: + enabled: false + +pipelines: + service: + type : NodePort + nodePort: 30010 + crd: + enabled: false + priority_class: + enabled: false + +kube-prometheus-stack: + enabled: false diff --git a/charts/mlrun-ce/requirements.lock b/charts/mlrun-ce/requirements.lock index b5b4123c..a58b4711 100644 --- a/charts/mlrun-ce/requirements.lock +++ b/charts/mlrun-ce/requirements.lock @@ -1,7 +1,7 @@ dependencies: - name: nuclio repository: https://nuclio.github.io/nuclio/charts - version: 0.17.13 + version: 0.18.3 - name: mlrun repository: https://v3io.github.io/helm-charts/stable version: 0.9.16 @@ -17,5 +17,5 @@ dependencies: - name: kube-prometheus-stack repository: https://prometheus-community.github.io/helm-charts version: 41.7.2 -digest: sha256:ef115a3d4eab8b4d568208ab979efd1cfbe8f854e232e0300c04a1c9b53ed79f -generated: "2023-08-21T16:01:38.348435+03:00" +digest: sha256:1fe93cb969f5c1e6676a58feb4c8b18210158a12cfe6fc8a6acf58ad1b2c4327 +generated: "2023-10-04T11:56:24.400537+03:00" diff --git a/charts/mlrun-ce/requirements.yaml b/charts/mlrun-ce/requirements.yaml index ba647623..18a4827d 100644 --- a/charts/mlrun-ce/requirements.yaml +++ b/charts/mlrun-ce/requirements.yaml @@ -1,10 +1,11 @@ dependencies: - name: nuclio - version: "0.17.13" + version: "0.18.3" repository: "https://nuclio.github.io/nuclio/charts" - name: mlrun version: "0.9.16" repository: "https://v3io.github.io/helm-charts/stable" + condition: mlrun.enabled - name: mpi-operator version: "0.6.0" repository: "https://v3io.github.io/helm-charts/stable" @@ -20,4 +21,3 @@ dependencies: repository: "https://prometheus-community.github.io/helm-charts" version: "41.7.2" condition: kube-prometheus-stack.enabled - diff --git a/charts/mlrun-ce/templates/NOTES.txt b/charts/mlrun-ce/templates/NOTES.txt index f77dc4bf..c3249253 100644 --- a/charts/mlrun-ce/templates/NOTES.txt +++ b/charts/mlrun-ce/templates/NOTES.txt @@ -1,17 +1,20 @@ +{{- if or (.Values.jupyterNotebook.enabled) (.Values.mlrun.enabled) (.Values.minio.enabled) (.Values.pipelines.enabled) ( index .Values "kube-prometheus-stack" "enabled")}} You're up and running ! - +{{- if .Values.jupyterNotebook.enabled }} 1. Jupyter UI is available at: http://{{ .Values.global.externalHostAddress }}:{{ .Values.jupyterNotebook.service.nodePort }} - +{{- end}} +{{- if .Values.nuclio.dashboard.enabled }} 2. Nuclio UI is available at: http://{{ .Values.global.externalHostAddress }}:{{ .Values.global.nuclio.dashboard.nodePort }} - +{{- end}} +{{- if .Values.mlrun.enabled }} 3. MLRun UI is available at: http://{{ .Values.global.externalHostAddress }}:{{ .Values.mlrun.ui.service.nodePort }} 4. MLRun API is exposed externally at: http://{{ .Values.global.externalHostAddress }}:{{ .Values.mlrun.api.service.nodePort }} - +{{- end}} {{- if .Values.minio.enabled }} 5. Minio API is exposed externally at: @@ -29,18 +32,18 @@ You're up and running ! {{- if .Values.pipelines.enabled }} 7. Pipelines UI is available at: - http://{{ .Values.global.externalHostAddress }}:30100 + http://{{ .Values.global.externalHostAddress }}:{{ .Values.pipelines.service.nodePort }} {{- end }} {{- if index .Values "kube-prometheus-stack" "enabled" }} - 8. Grafana UI is available at: - http://{{ .Values.global.externalHostAddress }}:30110 + http://{{ .Values.global.externalHostAddress }}:{{ index .Values "kube-prometheus-stack" "grafana" "service" "nodePort"}} 9. Prometheus UI is available at: - http://{{ .Values.global.externalHostAddress }}:30120 + http://{{ .Values.global.externalHostAddress }}:{{ index .Values "kube-prometheus-stack" "prometheus" "service" "nodePort"}} {{- end }} Happy MLOPSing !!! :] +{{- end}} \ No newline at end of file diff --git a/charts/mlrun-ce/templates/_helpers.tpl b/charts/mlrun-ce/templates/_helpers.tpl index 7329acf1..9d4d9955 100644 --- a/charts/mlrun-ce/templates/_helpers.tpl +++ b/charts/mlrun-ce/templates/_helpers.tpl @@ -3,6 +3,7 @@ {{/* Create fully qualified names. */}} + {{- define "mlrun-ce.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -118,9 +119,11 @@ Create chart name and version as used by the chart label. Minio Service URL */}} {{- define "mlrun-ce.minio.service.url" -}} -http://minio.mlrun.svc.cluster.local:{{ .Values.minio.service.port }} +http://minio.{{.Release.Namespace}}.svc.cluster.local:{{ .Values.minio.service.port }} +{{- end -}} +{{- define "mlrun-ce.minio-pipeline.service.url" -}} +minio.{{.Release.Namespace}}.svc.cluster.local {{- end -}} - {{/* Mlrun DB labels diff --git a/charts/mlrun-ce/templates/config/jupyter-env-configmap.yaml b/charts/mlrun-ce/templates/config/jupyter-env-configmap.yaml new file mode 100644 index 00000000..98a27d63 --- /dev/null +++ b/charts/mlrun-ce/templates/config/jupyter-env-configmap.yaml @@ -0,0 +1,10 @@ +{{ if .Values.jupyterNotebook.enabled}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: jupyter-common-env +data: + S3_ENDPOINT_URL: {{ include "mlrun-ce.minio.service.url" . }} + AWS_SECRET_ACCESS_KEY: {{ .Values.minio.rootPassword }} + AWS_ACCESS_KEY_ID: {{ .Values.minio.rootUser }} +{{- end}} diff --git a/charts/mlrun-ce/templates/config/mlrun-env-configmap.yaml b/charts/mlrun-ce/templates/config/mlrun-env-configmap.yaml index d2bd20c0..14525b3b 100644 --- a/charts/mlrun-ce/templates/config/mlrun-env-configmap.yaml +++ b/charts/mlrun-ce/templates/config/mlrun-env-configmap.yaml @@ -1,3 +1,4 @@ +{{ if .Values.mlrun.enabled}} apiVersion: v1 kind: ConfigMap metadata: @@ -19,4 +20,4 @@ data: MLRUN_FEATURE_STORE__DEFAULT_TARGETS: parquet MLRUN_MODEL_ENDPOINT_MONITORING__STORE_TYPE: sql MLRUN_MODEL_ENDPOINT_MONITORING__ENDPOINT_STORE_CONNECTION: "{{ template "mlrun-ce.mlrun.modelMonitoring.DSN" . }}" - +{{- end}} diff --git a/charts/mlrun-ce/templates/config/mlrun-pipelines-config.yaml b/charts/mlrun-ce/templates/config/mlrun-pipelines-config.yaml index 6016f9d7..f10f6e92 100644 --- a/charts/mlrun-ce/templates/config/mlrun-pipelines-config.yaml +++ b/charts/mlrun-ce/templates/config/mlrun-pipelines-config.yaml @@ -4,5 +4,5 @@ kind: ConfigMap metadata: name: mlrun-pipelines-config data: - MLRUN_KFP_URL: http://ml-pipeline.mlrun.svc.cluster.local:8888 + MLRUN_KFP_URL: http://ml-pipeline.{{.Release.Namespace}}.svc.cluster.local:8888 {{- end -}} diff --git a/charts/mlrun-ce/templates/jupyter-notebook/deployment.yaml b/charts/mlrun-ce/templates/jupyter-notebook/deployment.yaml index 05ddd75d..28519ae4 100644 --- a/charts/mlrun-ce/templates/jupyter-notebook/deployment.yaml +++ b/charts/mlrun-ce/templates/jupyter-notebook/deployment.yaml @@ -61,6 +61,16 @@ spec: {{- if .Values.jupyterNotebook.extraEnv }} {{ toYaml .Values.jupyterNotebook.extraEnv | nindent 8 }} {{- end }} + {{- if .Values.jupyterNotebook.extraEnvKeyValue }} + {{- range $name, $value := .Values.jupyterNotebook.extraEnvKeyValue }} + - name: {{ $name }} + value: {{ $value | quote }} + {{- end }} + {{- end }} + {{- if .Values.jupyterNotebook.envFrom }} + envFrom: + {{ toYaml .Values.jupyterNotebook.envFrom | nindent 10 }} + {{- end }} volumeMounts: - mountPath: /home/jovyan/data name: notebooks @@ -69,6 +79,7 @@ spec: name: http command: [ "start-notebook.sh" ] args: + - --NotebookApp.allow_origin="*" - --ip="0.0.0.0" - --port=8888 - --NotebookApp.token='' diff --git a/charts/mlrun-ce/templates/pipelines/configmaps/pipeline-install-config.yaml b/charts/mlrun-ce/templates/pipelines/configmaps/pipeline-install-config.yaml index 8c9950b6..76d9a66e 100644 --- a/charts/mlrun-ce/templates/pipelines/configmaps/pipeline-install-config.yaml +++ b/charts/mlrun-ce/templates/pipelines/configmaps/pipeline-install-config.yaml @@ -1,7 +1,7 @@ {{- if .Values.pipelines.enabled -}} apiVersion: v1 data: - minioServiceHost: "{{ .Values.pipelines.minio.endpoint }}" + minioServiceHost: {{ include "mlrun-ce.minio-pipeline.service.url" . }} minioServicePort: "{{ .Values.pipelines.minio.endpointPort }}" ConMaxLifeTime: 120s appName: pipeline diff --git a/charts/mlrun-ce/templates/pipelines/configmaps/workflow-controller-configmap.yaml b/charts/mlrun-ce/templates/pipelines/configmaps/workflow-controller-configmap.yaml index 5058fa96..06a4d981 100644 --- a/charts/mlrun-ce/templates/pipelines/configmaps/workflow-controller-configmap.yaml +++ b/charts/mlrun-ce/templates/pipelines/configmaps/workflow-controller-configmap.yaml @@ -4,7 +4,7 @@ data: artifactRepository: | archiveLogs: true s3: - endpoint: "{{ .Values.pipelines.minio.endpoint }}:{{ .Values.pipelines.minio.endpointPort }}" + endpoint: "{{ include "mlrun-ce.minio-pipeline.service.url" . }}:{{ .Values.pipelines.minio.endpointPort }}" bucket: "{{ .Values.pipelines.minio.bucket }}" insecure: true accessKeySecret: diff --git a/charts/mlrun-ce/templates/pipelines/crd/applications.app.k8s.io.yaml b/charts/mlrun-ce/templates/pipelines/crd/applications.app.k8s.io.yaml index 89dd9e06..fa1ff9f6 100644 --- a/charts/mlrun-ce/templates/pipelines/crd/applications.app.k8s.io.yaml +++ b/charts/mlrun-ce/templates/pipelines/crd/applications.app.k8s.io.yaml @@ -1,4 +1,4 @@ -{{- if .Values.pipelines.enabled -}} +{{- if .Values.pipelines.crd.enabled -}} apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/charts/mlrun-ce/templates/pipelines/crd/clusterworkflowtemplates.argoproj.io.yaml b/charts/mlrun-ce/templates/pipelines/crd/clusterworkflowtemplates.argoproj.io.yaml index 8e95372a..68701ed0 100644 --- a/charts/mlrun-ce/templates/pipelines/crd/clusterworkflowtemplates.argoproj.io.yaml +++ b/charts/mlrun-ce/templates/pipelines/crd/clusterworkflowtemplates.argoproj.io.yaml @@ -1,4 +1,4 @@ -{{- if .Values.pipelines.enabled -}} +{{- if .Values.pipelines.crd.enabled -}} apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/charts/mlrun-ce/templates/pipelines/crd/cronworkflows.argoproj.io.yaml b/charts/mlrun-ce/templates/pipelines/crd/cronworkflows.argoproj.io.yaml index 250de2e2..ec4e440f 100644 --- a/charts/mlrun-ce/templates/pipelines/crd/cronworkflows.argoproj.io.yaml +++ b/charts/mlrun-ce/templates/pipelines/crd/cronworkflows.argoproj.io.yaml @@ -1,4 +1,4 @@ -{{- if .Values.pipelines.enabled -}} +{{- if .Values.pipelines.crd.enabled -}} apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/charts/mlrun-ce/templates/pipelines/crd/scheduledworkflows.kubeflow.org.yaml b/charts/mlrun-ce/templates/pipelines/crd/scheduledworkflows.kubeflow.org.yaml index 74b7bcda..47fe2c4f 100644 --- a/charts/mlrun-ce/templates/pipelines/crd/scheduledworkflows.kubeflow.org.yaml +++ b/charts/mlrun-ce/templates/pipelines/crd/scheduledworkflows.kubeflow.org.yaml @@ -1,4 +1,4 @@ -{{- if .Values.pipelines.enabled -}} +{{- if .Values.pipelines.crd.enabled -}} apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/charts/mlrun-ce/templates/pipelines/crd/viewers.kubeflow.org.yaml b/charts/mlrun-ce/templates/pipelines/crd/viewers.kubeflow.org.yaml index 9e961d08..1d38b479 100644 --- a/charts/mlrun-ce/templates/pipelines/crd/viewers.kubeflow.org.yaml +++ b/charts/mlrun-ce/templates/pipelines/crd/viewers.kubeflow.org.yaml @@ -1,4 +1,4 @@ -{{- if .Values.pipelines.enabled -}} +{{- if .Values.pipelines.crd.enabled -}} apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/charts/mlrun-ce/templates/pipelines/crd/workfloweventbindings.argoproj.io.yaml b/charts/mlrun-ce/templates/pipelines/crd/workfloweventbindings.argoproj.io.yaml index 58021831..942b3bbf 100644 --- a/charts/mlrun-ce/templates/pipelines/crd/workfloweventbindings.argoproj.io.yaml +++ b/charts/mlrun-ce/templates/pipelines/crd/workfloweventbindings.argoproj.io.yaml @@ -1,4 +1,4 @@ -{{- if .Values.pipelines.enabled -}} +{{- if .Values.pipelines.crd.enabled -}} apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/charts/mlrun-ce/templates/pipelines/crd/workflows.argoproj.io.yaml b/charts/mlrun-ce/templates/pipelines/crd/workflows.argoproj.io.yaml index c0c81ff0..b0efe7b4 100644 --- a/charts/mlrun-ce/templates/pipelines/crd/workflows.argoproj.io.yaml +++ b/charts/mlrun-ce/templates/pipelines/crd/workflows.argoproj.io.yaml @@ -1,4 +1,4 @@ -{{- if .Values.pipelines.enabled -}} +{{- if .Values.pipelines.crd.enabled -}} apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/charts/mlrun-ce/templates/pipelines/crd/workflowtaskresults.argoproj.io.yaml b/charts/mlrun-ce/templates/pipelines/crd/workflowtaskresults.argoproj.io.yaml index b014d333..eff8d9b9 100644 --- a/charts/mlrun-ce/templates/pipelines/crd/workflowtaskresults.argoproj.io.yaml +++ b/charts/mlrun-ce/templates/pipelines/crd/workflowtaskresults.argoproj.io.yaml @@ -1,4 +1,4 @@ -{{- if .Values.pipelines.enabled -}} +{{- if .Values.pipelines.crd.enabled -}} apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/charts/mlrun-ce/templates/pipelines/crd/workflowtasksets.argoproj.io.yaml b/charts/mlrun-ce/templates/pipelines/crd/workflowtasksets.argoproj.io.yaml index d4e74cec..360e9cda 100644 --- a/charts/mlrun-ce/templates/pipelines/crd/workflowtasksets.argoproj.io.yaml +++ b/charts/mlrun-ce/templates/pipelines/crd/workflowtasksets.argoproj.io.yaml @@ -1,4 +1,4 @@ -{{- if .Values.pipelines.enabled -}} +{{- if .Values.pipelines.crd.enabled -}} apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/charts/mlrun-ce/templates/pipelines/crd/workflowtemplates.argoproj.io.yaml b/charts/mlrun-ce/templates/pipelines/crd/workflowtemplates.argoproj.io.yaml index 3a43bfa4..ccf468d0 100644 --- a/charts/mlrun-ce/templates/pipelines/crd/workflowtemplates.argoproj.io.yaml +++ b/charts/mlrun-ce/templates/pipelines/crd/workflowtemplates.argoproj.io.yaml @@ -1,4 +1,4 @@ -{{- if .Values.pipelines.enabled -}} +{{- if .Values.pipelines.crd.enabled -}} apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/charts/mlrun-ce/templates/pipelines/deployments/ml-pipeline-ui.yaml b/charts/mlrun-ce/templates/pipelines/deployments/ml-pipeline-ui.yaml index bce082f5..eff70cb6 100644 --- a/charts/mlrun-ce/templates/pipelines/deployments/ml-pipeline-ui.yaml +++ b/charts/mlrun-ce/templates/pipelines/deployments/ml-pipeline-ui.yaml @@ -36,7 +36,7 @@ spec: - name: VIEWER_TENSORBOARD_POD_TEMPLATE_SPEC_PATH value: /etc/config/viewer-pod-template.json - name: MINIO_HOST - value: "{{ .Values.pipelines.minio.endpoint }}" + value: {{ include "mlrun-ce.minio-pipeline.service.url" . }} - name: MINIO_PORT value: "{{ .Values.pipelines.minio.endpointPort }}" - name: MINIO_NAMESPACE @@ -90,10 +90,6 @@ spec: periodSeconds: 5 successThreshold: 1 timeoutSeconds: 2 - resources: - requests: - cpu: 10m - memory: 70Mi terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: diff --git a/charts/mlrun-ce/templates/pipelines/deployments/ml-pipeline-visualizationserver.yaml b/charts/mlrun-ce/templates/pipelines/deployments/ml-pipeline-visualizationserver.yaml index 954a7edd..5f6a0c26 100644 --- a/charts/mlrun-ce/templates/pipelines/deployments/ml-pipeline-visualizationserver.yaml +++ b/charts/mlrun-ce/templates/pipelines/deployments/ml-pipeline-visualizationserver.yaml @@ -67,10 +67,6 @@ spec: periodSeconds: 5 successThreshold: 1 timeoutSeconds: 2 - resources: - requests: - cpu: 30m - memory: 500Mi terminationMessagePath: /dev/termination-log terminationMessagePolicy: File dnsPolicy: ClusterFirst diff --git a/charts/mlrun-ce/templates/pipelines/deployments/mysql.yaml b/charts/mlrun-ce/templates/pipelines/deployments/mysql.yaml index 0c0de72f..b1a5b3df 100644 --- a/charts/mlrun-ce/templates/pipelines/deployments/mysql.yaml +++ b/charts/mlrun-ce/templates/pipelines/deployments/mysql.yaml @@ -44,7 +44,7 @@ spec: resources: requests: cpu: 100m - memory: 800Mi + memory: 500Mi terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: diff --git a/charts/mlrun-ce/templates/pipelines/priorityclass.scheduling.k8s.io/workflow-controller.yaml b/charts/mlrun-ce/templates/pipelines/priorityclass.scheduling.k8s.io/workflow-controller.yaml index d1d5b972..be88e752 100644 --- a/charts/mlrun-ce/templates/pipelines/priorityclass.scheduling.k8s.io/workflow-controller.yaml +++ b/charts/mlrun-ce/templates/pipelines/priorityclass.scheduling.k8s.io/workflow-controller.yaml @@ -1,3 +1,4 @@ +{{- if .Values.pipelines.priority_class.enabled -}} apiVersion: scheduling.k8s.io/v1 kind: PriorityClass metadata: @@ -8,4 +9,4 @@ metadata: name: workflow-controller preemptionPolicy: PreemptLowerPriority value: 1000000 - +{{- end}} diff --git a/charts/mlrun-ce/templates/pipelines/services/ml-pipeline-ui.yaml b/charts/mlrun-ce/templates/pipelines/services/ml-pipeline-ui.yaml index 68dd652c..8cdc5a92 100644 --- a/charts/mlrun-ce/templates/pipelines/services/ml-pipeline-ui.yaml +++ b/charts/mlrun-ce/templates/pipelines/services/ml-pipeline-ui.yaml @@ -13,10 +13,10 @@ spec: port: 80 protocol: TCP targetPort: 3000 - nodePort: 30100 + nodePort: {{ .Values.pipelines.service.nodePort }} selector: app: ml-pipeline-ui application-crd-id: kubeflow-pipelines sessionAffinity: None - type: NodePort + type: {{ .Values.pipelines.service.type }} {{- end -}} diff --git a/charts/mlrun-ce/values.yaml b/charts/mlrun-ce/values.yaml index 88ea07d9..76a43b46 100644 --- a/charts/mlrun-ce/values.yaml +++ b/charts/mlrun-ce/values.yaml @@ -1,6 +1,5 @@ # We use global values scope to multiplex the docker-registry details to both mlrun and nuclio global: - # External host/ip to reach the k8s node. This might take various values if k8s is run in a VM or a cloud env externalHostAddress: localhost registry: @@ -11,7 +10,6 @@ global: nodePort: 30050 nuclio: - # coupled with mlrun.nuclio.dashboardName template in mlrun chart fullnameOverride: nuclio controller: @@ -57,6 +55,7 @@ nuclio: mlrun: # set the type of filesystem to use: filesystem, s3 + enabled: true storage: filesystem secrets: s3: @@ -117,11 +116,11 @@ mlrun: db: name: db fullnameOverride: mlrun-db - securityContext: + securityContext: runAsUser: 999 podSecurityContext: runAsUser: 999 - fsGroup: 999 + fsGroup: 999 volumes: storageOverride: persistentVolumeClaim: @@ -178,7 +177,6 @@ jupyterNotebook: # use this to override mlrunUIURL, by default it will be auto-resolved to externalHostAddress and # mlrun UI's node port mlrunUIURL: - extraEnv: - name: MLRUN_ARTIFACT_PATH value: s3://mlrun/projects/{{run.project}}/artifacts @@ -188,13 +186,11 @@ jupyterNotebook: value: "" - name: MLRUN_FEATURE_STORE__DEFAULT_TARGETS value: "parquet" - - name: S3_ENDPOINT_URL - value: http://minio.mlrun.svc.cluster.local:9000 - - name: AWS_SECRET_ACCESS_KEY - value: minio123 - - name: AWS_ACCESS_KEY_ID - value: minio + extraEnvKeyValue: {} + envFrom: + - configMapRef: + name: jupyter-common-env persistence: enabled: true existingClaim: @@ -261,6 +257,12 @@ spark-operator: pipelines: enabled: true name: pipelines + service: + nodePort: 30100 + crd: + enabled: true + priority_class: + enabled: true persistence: enabled: true existingClaim: @@ -281,7 +283,6 @@ pipelines: enabled: true accessKey: "minio" secretKey: "minio123" - endpoint: "minio.mlrun.svc.cluster.local" endpointPort: "9000" bucket: "mlrun" images: @@ -357,12 +358,12 @@ kube-prometheus-stack: enabled: true service: type: NodePort - nodePort: 30110 + nodePort: 30010 prometheus: enabled: true service: type: NodePort - nodePort: 30120 + nodePort: 30020 prometheusSpec: storageSpec: volumeClaimTemplate: diff --git a/tests/compare.py b/tests/compare.py new file mode 100644 index 00000000..3bcd9017 --- /dev/null +++ b/tests/compare.py @@ -0,0 +1,43 @@ +import sys +from pathlib import Path +import ruamel.yaml + + +def difference(d1, d2, keep=[]): + if isinstance(d1, dict): + assert isinstance(d2, dict) + to_delete = set() + for k, v in d1.items(): + if isinstance(v, (dict, list)): + difference(v, d2[k], keep=keep) + continue + if k in keep: + continue + if k in d2: + to_delete.add(k) + difference(v, d2[k], keep=keep) + for k in to_delete: + del d1[k] + + elif isinstance(d1, list): + assert isinstance(d2, list) + to_delete = set() + for idx, elem in enumerate(d1): + if isinstance(elem, (dict, list)): + difference(elem, d2[idx], keep=keep) + elif elem in d2: + to_delete.add(elem) + for elem in to_delete: + d1.remove(elem) + return d1 + + +yaml = ruamel.yaml.YAML() +yaml.indent(sequence=4, offset=2) +file_1 = open('/Users/Gilad_Shapira/PycharmProjects/ce/charts/mlrun-ce/values.yaml').read() +file_2 = open('/Users/Gilad_Shapira/PycharmProjects/ce/charts/mlrun-ce/admin_installation_values.yaml').read() +data1 = yaml.load(file_1) +data2 = yaml.load(file_2) +print(data2) +result = difference(data1, data2) +yaml.dump(result, sys.stdout) \ No newline at end of file