Skip to content

Commit

Permalink
WIP socket.io service
Browse files Browse the repository at this point in the history
  • Loading branch information
tjohnson-bah authored and adpham95 committed Oct 28, 2019
1 parent e7a02c7 commit a5457b0
Show file tree
Hide file tree
Showing 32 changed files with 4,014 additions and 41 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.idea
venv
api/client/node_modules
socketio/node_modules
docs
testing
__pycache__
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ api/api/client_api.yaml
api/client/node_modules/
api/client/build/
api/client/coverage/
socketio/node_modules/
!apps/*.py
!interfaces/*.py
!interfaces/*.pytests/tmp/*
Expand Down
26 changes: 26 additions & 0 deletions bootloader/walkoff-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,31 @@ services:
- ./apps:/app/apps
- ./api/client/dist:/app/api/client/dist

core_socketio:
image: "127.0.0.1:5000/walkoff_core_socketio:latest"
build:
context: ./
dockerfile: ./socketio/Dockerfile
ports:
- '3000:3000'
# ports:
# - '8080:8080'
networks:
- walkoff_network
# stop_signal: SIGINT
# stop_grace_period: 30s
secrets:
# - walkoff_encryption_key
- walkoff_internal_key
# - walkoff_mongo_key
# - walkoff_redis_key
configs:
- common_env.yml
depends_on:
- core_api
# volumes:
# - ./api/client/dist:/app/api/client/dist

resource_nginx:
image: 'bitnami/nginx:latest'
networks:
Expand All @@ -68,6 +93,7 @@ services:
- ./nginx/key.pem:/opt/bitnami/nginx/conf/key.pem:ro
depends_on:
- core_api
- core_socketio

core_worker:
# command: python -m worker.worker --log-level=debug
Expand Down
91 changes: 50 additions & 41 deletions nginx/walkoff.conf
Original file line number Diff line number Diff line change
@@ -1,41 +1,50 @@
server {
listen 8081;
listen 8080 ssl;
ssl_certificate /opt/bitnami/nginx/conf/cert.pem;
ssl_certificate_key /opt/bitnami/nginx/conf/key.pem;
error_page 497 https://$host:$server_port$request_uri;

location / {
add_header X-Frame-Options "ALLOWALL";
proxy_pass http://core_api:8080;
proxy_read_timeout 24h;
}

location /walkoff/api/streams/ {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_pass http://core_api:8080/walkoff/api/streams/;
}

location /mongo/ {
proxy_pass http://debug_mongo_express:8081/mongo/;
}

location /minio/ {
proxy_pass http://resource_minio:9000/minio/;
}

location /portainer/ {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_pass http://resource_portainer:9000/;
}

location /portainer/api/websocket/ {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_pass http://resource_portainer:9000/api/websocket/;
}
}
server {
listen 8081;
listen 8080 ssl;
ssl_certificate /opt/bitnami/nginx/conf/cert.pem;
ssl_certificate_key /opt/bitnami/nginx/conf/key.pem;
error_page 497 https://$host:$server_port$request_uri;

location / {
add_header X-Frame-Options "ALLOWALL";
proxy_pass http://core_api:8080;
proxy_read_timeout 24h;
}

location /walkoff/api/streams/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://core_api:8080/walkoff/api/streams/;
}

location /walkoff/sockets/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_pass http://core_socketio:3000;
}

location /mongo/ {
proxy_pass http://debug_mongo_express:8081/mongo/;
}

location /minio/ {
proxy_pass http://resource_minio:9000/minio/;
}

location /portainer/ {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_pass http://resource_portainer:9000/;
}

location /portainer/api/websocket/ {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_pass http://resource_portainer:9000/api/websocket/;
}
}
22 changes: 22 additions & 0 deletions socketio/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM node:12.13.0-buster-slim as base

# Stage - Install/build Python dependencies
FROM base as builder

RUN mkdir /install
WORKDIR /install

COPY ./socketio /install
RUN npm install
RUN npm run build

# Stage - Copy pip packages and source files
FROM base

COPY --from=builder /install /
# COPY ./common /app/common
# COPY ./api /app/api
# WORKDIR /dist

EXPOSE 3000
CMD [ "npm", "start" ]
29 changes: 29 additions & 0 deletions socketio/dist/eventQueue.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions socketio/dist/eventQueue.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions socketio/dist/models/consoleEvent.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions socketio/dist/models/consoleEvent.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions socketio/dist/models/consoleLog.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions socketio/dist/models/consoleLog.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions socketio/dist/models/eventQueue.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions socketio/dist/models/eventQueue.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions socketio/dist/models/nodeStatusEvent.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions socketio/dist/models/nodeStatusEvent.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions socketio/dist/models/walkoffEvent.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions socketio/dist/models/walkoffEvent.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions socketio/dist/models/workflowStatusEvent.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions socketio/dist/models/workflowStatusEvent.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions socketio/dist/queue.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions socketio/dist/queue.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a5457b0

Please sign in to comment.