From 050f189afe1eea24ccafba27e8e273e181494cb3 Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 31 May 2024 09:31:27 -0400 Subject: [PATCH 1/8] fix: create namespace --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 55f7407e9bc71af70e0f3aa6565da894fcd324b0 Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 31 May 2024 11:01:05 -0400 Subject: [PATCH 2/8] fix: add docs --- README.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++- values.yaml | 8 ++++++- 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 03f2b3a..9da951d 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,65 @@ 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 the + +```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. + +```bash +$ kubectl get all --all-namespaces +``` + +### MINT services installation + +![ + +](image.png) + +If you want to test the MINT services on your local machine, you can use the helm charts provided in this repository. The helm charts are organized in the `charts` folder. To install the MINT services, follow the instructions below: + +If you using MacOS Silicon, you need to install the `amd64` version of the postgresql database. Add the following lines in the `values.yaml` file + +``` +components: + hasura_db: + image: + repository: imresamu/postgis-arm64 + tag: 12-3.4-alpine + pullPolicy: IfNotPresent +``` + +Use the following commands to install the MINT services: + +````bash + +$ helm install -f ./values.yaml mint ./helm --namespace mint --create-namespace +``` + ## 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 +82,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/values.yaml b/values.yaml index 8a16709..c4efc73 100644 --- a/values.yaml +++ b/values.yaml @@ -1,4 +1,10 @@ welcome_message: Welcome to MINT Demo google: maps: - key: + key: +components: + hasura_db: + image: + repository: imresamu/postgis-arm64 + tag: 12-3.4-alpine + pullPolicy: IfNotPresent From d65ce0eef2843f8cc000ac2ec7cdcbca653c0979 Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 31 May 2024 11:02:40 -0400 Subject: [PATCH 3/8] fix: remove unrequired file --- install.sh | 1 - 1 file changed, 1 deletion(-) delete mode 100755 install.sh diff --git a/install.sh b/install.sh deleted file mode 100755 index c95272d..0000000 --- a/install.sh +++ /dev/null @@ -1 +0,0 @@ -helm install -f ./values.yaml mint ./helm --namespace mint --create-namespace \ No newline at end of file From 9d6256c069de6f9f5102a09754c1dc162c47498e Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 31 May 2024 12:28:12 -0400 Subject: [PATCH 4/8] fix: add live check postgres hasura --- README.md | 18 +++++++++--------- helm/templates/hasura.yaml | 8 ++++++++ install.sh | 1 + 3 files changed, 18 insertions(+), 9 deletions(-) create mode 100755 install.sh diff --git a/README.md b/README.md index 9da951d..6fb8f97 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ $ microk8s install --memory 8 Support for 'multipass' needs to be set up. Would you like to do that now? [y/N]: y ``` -Enable the +Enable required addons: ```bash $ microk8s enable dashboard hostpath-storage @@ -35,21 +35,22 @@ Configure the kubectl to use the microk8s cluster $ microk8s config > ~/.kube/config ``` -To test, list the existing resources. It should be list multiple services, deployments, and pods. +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 ``` -### MINT services installation - -![ +Verify the node status -](image.png) +```bash +$ kubectl get nodes +``` -If you want to test the MINT services on your local machine, you can use the helm charts provided in this repository. The helm charts are organized in the `charts` folder. To install the MINT services, follow the instructions below: +### MINT services installation -If you using MacOS Silicon, you need to install the `amd64` version of the postgresql database. Add the following lines in the `values.yaml` file +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 following image is not tested and may not work as expected. Please use it at your own risk. ``` components: @@ -63,7 +64,6 @@ components: Use the following commands to install the MINT services: ````bash - $ helm install -f ./values.yaml mint ./helm --namespace mint --create-namespace ``` diff --git a/helm/templates/hasura.yaml b/helm/templates/hasura.yaml index d283ca5..446d200 100644 --- a/helm/templates/hasura.yaml +++ b/helm/templates/hasura.yaml @@ -105,6 +105,14 @@ spec: secretKeyRef: name: {{ include "mint.prefix" . }}-hasura-secrets key: username + readinessProbe: + exec: + command: + - pg_isready + - -U + - myuser + initialDelaySeconds: 5 + periodSeconds: 10 volumes: - name: hasura-db {{- if .Values.components.hasura_db.persistence.enabled }} diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..c95272d --- /dev/null +++ b/install.sh @@ -0,0 +1 @@ +helm install -f ./values.yaml mint ./helm --namespace mint --create-namespace \ No newline at end of file From f8c632a6339f634e98d4386def67076a0fd67563 Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 31 May 2024 12:31:34 -0400 Subject: [PATCH 5/8] fix: rollback changes values --- values.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/values.yaml b/values.yaml index c4efc73..8a16709 100644 --- a/values.yaml +++ b/values.yaml @@ -1,10 +1,4 @@ welcome_message: Welcome to MINT Demo google: maps: - key: -components: - hasura_db: - image: - repository: imresamu/postgis-arm64 - tag: 12-3.4-alpine - pullPolicy: IfNotPresent + key: From a0b32275a4c337a9fdc1eaf809c7e91a6dd16ce5 Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 31 May 2024 12:36:51 -0400 Subject: [PATCH 6/8] fix: use hasura user --- helm/templates/hasura.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/templates/hasura.yaml b/helm/templates/hasura.yaml index 446d200..9e078da 100644 --- a/helm/templates/hasura.yaml +++ b/helm/templates/hasura.yaml @@ -110,7 +110,7 @@ spec: command: - pg_isready - -U - - myuser + - {{ .Values.components.hasura_db.secrets.username }} initialDelaySeconds: 5 periodSeconds: 10 volumes: From 696b84d9129e51479e0619a5bfdc6c6f6c9c433b Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 31 May 2024 12:51:02 -0400 Subject: [PATCH 7/8] fix: support arm --- helm/templates/hasura.yaml | 8 ++++++- helm/values.yaml | 47 +++++++++++++++++++++----------------- values.yaml | 1 + 3 files changed, 34 insertions(+), 22 deletions(-) diff --git a/helm/templates/hasura.yaml b/helm/templates/hasura.yaml index 9e078da..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 @@ -110,7 +116,7 @@ spec: command: - pg_isready - -U - - {{ .Values.components.hasura_db.secrets.username }} + - {{ .Values.secrets.database.hasura.username }} initialDelaySeconds: 5 periodSeconds: 10 volumes: 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/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 From edc0da79ed959bc8117477a374e9483feb525c71 Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 31 May 2024 12:53:59 -0400 Subject: [PATCH 8/8] fix: improve documentation --- README.md | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6fb8f97..65c286b 100644 --- a/README.md +++ b/README.md @@ -50,15 +50,10 @@ $ 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 following image is not tested and may not work as expected. Please use it at your own risk. +WARNING: The arm64 image is not tested and may not work as expected. Please use it at your own risk. ``` -components: - hasura_db: - image: - repository: imresamu/postgis-arm64 - tag: 12-3.4-alpine - pullPolicy: IfNotPresent +arm_support: true ``` Use the following commands to install the MINT services: @@ -67,6 +62,35 @@ Use the following commands to install the MINT services: $ 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: