diff --git a/README.md b/README.md index 03f2b3a..65c286b 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,89 @@ More detailed information about the features and servicesin MINT can be found in All the documentation for the MINT framework can be found in the [MINT documentation page](https://mintproject.readthedocs.io/en/latest/). +## Testing on local machine + +To test the MINT services on your local machine, we recommend using the [microk8s](https://microk8s.io/) Kubernetes distribution. Follow the instructions in the [microk8s documentation](https://microk8s.io/#install-microk8s) to install microk8s on your machine. + +### Microk8s installation + +Tested on MacOS (arm64) with microk8s 1.28/stable. + +Install the microk8s using the following command: + +```bash +$ microk8s install --memory 8 +Support for 'multipass' needs to be set up. Would you like to do that now? [y/N]: y +``` + +Enable required addons: + +```bash +$ microk8s enable dashboard hostpath-storage +``` + +Configure the kubectl to use the microk8s cluster + +```bash +$ microk8s config > ~/.kube/config +``` + +To test, list the existing resources. It should be list multiple services, deployments, and pods. Please wait until all the resources are up and running. + +```bash +$ kubectl get all --all-namespaces +``` + +Verify the node status + +```bash +$ kubectl get nodes +``` + +### MINT services installation + +If you using MacOS Silicon, you need to install the `arm64` version of the postgresql database. Add the following lines in the `values.yaml` file +WARNING: The arm64 image is not tested and may not work as expected. Please use it at your own risk. + +``` +arm_support: true +``` + +Use the following commands to install the MINT services: + +````bash +$ helm install -f ./values.yaml mint ./helm --namespace mint --create-namespace +``` + +Helm will returns the URL to access the MINT services. You can use the following command to get the URL: + +```bash + export UI_PORT=$(kubectl get --namespace mint -o jsonpath="{.spec.ports[0].nodePort}" services mint-ui) + export CROMO_PORT=$(kubectl get --namespace mint -o jsonpath="{.spec.ports[0].nodePort}" services mint-cromo) + export DATA_CATALOG_PORT=$(kubectl get --namespace mint -o jsonpath="{.spec.ports[0].nodePort}" services mint-data-catalog) + export HASURA_PORT=$(kubectl get --namespace mint -o jsonpath="{.spec.ports[0].nodePort}" services mint-hasura) + export MODEL_CATALOG_API_PORT=$(kubectl get --namespace mint -o jsonpath="{.spec.ports[0].nodePort}" services mint-model-catalog) + export MODEL_CATALOG_DATABASE_PORT=$(kubectl get --namespace mint -o jsonpath="{.spec.ports[1].nodePort}" services mint-model-catalog) + export NODE_IP=$(kubectl get nodes --namespace mint -o jsonpath="{.items[0].status.addresses[0].address}") + + echo "MINT User Interface: http://$NODE_IP:$UI_PORT" + echo "MINT Model Catalog API: http://$NODE_IP:$MODEL_CATALOG_API_PORT/v1.8.0/docs" + echo "MINT Data Catalog: http://$NODE_IP:$DATA_CATALOG_PORT" + echo "MINT Constraint Reasoning Over MOdels (CROMO): http://$NODE_IP:$CROMO_PORT" + echo "MINT Database: http://$NODE_IP:$HASURA_PORT" + echo "MINT Model Catalog Database: http://$NODE_IP:$MODEL_CATALOG_DATABASE_PORT" +``` + +### MINT services removal + +To remove the MINT services, use the following command: + +```bash +$ helm uninstall mint -n mint +$ kubectl delete pvc --all -n mint +$ kubectl delete jobs --all -n mint +``` + ## Developer documentation This repository contains the helm charts for the MINT services. The helm charts are used to deploy the services in a Kubernetes cluster. The helm charts are organized in the following folders: @@ -23,6 +106,6 @@ To release a new version of the MINT charts, follow the following steps: ```bash make release -``` +```` 3. Commit the changes and push them to the repository. diff --git a/helm/templates/hasura.yaml b/helm/templates/hasura.yaml index d283ca5..561c7f9 100644 --- a/helm/templates/hasura.yaml +++ b/helm/templates/hasura.yaml @@ -86,10 +86,16 @@ spec: path: / port: http - name: hasura-db + #if the values.arm_support is true, then use the arm_image, otherwise use the image + + {{- if .Values.arm_support }} {{- with .Values.components.hasura_db }} + image: "{{ .arm_image.repository }}:{{ .arm_image.tag | default $.Chart.AppVersion }}" + {{- else }} image: "{{ .image.repository }}:{{ .image.tag | default $.Chart.AppVersion }}" imagePullPolicy: {{ .image.pullPolicy }} {{- end }} + {{- end }} resources: {} volumeMounts: - mountPath: /var/lib/postgresql/data @@ -105,6 +111,14 @@ spec: secretKeyRef: name: {{ include "mint.prefix" . }}-hasura-secrets key: username + readinessProbe: + exec: + command: + - pg_isready + - -U + - {{ .Values.secrets.database.hasura.username }} + initialDelaySeconds: 5 + periodSeconds: 10 volumes: - name: hasura-db {{- if .Values.components.hasura_db.persistence.enabled }} diff --git a/helm/values.yaml b/helm/values.yaml index 26eb3d9..c44dd1e 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -4,6 +4,7 @@ service: type: NodePort port: 30000 hostname: localhost +arm_support: false components: backups: enabled: false @@ -15,7 +16,7 @@ components: pullPolicy: IfNotPresent ingress: enabled: false - className: '' + className: "" annotations: {} hosts: - host: cromo.mint.local @@ -34,7 +35,7 @@ components: airflow_url: https://airflow.mint.isi.edu/api/v1 ingress: enabled: false - className: '' + className: "" annotations: {} hosts: - host: mic.mint.local @@ -50,7 +51,7 @@ components: pullPolicy: IfNotPresent ingress: enabled: false - className: '' + className: "" annotations: {} hosts: - host: api.mic.mint.local @@ -65,12 +66,12 @@ components: pullPolicy: IfNotPresent persistence: enabled: true - storageClass: '' + storageClass: "" accessModes: - ReadWriteOnce size: 10Gi dataSource: {} - existingClaim: '' + existingClaim: "" selector: {} annotations: helm.sh/resource-policy: keep @@ -82,7 +83,7 @@ components: pullPolicy: IfNotPresent ingress: enabled: false - className: '' + className: "" annotations: {} hosts: - host: datacatalog.mint.local @@ -97,12 +98,12 @@ components: pullPolicy: IfNotPresent persistence: enabled: true - storageClass: '' + storageClass: "" accessModes: - ReadWriteOnce size: 10Gi dataSource: {} - existingClaim: '' + existingClaim: "" selector: {} annotations: helm.sh/resource-policy: keep @@ -119,7 +120,7 @@ components: backup_file: /fuseki-base/seeds/model-catalog.trig ingress: enabled: false - className: '' + className: "" annotations: {} hosts: - host: endpoint.models.mint.local @@ -129,12 +130,12 @@ components: tls: [] persistence: enabled: true - storageClass: '' + storageClass: "" accessModes: - ReadWriteOnce size: 10Gi dataSource: {} - existingClaim: '' + existingClaim: "" selector: {} annotations: helm.sh/resource-policy: keep @@ -163,14 +164,18 @@ components: repository: postgis/postgis tag: 10-3.2-alpine pullPolicy: IfNotPresent + arm_image: + repository: imresamu/postgis-arm64 + tag: 12-3.4-alpine + pullPolicy: IfNotPresent persistence: enabled: true - storageClass: '' + storageClass: "" accessModes: - ReadWriteOnce size: 10Gi dataSource: {} - existingClaim: '' + existingClaim: "" selector: {} annotations: helm.sh/resource-policy: keep @@ -182,7 +187,7 @@ components: pullPolicy: IfNotPresent ingress: enabled: false - className: '' + className: "" annotations: {} hosts: - host: models.mint.local @@ -202,9 +207,9 @@ components: queries_dir: queries/ ingress: enabled: false - className: '' + className: "" annotations: - nginx.ingress.kubernetes.io/enable-cors: 'true' + nginx.ingress.kubernetes.io/enable-cors: "true" hosts: - host: api.models.mint.local paths: @@ -219,7 +224,7 @@ components: pullPolicy: IfNotPresent ingress: enabled: false - className: '' + className: "" annotations: {} hosts: - host: mint.local @@ -240,7 +245,7 @@ components: parallel: 1 ingress: enabled: false - className: '' + className: "" annotations: {} hosts: - host: ensemble-manager.mint.local @@ -285,12 +290,12 @@ auth: realm: production ui_client_id: mint-ui imagePullSecrets: [] -nameOverride: '' -fullnameOverride: '' +nameOverride: "" +fullnameOverride: "" serviceAccount: create: true annotations: {} - name: '' + name: "" podAnnotations: {} podSecurityContext: {} securityContext: {} diff --git a/install.sh b/install.sh index c7bbaeb..c95272d 100755 --- a/install.sh +++ b/install.sh @@ -1 +1 @@ -helm install -f ./values.yaml mint ./helm -n mint +helm install -f ./values.yaml mint ./helm --namespace mint --create-namespace \ No newline at end of file diff --git a/values.yaml b/values.yaml index 8a16709..8698517 100644 --- a/values.yaml +++ b/values.yaml @@ -2,3 +2,4 @@ welcome_message: Welcome to MINT Demo google: maps: key: +arm_support: false