From 8279a3bce9398f7c1a53bdd95187c53eda4e6435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Fri, 10 Nov 2017 23:01:17 -0800 Subject: [PATCH 1/7] Add QCON slides --- slides/index.html | 2 ++ 1 file changed, 2 insertions(+) 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 @@ QCON SF: Introduction to Docker and Containers + QCON SF: Orchestrating Microservices with Docker Swarm + From cd18a87b8cef44af6d0ca92f3d7eb4238f4ef5c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Sun, 12 Nov 2017 17:37:40 -0800 Subject: [PATCH 2/7] Add self-paced kube manifest + small fixes in kube content --- slides/common/sampleapp.md | 19 ++++++++++++++++++- slides/kube-halfday.yml | 1 - slides/kube-selfpaced.yml | 33 +++++++++++++++++++++++++++++++++ slides/kube/kubectlrun.md | 17 ++++++++--------- 4 files changed, 59 insertions(+), 11 deletions(-) create mode 100644 slides/kube-selfpaced.yml 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` -![Service discovery](images/service-discovery.png) +```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/kube-halfday.yml b/slides/kube-halfday.yml index 9d1ab3ee..7ca89f17 100644 --- a/slides/kube-halfday.yml +++ b/slides/kube-halfday.yml @@ -7,7 +7,6 @@ chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)" exclude: - self-paced -- snap chapters: - common/title.md diff --git a/slides/kube-selfpaced.yml b/slides/kube-selfpaced.yml new file mode 100644 index 00000000..dfac73f7 --- /dev/null +++ b/slides/kube-selfpaced.yml @@ -0,0 +1,33 @@ +title: | + Deploying and Scaling Microservices + with Docker and Kubernetes + +chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)" +#chat: "[Gitter](https://gitter.im/jpetazzo/workshop-yyyymmdd-city)" + +exclude: +- in-person + +chapters: +- common/title.md +#- logistics.md +- common/intro.md +- common/toc.md +- - common/prereqs.md + - kube/versions-k8s.md + - common/sampleapp.md +- - kube/concepts-k8s.md + - common/declarative.md + - kube/declarative.md + - kube/kubenet.md + - kube/kubectlget.md + - kube/setup-k8s.md + - kube/kubectlrun.md +- - kube/kubectlexpose.md + - kube/ourapponkube.md + - kube/dashboard.md +- - kube/kubectlscale.md + - kube/daemonset.md + - kube/rollout.md + - kube/whatsnext.md + - common/thankyou.md diff --git a/slides/kube/kubectlrun.md b/slides/kube/kubectlrun.md index 81397998..f94439f1 100644 --- a/slides/kube/kubectlrun.md +++ b/slides/kube/kubectlrun.md @@ -236,14 +236,13 @@ Unfortunately, `--follow` cannot (yet) be used to stream the logs from multiple class: title -.small[ -Meanwhile, at the Google NOC ... - -.small[ -Why the hell +Meanwhile,
-are we getting 1000 packets per second +at the Google NOC ...
-of ICMP ECHO traffic from EC2 ?!? -] -] +
+.small[“Why the hell] +
+.small[are we getting 1000 packets per second] +
+.small[of ICMP ECHO traffic from EC2 ?!?”] From 31d1074ee07701feca07f049dbacd14f9664dcf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Sun, 12 Nov 2017 17:38:01 -0800 Subject: [PATCH 3/7] autotest: process single keypresses --- slides/autotest.py | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/slides/autotest.py b/slides/autotest.py index c560a4c2..bb479c70 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) @@ -257,8 +265,7 @@ while i < len(actions): 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: From bc367a1297ab6c124d7965c4126582aa65fd43df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Sun, 12 Nov 2017 17:45:15 -0800 Subject: [PATCH 4/7] Simplify reference to PWD in intro slides --- README.md | 3 --- slides/common/intro.md | 7 +++---- 2 files changed, 3 insertions(+), 7 deletions(-) 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/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 --- From 6d4894458a9643a91bee6f6785af31e5bddcc44a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Sun, 12 Nov 2017 18:06:43 -0800 Subject: [PATCH 5/7] Add note about interstitials --- slides/logistics.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/slides/logistics.md b/slides/logistics.md index b5017012..7a89c46e 100644 --- a/slides/logistics.md +++ b/slides/logistics.md @@ -14,4 +14,6 @@ - Feel free to interrupt for questions at any time +- *Especially when you see full screen container pictures!* + - Live feedback, questions, help on @@CHAT@@ From d99dbd5878a2671a75706fbd1ab6dea0408fa325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Sun, 12 Nov 2017 22:47:07 -0800 Subject: [PATCH 6/7] Add first support to auto-open URLs --- slides/autotest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/slides/autotest.py b/slides/autotest.py index bb479c70..134387aa 100755 --- a/slides/autotest.py +++ b/slides/autotest.py @@ -260,6 +260,13 @@ 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 From 6c5e3eb3f398a9fbc6d6ca8fd8c4b23c116bfb07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Mon, 13 Nov 2017 22:39:21 -0800 Subject: [PATCH 7/7] Update versions --- prepare-vms/settings/fundamentals.yaml | 4 ++-- prepare-vms/settings/orchestration.yaml | 4 ++-- slides/swarm/versions.md | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) 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/swarm/versions.md b/slides/swarm/versions.md index d3252043..54b1a451 100644 --- a/slides/swarm/versions.md +++ b/slides/swarm/versions.md @@ -1,8 +1,8 @@ ## Brand new versions! -- Engine 17.10 -- Compose 1.16 -- Machine 0.12 +- Engine 17.11 +- Compose 1.17 +- Machine 0.13 .exercise[ @@ -17,7 +17,7 @@ --- -## Wait, what, 17.10 ?!? +## Wait, what, 17.11 ?!? --