1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-02 00:05:35 +01:00
This commit is contained in:
alexcos20 2020-05-24 01:25:58 -07:00
parent a83841e428
commit 5ab37492e4

View File

@ -8,41 +8,41 @@ description: Set Up a Compute-to-Data enviroment.
At the time of writing, we need the following: At the time of writing, we need the following:
* working [Barge](https://github.com/oceanprotocol/barge). For this setup, we will asume the Barge is installed in /ocean/barge/ - working [Barge](https://github.com/oceanprotocol/barge). For this setup, we will asume the Barge is installed in /ocean/barge/
* a working Kubernetes cluster (minikube is a good start) - a working Kubernetes cluster (minikube is a good start)
* a working kubectl connected to the k8 cluster - a working kubectl connected to the k8 cluster
* one folder (/ocean/operator-service/), in which we will download the following: - one folder (/ocean/operator-service/), in which we will download the following:
* [postgres-configmap.yaml](https://github.com/oceanprotocol/operator-service/blob/develop/deploy_on_k8s/postgres-configmap.yaml) - [postgres-configmap.yaml](https://github.com/oceanprotocol/operator-service/blob/develop/deploy_on_k8s/postgres-configmap.yaml)
* [postgres-storage.yaml](https://github.com/oceanprotocol/operator-service/blob/develop/deploy_on_k8s/postgres-storage.yaml) - [postgres-storage.yaml](https://github.com/oceanprotocol/operator-service/blob/develop/deploy_on_k8s/postgres-storage.yaml)
* [postgres-deployment.yaml](https://github.com/oceanprotocol/operator-service/blob/develop/deploy_on_k8s/postgres-deployment.yaml) - [postgres-deployment.yaml](https://github.com/oceanprotocol/operator-service/blob/develop/deploy_on_k8s/postgres-deployment.yaml)
* [postgres-service.yaml](https://github.com/oceanprotocol/operator-service/blob/develop/deploy_on_k8s/postgres-service.yaml) - [postgres-service.yaml](https://github.com/oceanprotocol/operator-service/blob/develop/deploy_on_k8s/postgres-service.yaml)
* [deployment.yaml](https://github.com/oceanprotocol/operator-service/blob/develop/deploy_on_k8s/deployment.yaml) - [deployment.yaml](https://github.com/oceanprotocol/operator-service/blob/develop/deploy_on_k8s/deployment.yaml)
* [role_binding.yaml](https://github.com/oceanprotocol/operator-service/blob/develop/deploy_on_k8s/role_binding.yaml) - [role_binding.yaml](https://github.com/oceanprotocol/operator-service/blob/develop/deploy_on_k8s/role_binding.yaml)
* [service_account.yaml](https://github.com/oceanprotocol/operator-service/blob/develop/deploy_on_k8s/service_account.yaml) - [service_account.yaml](https://github.com/oceanprotocol/operator-service/blob/develop/deploy_on_k8s/service_account.yaml)
* one folder (/ocean/operator-engine/), in which we will download the following: - one folder (/ocean/operator-engine/), in which we will download the following:
* [sa.yaml](https://github.com/oceanprotocol/operator-engine/blob/develop/k8s_install/sa.yml) - [sa.yaml](https://github.com/oceanprotocol/operator-engine/blob/develop/k8s_install/sa.yml)
* [binding.yaml](https://github.com/oceanprotocol/operator-engine/blob/develop/k8s_install/binding.yml) - [binding.yaml](https://github.com/oceanprotocol/operator-engine/blob/develop/k8s_install/binding.yml)
* [operator.yaml](https://github.com/oceanprotocol/operator-engine/blob/develop/k8s_install/operator.yml) - [operator.yaml](https://github.com/oceanprotocol/operator-engine/blob/develop/k8s_install/operator.yml)
* [computejob-crd.yaml](https://github.com/oceanprotocol/operator-engine/blob/develop/k8s_install/computejob-crd.yml) - [computejob-crd.yaml](https://github.com/oceanprotocol/operator-engine/blob/develop/k8s_install/computejob-crd.yml)
* [workflow-crd.yaml](https://github.com/oceanprotocol/operator-engine/blob/develop/k8s_install/workflow-crd.yml) - [workflow-crd.yaml](https://github.com/oceanprotocol/operator-engine/blob/develop/k8s_install/workflow-crd.yml)
## Customize your Operator Service deployment ## Customize your Operator Service deployment
The following resources needs attention: The following resources needs attention:
* postgres-configmap.yaml - contains secrets for the postgresql deployment - postgres-configmap.yaml - contains secrets for the postgresql deployment
* deployment.yaml - ALGO_POD_TIMEOUT = Allowed time for a algorithm to run. If it exceeded this value (in minutes), it's going to get killed - deployment.yaml - ALGO_POD_TIMEOUT = Allowed time for a algorithm to run. If it exceeded this value (in minutes), it's going to get killed
## Customize your Operator Engine deployment ## Customize your Operator Engine deployment
The following resource needs attention: The following resource needs attention:
* operator.yaml - contains configuration variabiles - operator.yaml - contains configuration variabiles
* ACCOUNT_JSON , ACCOUNT_PASSWORD = Defines the account that is going to be used when publishing results back to OceanProtocol - ACCOUNT_JSON , ACCOUNT_PASSWORD = Defines the account that is going to be used when publishing results back to OceanProtocol
* AWS_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID , AWS_REGION = S3 credidentials for the logs and output buckets - AWS_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID , AWS_REGION = S3 credidentials for the logs and output buckets
* AWS_BUCKET_OUTPUT = Bucket that will hold the output data (algorithm logs & algorithm output) - AWS_BUCKET_OUTPUT = Bucket that will hold the output data (algorithm logs & algorithm output)
* AWS_BUCKET_ADMINLOGS = Bucket that will hold the admin logs (logs from pod-configure & pod-publish) - AWS_BUCKET_ADMINLOGS = Bucket that will hold the admin logs (logs from pod-configure & pod-publish)
* STORAGE_CLASS = Storage class to use (see next section) - STORAGE_CLASS = Storage class to use (see next section)
## Storage class ## Storage class
@ -51,11 +51,11 @@ For minikube, you can use 'standard' class.
For AWS , please make sure that your class allocates volumes in the same region and zone in which you are running your pods. For AWS , please make sure that your class allocates volumes in the same region and zone in which you are running your pods.
We created our own 'standard' class in AWS: We created our own 'standard' class in AWS:
```
kubectl get storageclass standard -o yaml
```
``` ```bash
kubectl get storageclass standard -o yaml
allowedTopologies: allowedTopologies:
- matchLabelExpressions: - matchLabelExpressions:
- key: failure-domain.beta.kubernetes.io/zone - key: failure-domain.beta.kubernetes.io/zone
@ -73,14 +73,14 @@ We created our own 'standard' class in AWS:
## Create namespaces ## Create namespaces
``` ```bash
kubectl create ns ocean-operator kubectl create ns ocean-operator
kubectl create ns ocean-compute kubectl create ns ocean-compute
``` ```
## Deploy Operator-Service ## Deploy Operator-Service
``` ```bash
kubectl config set-context --current --namespace ocean-operator kubectl config set-context --current --namespace ocean-operator
kubectl create -f /ocean/operator-service/postgres-configmap.yaml kubectl create -f /ocean/operator-service/postgres-configmap.yaml
kubectl create -f /ocean/operator-service/postgres-storage.yaml kubectl create -f /ocean/operator-service/postgres-storage.yaml
@ -93,7 +93,7 @@ kubectl apply -f /ocean/operator-service/service_account.yaml
## Deploy Operator-Engine ## Deploy Operator-Engine
``` ```bash
kubectl config set-context --current --namespace ocean-compute kubectl config set-context --current --namespace ocean-compute
kubectl apply -f /ocean/operator-engine/sa.yml kubectl apply -f /ocean/operator-engine/sa.yml
kubectl apply -f /ocean/operator-engine/binding.yml kubectl apply -f /ocean/operator-engine/binding.yml
@ -105,13 +105,13 @@ kubectl create -f /ocean/operator-service/postgres-configmap.yaml
## Expose Operator - Service ## Expose Operator - Service
``` ```bash
kubectl expose deployment operator-api --namespace=ocean-operator --port=8050 kubectl expose deployment operator-api --namespace=ocean-operator --port=8050
``` ```
Run a port forward or create your ingress service (not covered here): Run a port forward or create your ingress service (not covered here):
``` ```bash
kubectl -n ocean-operator port-forward svc/operator-api 8050 kubectl -n ocean-operator port-forward svc/operator-api 8050
``` ```
@ -119,7 +119,7 @@ kubectl -n ocean-operator port-forward svc/operator-api 8050
If your cluster is running on example.com: If your cluster is running on example.com:
``` ```bash
curl -X POST "http://example.com:8050/api/v1/operator/pgsqlinit" -H "accept: application/json" curl -X POST "http://example.com:8050/api/v1/operator/pgsqlinit" -H "accept: application/json"
``` ```
@ -127,8 +127,7 @@ curl -X POST "http://example.com:8050/api/v1/operator/pgsqlinit" -H "accept: ap
Update Brizo by adding or updating the OPERATOR_SERVICE_URL env (in /ocean/barge/compose-files/brizo.yaml) Update Brizo by adding or updating the OPERATOR_SERVICE_URL env (in /ocean/barge/compose-files/brizo.yaml)
```
OPERATOR_SERVICE_URL: http://example.com:8050/ OPERATOR_SERVICE_URL: http://example.com:8050/
```
## Restart Barge with updated Brizo configuration ## Restart Barge with updated Brizo configuration