Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 84 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
14 changes: 14 additions & 0 deletions helm/templates/hasura.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
47 changes: 26 additions & 21 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ service:
type: NodePort
port: 30000
hostname: localhost
arm_support: false
components:
backups:
enabled: false
Expand All @@ -15,7 +16,7 @@ components:
pullPolicy: IfNotPresent
ingress:
enabled: false
className: ''
className: ""
annotations: {}
hosts:
- host: cromo.mint.local
Expand All @@ -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
Expand All @@ -50,7 +51,7 @@ components:
pullPolicy: IfNotPresent
ingress:
enabled: false
className: ''
className: ""
annotations: {}
hosts:
- host: api.mic.mint.local
Expand All @@ -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
Expand All @@ -82,7 +83,7 @@ components:
pullPolicy: IfNotPresent
ingress:
enabled: false
className: ''
className: ""
annotations: {}
hosts:
- host: datacatalog.mint.local
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -182,7 +187,7 @@ components:
pullPolicy: IfNotPresent
ingress:
enabled: false
className: ''
className: ""
annotations: {}
hosts:
- host: models.mint.local
Expand All @@ -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:
Expand All @@ -219,7 +224,7 @@ components:
pullPolicy: IfNotPresent
ingress:
enabled: false
className: ''
className: ""
annotations: {}
hosts:
- host: mint.local
Expand All @@ -240,7 +245,7 @@ components:
parallel: 1
ingress:
enabled: false
className: ''
className: ""
annotations: {}
hosts:
- host: ensemble-manager.mint.local
Expand Down Expand Up @@ -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: {}
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
helm install -f ./values.yaml mint ./helm -n mint
helm install -f ./values.yaml mint ./helm --namespace mint --create-namespace
1 change: 1 addition & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ welcome_message: Welcome to MINT Demo
google:
maps:
key: <google_maps_key>
arm_support: false