Skip to content

Commit 264f3a4

Browse files
burtonralexellis
authored andcommitted
Add guide for play-with-docker
This removes the unreliable PWD button on the deployment page and adds a page describing how to use the online Docker Playground Signed-off-by: Burton Rheutan <[email protected]>
1 parent 5cb1dae commit 264f3a4

File tree

3 files changed

+81
-3
lines changed

3 files changed

+81
-3
lines changed

docs/deployment.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,4 @@ You can follow the [deployment guide for Docker Swarm](/deployment/docker-swarm/
1818

1919
### Docker Playground
2020

21-
You can quickly start OpenFaaS on Docker Swarm online using the community-run Docker playground: play-with-docker.com (PWD) by clicking the button below:
22-
23-
[![Try in PWD](https://cdn.rawgit.com/play-with-docker/stacks/cff22438/assets/images/button.png)](http://play-with-docker.com?stack=https://raw.githubusercontent.com/openfaas/faas/master/docker-compose.yml&stack_name=func)
21+
You can quickly start OpenFaaS on Docker Swarm online using the community-run Docker playground: play-with-docker.com (PWD) by following the [Play with Docker guide](/deployment/play-with-docker/)

docs/deployment/play-with-docker.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Deployment guide for the Docker Playground (PWD)
2+
3+
> Note: You will need a free [Docker Hub](https://hub.docker.com) account to access play-with-docker.
4+
5+
## 1.0 Start a new session
6+
7+
Go to [play-with-docker.com](https://labs.play-with-docker.com) and log in with your Docker Hub account
8+
9+
This will create a new 4 hour session with access to all of docker's features in your browser
10+
11+
Once logged in, click the "+ ADD NEW INSTANCE" link on the right-hand side
12+
13+
This will open a console with Docker ready to run
14+
15+
## 1.0 Initialize Swarm Mode
16+
17+
In the console, run the swarm `init` command to initialize Swarm mode
18+
19+
```bash
20+
docker swarm init --advertise-addr eth0
21+
```
22+
23+
Highlight the join token command that is output and right-click - "copy" (we'll need that to join additional worker nodes)
24+
25+
## 1.1 Join workers (optional)
26+
27+
> OpenFaas works well for experimentation with only the master node if you don't want to create workers
28+
29+
Click the "+ ADD NEW INSTANCE" link on the right-hand side again to create another docker host within your session
30+
31+
In the new console, right-click and paste the join token command that was just copied
32+
33+
Repeat these steps for as many workers as you would like.
34+
35+
## 2.0 Deploy the stack
36+
37+
Go back to the master node by clicking the first button on the right-side menu
38+
39+
> This should have an icon of a person/user to indicate it is a swarm master
40+
41+
In the console, clone OpenFaaS and deploy the stack by copy/pasting the following command:
42+
43+
```bash
44+
git clone https://github.com/openfaas/faas && \
45+
cd faas && \
46+
./deploy_stack.sh
47+
```
48+
49+
`./deploy_stack.sh` can be run at any time and deploys the core OpenFaas components. You can read more about these in the [TestDrive document](https://github.com/openfaas/faas/blob/master/TestDrive.md)
50+
51+
## 2.1 Test out the UI
52+
53+
Within a few seconds (or minutes depending on PWD's load at the time) the API gateway will be deployed and you will be able to access the UI
54+
55+
Once the command is complete, you will notice two links appear at the top of the page with port numbers
56+
57+
`8080` and `9090`
58+
59+
To view the OpenFaaS UI, simply click the `8080` link.
60+
61+
This will open a new tab in your browser with the UI from your PWD Swarm cluster
62+
63+
The `9090` link will open the Prometheus console UI. More on that in the [Auto-scaling](/architecture/autoscaling/) section
64+
65+
## 3.0 Start the hands-on labs
66+
67+
Learn how to build serverless functions with OpenFaaS and Python in our half-day workshop. You can follow along online at your own pace.
68+
69+
* [OpenFaaS workshop](/tutorials/workshop/)
70+
71+
> There are **only 4 hours** available per PWD session, but we've found that most people are able to walk through the workshop in less time.
72+
73+
## Troubleshooting
74+
75+
If you are running into any issues please check out the troubleshooting guide and search the documentation / past issues before raising na issue.
76+
77+
* [Troubleshooting guide](https://github.com/openfaas/faas/blob/master/guide/troubleshooting.md)
78+
79+
Alternatively, just click the orange "CLOSE SESSION" button under the timer and start over with a fresh session

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ pages:
110110
- Deployment: deployment.md
111111
- Kubernetes: ./deployment/kubernetes.md
112112
- Docker Swarm: ./deployment/docker-swarm.md
113+
- Docker Playground: ./deployment/play-with-docker.md
113114
- Troubleshooting: ./deployment/troubleshooting.md
114115
- CLI:
115116
- Installation: ./cli/install.md

0 commit comments

Comments
 (0)