From a7458c37575fde3aae12517af84f35f552ab7a3a Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Thu, 1 Aug 2024 11:45:34 -0400 Subject: [PATCH 01/21] helm chart action - initial commit --- .github/workflows/helm-chart.yml | 32 ++++ README.md | 10 +- releases/R2024b/matlab-prodserver/Chart.yaml | 5 + .../templates/mps-1-service-ingress.yaml | 83 ++++++++++ .../templates/mps-2-configmap.yaml | 67 ++++++++ .../templates/mps-3-deployment.yaml | 146 ++++++++++++++++++ releases/R2024b/matlab-prodserver/values.yaml | 89 +++++++++++ values-overrides.yaml | 2 +- 8 files changed, 428 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/helm-chart.yml create mode 100644 releases/R2024b/matlab-prodserver/Chart.yaml create mode 100644 releases/R2024b/matlab-prodserver/templates/mps-1-service-ingress.yaml create mode 100644 releases/R2024b/matlab-prodserver/templates/mps-2-configmap.yaml create mode 100644 releases/R2024b/matlab-prodserver/templates/mps-3-deployment.yaml create mode 100644 releases/R2024b/matlab-prodserver/values.yaml diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml new file mode 100644 index 0000000..59b1330 --- /dev/null +++ b/.github/workflows/helm-chart.yml @@ -0,0 +1,32 @@ +name: Prerelease Helm Chart + +on: + workflow_dispatch: + +env: + HELM_CHART_VERSION: 1.1.0 + MATLAB_APP_VERSION: "R2024b" + +jobs: + release-helm-chart: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Install Helm + uses: azure/setup-helm@v4 + + - name: Package the chart + run: helm package releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver --version ${{ env.HELM_CHART_VERSION }} --app-version ${{ env.MATLAB_APP_VERSION }} + + - name: Login to GitHub Container Registry + run: echo ${{ secrets.CR_TOKEN }} | helm registry login ${{ secrets.MATHWORKS_REGISTRY }} --username ${{ secrets.CR_USER }} --password-stdin + + - name: Deploy the chart + run: helm push matlab-prodserver-k8s-${{ env.HELM_CHART_VERSION }}.tgz oci://${{ secrets.MATHWORKS_REGISTRY }} + diff --git a/README.md b/README.md index 9d6fe9f..ce4c7be 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,11 @@ Before starting, you need the following: * [Git™](https://git-scm.com/) * [Docker®](https://www.docker.com/) * Running [Kubernetes](https://kubernetes.io/) cluster that meets the following conditions: - * Uses Kubernetes version 1.27 or later. + * Uses Kubernetes version 1.28 or later. * Each MATLAB Production Server container in the Kubernetes cluster requires at least 1 CPU core and 2 GiB RAM. * [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) command-line tool that can access your Kubernetes cluster * [Helm](https://helm.sh/) package manager to install Helm charts that contain preconfigured Kubernetes resources for MATLAB Production Server - * Uses Helm version v3.13.0 or later. + * Uses Helm version v3.14 or later. If you do not have a license, please contact your MathWorks representative [here](https://www.mathworks.com/company/aboutus/contact_us/contact_sales.html) or [request a trial license](https://www.mathworks.com/campaigns/products/trials.html?prodcode=PR). @@ -43,7 +43,7 @@ The MATLAB Production Server on Kubernetes GitHub repository contains Helm chart ``` This repository includes Helm chart folders for each supported MATLAB Production Server release and a `values-overrides.yaml` file containing configuration options that apply across all release deployments. -2. Navigate to the Helm chart folder for the release you want to use. Replace `` with the release version, for example, `R2024a`. +2. Navigate to the Helm chart folder for the release you want to use. Replace `` with the release version, for example, `R2024b`. ``` cd matlab-production-server-on-kubernetes/releases//matlab-prodserver ``` @@ -60,7 +60,7 @@ The MATLAB Production Server on Kubernetes GitHub repository contains Helm chart ``` * `containers.mathworks.com` is the name of the container registry. * `matlab-production-server` is the name of the repository. - * `` is the tag name of the MATLAB Production Server release, for example, `r2024a`. + * `` is the tag name of the MATLAB Production Server release, for example, `r2024b`. The `values.yaml` file specifies these values in the `productionServer` section, in the `registry`, `repository`, and `tag` variables, respectively. @@ -71,7 +71,7 @@ The MATLAB Production Server on Kubernetes GitHub repository contains Helm chart ``` * `containers.mathworks.com` is the name of the container registry. * `matlab-runtime` is the name of the repository. - * `` is the tag name of the MATLAB Runtime release. Update this value to the release version of the MATLAB Runtime you are using, for example, `r2024a`. MATLAB Production Server supports MATLAB Runtime versions up to six releases back from the MATLAB Production Server version you are using. + * `` is the tag name of the MATLAB Runtime release. Update this value to the release version of the MATLAB Runtime you are using, for example, `r2024b`. MATLAB Production Server supports MATLAB Runtime versions up to six releases back from the MATLAB Production Server version you are using. The `values.yaml` file specifies these values in the `matlabRuntime` section, in the `registry`, `repository`, and `tag` variables, respectively. diff --git a/releases/R2024b/matlab-prodserver/Chart.yaml b/releases/R2024b/matlab-prodserver/Chart.yaml new file mode 100644 index 0000000..fac2a9f --- /dev/null +++ b/releases/R2024b/matlab-prodserver/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +appVersion: "R2024b" +description: MATLAB Production Server Helm chart for Kubernetes +name: matlab-prodserver-k8s +version: 1.1.0 diff --git a/releases/R2024b/matlab-prodserver/templates/mps-1-service-ingress.yaml b/releases/R2024b/matlab-prodserver/templates/mps-1-service-ingress.yaml new file mode 100644 index 0000000..0c2c9a5 --- /dev/null +++ b/releases/R2024b/matlab-prodserver/templates/mps-1-service-ingress.yaml @@ -0,0 +1,83 @@ +# +# Expose MATLAB Production Server internal endpoint +# +kind: Service +apiVersion: v1 +metadata: + name: matlab-production-server + namespace: {{ .Release.Namespace }} + labels: + app: mps + release: {{ .Release.Name }} +spec: + selector: + app: mps + ports: + - name: mps-port + port: 9910 + targetPort: 9910 + type: ClusterIP + +--- +{{- if .Values.global.ingressController.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: matlab-production-server-ingress + namespace: {{ .Release.Namespace }} + labels: + release: {{ .Release.Name }} + annotations: + {{ if .Values.global.ingressController }} + ## set ingress-conroller vendor-specific annotations: + {{- range $key, $value := .Values.global.ingressController.annotations }} + {{ $key }}: {{ quote $value }} + {{- end }} + {{ end }} +spec: + ingressClassName: {{ .Values.global.ingressController.name }} + {{ if .Values.global.ingressController.tls.enabled }} + tls: + - hosts: + - {{ .Values.global.ingressController.domainBase }} + {{- if .Values.global.ingressController.tls.secretName }} + secretName: {{ .Values.global.ingressController.tls.secretName }} + {{- end }} + {{ end }} + + rules: + - host: {{ .Values.global.ingressController.domainBase }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: matlab-production-server + port: + number: 9910 +{{- end }} + +--- +{{ if and (.Values.optionalSettings.Prometheus.enabled) (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor") }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: matlab-production-server-monitor + labels: + app: mps + app.kubernetes.io/part-of: {{ .Values.optionalSettings.Prometheus.matchOn }} + release: {{ .Values.optionalSettings.Prometheus.matchOn }} +spec: + selector: + matchLabels: + app: mps + release: {{ .Release.Name }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + endpoints: + - port: mps-port + path: /api/metrics +{{ end }} + diff --git a/releases/R2024b/matlab-prodserver/templates/mps-2-configmap.yaml b/releases/R2024b/matlab-prodserver/templates/mps-2-configmap.yaml new file mode 100644 index 0000000..3b3dfec --- /dev/null +++ b/releases/R2024b/matlab-prodserver/templates/mps-2-configmap.yaml @@ -0,0 +1,67 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: matlab-production-server-config + namespace: {{ .Release.Namespace }} + labels: + release: {{ .Release.Name }} +data: + main_config: | + --http 9910 + --ssl-verify-peer-mode no-verify-peer + --ssl-protocols TLSv1.2 + --ssl-ciphers ALL + --mcr-root /opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }} + --num-workers {{ .Values.matlabProductionServerSettings.numWorkers | default 1 }} + --worker-restart-interval 12:00:00 + --worker-memory-check-interval 0:00:30 + --queue-time-trigger 0:00:00.25 + --queue-time-target 0:00:00.25 + --num-threads 1 + --auto-deploy-root ./auto_deploy + --request-size-limit 64MB + --log-severity information + --log-rotation-size 100MB + --log-archive-root ./old_logs + --log-archive-max-size 1GB + --log-root ./log + --log-stdout + --license {{ .Values.global.licenseServer | default "27000@hostname" }} + --license-grace-period 2:30 + --license-poll-interval 0:10 + --pid-root ./pid + --endpoint-root ./endpoint + --extract-root . + --socket-root ./.mps_socket + --main-log-format text/plain + --disable-control-c + --enable-graceful-shutdown + --no-display + --enable-http-pipelining + --server-memory-threshold 2GB + --server-memory-threshold-overflow-action purge_responses + --enable-discovery + --enable-metrics + --routes-file ./config/routes.json + + {{- if .Values.optionalSettings.Redis.host }} + mps_cache_config: | + {"Connections": + {"{{ .Values.optionalSettings.Redis.name }}": + {"Provider":"Redis", + "Host":{{ .Values.optionalSettings.Redis.host | quote }}, + "Port":{{ .Values.optionalSettings.Redis.port | default 6379 }} + {{- if .Values.optionalSettings.Redis.auth }} + ,"Key":{{ .Values.optionalSettings.Redis.auth | quote }} + {{- end }} + } + } + } + {{- end }} + + routes.json: | + { + "version": "1.0.0", + "pathmap": [] + } + diff --git a/releases/R2024b/matlab-prodserver/templates/mps-3-deployment.yaml b/releases/R2024b/matlab-prodserver/templates/mps-3-deployment.yaml new file mode 100644 index 0000000..09fa146 --- /dev/null +++ b/releases/R2024b/matlab-prodserver/templates/mps-3-deployment.yaml @@ -0,0 +1,146 @@ +# +# MATLAB Production Server instance +# +apiVersion: apps/v1 +kind: Deployment +metadata: + name: matlab-production-server + namespace: {{ .Release.Namespace }} + labels: + app: mps + release: {{ .Release.Name }} +spec: + replicas: {{ .Values.deploymentSettings.replicaCount }} + selector: + matchLabels: + app: mps + template: + metadata: + labels: + app: mps + annotations: + {{ if not .Values.optionalSettings.Prometheus.enabled }} + prometheus.io/scrape: 'true' + prometheus.io/path: '/api/metrics' + prometheus.io/port: '9910' + {{ end }} + spec: + securityContext: + runAsNonRoot: true + runAsUser: 1000 + runAsGroup: 1000 + + containers: + - name: mps + image: {{ .Values.global.images.registry | default .Values.images.productionServer.registry }}/{{ .Values.images.productionServer.repository }}:{{ .Values.images.productionServer.tag }} + env: + - name: AGREE_TO_MATHWORKS_SOFTWARE_LICENSE + value: {{ required "agreeToLicense must be set to \"yes\"." .Values.global.agreeToLicense | default "no" | lower | quote }} + - name: AGREE_TO_MATLAB_RUNTIME_LICENSE + value: {{ required "agreeToLicense must be set to \"yes\"." .Values.global.agreeToLicense | default "no" | lower | quote }} + - name: LD_LIBRARY_PATH + value: "/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/runtime/glnxa64:/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/bin/glnxa64:/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/sys/os/glnxa64:/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/extern/bin/glnxa64:/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/sys/opengl/lib/glnxa64" + {{ if .Values.optionalSettings.Redis.secretName }} + - name: MPS_REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.optionalSettings.Redis.secretName }} + key: {{ .Values.optionalSettings.Redis.secretKey | default "redis-password" }} + {{ end }} + + ports: + - containerPort: 9910 + + resources: + requests: + cpu: {{ .Values.deploymentSettings.cpuRequest | default "1" | quote }} + memory: {{ .Values.deploymentSettings.memoryRequest | default "2Gi" | quote }} + limits: + cpu: {{ .Values.matlabProductionServerSettings.numWorkers | default "1" | quote }} + memory: "8Gi" + + volumeMounts: + - name: auto-deploy + mountPath: "/opt/mpsinstance/auto_deploy" + - name: mcr-root + mountPath: "/opt/matlabruntime" + - name: mps-config + mountPath: "/opt/mpsinstance/config" + + startupProbe: + exec: + command: + - ls + - /opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/matlabruntime_license_agreement.pdf + initialDelaySeconds: 10 + periodSeconds: 30 + + livenessProbe: + httpGet: + path: /api/health + port: 9910 + initialDelaySeconds: 10 + periodSeconds: 10 + + lifecycle: + preStop: + exec: + command: ["sh", "/opt/mpsinstance/stopmps.sh"] + + imagePullPolicy: {{ .Values.images.productionServer.pullPolicy }} + + initContainers: + - name: matlab-runtime + image: {{ .Values.global.images.registry | default .Values.images.matlabRuntime.registry }}/{{ .Values.images.matlabRuntime.repository }}:{{ .Values.images.matlabRuntime.tag }} + + command: + - /bin/sh + - -c + - "cp -r /opt/matlabruntime/* /mnt/" + + volumeMounts: + - name: mcr-root + mountPath: "/mnt" + + imagePullPolicy: {{ .Values.images.matlabRuntime.pullPolicy }} + + restartPolicy: {{ .Values.deploymentSettings.restartPolicy }} + imagePullSecrets: + {{- if .Values.global.images.pullSecret }} + - name: {{ .Values.global.images.pullSecret }} + {{- end }} + {{- if .Values.images.productionServer.pullSecret }} + - name: {{ .Values.images.productionServer.pullSecret }} + {{- end }} + {{- if and .Values.images.matlabRuntime.pullSecret (ne .Values.images.matlabRuntime.pullSecret .Values.images.productionServer.pullSecret) }} + - name: {{ .Values.images.matlabRuntime.pullSecret }} + {{- end }} + + volumes: + - name: mcr-root + emptyDir: {} + - name: mps-config + configMap: + name: matlab-production-server-config + - name: auto-deploy + {{- if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "hostpath" }} + hostPath: + path: {{ .Values.matlabProductionServerSettings.autoDeploy.hostpath }} + type: Directory + {{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "nfs" }} + nfs: + server: {{ .Values.matlabProductionServerSettings.autoDeploy.server }} + path: {{ .Values.matlabProductionServerSettings.autoDeploy.path }} + readOnly: true + {{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "pvc" }} + persistentVolumeClaim: + claimName: {{ .Values.matlabProductionServerSettings.autoDeploy.claimName }} + {{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "azurefileshare" }} + azureFile: + shareName: {{ .Values.matlabProductionServerSettings.autoDeploy.shareName }} + secretName: {{ .Values.matlabProductionServerSettings.autoDeploy.secretName }} + readOnly: true + {{ else }} + emptyDir: {} + {{- end }} + diff --git a/releases/R2024b/matlab-prodserver/values.yaml b/releases/R2024b/matlab-prodserver/values.yaml new file mode 100644 index 0000000..7386a7d --- /dev/null +++ b/releases/R2024b/matlab-prodserver/values.yaml @@ -0,0 +1,89 @@ +# Values for MATLAB Production Server Helm Chart + +global: + # MathWorks Cloud Reference Architecture License, example: "yes" (in quotes) + agreeToLicense: "" + # Network License Manager: server host and port number, example: 27000@hostname + licenseServer: 27000@hostname + # Override for a private container registry, example: cr.example.com, cr-secret + images: + registry: "" + pullSecret: "" + ingressController: + enabled: false # Create 'Ingress' API object + # Nginx settings (optional) + name: nginx + annotations: {} + + # Ingress host + domainBase: matlabprodserver.mwcloudtest.com + # Ingress https (tls termination) + tls: + enabled: false + # Name of kubernetes.io/tls secret with certificate data + secretName: "" + +matlabProductionServerSettings: + # CTF files are placed here for automatic deployment. + autoDeploy: + # Inline mount options: hostpath, nfs, pvc, azurefileshare, empty (default) + volumeType: "empty" + # Node mount dir, example: /mnt/share/autodeploy + hostpath: "" + # ================================================================= + # NFS server, example: server-sb08-nfs + server: "" + # NFS subpath, example: /vmgr/sandbox/share/autodeploy + path: "" + # ================================================================= + # Persistent-Volume-Claim name, example: autodeploy-pv-claim + claimName: "" + # ================================================================= + # Azure storage account file share name, example: auto-deploy-share + shareName: "" + # Azure storage account key secret name, example: azure-file-secret + secretName: "" + # ================================================================= + # Maximum number of worker processes (per pod). + numWorkers: 2 + +images: + productionServer: + registry: containers.mathworks.com + repository: matlab-production-server + tag: r2024b + variant: R2024b + pullPolicy: IfNotPresent + pullSecret: "" + + matlabRuntime: + registry: containers.mathworks.com + repository: matlab-runtime + tag: r2024b + variant: R2024b + pullPolicy: IfNotPresent + pullSecret: "" + +deploymentSettings: + cpuRequest: "1" + memoryRequest: "2Gi" + replicaCount: 1 + restartPolicy: Always + +optionalSettings: + Redis: + # Redis service fully qualified name, example: redis.namespace.svc.cluster.local + host: "" + auth: "" + name: myRedis + port: 6379 + secretName: "" + secretKey: "" + + Prometheus: + # Create a ServiceMonitor [monitoring.coreos.com/v1] for metrics discovery. + # Requires Prometheus and Prometheus Operator (CRDs) to be pre-installed. + enabled: false + # Helm release name or app.kubernetes.io/part-of label of Prometheus stack. + # ServiceMonitor needs to match on this value (if Prometheus is enabled). + matchOn: prometheus diff --git a/values-overrides.yaml b/values-overrides.yaml index a0f190e..1911581 100644 --- a/values-overrides.yaml +++ b/values-overrides.yaml @@ -12,7 +12,7 @@ global: # Ingress settings (optional) ingressController: - enabled: true # Create 'Ingress' API object + enabled: false # Create 'Ingress' API object name: nginx annotations: nginx.ingress.kubernetes.io/affinity: "cookie" From e7dd1ec527a61bb244ee9d4d30a83047b19173e4 Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Thu, 1 Aug 2024 11:48:53 -0400 Subject: [PATCH 02/21] deprecate chart older than 3 years --- releases/R2021b/matlab-prodserver/Chart.yaml | 5 - .../templates/mps-1-service-ingress.yaml | 49 ------- .../templates/mps-2-configmap.yaml | 56 -------- .../templates/mps-3-deployment.yaml | 131 ------------------ releases/R2021b/matlab-prodserver/values.yaml | 63 --------- 5 files changed, 304 deletions(-) delete mode 100644 releases/R2021b/matlab-prodserver/Chart.yaml delete mode 100644 releases/R2021b/matlab-prodserver/templates/mps-1-service-ingress.yaml delete mode 100644 releases/R2021b/matlab-prodserver/templates/mps-2-configmap.yaml delete mode 100644 releases/R2021b/matlab-prodserver/templates/mps-3-deployment.yaml delete mode 100644 releases/R2021b/matlab-prodserver/values.yaml diff --git a/releases/R2021b/matlab-prodserver/Chart.yaml b/releases/R2021b/matlab-prodserver/Chart.yaml deleted file mode 100644 index 97460b3..0000000 --- a/releases/R2021b/matlab-prodserver/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v2 -appVersion: "R2021b" -description: MATLAB Production Server Helm chart for Kubernetes -name: matlab-prodserver-k8s -version: 0.1.0 diff --git a/releases/R2021b/matlab-prodserver/templates/mps-1-service-ingress.yaml b/releases/R2021b/matlab-prodserver/templates/mps-1-service-ingress.yaml deleted file mode 100644 index 033a215..0000000 --- a/releases/R2021b/matlab-prodserver/templates/mps-1-service-ingress.yaml +++ /dev/null @@ -1,49 +0,0 @@ -# -# Expose MATLAB Production Server internal endpoint -# -kind: Service -apiVersion: v1 -metadata: - name: matlab-production-server - namespace: {{ .Release.Namespace }} - labels: - app: mps - release: {{ .Release.Name }} -spec: - selector: - app: mps - ports: - - name: mps-port - port: 9910 - targetPort: 9910 - type: ClusterIP - ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: matlab-production-server-ingress - namespace: {{ .Release.Namespace }} - labels: - release: {{ .Release.Name }} - annotations: - {{ if .Values.global.ingressController }} - ## set ingress-conroller vendor-specific annotations: - {{- range $key, $value := .Values.global.ingressController.annotations }} - {{ $key }}: {{ quote $value }} - {{- end }} - {{ end }} -spec: - ingressClassName: {{ .Values.global.ingressController.name }} - rules: - - host: {{ .Values.global.ingressController.domainBase }} - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: matlab-production-server - port: - number: 9910 - diff --git a/releases/R2021b/matlab-prodserver/templates/mps-2-configmap.yaml b/releases/R2021b/matlab-prodserver/templates/mps-2-configmap.yaml deleted file mode 100644 index 9f3e110..0000000 --- a/releases/R2021b/matlab-prodserver/templates/mps-2-configmap.yaml +++ /dev/null @@ -1,56 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: matlab-production-server-config - namespace: {{ .Release.Namespace }} - labels: - release: {{ .Release.Name }} -data: - main_config: | - --http 9910 - --ssl-verify-peer-mode no-verify-peer - --ssl-protocols TLSv1.1,TLSv1.2 - --ssl-ciphers ALL - --mcr-root /opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }} - --num-workers {{ .Values.matlabProductionServerSettings.numWorkers | default 1 }} - --worker-restart-interval 12:00:00 - --worker-memory-check-interval 0:00:30 - --queue-time-trigger 0:00:00.25 - --queue-time-target 0:00:00.25 - --num-threads 1 - --auto-deploy-root ./auto_deploy - --request-size-limit 64MB - --log-severity information - --log-rotation-size 100MB - --log-archive-root ./old_logs - --log-archive-max-size 1GB - --log-root ./log - --log-stdout - --license {{ .Values.global.licenseServer | default "27000@hostname" }} - --license-grace-period 2:30 - --license-poll-interval 0:10 - --pid-root ./pid - --endpoint-root ./endpoint - --extract-root . - --socket-root ./.mps_socket - --main-log-format text/plain - --disable-control-c - --enable-graceful-shutdown - --no-display - --enable-http-pipelining - --server-memory-threshold 2GB - --server-memory-threshold-overflow-action purge_responses - --enable-discovery - --enable-metrics - - {{- if .Values.optionalSettings.Redis.host }} - mps_cache_config: | - {"Connections": - {"{{ .Values.optionalSettings.Redis.name }}": - {"Provider":"Redis", - "Host":{{ .Values.optionalSettings.Redis.host | quote }}, - "Port":{{ .Values.optionalSettings.Redis.port | default 6379 }}} - } - } - {{- end }} - diff --git a/releases/R2021b/matlab-prodserver/templates/mps-3-deployment.yaml b/releases/R2021b/matlab-prodserver/templates/mps-3-deployment.yaml deleted file mode 100644 index a319f63..0000000 --- a/releases/R2021b/matlab-prodserver/templates/mps-3-deployment.yaml +++ /dev/null @@ -1,131 +0,0 @@ -# -# MATLAB Production Server instance -# -apiVersion: apps/v1 -kind: Deployment -metadata: - name: matlab-production-server - namespace: {{ .Release.Namespace }} - labels: - app: mps - release: {{ .Release.Name }} -spec: - replicas: {{ .Values.deploymentSettings.replicaCount }} - selector: - matchLabels: - app: mps - template: - metadata: - labels: - app: mps - annotations: - prometheus.io/scrape: 'true' - prometheus.io/path: '/api/metrics' - prometheus.io/port: '9910' - spec: - securityContext: - runAsNonRoot: true - runAsUser: 1000 - runAsGroup: 1000 - - containers: - - name: mps - image: {{ .Values.images.productionServer.registry }}/{{ .Values.images.productionServer.repository }}:{{ .Values.images.productionServer.tag }} - env: - - name: AGREE_TO_MATHWORKS_SOFTWARE_LICENSE - value: {{ .Values.global.agreeToLicense | default "no" | lower | quote }} - - name: AGREE_TO_MATLAB_RUNTIME_LICENSE - value: {{ .Values.global.agreeToLicense | default "no" | lower | quote }} - - name: LD_LIBRARY_PATH - value: "/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/runtime/glnxa64:/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/bin/glnxa64:/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/sys/os/glnxa64:/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/extern/bin/glnxa64:/opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/sys/opengl/lib/glnxa64" - - ports: - - containerPort: 9910 - - resources: - requests: - cpu: {{ .Values.deploymentSettings.cpuRequest | default "1" | quote }} - memory: {{ .Values.deploymentSettings.memoryRequest | default "2Gi" | quote }} - limits: - cpu: {{ .Values.matlabProductionServerSettings.numWorkers | default "1" | quote }} - memory: "8Gi" - - volumeMounts: - - name: auto-deploy - mountPath: "/opt/mpsinstance/auto_deploy" - - name: mcr-root - mountPath: "/opt/matlabruntime" - - name: mps-config - mountPath: "/opt/mpsinstance/config" - - startupProbe: - exec: - command: - - ls - - /opt/matlabruntime/{{ .Values.images.matlabRuntime.variant }}/MCR_license.txt - initialDelaySeconds: 30 - periodSeconds: 30 - - livenessProbe: - httpGet: - path: /api/health - port: 9910 - initialDelaySeconds: 10 - periodSeconds: 10 - - lifecycle: - preStop: - exec: - command: ["sh", "/opt/mpsinstance/stopmps.sh"] - - imagePullPolicy: {{ .Values.images.productionServer.pullPolicy }} - - initContainers: - - name: matlab-runtime - image: {{ .Values.images.matlabRuntime.registry }}/{{ .Values.images.matlabRuntime.repository }}:{{ .Values.images.matlabRuntime.tag }} - - command: - - /bin/sh - - -c - - "cp -r /opt/matlabruntime/* /mnt/" - - volumeMounts: - - name: mcr-root - mountPath: "/mnt" - - imagePullPolicy: {{ .Values.images.matlabRuntime.pullPolicy }} - - restartPolicy: {{ .Values.deploymentSettings.restartPolicy }} - imagePullSecrets: - {{- if .Values.images.productionServer.pullSecret }} - - name: {{ .Values.images.productionServer.pullSecret }} - {{- end }} - {{- if .Values.images.matlabRuntime.pullSecret }} - - name: {{ .Values.images.matlabRuntime.pullSecret }} - {{- end }} - - volumes: - - name: mcr-root - emptyDir: {} - - name: mps-config - configMap: - name: matlab-production-server-config - - name: auto-deploy - {{- if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "hostpath" }} - hostPath: - path: {{ .Values.matlabProductionServerSettings.autoDeploy.hostpath }} - type: Directory - {{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "nfs" }} - nfs: - server: {{ .Values.matlabProductionServerSettings.autoDeploy.server }} - path: {{ .Values.matlabProductionServerSettings.autoDeploy.path }} - readOnly: true - {{- else if eq .Values.matlabProductionServerSettings.autoDeploy.volumeType "azurefileshare" }} - azureFile: - shareName: {{ .Values.matlabProductionServerSettings.autoDeploy.shareName }} - secretName: {{ .Values.matlabProductionServerSettings.autoDeploy.secretName }} - readOnly: true - {{ else }} - emptyDir: {} - {{- end }} - diff --git a/releases/R2021b/matlab-prodserver/values.yaml b/releases/R2021b/matlab-prodserver/values.yaml deleted file mode 100644 index 79ac5d7..0000000 --- a/releases/R2021b/matlab-prodserver/values.yaml +++ /dev/null @@ -1,63 +0,0 @@ -# Values for MATLAB Production Server Helm Chart - -global: - # MathWorks Cloud Reference Architecture License, example: "yes" (in quotes) - agreeToLicense: "" - # Network License Manager: server host and port number, example: 27000@hostname - licenseServer: 27000@hostname - ingressController: - # Nginx settings (optional) - name: nginx - annotations: - nginx.ingress.kubernetes.io/load-balance: "round_robin" - domainBase: matlabprodserver.mwcloudtest.com - -matlabProductionServerSettings: - # CTF files are placed here for automatic deployment. - autoDeploy: - # Inline mount options: hostpath, nfs, azurefileshare, empty (default) - volumeType: "empty" - # Node mount dir, example: /mnt/share/autodeploy - hostpath: "" - # ================================================================= - # NFS server, example: server-sb08-nfs - server: "" - # NFS subpath, example: /vmgr/sandbox/share/autodeploy - path: "" - # ================================================================= - # Azure storage account file share name, example: auto-deploy-share - shareName: "" - # Azure storage account key secret name, example: azure-file-secret - secretName: "" - # ================================================================= - # Maximum number of worker processes (per pod). - numWorkers: 2 - -images: - productionServer: - registry: containers.mathworks.com - repository: matlab-production-server - tag: r2021b - variant: R2021b - pullPolicy: IfNotPresent - pullSecret: "" - - matlabRuntime: - registry: containers.mathworks.com - repository: matlab-runtime - tag: r2021b - variant: v911 - pullPolicy: IfNotPresent - pullSecret: "" - -deploymentSettings: - cpuRequest: "1" - memoryRequest: "2Gi" - replicaCount: 1 - restartPolicy: Always - -optionalSettings: - Redis: - host: {} - name: myRedis - From 76a06214a54033dd7c13a050bde0be1c78b97c5a Mon Sep 17 00:00:00 2001 From: Eitan Steiner <49420823+esteinerMW@users.noreply.github.com> Date: Thu, 1 Aug 2024 14:15:58 -0400 Subject: [PATCH 03/21] helm chart action - initial commit From 4089af2446c83895daf028eec4c9b32be00914a3 Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Thu, 1 Aug 2024 15:30:05 -0400 Subject: [PATCH 04/21] Enable action for non-main branch --- .github/workflows/helm-chart.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index 59b1330..eab727a 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -2,6 +2,9 @@ name: Prerelease Helm Chart on: workflow_dispatch: + push: + branches: + - Helm_artifacts env: HELM_CHART_VERSION: 1.1.0 From affe8c7c84f898a526c6a2d734ac85a430a7b97b Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 13:53:43 -0400 Subject: [PATCH 05/21] Added chart version check --- .github/workflows/helm-chart.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index eab727a..567ae1d 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -16,6 +16,8 @@ jobs: permissions: contents: read packages: write + env: + CHART_DIR: releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver steps: - name: Check out the repo @@ -24,8 +26,12 @@ jobs: - name: Install Helm uses: azure/setup-helm@v4 + - name: Check chart version + run: | + grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "${{ env.MATLAB_APP_VERSION }}"' ${CHART_DIR}/Chart.yaml + - name: Package the chart - run: helm package releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver --version ${{ env.HELM_CHART_VERSION }} --app-version ${{ env.MATLAB_APP_VERSION }} + run: helm package ${CHART_DIR} --version ${{ env.HELM_CHART_VERSION }} --app-version ${{ env.MATLAB_APP_VERSION }} - name: Login to GitHub Container Registry run: echo ${{ secrets.CR_TOKEN }} | helm registry login ${{ secrets.MATHWORKS_REGISTRY }} --username ${{ secrets.CR_USER }} --password-stdin From befcae3dbf3799f98d94360fded78c0fdb11ba4a Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 16:10:55 -0400 Subject: [PATCH 06/21] Added chart version check --- .github/workflows/helm-chart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index 567ae1d..41b1192 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -17,7 +17,7 @@ jobs: contents: read packages: write env: - CHART_DIR: releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver + CHART_DIR: releases/${MATLAB_APP_VERSION}/matlab-prodserver steps: - name: Check out the repo From db021304889b22ad5fb417e0f6892380f84e5126 Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 16:45:57 -0400 Subject: [PATCH 07/21] Added chart version check --- .github/workflows/helm-chart.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index 41b1192..4e30755 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -17,7 +17,7 @@ jobs: contents: read packages: write env: - CHART_DIR: releases/${MATLAB_APP_VERSION}/matlab-prodserver + CHART_DIR: "releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver" steps: - name: Check out the repo @@ -28,6 +28,7 @@ jobs: - name: Check chart version run: | + echo S{CHART_DIR} grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "${{ env.MATLAB_APP_VERSION }}"' ${CHART_DIR}/Chart.yaml - name: Package the chart From 9b53ab8c23f575f587af990ff171fd48d57819e1 Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 17:16:06 -0400 Subject: [PATCH 08/21] Added chart version check --- .github/workflows/helm-chart.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index 4e30755..edce6ea 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -16,8 +16,6 @@ jobs: permissions: contents: read packages: write - env: - CHART_DIR: "releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver" steps: - name: Check out the repo @@ -27,12 +25,15 @@ jobs: uses: azure/setup-helm@v4 - name: Check chart version + id: check_chart run: | - echo S{CHART_DIR} + CHART_DIR="releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver" + echo $CHART_DIR grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "${{ env.MATLAB_APP_VERSION }}"' ${CHART_DIR}/Chart.yaml + echo "::set-output name=chart_dir::${CHART_DIR}" - name: Package the chart - run: helm package ${CHART_DIR} --version ${{ env.HELM_CHART_VERSION }} --app-version ${{ env.MATLAB_APP_VERSION }} + run: helm package ${{ steps.check_chart.outouts.chart_dir }} --version ${{ env.HELM_CHART_VERSION }} --app-version ${{ env.MATLAB_APP_VERSION }} - name: Login to GitHub Container Registry run: echo ${{ secrets.CR_TOKEN }} | helm registry login ${{ secrets.MATHWORKS_REGISTRY }} --username ${{ secrets.CR_USER }} --password-stdin From b05a3b9ca1a23f08c94a5e5e2e3a74b155bb79c2 Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 17:40:14 -0400 Subject: [PATCH 09/21] Added chart version check --- .github/workflows/helm-chart.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index edce6ea..eff36ed 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -25,15 +25,13 @@ jobs: uses: azure/setup-helm@v4 - name: Check chart version - id: check_chart run: | CHART_DIR="releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver" - echo $CHART_DIR grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "${{ env.MATLAB_APP_VERSION }}"' ${CHART_DIR}/Chart.yaml - echo "::set-output name=chart_dir::${CHART_DIR}" + echo "CHART_DIR=${CHART_DIR}" >> $GITHUB_ENV - name: Package the chart - run: helm package ${{ steps.check_chart.outouts.chart_dir }} --version ${{ env.HELM_CHART_VERSION }} --app-version ${{ env.MATLAB_APP_VERSION }} + run: helm package ${CHART_DIR} --version ${{ env.HELM_CHART_VERSION }} --app-version ${{ env.MATLAB_APP_VERSION }} - name: Login to GitHub Container Registry run: echo ${{ secrets.CR_TOKEN }} | helm registry login ${{ secrets.MATHWORKS_REGISTRY }} --username ${{ secrets.CR_USER }} --password-stdin From c1d4e6edbd5e26a2103e8c64cd03af8d49d1fd8e Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 17:55:27 -0400 Subject: [PATCH 10/21] Test run --- .github/workflows/helm-chart.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index eff36ed..d8db47a 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -7,7 +7,7 @@ on: - Helm_artifacts env: - HELM_CHART_VERSION: 1.1.0 + HELM_CHART_VERSION: 1.1.1 MATLAB_APP_VERSION: "R2024b" jobs: @@ -28,7 +28,7 @@ jobs: run: | CHART_DIR="releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver" grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "${{ env.MATLAB_APP_VERSION }}"' ${CHART_DIR}/Chart.yaml - echo "CHART_DIR=${CHART_DIR}" >> $GITHUB_ENV + echo "CHART_DIR=${CHART_DIR}" >> $GITHUB_ENV # Add to env if correct version - name: Package the chart run: helm package ${CHART_DIR} --version ${{ env.HELM_CHART_VERSION }} --app-version ${{ env.MATLAB_APP_VERSION }} From bc4f8ebe1dfeffd1a739c87037037685485e2663 Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 18:04:37 -0400 Subject: [PATCH 11/21] Test run --- .github/workflows/helm-chart.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index d8db47a..661f1e5 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -7,8 +7,8 @@ on: - Helm_artifacts env: - HELM_CHART_VERSION: 1.1.1 - MATLAB_APP_VERSION: "R2024b" + HELM_CHART_VERSION: 1.1.0 + MATLAB_APP_VERSION: "R2024a" jobs: release-helm-chart: @@ -27,6 +27,7 @@ jobs: - name: Check chart version run: | CHART_DIR="releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver" + cat ${CHART_DIR}/Chart.yaml grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "${{ env.MATLAB_APP_VERSION }}"' ${CHART_DIR}/Chart.yaml echo "CHART_DIR=${CHART_DIR}" >> $GITHUB_ENV # Add to env if correct version From b3fbccaf340cbad0467a43896daf7d7ac20af0d9 Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 18:14:26 -0400 Subject: [PATCH 12/21] Test run --- .github/workflows/helm-chart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index 661f1e5..0559b79 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -8,7 +8,7 @@ on: env: HELM_CHART_VERSION: 1.1.0 - MATLAB_APP_VERSION: "R2024a" + MATLAB_APP_VERSION: "R2024c" jobs: release-helm-chart: From 13e8039f5cc8efa116a791b92cb27223d47b4aee Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 18:43:59 -0400 Subject: [PATCH 13/21] Test run --- .github/workflows/helm-chart.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index 0559b79..ba820d5 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -7,8 +7,8 @@ on: - Helm_artifacts env: - HELM_CHART_VERSION: 1.1.0 - MATLAB_APP_VERSION: "R2024c" + HELM_CHART_VERSION: 1.1.1 + MATLAB_APP_VERSION: "R2024b" jobs: release-helm-chart: @@ -26,10 +26,10 @@ jobs: - name: Check chart version run: | - CHART_DIR="releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver" + echo "CHART_DIR=releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver" >> $GITHUB_ENV cat ${CHART_DIR}/Chart.yaml grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "${{ env.MATLAB_APP_VERSION }}"' ${CHART_DIR}/Chart.yaml - echo "CHART_DIR=${CHART_DIR}" >> $GITHUB_ENV # Add to env if correct version + # echo "CHART_DIR=${CHART_DIR}" >> $GITHUB_ENV # Add to env if correct version - name: Package the chart run: helm package ${CHART_DIR} --version ${{ env.HELM_CHART_VERSION }} --app-version ${{ env.MATLAB_APP_VERSION }} From e82b225a9e3c0c8900e6e2124861d07b0558905f Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 18:54:45 -0400 Subject: [PATCH 14/21] Test run --- .github/workflows/helm-chart.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index ba820d5..64c963e 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -8,7 +8,7 @@ on: env: HELM_CHART_VERSION: 1.1.1 - MATLAB_APP_VERSION: "R2024b" + MATLAB_APP_VERSION: "R2024c" jobs: release-helm-chart: @@ -24,12 +24,15 @@ jobs: - name: Install Helm uses: azure/setup-helm@v4 - - name: Check chart version + - name: Check that chart exists run: | - echo "CHART_DIR=releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver" >> $GITHUB_ENV + CHART_DIR="releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver" cat ${CHART_DIR}/Chart.yaml + echo "CHART_DIR=${CHART_DIR}" >> $GITHUB_ENV # Add to env if exists + + - name: Check chart version + run: | grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "${{ env.MATLAB_APP_VERSION }}"' ${CHART_DIR}/Chart.yaml - # echo "CHART_DIR=${CHART_DIR}" >> $GITHUB_ENV # Add to env if correct version - name: Package the chart run: helm package ${CHART_DIR} --version ${{ env.HELM_CHART_VERSION }} --app-version ${{ env.MATLAB_APP_VERSION }} From b08447ac851390f00735cc5166905137e2369654 Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 18:58:12 -0400 Subject: [PATCH 15/21] Test run --- .github/workflows/helm-chart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index 64c963e..e2e1dec 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -8,7 +8,7 @@ on: env: HELM_CHART_VERSION: 1.1.1 - MATLAB_APP_VERSION: "R2024c" + MATLAB_APP_VERSION: "R2024b" jobs: release-helm-chart: From 351eac45983765e7de2c7ace68f28e486a3faa3e Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 19:04:00 -0400 Subject: [PATCH 16/21] Test run --- .github/workflows/helm-chart.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index e2e1dec..b9623bb 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -7,7 +7,7 @@ on: - Helm_artifacts env: - HELM_CHART_VERSION: 1.1.1 + HELM_CHART_VERSION: 1.1.0 MATLAB_APP_VERSION: "R2024b" jobs: @@ -32,7 +32,8 @@ jobs: - name: Check chart version run: | - grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "${{ env.MATLAB_APP_VERSION }}"' ${CHART_DIR}/Chart.yaml + # grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "${{ env.MATLAB_APP_VERSION }}"' ${CHART_DIR}/Chart.yaml + grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "R2024a"' ${CHART_DIR}/Chart.yaml - name: Package the chart run: helm package ${CHART_DIR} --version ${{ env.HELM_CHART_VERSION }} --app-version ${{ env.MATLAB_APP_VERSION }} From 9400d753c71f533efaa598c7ffef5674ac094b25 Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 19:08:49 -0400 Subject: [PATCH 17/21] Test run --- .github/workflows/helm-chart.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index b9623bb..9f4ab71 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -8,7 +8,7 @@ on: env: HELM_CHART_VERSION: 1.1.0 - MATLAB_APP_VERSION: "R2024b" + MATLAB_APP_VERSION: "R2024c" jobs: release-helm-chart: @@ -26,14 +26,12 @@ jobs: - name: Check that chart exists run: | - CHART_DIR="releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver" - cat ${CHART_DIR}/Chart.yaml + CHART_DIR="releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver" && cat ${CHART_DIR}/Chart.yaml echo "CHART_DIR=${CHART_DIR}" >> $GITHUB_ENV # Add to env if exists - name: Check chart version run: | - # grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "${{ env.MATLAB_APP_VERSION }}"' ${CHART_DIR}/Chart.yaml - grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "R2024a"' ${CHART_DIR}/Chart.yaml + grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "${{ env.MATLAB_APP_VERSION }}"' ${CHART_DIR}/Chart.yaml - name: Package the chart run: helm package ${CHART_DIR} --version ${{ env.HELM_CHART_VERSION }} --app-version ${{ env.MATLAB_APP_VERSION }} From 2dd76fdee34f4a7cfb501c719794e462d2f3f72b Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 19:10:29 -0400 Subject: [PATCH 18/21] Cleanup --- .github/workflows/helm-chart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index 9f4ab71..c19e79d 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -8,7 +8,7 @@ on: env: HELM_CHART_VERSION: 1.1.0 - MATLAB_APP_VERSION: "R2024c" + MATLAB_APP_VERSION: "R2024b" jobs: release-helm-chart: From e2184aee0f357dd62ec63996e243338dc46c1c87 Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Fri, 2 Aug 2024 19:17:32 -0400 Subject: [PATCH 19/21] Cleanup --- .github/workflows/helm-chart.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index c19e79d..e53635d 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -29,7 +29,7 @@ jobs: CHART_DIR="releases/${{ env.MATLAB_APP_VERSION }}/matlab-prodserver" && cat ${CHART_DIR}/Chart.yaml echo "CHART_DIR=${CHART_DIR}" >> $GITHUB_ENV # Add to env if exists - - name: Check chart version + - name: Check chart versions run: | grep 'version: ${{ env.HELM_CHART_VERSION }}' ${CHART_DIR}/Chart.yaml && grep 'appVersion: "${{ env.MATLAB_APP_VERSION }}"' ${CHART_DIR}/Chart.yaml From 2ff6515b41e380e18f3517718a2ab9bfb4ae79a8 Mon Sep 17 00:00:00 2001 From: esteinerMW Date: Tue, 6 Aug 2024 15:03:16 -0400 Subject: [PATCH 20/21] Chart updates for R2024b --- .../R2024b/matlab-prodserver/templates/mps-3-deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/releases/R2024b/matlab-prodserver/templates/mps-3-deployment.yaml b/releases/R2024b/matlab-prodserver/templates/mps-3-deployment.yaml index 09fa146..1743fc8 100644 --- a/releases/R2024b/matlab-prodserver/templates/mps-3-deployment.yaml +++ b/releases/R2024b/matlab-prodserver/templates/mps-3-deployment.yaml @@ -27,8 +27,8 @@ spec: spec: securityContext: runAsNonRoot: true - runAsUser: 1000 - runAsGroup: 1000 + runAsUser: 1001 + runAsGroup: 1001 containers: - name: mps From ce6950a6c5f82014346d4a3acf232d1a2135debb Mon Sep 17 00:00:00 2001 From: EUdler <35280136+EUdler@users.noreply.github.com> Date: Tue, 13 Aug 2024 14:47:56 -0400 Subject: [PATCH 21/21] Add Quick Start instructions to readme (#30) * Add Quick Start instructions to readme * Update README.md --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index ce4c7be..bef5930 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,34 @@ Before starting, you need the following: If you do not have a license, please contact your MathWorks representative [here](https://www.mathworks.com/company/aboutus/contact_us/contact_sales.html) or [request a trial license](https://www.mathworks.com/campaigns/products/trials.html?prodcode=PR). +## Quick Start +The Quick Start option is recommended for the following cases: +* You are deploying MATLAB Production Server R2024b or newer +* You don't require significant changes to the Helm chart +* You are not running MATLAB Production server on Kubernetes as part of a CI/CD workflow +For CI/CD workflows, we recommend that you cache docker images in your private container registry. For more complex workflows, use the [Deployment Steps](#Deployment-Steps) + +The Quick Start option only requires you to download a single file, rather than cloning the full GitHub repository. For more complex workflows, use the [Deployment Steps](#Deployment-Steps) + +1. Download the `values-overrides.yaml` file containing configuration options that apply across all release deployments from the MATLAB Production Server on Kubernetes GitHub repository. You can use the cURL command below or click the "Download Raw File" icon. + ``` + curl -O https://raw.githubusercontent.com/mathworks-ref-arch/matlab-production-server-on-kubernetes/main/values-overrides.yaml + ``` + +2. Complete the steps in [Provide Mapping for Deployable Archives](#Provide-Mapping-for-Deployable-Archives). + +3. Before installing the chart, first set parameters that state your agreement to the MathWorks cloud reference architecture license and specify the address of the network license manager. In the top-level values-overrides.yaml file, set these parameters: + + To accept the license terms, set global > agreeToLicense to "yes". + To specify the address of the license server, set global > licenseServer using the format port_number@host. + + Next, install the Helm chart for MATLAB Production Server by using the following `helm install` command: + + ``` + helm install -f [-n ] --generate-name oci://containers.mathworks.com/matlab-prodserver-k8s --version 1.1.0 + ``` +4. After the deployment is complete, upload the MATLAB Production Server deployable archive to your network file server or Azure file share. All users must have read permission to the deployable archive. + ## Deployment Steps ### Clone GitHub® Repository that Contains Helm Chart The MATLAB Production Server on Kubernetes GitHub repository contains Helm charts that reference Ubuntu-based Docker container images for MATLAB Production Server deployment.