Skip to content

Commit

Permalink
Addind files, examiner and convert some to hugo
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemoralespou committed Dec 12, 2023
1 parent c419326 commit f8e4b1e
Show file tree
Hide file tree
Showing 33 changed files with 217 additions and 45 deletions.
2 changes: 2 additions & 0 deletions workshops/lab-conda-environment/resources/workshop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ spec:
terminal:
enabled: true
layout: split
files:
enabled: true
editor:
enabled: true
2 changes: 2 additions & 0 deletions workshops/lab-docker-runtime/resources/workshop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ spec:
layout: split
console:
enabled: true
files:
enabled: true
docker:
enabled: true
registry:
Expand Down
4 changes: 4 additions & 0 deletions workshops/lab-examiner-scripts/resources/workshop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ spec:
- /workshop/**
session:
namespaces:
security:
policy: baseline
budget: medium
applications:
terminal:
enabled: true
layout: split
files:
enabled: true
examiner:
enabled: true
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
This is the initial landing page for your workshop. Include in this page a description of what your workshop is about.
+++
title = 'Workshop Overview'
+++

The Educates training platform is a Kubernetes native application which provides
time limited sandboxes for hosted workshop environments.

This series of workshops demonstrates the capabilities of the Educates training
platform and how it can be used.

In this workshop you will get an overview of how a to create an examiner workshop to test
what the learner has learnt.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
+++
title = 'Deploying a pod'
+++

In this this task you are required to deploy a pod. The name of the pod must be "one".

Before doing so, it is suggested you create a watch on pods in the namespace so you can monitor what happens.

```execute-2
watch kubectl get pods
```

The examiner is already running and will indicate when the task has been completed.

```examiner:execute-test
name: test-that-pod-exists
title: Verify that pod named "one" exists.
args:
- one
retries: .INF
delay: 1
autostart: true
```

Don't know how to deploy the required pod? One way is to execute the following command.

```execute
kubectl run one -it --image=busybox:latest --restart=Never -- sh
```

You could also have manually created a `Pod` resource definition as a YAML or JSON file and used it with `kubectl apply`.

If you used the above command to deploy the pod, you will need to exit from the interactive shell it created before continuing.

```execute
exit
```

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
+++
title = 'Deleting a pod'
+++

In this task you are required to delete the pod named "one" that you previously created.

The examiner is already running and will indicate when the task has been completed.

```examiner:execute-test
name: test-that-pod-does-not-exist
title: Verify that pod named "one" does not exist.
args:
- one
retries: .INF
delay: 1
autostart: true
```

Don't know how to delete the pod? One way is to execute the following command.

```execute
kubectl delete pod one
```
28 changes: 28 additions & 0 deletions workshops/lab-examiner-scripts/workshop/content/03-user-input.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
+++
title = 'User input'
+++

We will create a pod with the user provided name

```examiner:execute-test
name: start-pod
prefix: Task
title: Start pod with name
inputs:
schema:
name:
type: string
title: "Name:"
default: "my-app"
required: true
form:
- "*"
- type: submit
title: Start
```

Stop the watch for pods in the namespace.

```execute-2
<ctrl-c>
```
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
This is the last page of the workshop. Include in this page a summary of the workshop and any links to resources relevant to the workshop. This ensures anyone doing the workshop has material they can research later to learn more.
+++
title = 'Workshop Summary'
+++

This is the end of the workshop. The Educates workshop resource definition for
this workshop can be viewed by clicking:

```dashboard:create-dashboard
name: Resource
prefix: Workshop
title: View workshop definition
description: ""
url: /files/resources/workshop.yaml
```

The source code repository for this series of workshops showcasing the Educates
training platform can be found at:

```dashboard:open-url
url: https://github.com/educates/labs-educates-showcase
```

Documentation for Educates can be found at:

```dashboard:open-url
url: https://docs.educates.dev/
```
15 changes: 15 additions & 0 deletions workshops/lab-examiner-scripts/workshop/examiner/tests/start-pod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -x

TMPFILE=/tmp/examiner-$(basename "$0")

trap "rm -f $TMPFILE" EXIT

cat - > $TMPFILE

NAME=$(jq -r ".name" $TMPFILE)

kubectl run -it $NAME --image=busybox:latest --restart=Never

exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -x

kubectl get pod/$1 -o name

if [ "$?" == "0" ]; then
exit 1
fi

exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -x

kubectl get pods --field-selector=status.phase=Running -o name | egrep -e "^pod/$1$"

if [ "$?" != "0" ]; then
exit 1
fi

exit 0
9 changes: 0 additions & 9 deletions workshops/lab-examiner-scripts/workshop/modules.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions workshops/lab-examiner-scripts/workshop/workshop.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions workshops/lab-extension-packages/resources/workshop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ spec:
terminal:
enabled: true
layout: split
files:
enabled: true
2 changes: 2 additions & 0 deletions workshops/lab-git-repositories/resources/workshop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ spec:
layout: split
git:
enabled: true
files:
enabled: true
2 changes: 2 additions & 0 deletions workshops/lab-ingress-proxy/resources/workshop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ spec:
terminal:
enabled: true
layout: split
files:
enabled: true
2 changes: 2 additions & 0 deletions workshops/lab-integrated-editor/resources/workshop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ spec:
layout: split
editor:
enabled: true
files:
enabled: true
2 changes: 2 additions & 0 deletions workshops/lab-java-environment/resources/workshop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ spec:
layout: split
editor:
enabled: true
files:
enabled: true
2 changes: 2 additions & 0 deletions workshops/lab-managed-services/resources/workshop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ spec:
terminal:
enabled: true
layout: split
files:
enabled: true
2 changes: 2 additions & 0 deletions workshops/lab-session-resources/resources/workshop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ spec:
terminal:
enabled: true
layout: split
files:
enabled: true
2 changes: 2 additions & 0 deletions workshops/lab-shared-resources/resources/workshop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ spec:
enabled: false
vcluster:
enabled: false
files:
enabled: true
2 changes: 2 additions & 0 deletions workshops/lab-slide-presentations/resources/workshop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ spec:
enabled: true
reveal.js:
version: 3.X
files:
enabled: true
2 changes: 2 additions & 0 deletions workshops/lab-virtual-machines/resources/workshop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ spec:
layout: split
examiner:
enabled: true
files:
enabled: true
objects:
- apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
+++
title = 'Workshop Overview'
+++

The Educates training platform is a Kubernetes native application which provides
time limited sandboxes for hosted workshop environments.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
+++
title = 'Workshop Instructions'
+++

A specific hosted workshop can be selected via the Educates training portal web
interface, or a distinct custom web portal, which interacts with the Educates
training portal application via a REST API to request access to a workshop.

In either case, a workshop session for the hosted workshop is allocated to the
user and they are redirected to the dashboard for the workshop session.

![](workshop-dashboard.png)
![Workshop dashboard](workshop-dashboard.png)

The workshop dashboard typically consists of a set of instructions on the left
hand side, with one or more interactive terminals on the right hand side for
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
+++
title = 'Clickable Actions'
+++

Workshop instructions can be scripted with the details of commands a user should
execute in the terminals. These can be displayed as code blocks, with the user
required to manually type in each command:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
+++
title = 'Terminal Environment'
+++

The Educates training platform is designed to be run in a Kubernetes cluster.
When a workshop is accessed a distinct Kubernetes deployment is created to host
the workshop dashboard for that workshop session. The shell environment provided
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
+++
title = 'Session Lifecycle'
+++

The duration of training workshops would normally be time limited. This duration
can be fixed, or requests for time extensions up to a maximum can be enabled. An
inactivity timeout can be specified so that workshop sessions are automatically
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
+++
title = 'Workshop Summary'
+++

This is the end of the workshop. The Educates workshop resource definition for
this workshop can be viewed by clicking:

Expand Down
15 changes: 0 additions & 15 deletions workshops/lab-workshop-session/workshop/modules.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions workshops/lab-workshop-session/workshop/workshop.yaml

This file was deleted.

0 comments on commit f8e4b1e

Please sign in to comment.