Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/workerpipe #269

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 40 additions & 40 deletions .github/ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
** PLEASE ONLY USE THIS ISSUE TRACKER TO SUBMIT ISSUES WITH THE EXAMPLE VOTING APP **

* If you have a bug working with Docker itself, not related to these labs, please file the bug on the [Docker repo](https://github.com/docker/docker) *
* If you would like general support figuring out how to do something with Docker, please use the Docker Slack channel. If you're not on that channel, sign up for the [Docker Community](http://dockr.ly/MeetUp) and you'll get an invite. *
* Or go to the [Docker Forums](https://forums.docker.com/) *

Please provide the following information so we can assess the issue you're having

**Description**

<!--
Briefly describe the problem you are having in a few paragraphs.
-->

**Steps to reproduce the issue, if relevant:**
1.
2.
3.

**Describe the results you received:**


**Describe the results you expected:**


**Additional information you deem important (e.g. issue happens only occasionally):**

**Output of `docker version`:**

```
(paste your output here)
```

**Output of `docker info`:**

```
(paste your output here)
```

**Additional environment details (AWS, Docker for Mac, Docker for Windows, VirtualBox, physical, etc.):**
** PLEASE ONLY USE THIS ISSUE TRACKER TO SUBMIT ISSUES WITH THE EXAMPLE VOTING APP **
* If you have a bug working with Docker itself, not related to these labs, please file the bug on the [Docker repo](https://github.com/docker/docker) *
* If you would like general support figuring out how to do something with Docker, please use the Docker Slack channel. If you're not on that channel, sign up for the [Docker Community](http://dockr.ly/MeetUp) and you'll get an invite. *
* Or go to the [Docker Forums](https://forums.docker.com/) *
Please provide the following information so we can assess the issue you're having
**Description**
<!--
Briefly describe the problem you are having in a few paragraphs.
-->
**Steps to reproduce the issue, if relevant:**
1.
2.
3.
**Describe the results you received:**
**Describe the results you expected:**
**Additional information you deem important (e.g. issue happens only occasionally):**
**Output of `docker version`:**
```
(paste your output here)
```
**Output of `docker info`:**
```
(paste your output here)
```
**Additional environment details (AWS, Docker for Mac, Docker for Windows, VirtualBox, physical, etc.):**
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.pyc
project.lock.json
bin/
*.pyc
project.lock.json
bin/
obj/
382 changes: 191 additions & 191 deletions LICENSE

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Aanand Prasad <[email protected]>
Ben Firshman <[email protected]>
Fernando Mayo <[email protected]>
Mano Marks <[email protected]>
Maxime Heckel <[email protected]>
Aanand Prasad <[email protected]>
Ben Firshman <[email protected]>
Fernando Mayo <[email protected]>
Mano Marks <[email protected]>
Maxime Heckel <[email protected]>
120 changes: 60 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
Example Voting App
=========

Getting started
---------------

Download [Docker](https://www.docker.com/products/overview). If you are on Mac or Windows, [Docker Compose](https://docs.docker.com/compose) will be automatically installed. On Linux, make sure you have the latest version of [Compose](https://docs.docker.com/compose/install/). If you're using [Docker for Windows](https://docs.docker.com/docker-for-windows/) on Windows 10 pro or later, you must also [switch to Linux containers](https://docs.docker.com/docker-for-windows/#switch-between-windows-and-linux-containers).

Run in this directory:
```
docker-compose up
```
The app will be running at [http://localhost:5000](http://localhost:5000), and the results will be at [http://localhost:5001](http://localhost:5001).

Alternately, if you want to run it on a [Docker Swarm](https://docs.docker.com/engine/swarm/), first make sure you have a swarm. If you don't, run:
```
docker swarm init
```
Once you have your swarm, in this directory run:
```
docker stack deploy --compose-file docker-stack.yml vote
```

Run the app in Kubernetes
-------------------------

The folder k8s-specifications contains the yaml specifications of the Voting App's services.

Run the following command to create the deployments and services objects:
```
$ kubectl create -f k8s-specifications/
deployment "db" created
service "db" created
deployment "redis" created
service "redis" created
deployment "result" created
service "result" created
deployment "vote" created
service "vote" created
deployment "worker" created
```

The vote interface is then available on port 31000 on each host of the cluster, the result one is available on port 31001.

Architecture
-----

![Architecture diagram](architecture.png)

* A Python webapp which lets you vote between two options
* A Redis queue which collects new votes
* A .NET worker which consumes votes and stores them in…
* A Postgres database backed by a Docker volume
* A Node.js webapp which shows the results of the voting in real time


Note
----

The voting application only accepts one vote per client. It does not register votes if a vote has already been submitted from a client.
Example Voting App
=========
Getting started
---------------
Download [Docker](https://www.docker.com/products/overview). If you are on Mac or Windows, [Docker Compose](https://docs.docker.com/compose) will be automatically installed. On Linux, make sure you have the latest version of [Compose](https://docs.docker.com/compose/install/). If you're using [Docker for Windows](https://docs.docker.com/docker-for-windows/) on Windows 10 pro or later, you must also [switch to Linux containers](https://docs.docker.com/docker-for-windows/#switch-between-windows-and-linux-containers).
Run in this directory:
```
docker-compose up
```
The app will be running at [http://localhost:5000](http://localhost:5000), and the results will be at [http://localhost:5001](http://localhost:5001).
Alternately, if you want to run it on a [Docker Swarm](https://docs.docker.com/engine/swarm/), first make sure you have a swarm. If you don't, run:
```
docker swarm init
```
Once you have your swarm, in this directory run:
```
docker stack deploy --compose-file docker-stack.yml vote
```
Run the app in Kubernetes
-------------------------
The folder k8s-specifications contains the yaml specifications of the Voting App's services.
Run the following command to create the deployments and services objects:
```
$ kubectl create -f k8s-specifications/
deployment "db" created
service "db" created
deployment "redis" created
service "redis" created
deployment "result" created
service "result" created
deployment "vote" created
service "vote" created
deployment "worker" created
```
The vote interface is then available on port 31000 on each host of the cluster, the result one is available on port 31001.
Architecture
-----
![Architecture diagram](architecture.png)
* A Python webapp which lets you vote between two options
* A Redis queue which collects new votes
* A .NET worker which consumes votes and stores them in…
* A Postgres database backed by a Docker volume
* A Node.js webapp which shows the results of the voting in real time
Note
----
The voting application only accepts one vote per client. It does not register votes if a vote has already been submitted from a client.
28 changes: 28 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Docker
# Build a Docker image
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker

trigger:
- master

resources:
- repo: self

variables:
tag: '$(Build.BuildId)'

stages:
- stage: Build
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
name: mainagent
steps:
- task: Docker@2
inputs:
containerRegistry: 'ACR-new'
repository: 'acer-test'
command: 'buildAndPush'
Dockerfile: '**/Dockerfile'
34 changes: 17 additions & 17 deletions e2e.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash

cd e2e

docker-compose down > /dev/null 2>&1

#sleep 10

docker-compose build
docker-compose up -d

docker-compose ps

docker-compose run --rm e2e

docker-compose down

#!/bin/bash
cd e2e
docker-compose down > /dev/null 2>&1
#sleep 10
docker-compose build
docker-compose up -d
docker-compose ps
docker-compose run --rm e2e
docker-compose down
6 changes: 3 additions & 3 deletions e2e/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VOTE_IMAGE=lfs261/vote:master
WORKER_IMAGE=lfs261/worker:master
RESULT_IMAGE=lfs261/result:master
VOTE_IMAGE=lfs261/vote:master
WORKER_IMAGE=lfs261/worker:master
RESULT_IMAGE=lfs261/result:master
Loading