2. Getting started¶
This tutorial explains how to quick-start with REANA-Cluster.
2.1. Deploy locally¶
Are you looking at installing and deploying REANA cluster locally on your laptop?
Install kubectl (e.g. version 1.16.3), minikube (e.g. version 1.5.2) and Helm (e.g. version 3.0.0):
$ sudo dpkg -i kubectl*.deb minikube*.deb kubernetes-helm*.deb
Start Minikube virtual machine:
$ minikube start --vm-driver=virtualbox --feature-gates="TTLAfterFinished=true"
Install REANA-Cluster sources. You probably want to use a virtual environment:
$ # create new virtual environment $ virtualenv ~/.virtualenvs/myreana $ source ~/.virtualenvs/myreana/bin/activate $ # install reana-cluster utility $ pip install reana-cluster
Start REANA cluster instance on Minikube:
$ reana-cluster init
Check the status of the REANA cluster deployment. (Note that it may take several minutes to pull the REANA component images for the first time.)
$ reana-cluster status ... REANA cluster is ready.
Display the commands to set up the environment for the user clients:
$ reana-cluster env export REANA_SERVER_URL=http://192.168.99.100:32732 $ eval $(reana-cluster env --include-admin-token)
If you need to create more users you can:
$ kubectl exec \ -ti $(kubectl get pods -l=app=server -o jsonpath='{.items[0].metadata.name}') \ -- flask users create \ -e jane.doe@example.org \ --admin-access-token $REANA_ACCESS_TOKEN User was successfully created. ID EMAIL ACCESS_TOKEN 09259d12-b06c-4a13-a696-ae8e57f1f0c9 jane.doe@example.org dHYXgh5AXmukZrdWccZaSg
You can now run REANA examples on the locally-deployed cluster using reana-client.
Note that after you finish testing REANA, you can delete the locally-deployed cluster and the Minikube virtual machine as follows:
$ reana-cluster down $ minikube stop
2.2. Deploy on CERN infrastructure¶
Log into lxplus-cloud (CC7 subset of lxplus with recent OpenStack clients) and create a working directory for reana:
$ ssh lxplus-cloud.cern.ch $ mkdir reana && cd reana
Setup your OpenStack account and create a Kubernetes cluster following the official documentation.
Load the configuration to connect to the Kubernetes cluster and wait for the pods to be created:
$ $(openstack coe cluster config <cluster-name>) $ kubectl get pods -w
Set one of the nodes to be an ingress controller and create a landb alias:
# Get all cluster nodes $ kubectl get nodes $ kubectl label node <node-name> role=ingress $ openstack server set --property landb-alias=<your-subdomain> <ingress-node>
As we are using the alpha feature gate TTLAfterFinished we need to manually activate it:
$ # Get the Kube master name and connect to it $ openstack server list | grep -E reana-.*-master $ ssh -i <ssh-key> fedora@<master-node> ssh> # Add `TTLAfterFinished=true` to the `--feature-gates` in ssh> # `/etc/kubernetes/apiserver `and `/etc/kubernetes/controller-manager` ssh> sudo vi /etc/kubernetes/apiserver ssh> sudo vi /etc/kubernetes/controller-manager ssh> # Finally restart both services ssh> sudo systemctl restart kube-apiserver ssh> sudo systemctl restart kube-controller-manager ssh> # Logout from the master node ssh> exit
Since Python3 does not come by default we have to use the slc command to activate it and we create a virtual environment for REANA:
$ scl enable rh-python36 bash $ virtualenv reana $ source reana/bin/activate
Install reana-cluster:
(reana) $ pip install reana-cluster
Create your own
reana-cluster.yaml
. For instance, to deploy REANA0.6.1
at CERN with 200 GB Ceph volume and having as URLreana-dev.cern.ch
the file,reana-cluster-CERN.yaml
, would look like follows:cluster: type: "kubernetes" version: "v1.16.3" db_config: &db_base_config - REANA_DB_NAME: "reana" - REANA_DB_HOST: "db-host-name" - REANA_DB_PORT: "5432" root_path: "/var/reana" shared_volume_path: "/var/reana" reana_url: "reana-dev.cern.ch" ui: True eos: True cephfs: True cephfs_volume_size: 200 cephfs_os_share_id: <cephfs-share-id> cephfs_os_share_access_id: <cephfs-share-access-id> db_persistence_path: "/var/reana/db" components: reana-workflow-controller: type: "docker" image: "reanahub/reana-workflow-controller:0.6.1" environment: - <<: *db_base_config - REANA_JOB_CONTROLLER_IMAGE: "reanahub/reana-job-controller:0.6.1" - REANA_WORKFLOW_ENGINE_IMAGE_CWL: "reanahub/reana-workflow-engine-cwl:0.6.1" - REANA_WORKFLOW_ENGINE_IMAGE_YADAGE: "reanahub/reana-workflow-engine-yadage:0.6.1" - REANA_WORKFLOW_ENGINE_IMAGE_SERIAL: "reanahub/reana-workflow-engine-serial:0.6.1" reana-server: type: "docker" image: "reanahub/reana-server:0.6.1" environment: - <<: *db_base_config reana-message-broker: type: "docker" image: "reanahub/reana-message-broker:0.6.0"
Instantiate REANA cluster:
(reana) $ reana-cluster -f reana-cluster-CERN.yaml init
Test that REANA can be accessed by the specified domain name:
(reana) $ curl http://reana-dev.cern.ch/api/ping {"message": "OK", "status": "200"}
2.3. Next steps¶
For more information, please see:
- Looking for a more comprehensive user manual? See User guide
- Looking for tips how to develop REANA-Cluster component? See Developer guide
- Looking for command-line API reference? See CLI API