From 84569a7c24175ecf1f07f0ea69c4c67c3198a00e Mon Sep 17 00:00:00 2001 From: Oleg Sheynin Date: Fri, 25 Apr 2025 17:52:29 -0400 Subject: [PATCH] moved some to cvtt_docker --- .../config_service}/.dockerignore | 0 .../config_service}/Dockerfile | 0 .../config_service}/HOWTO.md | 0 .../config_service}/requirements.txt | 0 .../md_recorder/.dockerignore | 0 .../md_recorder/Dockerfile | 0 {market_data => __DECO__}/md_recorder/VERSION | 0 .../md_recorder/build.sh | 0 .../md_recorder/deployment/cloud24/.creds | 0 .../md_recorder/deployment/cloud24/.env | 0 .../deployment/cloud24/docker-compose.yml | 0 .../deployment/cloud24/md_recorder.cfg | 0 .../md_recorder/deployment/cvtt-md/.creds | 0 .../md_recorder/deployment/cvtt-md/.env | 0 .../deployment/cvtt-md/docker-compose.yml | 0 .../deployment/cvtt-md/md_recorder.cfg | 0 .../md_recorder/entrypoint.sh | 0 .../md_recorder/requirements.txt | 0 .../microservices}/.env | 0 __DECO__/microservices/VERSION | 1 + .../microservices}/ac_gateway/.dockerignore | 0 .../microservices}/ac_gateway/Dockerfile | 0 .../microservices}/ac_gateway/entrypoint.sh | 0 .../ac_gateway/requirements.txt | 0 .../microservices}/bookkeeper/.dockerignore | 0 .../microservices}/bookkeeper/Dockerfile | 0 .../microservices}/bookkeeper/entrypoint.sh | 0 .../bookkeeper/requirements.txt | 0 .../microservices}/build.sh | 13 +- .../microservices}/coordinator/.dockerignore | 0 .../microservices}/coordinator/Dockerfile | 0 .../microservices}/coordinator/entrypoint.sh | 9 ++ .../coordinator}/requirements.txt | 1 + .../microservices}/docker-compose.yml | 0 .../microservices}/md_gateway/.dockerignore | 0 .../microservices}/md_gateway/Dockerfile | 0 .../microservices}/md_gateway/entrypoint.sh | 0 .../md_gateway}/requirements.txt | 0 .../microservices}/oe_gateway/.dockerignore | 0 .../microservices}/oe_gateway/Dockerfile | 0 .../microservices}/oe_gateway/entrypoint.sh | 0 .../oe_gateway/requirements.txt | 0 .../microservices}/pricer/.dockerignore | 0 .../microservices}/pricer/Dockerfile | 0 .../microservices}/pricer/entrypoint.sh | 0 .../microservices/pricer}/requirements.txt | 0 .../microservices}/quant/.dockerignore | 0 .../microservices}/quant/Dockerfile | 0 .../microservices}/quant/entrypoint.sh | 0 .../microservices/quant}/requirements.txt | 0 .../microservices}/risk_manager/.dockerignore | 0 .../microservices}/risk_manager/Dockerfile | 0 .../microservices}/risk_manager/entrypoint.sh | 0 .../risk_manager}/requirements.txt | 0 .../microservices}/trader/.dockerignore | 0 .../microservices}/trader/Dockerfile | 0 .../microservices}/trader/entrypoint.sh | 0 .../microservices/trader}/requirements.txt | 0 .../trading_simulator}/Dockerfile | 2 +- .../trading_simulator}/VERSION | 0 .../trading_simulator}/build.sh | 0 __DECO__/trading_simulator/deployment/.env | 9 ++ .../deployment/config/simulation.cfg | 131 ++++++++++++++++++ .../deployment/docker-compose.yml | 16 +++ .../trading_simulator}/entrypoint.sh | 2 +- __DECO__/trading_simulator/requirements.txt | 10 ++ microservices/VERSION | 1 - microservices/trader/requirements.txt | 9 -- test/rsync_test/Dockerfile | 21 --- test/rsync_test/test.sh | 19 --- 70 files changed, 187 insertions(+), 57 deletions(-) rename {config_service => __DECO__/config_service}/.dockerignore (100%) rename {config_service => __DECO__/config_service}/Dockerfile (100%) rename {config_service => __DECO__/config_service}/HOWTO.md (100%) rename {config_service => __DECO__/config_service}/requirements.txt (100%) rename {market_data => __DECO__}/md_recorder/.dockerignore (100%) rename {market_data => __DECO__}/md_recorder/Dockerfile (100%) rename {market_data => __DECO__}/md_recorder/VERSION (100%) rename {market_data => __DECO__}/md_recorder/build.sh (100%) rename {market_data => __DECO__}/md_recorder/deployment/cloud24/.creds (100%) rename {market_data => __DECO__}/md_recorder/deployment/cloud24/.env (100%) rename {market_data => __DECO__}/md_recorder/deployment/cloud24/docker-compose.yml (100%) rename {market_data => __DECO__}/md_recorder/deployment/cloud24/md_recorder.cfg (100%) rename {market_data => __DECO__}/md_recorder/deployment/cvtt-md/.creds (100%) rename {market_data => __DECO__}/md_recorder/deployment/cvtt-md/.env (100%) rename {market_data => __DECO__}/md_recorder/deployment/cvtt-md/docker-compose.yml (100%) rename {market_data => __DECO__}/md_recorder/deployment/cvtt-md/md_recorder.cfg (100%) rename {market_data => __DECO__}/md_recorder/entrypoint.sh (100%) rename {market_data => __DECO__}/md_recorder/requirements.txt (100%) rename {microservices => __DECO__/microservices}/.env (100%) create mode 100644 __DECO__/microservices/VERSION rename {microservices => __DECO__/microservices}/ac_gateway/.dockerignore (100%) rename {microservices => __DECO__/microservices}/ac_gateway/Dockerfile (100%) rename {microservices => __DECO__/microservices}/ac_gateway/entrypoint.sh (100%) rename {microservices => __DECO__/microservices}/ac_gateway/requirements.txt (100%) rename {microservices => __DECO__/microservices}/bookkeeper/.dockerignore (100%) rename {microservices => __DECO__/microservices}/bookkeeper/Dockerfile (100%) rename {microservices => __DECO__/microservices}/bookkeeper/entrypoint.sh (100%) rename {microservices => __DECO__/microservices}/bookkeeper/requirements.txt (100%) rename {microservices => __DECO__/microservices}/build.sh (88%) rename {microservices => __DECO__/microservices}/coordinator/.dockerignore (100%) rename {microservices => __DECO__/microservices}/coordinator/Dockerfile (100%) rename {microservices => __DECO__/microservices}/coordinator/entrypoint.sh (60%) rename {trading_simulator => __DECO__/microservices/coordinator}/requirements.txt (91%) rename {microservices => __DECO__/microservices}/docker-compose.yml (100%) rename {microservices => __DECO__/microservices}/md_gateway/.dockerignore (100%) rename {microservices => __DECO__/microservices}/md_gateway/Dockerfile (100%) rename {microservices => __DECO__/microservices}/md_gateway/entrypoint.sh (100%) rename {microservices/coordinator => __DECO__/microservices/md_gateway}/requirements.txt (100%) rename {microservices => __DECO__/microservices}/oe_gateway/.dockerignore (100%) rename {microservices => __DECO__/microservices}/oe_gateway/Dockerfile (100%) rename {microservices => __DECO__/microservices}/oe_gateway/entrypoint.sh (100%) rename {microservices => __DECO__/microservices}/oe_gateway/requirements.txt (100%) rename {microservices => __DECO__/microservices}/pricer/.dockerignore (100%) rename {microservices => __DECO__/microservices}/pricer/Dockerfile (100%) rename {microservices => __DECO__/microservices}/pricer/entrypoint.sh (100%) rename {microservices/md_gateway => __DECO__/microservices/pricer}/requirements.txt (100%) rename {microservices => __DECO__/microservices}/quant/.dockerignore (100%) rename {microservices => __DECO__/microservices}/quant/Dockerfile (100%) rename {microservices => __DECO__/microservices}/quant/entrypoint.sh (100%) rename {microservices/pricer => __DECO__/microservices/quant}/requirements.txt (100%) rename {microservices => __DECO__/microservices}/risk_manager/.dockerignore (100%) rename {microservices => __DECO__/microservices}/risk_manager/Dockerfile (100%) rename {microservices => __DECO__/microservices}/risk_manager/entrypoint.sh (100%) rename {microservices/quant => __DECO__/microservices/risk_manager}/requirements.txt (100%) rename {microservices => __DECO__/microservices}/trader/.dockerignore (100%) rename {microservices => __DECO__/microservices}/trader/Dockerfile (100%) rename {microservices => __DECO__/microservices}/trader/entrypoint.sh (100%) rename {microservices/risk_manager => __DECO__/microservices/trader}/requirements.txt (100%) rename {trading_simulator => __DECO__/trading_simulator}/Dockerfile (90%) rename {trading_simulator => __DECO__/trading_simulator}/VERSION (100%) rename {trading_simulator => __DECO__/trading_simulator}/build.sh (100%) create mode 100644 __DECO__/trading_simulator/deployment/.env create mode 100644 __DECO__/trading_simulator/deployment/config/simulation.cfg create mode 100644 __DECO__/trading_simulator/deployment/docker-compose.yml rename {trading_simulator => __DECO__/trading_simulator}/entrypoint.sh (79%) create mode 100644 __DECO__/trading_simulator/requirements.txt delete mode 100644 microservices/VERSION delete mode 100644 microservices/trader/requirements.txt delete mode 100644 test/rsync_test/Dockerfile delete mode 100755 test/rsync_test/test.sh diff --git a/config_service/.dockerignore b/__DECO__/config_service/.dockerignore similarity index 100% rename from config_service/.dockerignore rename to __DECO__/config_service/.dockerignore diff --git a/config_service/Dockerfile b/__DECO__/config_service/Dockerfile similarity index 100% rename from config_service/Dockerfile rename to __DECO__/config_service/Dockerfile diff --git a/config_service/HOWTO.md b/__DECO__/config_service/HOWTO.md similarity index 100% rename from config_service/HOWTO.md rename to __DECO__/config_service/HOWTO.md diff --git a/config_service/requirements.txt b/__DECO__/config_service/requirements.txt similarity index 100% rename from config_service/requirements.txt rename to __DECO__/config_service/requirements.txt diff --git a/market_data/md_recorder/.dockerignore b/__DECO__/md_recorder/.dockerignore similarity index 100% rename from market_data/md_recorder/.dockerignore rename to __DECO__/md_recorder/.dockerignore diff --git a/market_data/md_recorder/Dockerfile b/__DECO__/md_recorder/Dockerfile similarity index 100% rename from market_data/md_recorder/Dockerfile rename to __DECO__/md_recorder/Dockerfile diff --git a/market_data/md_recorder/VERSION b/__DECO__/md_recorder/VERSION similarity index 100% rename from market_data/md_recorder/VERSION rename to __DECO__/md_recorder/VERSION diff --git a/market_data/md_recorder/build.sh b/__DECO__/md_recorder/build.sh similarity index 100% rename from market_data/md_recorder/build.sh rename to __DECO__/md_recorder/build.sh diff --git a/market_data/md_recorder/deployment/cloud24/.creds b/__DECO__/md_recorder/deployment/cloud24/.creds similarity index 100% rename from market_data/md_recorder/deployment/cloud24/.creds rename to __DECO__/md_recorder/deployment/cloud24/.creds diff --git a/market_data/md_recorder/deployment/cloud24/.env b/__DECO__/md_recorder/deployment/cloud24/.env similarity index 100% rename from market_data/md_recorder/deployment/cloud24/.env rename to __DECO__/md_recorder/deployment/cloud24/.env diff --git a/market_data/md_recorder/deployment/cloud24/docker-compose.yml b/__DECO__/md_recorder/deployment/cloud24/docker-compose.yml similarity index 100% rename from market_data/md_recorder/deployment/cloud24/docker-compose.yml rename to __DECO__/md_recorder/deployment/cloud24/docker-compose.yml diff --git a/market_data/md_recorder/deployment/cloud24/md_recorder.cfg b/__DECO__/md_recorder/deployment/cloud24/md_recorder.cfg similarity index 100% rename from market_data/md_recorder/deployment/cloud24/md_recorder.cfg rename to __DECO__/md_recorder/deployment/cloud24/md_recorder.cfg diff --git a/market_data/md_recorder/deployment/cvtt-md/.creds b/__DECO__/md_recorder/deployment/cvtt-md/.creds similarity index 100% rename from market_data/md_recorder/deployment/cvtt-md/.creds rename to __DECO__/md_recorder/deployment/cvtt-md/.creds diff --git a/market_data/md_recorder/deployment/cvtt-md/.env b/__DECO__/md_recorder/deployment/cvtt-md/.env similarity index 100% rename from market_data/md_recorder/deployment/cvtt-md/.env rename to __DECO__/md_recorder/deployment/cvtt-md/.env diff --git a/market_data/md_recorder/deployment/cvtt-md/docker-compose.yml b/__DECO__/md_recorder/deployment/cvtt-md/docker-compose.yml similarity index 100% rename from market_data/md_recorder/deployment/cvtt-md/docker-compose.yml rename to __DECO__/md_recorder/deployment/cvtt-md/docker-compose.yml diff --git a/market_data/md_recorder/deployment/cvtt-md/md_recorder.cfg b/__DECO__/md_recorder/deployment/cvtt-md/md_recorder.cfg similarity index 100% rename from market_data/md_recorder/deployment/cvtt-md/md_recorder.cfg rename to __DECO__/md_recorder/deployment/cvtt-md/md_recorder.cfg diff --git a/market_data/md_recorder/entrypoint.sh b/__DECO__/md_recorder/entrypoint.sh similarity index 100% rename from market_data/md_recorder/entrypoint.sh rename to __DECO__/md_recorder/entrypoint.sh diff --git a/market_data/md_recorder/requirements.txt b/__DECO__/md_recorder/requirements.txt similarity index 100% rename from market_data/md_recorder/requirements.txt rename to __DECO__/md_recorder/requirements.txt diff --git a/microservices/.env b/__DECO__/microservices/.env similarity index 100% rename from microservices/.env rename to __DECO__/microservices/.env diff --git a/__DECO__/microservices/VERSION b/__DECO__/microservices/VERSION new file mode 100644 index 0000000..5c4511c --- /dev/null +++ b/__DECO__/microservices/VERSION @@ -0,0 +1 @@ +0.0.7 \ No newline at end of file diff --git a/microservices/ac_gateway/.dockerignore b/__DECO__/microservices/ac_gateway/.dockerignore similarity index 100% rename from microservices/ac_gateway/.dockerignore rename to __DECO__/microservices/ac_gateway/.dockerignore diff --git a/microservices/ac_gateway/Dockerfile b/__DECO__/microservices/ac_gateway/Dockerfile similarity index 100% rename from microservices/ac_gateway/Dockerfile rename to __DECO__/microservices/ac_gateway/Dockerfile diff --git a/microservices/ac_gateway/entrypoint.sh b/__DECO__/microservices/ac_gateway/entrypoint.sh similarity index 100% rename from microservices/ac_gateway/entrypoint.sh rename to __DECO__/microservices/ac_gateway/entrypoint.sh diff --git a/microservices/ac_gateway/requirements.txt b/__DECO__/microservices/ac_gateway/requirements.txt similarity index 100% rename from microservices/ac_gateway/requirements.txt rename to __DECO__/microservices/ac_gateway/requirements.txt diff --git a/microservices/bookkeeper/.dockerignore b/__DECO__/microservices/bookkeeper/.dockerignore similarity index 100% rename from microservices/bookkeeper/.dockerignore rename to __DECO__/microservices/bookkeeper/.dockerignore diff --git a/microservices/bookkeeper/Dockerfile b/__DECO__/microservices/bookkeeper/Dockerfile similarity index 100% rename from microservices/bookkeeper/Dockerfile rename to __DECO__/microservices/bookkeeper/Dockerfile diff --git a/microservices/bookkeeper/entrypoint.sh b/__DECO__/microservices/bookkeeper/entrypoint.sh similarity index 100% rename from microservices/bookkeeper/entrypoint.sh rename to __DECO__/microservices/bookkeeper/entrypoint.sh diff --git a/microservices/bookkeeper/requirements.txt b/__DECO__/microservices/bookkeeper/requirements.txt similarity index 100% rename from microservices/bookkeeper/requirements.txt rename to __DECO__/microservices/bookkeeper/requirements.txt diff --git a/microservices/build.sh b/__DECO__/microservices/build.sh similarity index 88% rename from microservices/build.sh rename to __DECO__/microservices/build.sh index e984511..001c568 100755 --- a/microservices/build.sh +++ b/__DECO__/microservices/build.sh @@ -13,8 +13,11 @@ ValidImages+=(bookkeeper) ValidImages+=(risk_manager) ValidImages+=(quant) ValidImages+=(trader) -BashFunctionCode=$(realpath $(dirname ${0}))/../dckr_bld_functions.sh -ImageVersion=$(cat $(realpath $(dirname ${0}))/VERSION) + +ScriptPath=$(realpath $(dirname ${0})) +BashFunctionCode=${ScriptPath}/../dckr_bld_functions.sh +ImageVersion=$(cat ${ScriptPath}/VERSION) + # --- Settings usage() { @@ -71,8 +74,9 @@ build_musvc_image() { Project=${2} ProjectVersion=${3} - DockerDir=$(realpath $(dirname ${0})/${ImageName}) - cd ${DockerDir} + DockerDir=${ScriptPath}/${ImageName} + Cmd="cd ${DockerDir}" + echo ${Cmd} && eval ${Cmd} if [ "${Project}" != "" ]; then get_project_version ${Project} ${ProjectVersion} @@ -103,7 +107,6 @@ for ImageName in "${Images[@]}"; do build_musvc_image ${ImageName} ${Project} ${ProjectVersion} done -# echo "**** D E B U G E X I T" && exit echo "***** ${0} D O N E" diff --git a/microservices/coordinator/.dockerignore b/__DECO__/microservices/coordinator/.dockerignore similarity index 100% rename from microservices/coordinator/.dockerignore rename to __DECO__/microservices/coordinator/.dockerignore diff --git a/microservices/coordinator/Dockerfile b/__DECO__/microservices/coordinator/Dockerfile similarity index 100% rename from microservices/coordinator/Dockerfile rename to __DECO__/microservices/coordinator/Dockerfile diff --git a/microservices/coordinator/entrypoint.sh b/__DECO__/microservices/coordinator/entrypoint.sh similarity index 60% rename from microservices/coordinator/entrypoint.sh rename to __DECO__/microservices/coordinator/entrypoint.sh index f92d423..891f1dd 100755 --- a/microservices/coordinator/entrypoint.sh +++ b/__DECO__/microservices/coordinator/entrypoint.sh @@ -3,6 +3,15 @@ LogDir=/logs Cmd="python3.12" + +if [ "${COORD_DEBUG}" == "Y" ]; then + Cmd+=" -m debugpy" + Cmd+=" --listen 0.0.0.0:5678" + if [ "${COORD_DEBUG_WAIT}" == "Y" ]; then + Cmd+=" --wait-for-client" + fi +fi + Cmd+=" cvttpy/apps/microservices/coordinator/coordinator.py" Cmd+=" --config=${CONFIG_FILE:-/config/cvtt_musvc.cfg}" diff --git a/trading_simulator/requirements.txt b/__DECO__/microservices/coordinator/requirements.txt similarity index 91% rename from trading_simulator/requirements.txt rename to __DECO__/microservices/coordinator/requirements.txt index e840a84..ceeb72d 100644 --- a/trading_simulator/requirements.txt +++ b/__DECO__/microservices/coordinator/requirements.txt @@ -7,3 +7,4 @@ python-dateutil>=2.8.2 types-python-dateutil>=2.8.19.6 cryptography>=43.0.0 PyJWT>=2.10.1 +debugpy>=1.8.13 diff --git a/microservices/docker-compose.yml b/__DECO__/microservices/docker-compose.yml similarity index 100% rename from microservices/docker-compose.yml rename to __DECO__/microservices/docker-compose.yml diff --git a/microservices/md_gateway/.dockerignore b/__DECO__/microservices/md_gateway/.dockerignore similarity index 100% rename from microservices/md_gateway/.dockerignore rename to __DECO__/microservices/md_gateway/.dockerignore diff --git a/microservices/md_gateway/Dockerfile b/__DECO__/microservices/md_gateway/Dockerfile similarity index 100% rename from microservices/md_gateway/Dockerfile rename to __DECO__/microservices/md_gateway/Dockerfile diff --git a/microservices/md_gateway/entrypoint.sh b/__DECO__/microservices/md_gateway/entrypoint.sh similarity index 100% rename from microservices/md_gateway/entrypoint.sh rename to __DECO__/microservices/md_gateway/entrypoint.sh diff --git a/microservices/coordinator/requirements.txt b/__DECO__/microservices/md_gateway/requirements.txt similarity index 100% rename from microservices/coordinator/requirements.txt rename to __DECO__/microservices/md_gateway/requirements.txt diff --git a/microservices/oe_gateway/.dockerignore b/__DECO__/microservices/oe_gateway/.dockerignore similarity index 100% rename from microservices/oe_gateway/.dockerignore rename to __DECO__/microservices/oe_gateway/.dockerignore diff --git a/microservices/oe_gateway/Dockerfile b/__DECO__/microservices/oe_gateway/Dockerfile similarity index 100% rename from microservices/oe_gateway/Dockerfile rename to __DECO__/microservices/oe_gateway/Dockerfile diff --git a/microservices/oe_gateway/entrypoint.sh b/__DECO__/microservices/oe_gateway/entrypoint.sh similarity index 100% rename from microservices/oe_gateway/entrypoint.sh rename to __DECO__/microservices/oe_gateway/entrypoint.sh diff --git a/microservices/oe_gateway/requirements.txt b/__DECO__/microservices/oe_gateway/requirements.txt similarity index 100% rename from microservices/oe_gateway/requirements.txt rename to __DECO__/microservices/oe_gateway/requirements.txt diff --git a/microservices/pricer/.dockerignore b/__DECO__/microservices/pricer/.dockerignore similarity index 100% rename from microservices/pricer/.dockerignore rename to __DECO__/microservices/pricer/.dockerignore diff --git a/microservices/pricer/Dockerfile b/__DECO__/microservices/pricer/Dockerfile similarity index 100% rename from microservices/pricer/Dockerfile rename to __DECO__/microservices/pricer/Dockerfile diff --git a/microservices/pricer/entrypoint.sh b/__DECO__/microservices/pricer/entrypoint.sh similarity index 100% rename from microservices/pricer/entrypoint.sh rename to __DECO__/microservices/pricer/entrypoint.sh diff --git a/microservices/md_gateway/requirements.txt b/__DECO__/microservices/pricer/requirements.txt similarity index 100% rename from microservices/md_gateway/requirements.txt rename to __DECO__/microservices/pricer/requirements.txt diff --git a/microservices/quant/.dockerignore b/__DECO__/microservices/quant/.dockerignore similarity index 100% rename from microservices/quant/.dockerignore rename to __DECO__/microservices/quant/.dockerignore diff --git a/microservices/quant/Dockerfile b/__DECO__/microservices/quant/Dockerfile similarity index 100% rename from microservices/quant/Dockerfile rename to __DECO__/microservices/quant/Dockerfile diff --git a/microservices/quant/entrypoint.sh b/__DECO__/microservices/quant/entrypoint.sh similarity index 100% rename from microservices/quant/entrypoint.sh rename to __DECO__/microservices/quant/entrypoint.sh diff --git a/microservices/pricer/requirements.txt b/__DECO__/microservices/quant/requirements.txt similarity index 100% rename from microservices/pricer/requirements.txt rename to __DECO__/microservices/quant/requirements.txt diff --git a/microservices/risk_manager/.dockerignore b/__DECO__/microservices/risk_manager/.dockerignore similarity index 100% rename from microservices/risk_manager/.dockerignore rename to __DECO__/microservices/risk_manager/.dockerignore diff --git a/microservices/risk_manager/Dockerfile b/__DECO__/microservices/risk_manager/Dockerfile similarity index 100% rename from microservices/risk_manager/Dockerfile rename to __DECO__/microservices/risk_manager/Dockerfile diff --git a/microservices/risk_manager/entrypoint.sh b/__DECO__/microservices/risk_manager/entrypoint.sh similarity index 100% rename from microservices/risk_manager/entrypoint.sh rename to __DECO__/microservices/risk_manager/entrypoint.sh diff --git a/microservices/quant/requirements.txt b/__DECO__/microservices/risk_manager/requirements.txt similarity index 100% rename from microservices/quant/requirements.txt rename to __DECO__/microservices/risk_manager/requirements.txt diff --git a/microservices/trader/.dockerignore b/__DECO__/microservices/trader/.dockerignore similarity index 100% rename from microservices/trader/.dockerignore rename to __DECO__/microservices/trader/.dockerignore diff --git a/microservices/trader/Dockerfile b/__DECO__/microservices/trader/Dockerfile similarity index 100% rename from microservices/trader/Dockerfile rename to __DECO__/microservices/trader/Dockerfile diff --git a/microservices/trader/entrypoint.sh b/__DECO__/microservices/trader/entrypoint.sh similarity index 100% rename from microservices/trader/entrypoint.sh rename to __DECO__/microservices/trader/entrypoint.sh diff --git a/microservices/risk_manager/requirements.txt b/__DECO__/microservices/trader/requirements.txt similarity index 100% rename from microservices/risk_manager/requirements.txt rename to __DECO__/microservices/trader/requirements.txt diff --git a/trading_simulator/Dockerfile b/__DECO__/trading_simulator/Dockerfile similarity index 90% rename from trading_simulator/Dockerfile rename to __DECO__/trading_simulator/Dockerfile index 33e3bc2..26381be 100644 --- a/trading_simulator/Dockerfile +++ b/__DECO__/trading_simulator/Dockerfile @@ -7,7 +7,7 @@ RUN pip install -r /requirements.txt --root-user-action=ignore COPY cvttpy /cvttpy -RUN mkdir -p /logs /config +RUN mkdir -p /logs /config /data SHELL ["/bin/bash", "-c"] diff --git a/trading_simulator/VERSION b/__DECO__/trading_simulator/VERSION similarity index 100% rename from trading_simulator/VERSION rename to __DECO__/trading_simulator/VERSION diff --git a/trading_simulator/build.sh b/__DECO__/trading_simulator/build.sh similarity index 100% rename from trading_simulator/build.sh rename to __DECO__/trading_simulator/build.sh diff --git a/__DECO__/trading_simulator/deployment/.env b/__DECO__/trading_simulator/deployment/.env new file mode 100644 index 0000000..cbd54d7 --- /dev/null +++ b/__DECO__/trading_simulator/deployment/.env @@ -0,0 +1,9 @@ +TRDSIM_VERSION=0.0.1 + +CONFIG_SERVICE=cloud16.cvtt.vpn:6789 +CONFIG_FILE="/config/simulation.cfg" + +TRDSIM_USER=1001:1001 + +TRDSIM_LOG_FILE=%T.trading_simulator.log +TRDSIM_ADD_ARGS= diff --git a/__DECO__/trading_simulator/deployment/config/simulation.cfg b/__DECO__/trading_simulator/deployment/config/simulation.cfg new file mode 100644 index 0000000..cb5f270 --- /dev/null +++ b/__DECO__/trading_simulator/deployment/config/simulation.cfg @@ -0,0 +1,131 @@ +@var DATA_DIR=/home/oleg/develop/simulation/data + +@var FROM_TIME="2024-11-14 13:30:00" +@var INTERVAL="18 minutes" +# @var INTERVAL="5 minutes" + +{ + "refdata": @inc=http://@env{CONFIG_SERVICE}/refdata/refdata + , "comm": @inc=http://@env{CONFIG_SERVICE}/apps/common/comm + , "comm": @inc=http://@env{CONFIG_SERVICE}/apps/common/comm + , "comm_settings": "/comm/pubsub/redis/localhost" + , "simulation": { + # "speed_factor": 1.0, + "speed_factor": 0.0, + "time_events_interval_ms": 0 + } + , "market_simulator" : { + "initial_positions": { + "exchange": "COINBASE", + "assets": { + "BTC": 0.5 + , "ETH": 0.0 + , "USD": 10_000.0 + } + } + , "market_data": { + "sources": [ + { + "loader_class": "cvttpy.trading.mkt_data.time_series.loaders.sqlite_loader.SqliteMdLoader" + , "file_name": "${DATA_DIR}/20250422.CNBS.BTC_USD.db" + , "table_name": "md_trades" + , "columns": [ + "tstamp" + , "tstamp_ns as tm" # must have tm for DataFrame + , "tstamp_ns as local_time_ns" # must have for simrunner + , "exchange_id" + , "instrument_id" + , "px" + , "qty" + , "trade_id" + , "condition as agressor_side" + ] + , "time_column": "tstamp" + , "exchange_id": "COINBASE" + , "instruments": ["PAIR-BTC-USD"] + , "md_type": "TRADES" + } + # , { + # "loader_class": "cvttpy.trading.mkt_data.time_series.loaders.tsdb_loader.TimescaleTSLoader" + # , "credentials_key": "TSDB_MD_CVTTDATA_RO" + # , "interval": ${INTERVAL} + # , "from_time": ${FROM_TIME} #"2024-10-03 09:00:00" + # , "exchange_id": "COINBASE" + # , "instruments": ["PAIR-BTC-USD"] + # , "md_type": "BOOK_TOP" + # , "table_name": "coinbase.md_booktops" + # , "columns": [ + # "time", + # "local_time_ns", + # "exchange_id", + # "instrument_id", + # "bid_price", + # "bid_quantity", + # "ask_price", + # "ask_quantity", + # "'BT' as type", + # ] + # , "time_column": "time" + # } + ] + , "api": { + "web_socket": { + "url": "ws://localhost:8080/ws" + } + } + } + , "order_entry": { + "execution": { + "execute_on": ["BOOK_TOP", "TRADES"] + "top_only": true + ,"min_order_age_sec": 0.1 + , "pricing_method": "BY_MKT_TRD_PRICE_BY_TRADE" + + , "short_sale_allowed": false + , "fee_schedule": { + "taker_fee_rate": 0.006 + "maker_fee_rate": 0.004 + } + # , "presubscribe_md_types": ["BOOK_TOP", "TRADES"] + } + , "api": { + "web_socket": { + "url": "ws://localhost:8180/ws" + } + , "REST": { + "port": 8181 + "new_order_url": ["POST", "http://localhost:8181/order"] + , "cancel_order_url": ["POST", "http://localhost:8181/cancel"] + , "cancel_all_url": ["POST", "http://localhost:8181/cancel_all"] + , "open_orders_url": ["GET", "http://localhost:8181/open_orders"] + , "order_status_url": ["GET", "http://localhost:8181/order_status"] + } + } + } + , "accounting": { + "api": { + "REST": { + "port": 8182 + , "positions_url": ["GET", "http://localhost:8182/positions"] + , "trades_url": ["GET", "http://localhost:8182/trades"] + } + } + } + } + , "external_participants": [ + { + "class": "cvttpy.apps.trading_simulator.participants.external_strategy.ExternalStrategySim" + "params": { + "reader": { + "source": "file:///home/oleg/develop/cvtt2/simulation/trading_instructions.json" + } + "listener": { + # communicate with coordinator + "coordinator_url": "http://localhost:12345" + , "book_id": "TESTBK_COINBS_01" + , "strategy_id": "DUMMY_STRATEGY" + } + } + } + ] +} diff --git a/__DECO__/trading_simulator/deployment/docker-compose.yml b/__DECO__/trading_simulator/deployment/docker-compose.yml new file mode 100644 index 0000000..f67dc63 --- /dev/null +++ b/__DECO__/trading_simulator/deployment/docker-compose.yml @@ -0,0 +1,16 @@ +# CVTT Microservices +services: + trdsim: + image: cloud21.cvtt.vpn:5500/trading_simulator:${TRDSIM_VERSION} + container_name: trading_simulator + pull_policy: always + user: ${TRDSIM_USER:-1001:1001} + environment: + CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} + CONFIG_FILE: ${CONFIG_FILE:-http://${CONFIG_SERVICE}/apps/cvtt_musvc} + TRDSIM_LOG_FILE: ${TRDSIM_LOG_FILE:-%T.trader.log} + TRDSIM_ADD_ARGS: ${TRDSIM_ADD_ARGS:-} + volumes: + - ./config:/config + - ./data:/data + - ./logs:/logs diff --git a/trading_simulator/entrypoint.sh b/__DECO__/trading_simulator/entrypoint.sh similarity index 79% rename from trading_simulator/entrypoint.sh rename to __DECO__/trading_simulator/entrypoint.sh index f28fbc1..fc5940b 100755 --- a/trading_simulator/entrypoint.sh +++ b/__DECO__/trading_simulator/entrypoint.sh @@ -9,7 +9,7 @@ Cmd+=" --config=${CONFIG_FILE:-/config/simulation.cfg}" Cmd+=" --simtime_file=${SIMTIME_FILE:-/data/simtime.bin}" Cmd+=" --cfgvar=DATA_DIR=/data" -Cmd+=" --log_file=${LogDir}/$TRDSIM_LOG_FILE:-%T.trading_simulator.log}" +Cmd+=" --log_file=${LogDir}/${TRDSIM_LOG_FILE:-%T.trading_simulator.log}" Cmd+=" ${TRDSIM_ADD_ARGS}" echo ${Cmd} exec ${Cmd} diff --git a/__DECO__/trading_simulator/requirements.txt b/__DECO__/trading_simulator/requirements.txt new file mode 100644 index 0000000..975615c --- /dev/null +++ b/__DECO__/trading_simulator/requirements.txt @@ -0,0 +1,10 @@ +aiohttp>=3.7.4.post0 +nest-asyncio>=1.5.5 +hjson>=3.1.0 +sortedcontainers>=2.4.0 +pandas>=1.5.3 +# redis>=5.0.8 +# python-dateutil>=2.8.2 +# types-python-dateutil>=2.8.19.6 +# cryptography>=43.0.0 +# PyJWT>=2.10.1 diff --git a/microservices/VERSION b/microservices/VERSION deleted file mode 100644 index 99d85ec..0000000 --- a/microservices/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.6 \ No newline at end of file diff --git a/microservices/trader/requirements.txt b/microservices/trader/requirements.txt deleted file mode 100644 index e840a84..0000000 --- a/microservices/trader/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -aiohttp>=3.7.4.post0 -nest-asyncio>=1.5.5 -hjson>=3.1.0 -sortedcontainers>=2.4.0 -redis>=5.0.8 -python-dateutil>=2.8.2 -types-python-dateutil>=2.8.19.6 -cryptography>=43.0.0 -PyJWT>=2.10.1 diff --git a/test/rsync_test/Dockerfile b/test/rsync_test/Dockerfile deleted file mode 100644 index 6fd40a9..0000000 --- a/test/rsync_test/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM python:3.12-slim - -ARG FROM_DIR=docker_dev/test/rsync_test - -COPY ${FROM_DIR}/test.sh /test.sh - -RUN apt-get update && apt-get install -y rsync openssh-client - -COPY docker_dev/shared/id_rsa /root/.ssh/id_rsa -COPY docker_dev/shared/id_rsa.pub /root/.ssh/id_rsa.pub - -RUN chmod 600 /root/.ssh/id_rsa /root/.ssh/id_rsa.pub - -# Shared Volumes -RUN chmod +x /test.sh - -WORKDIR / -SHELL ["/bin/bash", "-c"] -ENV PYTHONPATH=/ -ENTRYPOINT [ "/test.sh" ] - diff --git a/test/rsync_test/test.sh b/test/rsync_test/test.sh deleted file mode 100755 index f388ee1..0000000 --- a/test/rsync_test/test.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -date > /testfile.txt - -Source=/testfile.txt -Targets= -Targets="${Targets} cvtt@cloud21.cvtt.vpn:/tmp/" -Targets="${Targets} cvtt@hs01.cvtt.vpn:/tmp/" - - -for tgt in ${Targets} -do - Cmd="/usr/bin/rsync -ahv" - Cmd+=" -e 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'" - Cmd+=" ${Source} ${tgt}" - echo $Cmd - eval $Cmd -done -