Skip to content
Draft
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
125 changes: 42 additions & 83 deletions docker/dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,55 @@

version: '3'
services:
sandbox:
sandbox1:
image: nutc-exchange
build:
context: ../..
dockerfile: exchange/docker/sandbox/Dockerfile
args:
firebase_emulator: "false"
restart: unless-stopped
environment:
- NUTC_EXPOSE_METRICS=1
command: ["--sandbox"]
- NUTC_ALGO_ENDPOINT=http://webserver:16124/algorithms/HFT
- NUTC_ID=0
depends_on:
- webserver
# sandbox2:
# image: nutc-exchange
# build:
# context: ../..
# dockerfile: exchange/docker/sandbox/Dockerfile
# restart: unless-stopped
# environment:
# - NUTC_EXPOSE_METRICS=1
# - NUTC_ALGO_ENDPOINT=http://webserver:16124/algorithms/HFT
# - NUTC_ID=1
# depends_on:
# - webserver
# sandbox3:
# image: nutc-exchange
# build:
# context: ../..
# dockerfile: exchange/docker/sandbox/Dockerfile
# restart: unless-stopped
# environment:
# - NUTC_EXPOSE_METRICS=1
# - NUTC_ALGO_ENDPOINT=http://webserver:16124/algorithms/HFT
# - NUTC_ID=2
# depends_on:
# - webserver
sandbox4:
image: nutc-exchange
build:
context: ../..
dockerfile: exchange/docker/sandbox/Dockerfile
restart: unless-stopped
environment:
- NUTC_EXPOSE_METRICS=1
- NUTC_ALGO_ENDPOINT=http://webserver:16124/algorithms/HFT
- NUTC_ID=3
depends_on:
- webserver
# command: ["--sandbox"]

#port: 16124
webserver:
Expand All @@ -23,15 +61,6 @@ services:
dockerfile: webserver/Dockerfile
restart: unless-stopped

linter:
image: nutc-linter
restart: unless-stopped
build:
context: ../..
dockerfile: exchange/docker/linter/Dockerfile
args:
firebase_emulator: "false"

# Exposed on port 9000
prometheus:
image: prom/prometheus
Expand All @@ -42,16 +71,6 @@ services:
- '--storage.tsdb.retention.time=12h'
restart: unless-stopped

reverse-proxy:
image: nginx:latest
ports:
- "26389:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
restart: unless-stopped
depends_on:
- webserver
- grafana

grafana:
image: grafana/grafana
Expand All @@ -68,63 +87,3 @@ services:
- ../../exchange/docker/dev/grafana_data:/var/lib/grafana
# - /var/lib/grafana/grafana.db
# - /var/lib/grafana/alerting

web:
image: node:latest
restart: unless-stopped
working_dir: /app
environment:
- PORT=3001
volumes:
- ../../web:/app
command: ["npm", "run", "dev",]
ports:
- "3001:3001"
depends_on:
- postgres

localstack:
image: localstack/localstack
restart: unless-stopped
ports:
- "4566:4566"
- "4571:4571"
- "8080:8080"
environment:
- SERVICES=s3
- DEFAULT_REGION=us-east-1
- DATA_DIR=/var/lib/localstack/data
- AWS_ACCESS_KEY_ID=test
- AWS_SECRET_ACCESS_KEY=test
- S3_FORCE_PATH_STYLE=true
volumes:
- localstack:/var/lib/localstack

awscli:
image: amazon/aws-cli
environment:
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
depends_on:
- localstack
volumes:
- ../../web/dev/local-dev-setup.sh:/home/init.sh
- ../../web/dev/cors.json:/home/cors.json
entrypoint: /home/init.sh

postgres:
image: postgres:13
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: nutc
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data

volumes:
postgres_data:
localstack:
21 changes: 20 additions & 1 deletion docker/prod/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,30 @@ services:
args:
firebase_emulator: "false"
restart: unless-stopped
ports:
- "18080:18080"
environment:
- NUTC_EXPOSE_METRICS=1
- NUTC_ID=0
command: ["--sandbox"]
extra_hosts:
- "host.docker.internal:host-gateway"

#port: 16124
webserver:
image: nutc-webserver
ports:
- "16124:16124"
build:
context: ../..
dockerfile: webserver/Dockerfile
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
links:
- sandbox
depends_on:
- sandbox

linter:
image: nutc-linter
Expand All @@ -31,12 +44,18 @@ services:
dockerfile: exchange/docker/linter/Dockerfile
args:
firebase_emulator: "false"
extra_hosts:
- "host.docker.internal:host-gateway"

# Exposed on port 9000
prometheus:
image: prom/prometheus
volumes:
- ../../exchange/docker/sandbox/prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
- "9000:9000"
- "9091:9091"
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.retention.time=12h'
Expand All @@ -58,7 +77,7 @@ services:
restart: unless-stopped
user: "${UID}:${GID}"
ports:
- "3000:3000"
- "3001:3000"
environment:
- GF_SECURITY_ALLOW_EMBEDDING=true
- GF_AUTH_ANONYMOUS_ENABLED=true
Expand Down
1 change: 0 additions & 1 deletion exchange/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ target_link_libraries(LINTER_spawner_exe PRIVATE Python3::Python)
# ---- COMMON ----------

add_library(COMMON_lib OBJECT
src/common/firebase/firebase.cpp
src/common/file_operations/file_operations.cpp
src/common/util.cpp
src/common/types/decimal.cpp
Expand Down
1 change: 1 addition & 0 deletions exchange/benchmark/src/orderbook.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "common/util.hpp"
#include "exchange/orders/orderbook/limit_orderbook.hpp"
#include "helpers/benchmark_trader.hpp"

Expand Down
Binary file modified exchange/docker/dev/grafana_data/grafana.db
Binary file not shown.
2 changes: 2 additions & 0 deletions exchange/docker/sandbox/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ scrape_configs:
- job_name: 'exchange-sandbox'
static_configs:
- targets: ['sandbox:4152']
# - targets: ['sandbox1:4152', 'sandbox2:4152', 'sandbox3:4152', 'sandbox4:4152']

5 changes: 3 additions & 2 deletions exchange/src/common/compilation/compile_cpp.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "compile_cpp.hpp"

#include "common/file_operations/file_operations.hpp"
#include "common/util.hpp"

#include <optional>
Expand Down Expand Up @@ -43,8 +44,8 @@ compile_cpp(const std::filesystem::path& filepath)

if (result) {
throw std::runtime_error(fmt::format(
"Compilation of {} failed. Compiler output below:\n {}", filepath.string(),
result.value()
"Compilation of {} failed. Compiler output below:\n {}\n Code: {}",
filepath.string(), result.value(), read_file_content(filepath.string())
));
}
return binary_output;
Expand Down
123 changes: 0 additions & 123 deletions exchange/src/common/firebase/firebase.cpp

This file was deleted.

20 changes: 0 additions & 20 deletions exchange/src/common/firebase/firebase.hpp

This file was deleted.

Loading
Loading