Skip to content

Commit 267ae3d

Browse files
authored
Merge pull request #73 from joellord/master
New workshop
2 parents fb8aea8 + 127b7bc commit 267ae3d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+929
-1515
lines changed

.workshop/setup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
# the steps having already been run. This is because this script will be
88
# run a second time if the container were restarted for some reason.
99

10-
envsubst < exercise/image-pipeline-resource.yaml.in > exercise/image-pipeline-resource.yaml
10+
envsubst < resources/image-pipeline-resource.yaml.in > resources/image-pipeline-resource.yaml

README.md

Lines changed: 84 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,46 @@
1-
Lab - OpenShift Pipelines with Tekton
2-
====================
1+
# Lab - OpenShift Pipelines with Tekton
2+
3+
* [Overview](#overview)
4+
* [Deploying the Workshop](#deploying-the-workshop)
5+
* [Deploying to OpenShift](#deploying-to-openshift)
6+
* [Deploying on Red Hat Product Demo System](#deploying-on-red-hat-product-demo-system)
7+
* [Running the Workshop](#running-the-workshop)
8+
* [Deleting the Workshop](#deleting-the-workshop)
9+
* [Development](#development)
10+
11+
## Overview
312

413
This workshop provides an introduction to OpenShift Pipelines with Tekton.
514
Please check [releases](https://github.com/openshift-labs/lab-tekton-pipelines/releases)
615
for the latest version of the workshop and also make sure to note if a version
716
released has been deprecated.
817

18+
| | |
19+
--- | ---
20+
| Audience Experience Level | Intermediate |
21+
| Supported Number of Users | One per cluster [1] |
22+
| Average Time to Complete | 30 minutes |
23+
924
The workshop uses the HomeRoom workshop environment in the learning portal configuration.
1025
You will need to be a cluster admin in order to deploy it.
1126

1227
When the URL for the workshop environment is accessed, a workshop session will be created on demand.
1328

14-
Deploying the Workshop
15-
----------------------
29+
## Deploying the Workshop
1630

17-
To deploy the workshop, first clone this Git repository to your own machine.
31+
### Deploying to OpenShift
1832

19-
When you clone the repository, ensure you use the `--recurse-submodules` option with the `git clone` command. Alternatively, after having cloned the repository, within the repository directory, run:
33+
To deploy the workshop, first clone this Git repository to your own machine. Use the command:
2034

2135
```
22-
git submodule update --init --recursive
36+
git clone --recurse-submodules --branch 1.0 https://github.com/openshift-labs/lab-tekton-pipelines.git
2337
```
2438

25-
The option to `git clone`, or the `git submodule update` command, ensure that a copy of a Git submodule which contains scripts to help you deploy the workshop will also be cloned.
39+
The ``--recurse-submodules`` option ensures that Git submodules are checked out. If you forget to use this option, after having clone the repository, run:
40+
41+
```
42+
git submodule update --recursive --remote
43+
```
2644

2745
Next create a project in OpenShift into which the workshop is to be deployed.
2846

@@ -36,79 +54,104 @@ From within the top level of the Git repository, now run the command below.
3654
.workshop/scripts/deploy-spawner.sh
3755
```
3856

39-
**NOTE:** The default max number of sessions (i.e. users who can access the workshop at the same time) defaults to 50. The number for the max number
40-
of sessions can be overridden when running the `deploy-spawner.sh` script by supplying the `--override SERVER_LIMIT=50` option. If 50 is not enough sessions, or too many, the amount can be increased or decreased by changing the value from 50 to the expected number of users. Your cluster should have enough resources to support the number of users in your workshop. Each user is given a quota of 8Gi of memory. If you don't set this up front and need to change it later, you can edit the `SERVER_LIMIT` environment variable on the spawner deployment config. Changing it will cause all currently running sessions to be stopped, so avoid changing it during a workshop.
57+
The name of the pod used to start the workshop will be ``lab-tekton-pipelines-spawner``.
58+
59+
### Deploying on Red Hat Product Demo System
60+
61+
The workshop is found in the catalog under the *Workshops* folder and is named *OCP4 Pipelines Workshop*.
4162

42-
When deployed the name of the deployment will be `lab-tekton-pipelines`.
63+
Once the cluster is deployed, follow the directions in the next section to begin the workshop itself.
64+
65+
## Running the Workshop
4366

4467
You can determine the hostname for the URL to access the workshop by running:
4568

4669
```
4770
oc get route lab-tekton-pipelines
4871
```
4972

50-
When the URL is accessed, you will be prompted to login. For the user name, use your email address or other name which would uniquely identify you. This is just used as an identifier for your session if you need to login again to the same session again. What you use for the user name isn't recorded in any way. For the password, use "openshift".
73+
When first accessing the workshop URL, the user may be presented with a warning about a potential security risk. This is due to the workshop using a self-signed certificate and users should be instructed to elect to continue to the site.
5174

52-
Editing the Workshop
53-
--------------------
75+
That URL leads to a login for the workshop itself.
5476

55-
The deployment created above will use a version of the workshop which has been pre-built into an image and which is hosted on `quay.io`.
77+
![Workshop Login](/docs/jupyter-login.png)
5678

57-
To make changes to the workshop content and test them, edit the files in the Git repository and then run:
79+
Users will enter the following information:
5880

59-
```
60-
.workshop/scripts/build-workshop.sh
61-
```
81+
| Key | Value |
82+
| --- | ----- |
83+
| Username | The user's e-mail address. This address is not saved anywhere outside of the workshop itself; it will not be used to follow up with the user. It simply acts as a unique identifier for the workshop instance. Logging into the site with a new username will cause a new instance of the workshop to be created (on the same cluster, however, so previously run cluster-wide operations will still be in effect. |
84+
| Password | ``openshift`` |
6285

63-
This will replace the existing image used by the active deployment.
86+
After logging in, the workshop takes a few seconds to start:
87+
88+
![Workshop Startup](/docs/starting-up.png)
89+
90+
Once the workshop begins, users are presented with a two panel interface:
6491

65-
If you are running an existing instance of the workshop, from your web browser select "Restart Workshop" from the menu top right of the workshop environment dashboard.
92+
![Workshop Terminal](/docs/workshop-terminal.png)
6693

67-
When you are happy with your changes, push them back to the remote Git repository. This will automatically trigger a new build of the image hosted on `quay.io`.
94+
On the left are the instructions users will follow for the workshop. The workshop itself explains how to use the interface, but generally speaking users will follow the directions on the left, with navigation buttons appearing at the end of each section. Text that is highlighted with a yellow background may be clicked to have the operation automatically executed in the cluster on the right.
6895

69-
If you need to change the RBAC definitions, or what resources are created when a project is created, change the definitions in the `templates` directory. You can then re-run:
96+
By default, users are presented with the terminal, which contains (among other things) an authenticated ``oc`` client. The ``Console`` tab on the right can be clicked to open the OpenShift web console. Again, the user will already be authenticated; if a workshop requires users to change their logged in OpenShift user, the workshop instructions will specifically mention that.
97+
98+
![Workshop Console](/docs/workshop-console.png)
99+
100+
101+
## Deleting the Workshop
102+
103+
To delete the spawner and any active sessions, including projects, run:
70104

71105
```
72-
.workshop/scripts/deploy-spawner.sh
106+
./.workshop/scripts/delete-spawner.sh
73107
```
74108

75-
and it will update the active definitions.
109+
To delete the build configuration for the workshop image, run:
76110

77-
Note that if you do this, you will need to re-run:
111+
```
112+
./.workshop/scripts/delete-workshop.sh
113+
```
114+
115+
To delete any global resources which may have been created, run:
78116

79117
```
80-
.workshop/scripts/build-workshop.sh
118+
./.workshop/scripts/delete-resources.sh
81119
```
82120

83-
to have any local content changes be used once again as it will revert back to using the image on ``quay.io``.
121+
## Development
84122

85-
If you need to ever update the deployment scripts pulled in via a git submodule to the latest version, run:
123+
The deployment created above will use an image from ``quay.io`` for this workshop based on the ``master`` branch of the repository.
124+
125+
To make changes to the workshop content and test them, edit the files in the Git repository and then run:
86126

87127
```
88-
git submodule update --recursive --remote
128+
./.workshop/scripts/build-workshop.sh
89129
```
90130

91-
The update will be staged immediately, so don't forget to commit it.
92-
93-
Deleting the Workshop
94-
---------------------
131+
This will replace the existing image used by the active deployment.
95132

96-
To delete the spawner and any active sessions, including projects, run:
133+
If you are running an existing instance of the workshop, if you want to start over with a fresh project, first delete the project used for the session.
97134

98135
```
99-
.workshop/scripts/delete-spawner.sh
136+
oc delete project $PROJECT_NAMESPACE
100137
```
101138

102-
To delete the build configuration for the workshop image, run:
139+
Then select "Restart Workshop" from the menu top right of the workshop environment dashboard.
140+
141+
When you are happy with your changes, push them back to the remote Git repository.
142+
143+
If you need to change the RBAC definitions, or what resources are created when a project is created, change the definitions in the ``templates`` directory. You can then re-run:
103144

104145
```
105-
.workshop/scripts/delete-workshop.sh
146+
./.workshop/scripts/deploy-spawner.sh
106147
```
107148

108-
To delete special resources for CRDs and cluster roles for the Tekton operator, run:
149+
and it will update the active definitions.
150+
151+
Note that if you do this, you will need to re-run:
109152

110153
```
111-
.workshop/scripts/delete-resources.sh
154+
./.workshop/scripts/build-workshop.sh
112155
```
113156

114-
Only delete these last set of resources if the Tekton operator is not being used elsewhere in the cluster. Ideally this workshop environment should only be deployed in an expendable cluster, and not one which is shared for other work.
157+
to have any local content changes be used once again as it will revert back to using the image on ``quay.io``.
File renamed without changes.

code/tektontasks/s2i-nodejs-task.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
params:
1111
- name: VERSION
1212
description: The version of the nodejs
13-
default: '8'
13+
default: '12'
1414
- name: PATH_CONTEXT
1515
description: The location of the path to run s2i from.
1616
default: .
@@ -25,7 +25,7 @@ spec:
2525
- name: generate
2626
image: quay.io/openshift-pipeline/s2i
2727
workingdir: /workspace/source
28-
command: ['s2i', 'build', '$(inputs.params.PATH_CONTEXT)', 'registry.access.redhat.com/rhscl/nodejs-$(inputs.params.VERSION)-rhel7', '--as-dockerfile', '/gen-source/Dockerfile.gen']
28+
command: ['s2i', 'build', '$(inputs.params.PATH_CONTEXT)', 'registry.access.redhat.com/ubi8/nodejs-$(inputs.params.VERSION)', '--as-dockerfile', '/gen-source/Dockerfile.gen']
2929
volumeMounts:
3030
- name: gen-source
3131
mountPath: /gen-source

docs/jupyter-login.png

6.86 KB
Loading

docs/starting-up.png

22.4 KB
Loading

docs/workshop-console.png

359 KB
Loading

docs/workshop-terminal.png

240 KB
Loading

0 commit comments

Comments
 (0)