|
| 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 |
0 commit comments