diff --git a/README.md b/README.md
index d22ceb57..79b5c754 100644
--- a/README.md
+++ b/README.md
@@ -76,9 +76,6 @@ a few other contributors. It is actively maintained.
## Repository structure
-- [autotest](autotest/)
- - Semi-automated testing system to check that all the exercises
- in the slides work properly.
- [bin](bin/)
- A few helper scripts that you can safely ignore for now.
- [dockercoins](dockercoins/)
diff --git a/prepare-vms/settings/fundamentals.yaml b/prepare-vms/settings/fundamentals.yaml
index 3ecc764b..f4029d05 100644
--- a/prepare-vms/settings/fundamentals.yaml
+++ b/prepare-vms/settings/fundamentals.yaml
@@ -20,5 +20,5 @@ paper_margin: 0.2in
engine_version: test
# These correspond to the version numbers visible on their respective GitHub release pages
-compose_version: 1.16.1
-machine_version: 0.12.0
+compose_version: 1.17.1
+machine_version: 0.13.0
diff --git a/prepare-vms/settings/orchestration.yaml b/prepare-vms/settings/orchestration.yaml
index cab03235..2b1f0e83 100644
--- a/prepare-vms/settings/orchestration.yaml
+++ b/prepare-vms/settings/orchestration.yaml
@@ -20,5 +20,5 @@ paper_margin: 0.2in
engine_version: test
# These correspond to the version numbers visible on their respective GitHub release pages
-compose_version: 1.16.1
-machine_version: 0.12.0
+compose_version: 1.17.1
+machine_version: 0.13.0
diff --git a/slides/autotest.py b/slides/autotest.py
index c560a4c2..134387aa 100755
--- a/slides/autotest.py
+++ b/slides/autotest.py
@@ -1,5 +1,7 @@
#!/usr/bin/env python
+# coding: utf-8
+import click
import logging
import os
import random
@@ -11,11 +13,13 @@ import uuid
logging.basicConfig(level=os.environ.get("LOG_LEVEL", "INFO"))
+interactive = True
+verify_status = False
+simulate_type = True
TIMEOUT = 60 # 1 minute
-
def hrule():
return "="*int(subprocess.check_output(["tput", "cols"]))
@@ -182,10 +186,6 @@ except Exception as e:
logging.warning("Could not read nextstep file ({}), initializing to 0.".format(e))
i = 0
-interactive = True
-verify_status = False
-simulate_type = True
-
while i < len(actions):
with open("nextstep", "w") as f:
f.write(str(i))
@@ -199,10 +199,14 @@ while i < len(actions):
print(hrule())
if interactive:
print("[{}/{}] Shall we execute that snippet above?".format(i, len(actions)))
- print("(ENTER to execute, 'c' to continue until next error, N to jump to step #N)")
- command = raw_input("> ")
+ print("y/⏎/→ Execute snippet")
+ print("s Skip snippet")
+ print("g Go to a specific snippet")
+ print("q Quit")
+ print("c Continue non-interactively until next error")
+ command = click.getchar()
else:
- command = ""
+ command = "y"
# For now, remove the `highlighted` sections
# (Make sure to use $() in shell snippets!)
@@ -210,12 +214,16 @@ while i < len(actions):
logging.info("Stripping ` from snippet.")
data = data.replace('`', '')
- if command == "c":
+ if command == "s":
+ i += 1
+ elif command == "g":
+ i = click.prompt("Enter snippet number", type=int)
+ elif command == "q":
+ break
+ elif command == "c":
# continue until next timeout
interactive = False
- elif command.isdigit():
- i = int(command)
- elif command == "":
+ elif command in ("y", "\r", " ", "\x1b[C"):
logging.info("Running with method {}: {}".format(method, data))
if method == "keys":
send_keys(data)
@@ -252,13 +260,19 @@ while i < len(actions):
# FIXME: we should factor out the "bash" method
wait_for_prompt()
check_exit_status()
+ elif method == "open":
+ # Cheap way to get node1's IP address
+ screen = capture_pane()
+ ipaddr = re.findall("^\[(.*)\]", screen, re.MULTILINE)[-1]
+ url = data.replace("/node1", "/{}".format(ipaddr))
+ # This should probably be adapted to run on different OS
+ subprocess.check_call(["open", url])
else:
logging.warning("Unknown method {}: {!r}".format(method, data))
i += 1
else:
- i += 1
- logging.warning("Unknown command {}, skipping to next step.".format(command))
+ logging.warning("Unknown command {}.".format(command))
# Reset slide counter
with open("nextstep", "w") as f:
diff --git a/slides/common/intro.md b/slides/common/intro.md
index 1227a6be..51b8065a 100644
--- a/slides/common/intro.md
+++ b/slides/common/intro.md
@@ -35,10 +35,9 @@ class: self-paced
you will be given specific instructions to access your cluster
- If you are doing this on your own:
-
you can use
- [Play-With-Docker](http://www.play-with-docker.com/) and
- read [these instructions](https://github.com/jpetazzo/container.training#using-play-with-docker) for extra
- details
+
the first chapter will give you various options like
+ [Play-With-Docker](http://www.play-with-docker.com/)
+ to get your own cluster
---
diff --git a/slides/common/sampleapp.md b/slides/common/sampleapp.md
index c1a787fd..b689c2e1 100644
--- a/slides/common/sampleapp.md
+++ b/slides/common/sampleapp.md
@@ -59,7 +59,24 @@ class: extra-details
## Example in `worker/worker.py`
-
+```python
+redis = Redis("`redis`")
+
+
+def get_random_bytes():
+ r = requests.get("http://`rng`/32")
+ return r.content
+
+
+def hash_bytes(data):
+ r = requests.post("http://`hasher`/",
+ data=data,
+ headers={"Content-Type": "application/octet-stream"})
+```
+
+(Full source code available [here](
+https://github.com/jpetazzo/container.training/blob/8279a3bce9398f7c1a53bdd95187c53eda4e6435/dockercoins/worker/worker.py#L17
+))
---
diff --git a/slides/index.html b/slides/index.html
index 4a3a932a..da9d4da3 100644
--- a/slides/index.html
+++ b/slides/index.html
@@ -72,11 +72,13 @@