diff options
-rw-r--r-- | doc/user/project/clusters/runbooks/img/authorize-jupyter.png | bin | 0 -> 334609 bytes | |||
-rw-r--r-- | doc/user/project/clusters/runbooks/img/demo-runbook.png | bin | 0 -> 132436 bytes | |||
-rw-r--r-- | doc/user/project/clusters/runbooks/img/gitlab-variables.png | bin | 0 -> 179611 bytes | |||
-rw-r--r-- | doc/user/project/clusters/runbooks/img/helm-install.png | bin | 0 -> 263703 bytes | |||
-rw-r--r-- | doc/user/project/clusters/runbooks/img/ingress-install.png | bin | 0 -> 371673 bytes | |||
-rw-r--r-- | doc/user/project/clusters/runbooks/img/jupyter-start.png | bin | 0 -> 54270 bytes | |||
-rw-r--r-- | doc/user/project/clusters/runbooks/img/jupyterhub-install.png | bin | 0 -> 288328 bytes | |||
-rw-r--r-- | doc/user/project/clusters/runbooks/img/postgres-query.png | bin | 0 -> 311908 bytes | |||
-rw-r--r-- | doc/user/project/clusters/runbooks/img/sample-runbook.png | bin | 0 -> 145728 bytes | |||
-rw-r--r-- | doc/user/project/clusters/runbooks/index.md | 90 |
10 files changed, 90 insertions, 0 deletions
diff --git a/doc/user/project/clusters/runbooks/img/authorize-jupyter.png b/doc/user/project/clusters/runbooks/img/authorize-jupyter.png Binary files differnew file mode 100644 index 00000000000..d808c4c1812 --- /dev/null +++ b/doc/user/project/clusters/runbooks/img/authorize-jupyter.png diff --git a/doc/user/project/clusters/runbooks/img/demo-runbook.png b/doc/user/project/clusters/runbooks/img/demo-runbook.png Binary files differnew file mode 100644 index 00000000000..25c9df4126d --- /dev/null +++ b/doc/user/project/clusters/runbooks/img/demo-runbook.png diff --git a/doc/user/project/clusters/runbooks/img/gitlab-variables.png b/doc/user/project/clusters/runbooks/img/gitlab-variables.png Binary files differnew file mode 100644 index 00000000000..f76ed21145f --- /dev/null +++ b/doc/user/project/clusters/runbooks/img/gitlab-variables.png diff --git a/doc/user/project/clusters/runbooks/img/helm-install.png b/doc/user/project/clusters/runbooks/img/helm-install.png Binary files differnew file mode 100644 index 00000000000..b3119985c5c --- /dev/null +++ b/doc/user/project/clusters/runbooks/img/helm-install.png diff --git a/doc/user/project/clusters/runbooks/img/ingress-install.png b/doc/user/project/clusters/runbooks/img/ingress-install.png Binary files differnew file mode 100644 index 00000000000..0a53d444380 --- /dev/null +++ b/doc/user/project/clusters/runbooks/img/ingress-install.png diff --git a/doc/user/project/clusters/runbooks/img/jupyter-start.png b/doc/user/project/clusters/runbooks/img/jupyter-start.png Binary files differnew file mode 100644 index 00000000000..434c37b2d38 --- /dev/null +++ b/doc/user/project/clusters/runbooks/img/jupyter-start.png diff --git a/doc/user/project/clusters/runbooks/img/jupyterhub-install.png b/doc/user/project/clusters/runbooks/img/jupyterhub-install.png Binary files differnew file mode 100644 index 00000000000..36c5c24596f --- /dev/null +++ b/doc/user/project/clusters/runbooks/img/jupyterhub-install.png diff --git a/doc/user/project/clusters/runbooks/img/postgres-query.png b/doc/user/project/clusters/runbooks/img/postgres-query.png Binary files differnew file mode 100644 index 00000000000..7c5dab7bf4b --- /dev/null +++ b/doc/user/project/clusters/runbooks/img/postgres-query.png diff --git a/doc/user/project/clusters/runbooks/img/sample-runbook.png b/doc/user/project/clusters/runbooks/img/sample-runbook.png Binary files differnew file mode 100644 index 00000000000..c12ce8990a4 --- /dev/null +++ b/doc/user/project/clusters/runbooks/img/sample-runbook.png diff --git a/doc/user/project/clusters/runbooks/index.md b/doc/user/project/clusters/runbooks/index.md index 3b81e439119..419e4ed60f3 100644 --- a/doc/user/project/clusters/runbooks/index.md +++ b/doc/user/project/clusters/runbooks/index.md @@ -47,3 +47,93 @@ an open-source python library that makes it easy to perform common DevOps tasks Tasks such as plotting Cloudwatch metrics and rolling your ECS/Kubernetes app are simplified down to a couple of lines of code. Check the [Nurtch Documentation](http://docs.nurtch.com/en/latest) for more information. + +## Configure an executable runbook with GitLab + +Follow this step-by-step guide to configure an executable runbook in GitLab using +the components outlined above and the preloaded demo runbook. + +### 1. Add a Kubernetes cluster + +Follow the steps outlined in [Adding and creating a new GKE cluster via GitLab](https://docs.gitlab.com/ee/user/project/clusters/#adding-and-creating-a-new-gke-cluster-via-gitlab) +to add a Kubernetes cluster to your project. + +### 2. Install Helm Tiller, Ingress, and JupyterHub + +Once the cluster has been provisioned in GKE, click the **"Install"** button next to the "Helm Tiller" app. + +![install helm](img/helm-install.png) + +Once Tiller has been installed successfully, click the **"Install"** button next to the "Ingress" app. + +![install ingress](img/ingress-install) + +Once Ingress has been installed successfully, click the **"Install"** button next to the "JupyterHub" app. + +![install jupyterhub](img/install-jupyterhub) + +### 3. Login to JupyterHub and start the server + +Once JupyterHub has been installed successfully, navigate to the "Jupyter Hostname" url presented and click +**"Sign in with GitLab"**. Authentication is automatically enabled for any user of GitLab server via OAuth2. This +will redirect to GitLab in order to authorize JupyterHub to use your GitLab account. Click **"Authorize"**. + +![authorize jupyter](img/authorize-jupyter.png) + +Once the application has been authorized you will taken back to the JupyterHub application. Click **"Start My Server"** + +![start jupyter](img/jupyter-start.png) + +The server will take a couple of seconds to start. + +### 4. Configure access + +In order for the runbook to access your GitLab project, you will need to enter a [GitLab Access Token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) as well as your Project ID in the "Setup" +section of the demo runbook. + +Double-click on the "DevOps-Runbook-Demo" folder located on the left panel. + +![demo runbook](img/demo-runbook.png) + +Double-click on the "Nurtch-DevOps-Demo.ipynb" runbook + +![sample runbook](img/sample-runbook.png) + +The contents on the runbook will be displayed on the right side of the screen. Under the "Setup" section, you will find +entries for both your `PRIVATE_TOKEN` and your `PROJECT_ID`. Enter both these values, conserving the single quotes as follows: + +```sql +PRIVATE_TOKEN = 'abcdef123456' +PROJECT_ID = '1234567' +``` + +Update the `VARIABLE_NAME` on the last line of this section to match the name of the variable you are using for you +access token. In this example our variable name is `PRIVATE_TOKEN`. + +```sql +VARIABLE_VALUE = project.variables.get('PRIVATE_TOKEN').value +``` + +### 5. Configure an operation + +For this example we'll use the "**Run SQL queries in Notebook**" section in the sample runbook to query +a postgres database. The first 4 lines of the section define the variables that are required for this query to function. + +```sql +%env DB_USER={project.variables.get('DB_USER').value} +%env DB_PASSWORD={project.variables.get('DB_PASSWORD').value} +%env DB_ENDPOINT={project.variables.get('DB_ENDPOINT').value} +%env DB_NAME={project.variables.get('DB_NAME').value} +``` + +Create the matching variables in your project's **Settings >> CI/CD >> Variables** + +![gitlab variables](img/gitlab-variables.png) + +Back in Jupyter, click the "Run SQL queries in Notebook" heading and the click the "run" button. The results will be +displayed in-line as follows: + +![postgres query](img/postgres-query.png) + +You can try other operations such as running shell scripts or interacting with a kubernetes cluster. Visit the +[Nurtch Documentation](http://docs.nurtch.com/) for more information.
\ No newline at end of file |