-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
196 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
--- | ||
apiVersion: template.openshift.io/v1 | ||
kind: Template | ||
labels: | ||
template: matlab-cpu | ||
metadata: | ||
annotations: | ||
description: |- | ||
Start Matlab with desktop UI. | ||
Running on CPU, with admin privileges to install anything you need. | ||
Matlab will be automatically enabled using the UM matlab license server. | ||
You can choose between 2 types of deployment: | ||
- Browser: access directly matlab in the browser, only available from r2024a and upn | ||
- VNC: access matlab in a Linux desktop in the browser, highly unstable, Matlab devs | ||
acknowledge themselves it is tricky to use | ||
📂 Use the `/home/matlab/persistent` folder to store your data in the persistent storage automatically created. | ||
You can find the persistent storage in the DSRI web UI, go to Administrator view | ||
> Storage > Persistent Volume Claims | ||
🐳 Visit https://hub.docker.com/r/mathworks/matlab for more details about the image' | ||
iconClass: icon-beaker | ||
openshift.io/display-name: Matlab | ||
openshift.io/documentation-url: https://maastrichtu-ids.github.io/dsri-documentation/docs/deploy-matlab | ||
openshift.io/provider-display-name: Institute of Data Science, UM | ||
openshift.io/support-url: https://maastrichtu-ids.github.io/dsri-documentation/help | ||
tags: matlab,cpu,root,persistent | ||
name: matlab-cpu | ||
namespace: openshift | ||
objects: | ||
- apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
annotations: | ||
template.openshift.io/expose-password: "{.data['application-password']}" | ||
labels: | ||
app: "${APPLICATION_NAME}" | ||
name: "${APPLICATION_NAME}" | ||
stringData: | ||
application-password: "${PASSWORD}" | ||
- apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
labels: | ||
app: "${APPLICATION_NAME}" | ||
name: "${APPLICATION_NAME}" | ||
spec: | ||
accessModes: | ||
- ReadWriteMany | ||
resources: | ||
requests: | ||
storage: "${STORAGE_SIZE}" | ||
- apiVersion: image.openshift.io/v1 | ||
kind: ImageStream | ||
metadata: | ||
labels: | ||
app: "${APPLICATION_NAME}" | ||
template: matlab-cpu | ||
name: "${APPLICATION_NAME}" | ||
spec: | ||
lookupPolicy: | ||
local: true | ||
tags: | ||
- from: | ||
kind: DockerImage | ||
name: "${APPLICATION_IMAGE}" | ||
importPolicy: | ||
scheduled: false | ||
name: latest | ||
- apiVersion: apps.openshift.io/v1 | ||
kind: DeploymentConfig | ||
metadata: | ||
labels: | ||
app: "${APPLICATION_NAME}" | ||
name: "${APPLICATION_NAME}" | ||
spec: | ||
replicas: 1 | ||
selector: | ||
app: "${APPLICATION_NAME}" | ||
deploymentconfig: "${APPLICATION_NAME}" | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: "${APPLICATION_NAME}" | ||
deploymentconfig: "${APPLICATION_NAME}" | ||
spec: | ||
automountServiceAccountToken: false | ||
containers: | ||
- args: | ||
- "${DEPLOYMENT_TYPE}" | ||
env: | ||
- name: PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
key: application-password | ||
name: "${APPLICATION_NAME}" | ||
- name: MLM_LICENSE_FILE | ||
value: [email protected] | ||
image: "${APPLICATION_NAME}:latest" | ||
name: matlab-container | ||
ports: | ||
- containerPort: 8888 | ||
protocol: TCP | ||
volumeMounts: | ||
- mountPath: "${PERSISTENT_FOLDER}" | ||
name: data | ||
- mountPath: "/dev/shm" | ||
name: dshm | ||
securityContext: | ||
runAsUser: 0 | ||
serviceAccountName: anyuid | ||
volumes: | ||
- name: data | ||
persistentVolumeClaim: | ||
claimName: "${APPLICATION_NAME}" | ||
- emptyDir: | ||
medium: Memory | ||
name: dshm | ||
triggers: | ||
- type: ConfigChange | ||
- imageChangeParams: | ||
automatic: true | ||
containerNames: | ||
- matlab-container | ||
from: | ||
kind: ImageStreamTag | ||
name: "${APPLICATION_NAME}:latest" | ||
type: ImageChange | ||
- apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: "${APPLICATION_NAME}" | ||
name: "${APPLICATION_NAME}" | ||
spec: | ||
ports: | ||
- name: 8888-tcp | ||
port: 8888 | ||
protocol: TCP | ||
targetPort: 8888 | ||
selector: | ||
app: "${APPLICATION_NAME}" | ||
deploymentconfig: "${APPLICATION_NAME}" | ||
- apiVersion: route.openshift.io/v1 | ||
kind: Route | ||
metadata: | ||
labels: | ||
app: "${APPLICATION_NAME}" | ||
name: "${APPLICATION_NAME}" | ||
spec: | ||
host: '' | ||
port: | ||
targetPort: 8888-tcp | ||
tls: | ||
insecureEdgeTerminationPolicy: Redirect | ||
termination: edge | ||
to: | ||
kind: Service | ||
name: "${APPLICATION_NAME}" | ||
weight: 100 | ||
parameters: | ||
- description: Must be unique in the project. It will be used to generate the application | ||
URL. | ||
displayName: Application name | ||
name: APPLICATION_NAME | ||
required: true | ||
value: matlab | ||
- description: The password to access the Matlab web UI | ||
displayName: Matlab UI password | ||
name: PASSWORD | ||
required: true | ||
- description: See https://hub.docker.com/r/mathworks/matlab for more details | ||
displayName: Application Docker image | ||
name: APPLICATION_IMAGE | ||
required: true | ||
value: mathworks/matlab:r2024b | ||
- description: Size of the storage used for Matlab (approximate). | ||
displayName: Storage size | ||
name: STORAGE_SIZE | ||
required: true | ||
value: 10Gi | ||
- description: Path to the persistent folder in the container | ||
displayName: Persistent folder | ||
name: PERSISTENT_FOLDER | ||
required: true | ||
value: "/home/matlab/persistent" | ||
- description: "-browser or -vnc (virtual desktop)" | ||
displayName: Type of deployment | ||
name: DEPLOYMENT_TYPE | ||
required: true | ||
value: "-browser" |