Merge branch 'master' into qconsf2017intro

This commit is contained in:
Jérôme Petazzoni
2017-11-13 22:41:38 -08:00
12 changed files with 102 additions and 40 deletions

View File

@@ -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/)

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -35,10 +35,9 @@ class: self-paced
<br/>you will be given specific instructions to access your cluster
- If you are doing this on your own:
<br/>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
<br/>the first chapter will give you various options like
[Play-With-Docker](http://www.play-with-docker.com/)
to get your own cluster
---

View File

@@ -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
))
---

View File

@@ -72,11 +72,13 @@
<tr>
<td>QCON SF: Introduction to Docker and Containers</td>
<td><a class="slides" href="http://qconsf2017intro.container.training/" /></td>
<td><a class="attend" href="https://qconsf.com/sf2017/workshop/introduction-docker-and-containers" /></td>
</tr>
<tr>
<td>QCON SF: Orchestrating Microservices with Docker Swarm</td>
<td><a class="slides" href="http://qconsf2017swarm.container.training/" /></td>
<td><a class="attend" href="https://qconsf.com/sf2017/workshop/orchestrating-microservices-docker-swarm" /></td>
</tr>

View File

@@ -7,7 +7,6 @@ chat: "[Slack](https://dockercommunity.slack.com/messages/C7GKACWDV)"
exclude:
- self-paced
- snap
chapters:
- common/title.md

33
slides/kube-selfpaced.yml Normal file
View File

@@ -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

View File

@@ -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,
<br/>
are we getting 1000 packets per second
at the Google NOC ...
<br/>
of ICMP ECHO traffic from EC2 ?!?
]
]
<br/>
.small[“Why the hell]
<br/>
.small[are we getting 1000 packets per second]
<br/>
.small[of ICMP ECHO traffic from EC2 ?!?”]

View File

@@ -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@@

View File

@@ -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 ?!?
--