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

Test pr #51

Open
wants to merge 72 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
37a8588
updating
davidgiffin Oct 31, 2019
39caf4d
Bears and Eagles
davidgiffin Nov 21, 2019
d80b30a
City and Country
davidgiffin Nov 21, 2019
ea0bfe0
Land and Sea Bears
davidgiffin Nov 27, 2019
2002665
City and Country
davidgiffin Nov 27, 2019
83bff82
Updating to work with new builders
davidgiffin Dec 13, 2019
2e8bc92
Fixing image references
davidgiffin Dec 17, 2019
f764c61
Adding depends for result and worker
davidgiffin Jan 12, 2020
dc62127
make a build go
davidgiffin Jan 19, 2020
a953cd4
test
davidgiffin Jan 19, 2020
0760506
Inner city vs metro
davidgiffin Jan 21, 2020
894ee0a
white space
davidgiffin Jan 21, 2020
8cb9a3c
Make vote and result depend on worker
davidgiffin Jan 31, 2020
1c8c56d
city and country
davidgiffin Jan 31, 2020
e2164f8
bears and eagles
davidgiffin Mar 22, 2020
341fd2d
chim vs scoot
davidgiffin Mar 23, 2020
c2b83c4
chimmy
davidgiffin Mar 27, 2020
3836514
chimmy!>
davidgiffin Apr 19, 2020
5fbeb41
change stuff
davidgiffin Apr 19, 2020
ec512b7
uuhhhh
davidgiffin Apr 19, 2020
b86395c
more
davidgiffin Apr 19, 2020
6ffd54d
go
davidgiffin Apr 19, 2020
591e7ec
vote
davidgiffin Apr 19, 2020
19232ef
Test
davidgiffin Apr 19, 2020
95843bb
More
davidgiffin Apr 19, 2020
80ddf7f
Timmy
davidgiffin Apr 20, 2020
9cd2163
go go
davidgiffin Apr 20, 2020
f5b396c
do it
davidgiffin Apr 20, 2020
74a4dfc
uh
davidgiffin Apr 20, 2020
98e0967
work!
davidgiffin Apr 20, 2020
dd3bf41
go
davidgiffin Apr 20, 2020
f9eaa2b
white
davidgiffin Apr 20, 2020
b3c7320
work!
davidgiffin Apr 20, 2020
9f4cae3
Updating worker
davidgiffin Apr 21, 2020
6bc75bc
testing
davidgiffin Apr 21, 2020
fcbb9a5
Change all the services
davidgiffin Apr 22, 2020
d30b18c
update all the things
davidgiffin Apr 22, 2020
7ca8cba
Testing
davidgiffin Apr 22, 2020
1a2b758
test
davidgiffin Apr 23, 2020
4432fff
New build
davidgiffin May 18, 2020
8f7a6bd
Adding uploader
davidgiffin Jun 8, 2020
ae23597
making the uploader work
davidgiffin Jun 8, 2020
587c50c
updating
davidgiffin Jun 12, 2020
5f5e2a0
Freddie
davidgiffin Jun 22, 2020
f10cf39
Trying out barrett jacksons db setup
davidgiffin Aug 4, 2020
97f07e7
removing postgres password
davidgiffin Sep 18, 2020
346b80f
whitespace
davidgiffin Apr 17, 2021
53323e9
Adding default app config and env config
davidgiffin Apr 24, 2021
9df7c94
fixing up release.yaml
davidgiffin Apr 24, 2021
1e511bc
moving app and env config to .release
davidgiffin Apr 27, 2021
0b326ff
Adding new env var
davidgiffin Apr 27, 2021
8a8736b
removing us-east-1 node selector
davidgiffin Apr 27, 2021
b539a95
updating failure zone
davidgiffin Apr 27, 2021
d31de83
whitespace
davidgiffin Apr 28, 2021
bcbe936
removing worker
davidgiffin Apr 28, 2021
fde2b93
Adding echo
davidgiffin Jun 23, 2021
f943cce
prep for gitops
davidgiffin Aug 16, 2021
2f5ec98
remove node selector
davidgiffin Aug 16, 2021
ce35282
Updating domain
davidgiffin Aug 16, 2021
47802ee
removing node selector
davidgiffin Aug 16, 2021
49bcb3a
parallel workflow
davidgiffin Aug 16, 2021
319d295
comment 5858
davidgiffin Aug 16, 2021
11214e4
Updating app template
davidgiffin Aug 16, 2021
9b49715
remove 5858
davidgiffin Aug 16, 2021
663ae5a
Adding cluster configs
davidgiffin Sep 11, 2021
739ec63
Updating cluster config
davidgiffin Sep 21, 2021
5d8bdd7
spelling namespace properly
davidgiffin Sep 21, 2021
b3b98ba
adding argo
davidgiffin Sep 22, 2021
4b54f6e
whitespace
davidgiffin Nov 8, 2021
9248957
whitespace
davidgiffin Nov 8, 2021
36f7d44
more whitespace
davidgiffin Nov 8, 2021
2c21da8
more more space
davidgiffin Nov 8, 2021
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
2 changes: 2 additions & 0 deletions .release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
application_template: .release/application_template.yaml
environment_variables: .release/environment_variables.yaml
103 changes: 103 additions & 0 deletions .release/application_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
app: example-voting-app
auto_deploy: true
context: release-handsup-us-east-1
domain: app.releaseapp.gethandsup.com
mode: development
repo_name: dustyspace/example-voting-app
hostnames:
- vote: vote-${env_id}-${domain}
- result: result-${env_id}-${domain}
environment_templates:
- name: ephemeral
- name: permanent
resources:
cpu:
limits: 1000m
requests: 100m
memory:
limits: 1Gi
requests: 100Mi
replicas: 1
services:
- name: vote
image: dustyspace/example-voting-app/vote
build:
context: "./vote"
has_repo: true
static: false
args:
- python
- app.py
depends_on:
- worker
ports:
- type: node_port
target_port: '80'
port: '5000'
- name: result
image: dustyspace/example-voting-app/result
build:
context: "./result"
has_repo: true
static: false
args:
- nodemon
- server.js
depends_on:
- worker
ports:
- type: node_port
target_port: '80'
port: '5001'
# - type: node_port
# target_port: '5858'
# port: '5858'
- name: worker
image: dustyspace/example-voting-app/worker
build:
context: "./worker"
has_repo: true
static: false
depends_on:
- redis
- db
- name: redis
image: redis:alpine
ports:
- type: container_port
port: '6379'
- name: db
image: postgres:9.6.1
volumes:
- type: persistent
name: db-data
mount_path: "/var/lib/postgresql/data"
ports:
- type: container_port
port: '5432'
storage:
size: 10Gi
type: aws-efs
workflows:
- name: setup
parallelize:
- step: data
tasks:
- services.db
- services.redis
- step: worker
tasks:
- services.worker
- step: frontend
tasks:
- services.result
- services.vote
- name: patch
parallelize:
- step: all
tasks:
- services.worker
- services.result
- services.vote

11 changes: 11 additions & 0 deletions .release/clusters/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
charts:
- name: argo-wf
repo_url: https://argoproj.github.io/argo-helm
add: argo
install: argo/argo-workflows
version: "0.2.12"
include_crds: true
directory: helm/argo
values: values.yaml
name_template: "argo-workflows"
13 changes: 13 additions & 0 deletions .release/clusters/release-test-us-west-2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
charts:
- name: argo-wf
repo_url: https://argoproj.github.io/argo-helm
add: argo
install: argo/argo-workflows
version: "0.2.12"
include_crds: true
directory: helm/argo
values: values.yaml
name_template: "argo-workflows"
context: release-test-us-west-2
namespace: argo-wf-test
31 changes: 31 additions & 0 deletions .release/env-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
defaults:
- key: FRESH
value: 'and so clean'
- key: POSTGRES_DB
value: database
- key: POSTGRES_HOST
value: db
- key: POSTGRES_PORT
value: '5432'
- key: POSTGRES_USER
value: postgres
- key: POSTGRES_HOST_AUTH_METHOD
value: trust
- key: PGDATA
value: "/var/lib/postgresql/data/pgdata"
services:
db:
- key: POSTGRES_DB
value: database
- key: POSTGRES_HOST
value: db
- key: POSTGRES_PORT
value: '5432'
- key: POSTGRES_USER
value: postgres
- key: POSTGRES_HOST_AUTH_METHOD
value: trust
- key: PGDATA
value: "/var/lib/postgresql/data/pgdata"

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Example Voting App
=========

A simple distributed application running across multiple Docker containers.

Getting started
Expand Down
41 changes: 31 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
version: "3"

services:
echo:
build: ./echo
ports:
- "8080:8080"
vote:
image: docker.giffin.org/tmcclung/example-voting-app-vote
build: ./vote
command:
- python
- app.py
command: python app.py
volumes:
- ./vote:/app
ports:
- "5000:80"
depends_on:
- "worker"
networks:
- front-tier
- back-tier

result:
image: docker.giffin.org/tmcclung/example-voting-app-result
build: ./result
command:
- nodemon
- server.js
command: nodemon server.js
volumes:
- ./result:/app
ports:
- "5001:80"
- "5858:5858"
depends_on:
- "worker"
networks:
- front-tier
- back-tier

worker:
image: docker.giffin.org/tmcclung/example-voting-app-worker
build:
context: ./worker
depends_on:
Expand All @@ -40,6 +41,20 @@ services:
networks:
- back-tier

uploader:
image: mayth/simple-upload-server
ports:
- "3000:3000"
command:
- "/usr/local/bin/app"
- "-port"
- '3000'
- "-upload_limit"
- '10485760'
- "-token"
- f9403fc5f537b4ab332d
- "/tmp"

redis:
image: redis:alpine
container_name: redis
Expand All @@ -48,8 +63,14 @@ services:
- back-tier

db:
image: postgres:9.4
image: postgres:9.6.1
container_name: db
ports: ["5432"]
environment:
- POSTGRES_DB=database
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
- POSTGRES_USER=postgres
volumes:
- "db-data:/var/lib/postgresql/data"
networks:
Expand Down
8 changes: 8 additions & 0 deletions echo/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Ignore everything
**

# Except
!generate-cert.sh
!index.js
!package.json
!package-lock.json
2 changes: 2 additions & 0 deletions echo/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.sh text eol=lf
4 changes: 4 additions & 0 deletions echo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.*.sw*
node_modules/
*.log
testarea
42 changes: 42 additions & 0 deletions echo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## Version `19` - 2021-04-08

* You can run the container as a different user than the one defined in the image.

## Version `18` - 2021-02-26

* You can pass a `x-set-response-delay-ms` to set a custom delay in milliseconds.

## Version `17` - 2021-01-15

* You can pass a `x-set-response-status-code` header to set the response status code

## Version `16` - 2020-12-22

* Dockerfile optimisation, slightly smaller image size
* This changelog added to the repo

## Version `15` - 2020-12-15

* The image now runs as a non-root user by default.

## Version `14` - 2020-11-26

* Optionally allow running as a non root user.

```
docker run --user node -e HTTP_PORT=8080 -e HTTPS_PORT=8443 -p 8080:8080 -p 8443:8443 --rm mendhak/http-https-echo:issue-14-non-root
#or
docker run --user node --sysctl net.ipv4.ip_unprivileged_port_start=0 -p 8080:80 -p 8443:443 --rm mendhak/http-https-echo:issue-14-non-root
```

## Version `latest` and others

_Note: The `latest` tag is no longer being built, I've removed it from the automated builds. Please don't use the `latest` tag any longer._

* JWT header
* Choose your own ports
* Choose your own certs
* Ignore a specific path
* JSON payloads
* Single line log output

26 changes: 26 additions & 0 deletions echo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:14-alpine AS build

WORKDIR /app
COPY . /app

RUN set -ex \
# Build JS-Application
&& npm install --production \
# Generate SSL-certificate (for HTTPS)
&& apk --no-cache add openssl \
&& sh generate-cert.sh \
&& apk del openssl \
&& rm -rf /var/cache/apk/* \
# Delete unnecessary files
&& rm package* generate-cert.sh \
# Correct User's file access
&& chown -R node:node /app \
&& chmod +r /app/privkey.pem

FROM node:14-alpine AS final
WORKDIR /app
COPY --from=build /app /app
ENV HTTP_PORT=8080 HTTPS_PORT=8443
EXPOSE $HTTP_PORT $HTTPS_PORT
USER 1000
CMD ["node", "./index.js"]
Loading