diff --git a/__DECO__/config_service/.dockerignore b/__DECO__/config_service/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/__DECO__/config_service/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/__DECO__/config_service/Dockerfile b/__DECO__/config_service/Dockerfile deleted file mode 100644 index 1edd5fe..0000000 --- a/__DECO__/config_service/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM python:3.12-slim - -WORKDIR / -COPY docker_dev/config_service/requirements.txt / -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy - -# Shared Volumes -RUN mkdir -p /app/data -RUN mkdir /logs - -ENV PYTHONPATH=/ -CMD [ \ - "python3.12", \ - "cvttpy/apps/utils/config_server.py", \ - "--port=6789", \ - "--root=/app/data", \ - "--log_file=/logs/%T.config_service.log" \ -] - diff --git a/__DECO__/config_service/HOWTO.md b/__DECO__/config_service/HOWTO.md deleted file mode 100644 index a0b4363..0000000 --- a/__DECO__/config_service/HOWTO.md +++ /dev/null @@ -1,42 +0,0 @@ -# Build/Dev Host -## Build -```bash -TgtHostname=cloud16.cvtt.vpn -Version=$(cat cvttpy/VERSION) - -cd /home/oleg/develop/cvtt2 -docker build -t config_service -t config_service:${Version} -f cvttpy/utils/docker/config_service/Dockerfile . - -## Deploy - -docker save -o /tmp/cvtt_config_service.img.tar config_service -scp /tmp/cvtt_config_service.img.tar cvtt@${TgtHostname}:/tmp/ - -ssh cvtt@${TgtHostname} -``` - -## On target Machine make sure user can use docker -```bash -sudo usermod -a -G docker cvtt -``` -**Re-login as cvtt after adding cvtt to the group** - -```bash -docker rm -f cvtt_config_service -docker load -i /tmp/cvtt_config_service.img.tar -docker run -d --name=cvtt_config_service -p 6789:6789 -v /home/cvtt/prod/config_service/data:/app/data -v /home/cvtt/prod/logs:/logs config_service -``` - -## Restarting -```bash -docker restart cvtt_config_service -``` - -# Useful Commands -```bash -docker images -docker ps -a -docker image rm -docker rm -docker exec -it /bin/bash -``` \ No newline at end of file diff --git a/__DECO__/config_service/requirements.txt b/__DECO__/config_service/requirements.txt deleted file mode 100644 index 173b431..0000000 --- a/__DECO__/config_service/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -aiohttp>=3.7.4.post0 -nest-asyncio>=1.5.5 \ No newline at end of file diff --git a/__DECO__/md_recorder/.dockerignore b/__DECO__/md_recorder/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/__DECO__/md_recorder/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/__DECO__/md_recorder/Dockerfile b/__DECO__/md_recorder/Dockerfile deleted file mode 100644 index e15e67f..0000000 --- a/__DECO__/md_recorder/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM python:3.12-slim - -# libpq needed for Timescale -RUN apt-get update && apt-get install -y \ - apt-utils \ - libpq-dev \ - build-essential - -COPY requirements.txt / - -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy - -RUN mkdir -p /logs /config - -SHELL ["/bin/bash", "-c"] - -ENV PYTHONPATH=/ - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/__DECO__/md_recorder/VERSION b/__DECO__/md_recorder/VERSION deleted file mode 100644 index 99d85ec..0000000 --- a/__DECO__/md_recorder/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.6 \ No newline at end of file diff --git a/__DECO__/md_recorder/build.sh b/__DECO__/md_recorder/build.sh deleted file mode 100755 index 5ea8af4..0000000 --- a/__DECO__/md_recorder/build.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -# --- Settings -RegistryService=cloud21.cvtt.vpn:5500 -ImageName=md_recorder -BashFunctionCode=$(realpath $(dirname ${0}))/../../dckr_bld_functions.sh -ImageVersion=$(cat $(realpath $(dirname ${0}))/VERSION) -# --- Settings - -usage() { - echo "Usage: $0 -L : [-V ] " - exit 1 -} - - -# ---------------- cmdline -while getopts "V:L:" opt; do - case ${opt} in - V ) - ImageVersion=$OPTARG - ;; - L ) - Library=$OPTARG - ;; - \? ) - echo "Invalid option: -$OPTARG" >&2 - usage - ;; - : ) - echo "Option -$OPTARG requires an argument." >&2 - usage - ;; - esac -done -# ---------------- cmdline - -if [ "${ImageVersion}" == "" ] -then - usage -fi - -Project= -ProjectVersion= -if [ "${Library}" != "" ] ; then - IFS=':' read -ra parts <<< "${Library}" - Project=${parts[0]} - ProjectVersion=${parts[1]} -fi - -DockerDir=$(realpath $(dirname ${0})) - -cd ${DockerDir} -source ${BashFunctionCode} - -if [ "${Project}" != "" ]; then - get_project_version ${Project} ${ProjectVersion} -fi -function cleanup { - cd ${DockerDir} - rm -rf cvttpy -} -trap cleanup EXIT - -build_docker_image ${ImageName} ${RegistryService} ${ImageVersion} ${Project} ${ProjectVersion} - - -# echo "**** D E B U G E X I T" && exit -echo "***** ${0} D O N E" - - diff --git a/__DECO__/md_recorder/deployment/cloud24/.creds b/__DECO__/md_recorder/deployment/cloud24/.creds deleted file mode 100644 index 1301a78..0000000 --- a/__DECO__/md_recorder/deployment/cloud24/.creds +++ /dev/null @@ -1,17 +0,0 @@ -{ - "__dummy__": null - , "TSDB_MD_CLD21": { - "host": "cloud21.cvtt.vpn" - , "port": 5432 - , "user": "cvtt" - , "database": "cvtt_md" - , "password": "ICdIh0JnMM7vM7Pf" - } - , "TSDB_MD_CVTTDATA": { - "host": "cvttdata.cvtt.vpn" - , "port": 5432 - , "user": "cvtt" - , "database": "cvtt_md" - , "password": "ICdIh0JnMM7vM7Pf" - } -} diff --git a/__DECO__/md_recorder/deployment/cloud24/.env b/__DECO__/md_recorder/deployment/cloud24/.env deleted file mode 100644 index 6d8c1dc..0000000 --- a/__DECO__/md_recorder/deployment/cloud24/.env +++ /dev/null @@ -1,52 +0,0 @@ -# ----- cloud24 settings -CVTT_USER=1001:1001 -IMAGE_VERSION=0.0.2 - -CONFIG_FILE=/config/md_recorder.cfg -CREDS_FILE=/config/.creds - -# bnspot-cvttdata -BSCD_CONTAINER_NAME=md_recorder.BNBSPOT_CVTTDATA -BSCD_INSTRUMENT_GROUP=BNBSPOT_CVTTDATA -BSCD_EXCHANGE_ACCT_NAME=BNBSPOT -BSCD_DB_CRED_KEY=TSDB_MD_CVTTDATA - -BSCD_LOG_FILE=/logs/%T.MD_REC.${BSCD_INSTRUMENT_GROUP}.log -BSCD_ADD_ARGS=--compress_log - -BSCD_ADMIN_PORT=7201 - -# bnspot-cloud21 -BSCLD21_CONTAINER_NAME=md_recorder.BNBSPOT_CLD21 -BSCLD21_INSTRUMENT_GROUP=BNBSPOT_CLD21 -BSCLD21_EXCHANGE_ACCT_NAME=BNBSPOT -BSCLD21_DB_CRED_KEY=TSDB_MD_CLD21 - -BSCLD21_LOG_FILE=/logs/%T.MD_REC.${BSCLD21_INSTRUMENT_GROUP}.log -BSCLD21_ADD_ARGS=--compress_log - -BSCLD21_ADMIN_PORT=7202 - -# bnbfut-cloud21 -BFCLD21_CONTAINER_NAME=md_recorder.BNBFUT_CLD21 -BFCLD21_INSTRUMENT_GROUP=BNBFUT_CLD21 -BFCLD21_EXCHANGE_ACCT_NAME=BNBFUT -BFCLD21_DB_CRED_KEY=TSDB_MD_CLD21 - -BFCLD21_LOG_FILE=/logs/%T.MD_REC.${BFCLD21_INSTRUMENT_GROUP}.log -BFCLD21_ADD_ARGS=--compress_log - -BFCLD21_ADMIN_PORT=7203 - -# coinbase-cloud21 -CBCLD21_CONTAINER_NAME=md_recorder.COINBASE_CLD21 -CBCLD21_INSTRUMENT_GROUP=COINBASE_CLD21 -CBCLD21_EXCHANGE_ACCT_NAME=COINBASE_AT -CBCLD21_DB_CRED_KEY=TSDB_MD_CLD21 - -CBCLD21_LOG_FILE=/logs/%T.MD_REC.${CBCLD21_INSTRUMENT_GROUP}.log -CBCLD21_ADD_ARGS=--compress_log - -CBCLD21_ADMIN_PORT=7204 - - diff --git a/__DECO__/md_recorder/deployment/cloud24/docker-compose.yml b/__DECO__/md_recorder/deployment/cloud24/docker-compose.yml deleted file mode 100644 index 9e948be..0000000 --- a/__DECO__/md_recorder/deployment/cloud24/docker-compose.yml +++ /dev/null @@ -1,86 +0,0 @@ -# CVTT Microservices -services: - bfcld21_md_recorder: - image: cloud21.cvtt.vpn:5500/md_recorder:${IMAGE_VERSION} - container_name: ${BFCLD21_CONTAINER_NAME} - user: ${CVTT_USER:-1001:1001} - pull_policy: always - restart: unless-stopped - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_FILE: ${CONFIG_FILE:-/config/md_recorder.cfg} - CREDS_FILE: ${CREDS_FILE} - EXCHANGE_ACCT_NAME: ${BFCLD21_EXCHANGE_ACCT_NAME} - INSTRUMENT_GROUP: ${BFCLD21_INSTRUMENT_GROUP} - DB_CRED_KEY: ${BFCLD21_DB_CRED_KEY} - LOG_FILE: ${BFCLD21_LOG_FILE} - ADD_ARGS: ${BFCLD21_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - ports: - - ${BFCLD21_ADMIN_PORT}:7200 - - - cbcld21_md_recorder: - image: cloud21.cvtt.vpn:5500/md_recorder:${IMAGE_VERSION} - container_name: ${CBCLD21_CONTAINER_NAME} - user: ${CVTT_USER:-1001:1001} - pull_policy: always - restart: unless-stopped - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_FILE: ${CONFIG_FILE:-/config/md_recorder.cfg} - CREDS_FILE: ${CREDS_FILE} - EXCHANGE_ACCT_NAME: ${CBCLD21_EXCHANGE_ACCT_NAME} - INSTRUMENT_GROUP: ${CBCLD21_INSTRUMENT_GROUP} - DB_CRED_KEY: ${CBCLD21_DB_CRED_KEY} - LOG_FILE: ${CBCLD21_LOG_FILE} - ADD_ARGS: ${CBCLD21_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - ports: - - ${CBCLD21_ADMIN_PORT}:7200 - - bscld21_md_recorder: - image: cloud21.cvtt.vpn:5500/md_recorder:${IMAGE_VERSION} - container_name: ${BSCLD21_CONTAINER_NAME} - user: ${CVTT_USER:-1001:1001} - pull_policy: always - restart: unless-stopped - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_FILE: ${CONFIG_FILE:-/config/md_recorder.cfg} - CREDS_FILE: ${CREDS_FILE} - EXCHANGE_ACCT_NAME: ${BSCLD21_EXCHANGE_ACCT_NAME} - INSTRUMENT_GROUP: ${BSCLD21_INSTRUMENT_GROUP} - DB_CRED_KEY: ${BSCLD21_DB_CRED_KEY} - LOG_FILE: ${BSCLD21_LOG_FILE} - ADD_ARGS: ${BSCLD21_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - ports: - - ${BSCLD21_ADMIN_PORT}:7200 - - bscd_md_recorder: - image: cloud21.cvtt.vpn:5500/md_recorder:${IMAGE_VERSION} - container_name: ${BSCD_CONTAINER_NAME} - user: ${CVTT_USER:-1001:1001} - pull_policy: always - restart: unless-stopped - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_FILE: ${CONFIG_FILE:-/config/md_recorder.cfg} - CREDS_FILE: ${CREDS_FILE} - EXCHANGE_ACCT_NAME: ${BSCD_EXCHANGE_ACCT_NAME} - INSTRUMENT_GROUP: ${BSCD_INSTRUMENT_GROUP} - DB_CRED_KEY: ${BSCD_DB_CRED_KEY} - LOG_FILE: ${BSCD_LOG_FILE} - ADD_ARGS: ${BSCD_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - ports: - - ${BSCD_ADMIN_PORT}:7200 diff --git a/__DECO__/md_recorder/deployment/cloud24/md_recorder.cfg b/__DECO__/md_recorder/deployment/cloud24/md_recorder.cfg deleted file mode 100644 index 89c7ba6..0000000 --- a/__DECO__/md_recorder/deployment/cloud24/md_recorder.cfg +++ /dev/null @@ -1,206 +0,0 @@ -{ - "refdata": { - "assets": @inc=http://@env{CONFIG_SERVICE}/refdata/assets - , "instruments": @inc=http://@env{CONFIG_SERVICE}/refdata/instruments - , "exchange_instruments": @inc=http://@env{CONFIG_SERVICE}/refdata/exchange_instruments - , "dynamic_instrument_exchanges": ["ALPACA"] - , "exchanges": { - "COINBASE_AT": { - "exchange_id": "COINBASE" - , "name": "Coinbase Advanced Trade" - , "type": "SPOT" - - , "mktdata" : { - # ****** NEW VAlUE - # "class": "cvttpy.exchanges.coinbase.spot.mkt_data.CoinbaseMultiWsFeed" - "class": "cvttpy.exchanges.coinbase.spot.mkt_data.CoinbaseMdFeed" - # ****** NEW VAlUE - - , "reconnect_secs": 2 - , "max_connections": 10 - , "price_throttle": true - - , "ws_url": ["WSS", "wss://ws-feed.exchange.coinbase.com"] - } - } - , "BNBSPOT": { - "exchange_id": "BNBSPOT" - , "name": "Binance Spot" - , "type": "SPOT" - - , "mktdata" : { - # -------- NEW VALUE - # "class": "cvttpy.exchanges.binance.spot.mkt_data.BnbSpotMultiWsFeed" - "class": "cvttpy.exchanges.binance.spot.mkt_data.BnbSpotMktDataFeed" - # -------- NEW VALUE - , "max_connections": 10 - , "reconnect_secs": 2.0 - - - , "ws_url": ["WSS", "wss://stream.binance.com/ws"] - , "REST": { - "depth_snapshot_url": ["GET", "https://api.binance.com/api/v3/depth"], - } - } - } - , "BNBFUT": { - "exchange_id": "BNBFUT" - , "name": "Binance Futures USD-M" - , "type": "FUTURES" - - , "mktdata" : { - # -------- NEW VALUE - # "class": "cvttpy.exchanges.binance.futures.mkt_data.BnbFutMultiWsFeed" - "class": "cvttpy.exchanges.binance.futures.mkt_data.BnbFutMktDataFeed" - # -------- NEW VALUE - , "max_connections": 10 - , "reconnect_secs": 2.0 - - , "ws_url": ["WSS", "wss://fstream.binance.com/ws"] - - , "REST": { - # https://fapi.binance.com/fapi/v1/depth?symbol=BNBBTC&limit=1000 - "depth_snapshot_url": ["GET", "https://fapi.binance.com/fapi/v1/depth"], - } - } - } - } - } - , "comm": @inc=http://@env{CONFIG_SERVICE}/apps/common/comm - - , "md_recorder": { - "instrument_groups": { - "BNBFUT_CLD21": [ - "BNBFUT:PERP-BTC-USDT" - , "BNBFUT:PERP-ETH-USDT" - ] - "BNBFUT_CVTTDATA": [ - "BNBFUT:PERP-BTC-USDT" - , "BNBFUT:PERP-ETH-USDT" - ] - , "BNBSPOT_CLD21": [ - "BNBSPOT:PAIR-ADA-USDT" - , "BNBSPOT:PAIR-BCH-USDT" - , "BNBSPOT:PAIR-BTC-USDT" - , "BNBSPOT:PAIR-DOT-USDT" - , "BNBSPOT:PAIR-ETH-USDT" - , "BNBSPOT:PAIR-LTC-USDT" - , "BNBSPOT:PAIR-SOL-USDT" - , "BNBSPOT:PAIR-USDC-USDT" - , "BNBSPOT:PAIR-XRP-USDT" - ] - , "BNBSPOT_CVTTDATA": [ - "BNBSPOT:PAIR-ADA-USDT" - , "BNBSPOT:PAIR-BCH-USDT" - , "BNBSPOT:PAIR-BTC-USDT" - , "BNBSPOT:PAIR-DOT-USDT" - , "BNBSPOT:PAIR-ETH-USDT" - , "BNBSPOT:PAIR-LTC-USDT" - , "BNBSPOT:PAIR-SOL-USDT" - , "BNBSPOT:PAIR-USDC-USDT" - , "BNBSPOT:PAIR-XRP-USDT" - ] - , "COINBASE_CLD21": [ - "COINBASE:PAIR-ADA-USD" - , "COINBASE:PAIR-BCH-USD" - , "COINBASE:PAIR-BTC-USD" - , "COINBASE:PAIR-DOT-USD" - , "COINBASE:PAIR-ETH-USD" - , "COINBASE:PAIR-LTC-USD" - , "COINBASE:PAIR-SOL-USD" - , "COINBASE:PAIR-XRP-USD" - ] - , "COINBASE_CVTTDATA": [ - "COINBASE:PAIR-ADA-USD" - , "COINBASE:PAIR-BCH-USD" - , "COINBASE:PAIR-BTC-USD" - , "COINBASE:PAIR-DOT-USD" - , "COINBASE:PAIR-ETH-USD" - , "COINBASE:PAIR-LTC-USD" - , "COINBASE:PAIR-SOL-USD" - , "COINBASE:PAIR-XRP-USD" - ] - } - , "db": { - "class": "cvttpy.tools.db.timescale.tsdb_client.TimescaleDbClient" - } - , "flush_interval_sec": 0.5 - - , "collections": { - "__dummy__": null - , "ALPACA": { - # dynamic instruments names - "tables": { - "trades": "alpaca_iex.md_trades" - , "booktops": "alpaca_iex.md_booktops" - , "booksnaps": "alpaca_iex.md_booksnaps" - } - } - , "BNBSPOT": { - "instruments": { - "PAIR-ADA-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-BCH-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-BTC-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-DOT-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-ETH-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-LTC-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-SOL-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-USDC-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-XRP-USDT": ["TRADES", "BOOK_TOP"] - } - , "tables": { - "trades": "bnbspot.md_trades" - , "booktops": "bnbspot.md_booktops" - , "booksnaps": "bnbspot.md_booksnaps" - } - } - , "BNBFUT": { - "instruments": { - "PERP-BTC-USDT": ["TRADES", "BOOK_TOP"] - , "PERP-ETH-USDT": ["TRADES", "BOOK_TOP"] - } - , "tables": { - "trades": "bnbfut.md_trades" - , "booktops": "bnbfut.md_booktops" - , "booksnaps": "bnbfut.md_booksnaps" - } - } - , "COINBASE": { - "instruments": { - "PAIR-ADA-USD": ["TRADES", "BOOK_TOP"] - , "PAIR-BCH-USD": ["TRADES", "BOOK_TOP"] - , "PAIR-BTC-USD": ["TRADES", "BOOK_TOP"] - , "PAIR-DOT-USD": ["TRADES", "BOOK_TOP"] - , "PAIR-ETH-USD": ["TRADES", "BOOK_TOP"] - , "PAIR-LTC-USD": ["TRADES", "BOOK_TOP"] - , "PAIR-SOL-USD": ["TRADES", "BOOK_TOP"] - , "PAIR-XRP-USD": ["TRADES", "BOOK_TOP"] - } - , "tables": { - "trades": "coinbase.md_trades" - , "booktops": "coinbase.md_booktops" - , "booksnaps": "coinbase.md_booksnaps" - } - } - } - } - - # ---------------------------------- - , "exchanges_settings": { - "*": { - "order_entry": { - "enabled": false - , "streaming": false - }, - "mkt_data": { - "enabled": true - , "streaming": true - }, - "accounting": { - "enabled": false - , "streaming": false - } - } - } -} - diff --git a/__DECO__/md_recorder/deployment/cvtt-md/.creds b/__DECO__/md_recorder/deployment/cvtt-md/.creds deleted file mode 100644 index 1301a78..0000000 --- a/__DECO__/md_recorder/deployment/cvtt-md/.creds +++ /dev/null @@ -1,17 +0,0 @@ -{ - "__dummy__": null - , "TSDB_MD_CLD21": { - "host": "cloud21.cvtt.vpn" - , "port": 5432 - , "user": "cvtt" - , "database": "cvtt_md" - , "password": "ICdIh0JnMM7vM7Pf" - } - , "TSDB_MD_CVTTDATA": { - "host": "cvttdata.cvtt.vpn" - , "port": 5432 - , "user": "cvtt" - , "database": "cvtt_md" - , "password": "ICdIh0JnMM7vM7Pf" - } -} diff --git a/__DECO__/md_recorder/deployment/cvtt-md/.env b/__DECO__/md_recorder/deployment/cvtt-md/.env deleted file mode 100644 index 0e96df8..0000000 --- a/__DECO__/md_recorder/deployment/cvtt-md/.env +++ /dev/null @@ -1,28 +0,0 @@ -# -------- cvtt-md -CVTT_USER=1001:1001 -IMAGE_VERSION=0.0.2 - -CONFIG_FILE=/config/md_recorder.cfg -CREDS_FILE=/config/.creds - -# bnbfut-cvttdata -BFCD_CONTAINER_NAME=md_recorder.BNBFUT_CVTTDATA -BFCD_INSTRUMENT_GROUP=BNBFUT_CVTTDATA -BFCD_EXCHANGE_ACCT_NAME=BNBFUT -BFCD_DB_CRED_KEY=TSDB_MD_CVTTDATA - -BFCD_LOG_FILE=/logs/%T.MD_REC.${BFCD_INSTRUMENT_GROUP}.log -BFCD_ADD_ARGS=--compress_log - -BFCD_ADMIN_PORT=7201 - -# coinbase-cvttdata -CBCD_CONTAINER_NAME=md_recorder.COINBASE_CVTTDATA -CBCD_INSTRUMENT_GROUP=COINBASE_CVTTDATA -CBCD_EXCHANGE_ACCT_NAME=COINBASE_AT -CBCD_DB_CRED_KEY=TSDB_MD_CVTTDATA - -CBCD_LOG_FILE=/logs/%T.MD_REC.${CBCD_INSTRUMENT_GROUP}.log -CBCD_ADD_ARGS=--compress_log - -CBCD_ADMIN_PORT=7202 diff --git a/__DECO__/md_recorder/deployment/cvtt-md/docker-compose.yml b/__DECO__/md_recorder/deployment/cvtt-md/docker-compose.yml deleted file mode 100644 index 2d1991f..0000000 --- a/__DECO__/md_recorder/deployment/cvtt-md/docker-compose.yml +++ /dev/null @@ -1,44 +0,0 @@ -# CVTT Microservices -services: - bfcd_md_recorder: - image: cloud21.cvtt.vpn:5500/md_recorder:${IMAGE_VERSION} - container_name: ${BFCD_CONTAINER_NAME} - user: ${CVTT_USER:-1001:1001} - pull_policy: always - restart: unless-stopped - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_FILE: ${CONFIG_FILE:-/config/md_recorder.cfg} - CREDS_FILE: ${CREDS_FILE} - EXCHANGE_ACCT_NAME: ${BFCD_EXCHANGE_ACCT_NAME} - INSTRUMENT_GROUP: ${BFCD_INSTRUMENT_GROUP} - DB_CRED_KEY: ${BFCD_DB_CRED_KEY} - LOG_FILE: ${BFCD_LOG_FILE} - ADD_ARGS: ${BFCD_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - ports: - - ${BFCD_ADMIN_PORT}:7200 - - - cbcd_md_recorder: - image: cloud21.cvtt.vpn:5500/md_recorder:${IMAGE_VERSION} - container_name: ${CBCD_CONTAINER_NAME} - user: ${CVTT_USER:-1001:1001} - pull_policy: always - restart: unless-stopped - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_FILE: ${CONFIG_FILE:-/config/md_recorder.cfg} - CREDS_FILE: ${CREDS_FILE} - EXCHANGE_ACCT_NAME: ${CBCD_EXCHANGE_ACCT_NAME} - INSTRUMENT_GROUP: ${CBCD_INSTRUMENT_GROUP} - DB_CRED_KEY: ${CBCD_DB_CRED_KEY} - LOG_FILE: ${CBCD_LOG_FILE} - ADD_ARGS: ${CBCD_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - ports: - - ${CBCD_ADMIN_PORT}:7200 diff --git a/__DECO__/md_recorder/deployment/cvtt-md/md_recorder.cfg b/__DECO__/md_recorder/deployment/cvtt-md/md_recorder.cfg deleted file mode 100644 index 89c7ba6..0000000 --- a/__DECO__/md_recorder/deployment/cvtt-md/md_recorder.cfg +++ /dev/null @@ -1,206 +0,0 @@ -{ - "refdata": { - "assets": @inc=http://@env{CONFIG_SERVICE}/refdata/assets - , "instruments": @inc=http://@env{CONFIG_SERVICE}/refdata/instruments - , "exchange_instruments": @inc=http://@env{CONFIG_SERVICE}/refdata/exchange_instruments - , "dynamic_instrument_exchanges": ["ALPACA"] - , "exchanges": { - "COINBASE_AT": { - "exchange_id": "COINBASE" - , "name": "Coinbase Advanced Trade" - , "type": "SPOT" - - , "mktdata" : { - # ****** NEW VAlUE - # "class": "cvttpy.exchanges.coinbase.spot.mkt_data.CoinbaseMultiWsFeed" - "class": "cvttpy.exchanges.coinbase.spot.mkt_data.CoinbaseMdFeed" - # ****** NEW VAlUE - - , "reconnect_secs": 2 - , "max_connections": 10 - , "price_throttle": true - - , "ws_url": ["WSS", "wss://ws-feed.exchange.coinbase.com"] - } - } - , "BNBSPOT": { - "exchange_id": "BNBSPOT" - , "name": "Binance Spot" - , "type": "SPOT" - - , "mktdata" : { - # -------- NEW VALUE - # "class": "cvttpy.exchanges.binance.spot.mkt_data.BnbSpotMultiWsFeed" - "class": "cvttpy.exchanges.binance.spot.mkt_data.BnbSpotMktDataFeed" - # -------- NEW VALUE - , "max_connections": 10 - , "reconnect_secs": 2.0 - - - , "ws_url": ["WSS", "wss://stream.binance.com/ws"] - , "REST": { - "depth_snapshot_url": ["GET", "https://api.binance.com/api/v3/depth"], - } - } - } - , "BNBFUT": { - "exchange_id": "BNBFUT" - , "name": "Binance Futures USD-M" - , "type": "FUTURES" - - , "mktdata" : { - # -------- NEW VALUE - # "class": "cvttpy.exchanges.binance.futures.mkt_data.BnbFutMultiWsFeed" - "class": "cvttpy.exchanges.binance.futures.mkt_data.BnbFutMktDataFeed" - # -------- NEW VALUE - , "max_connections": 10 - , "reconnect_secs": 2.0 - - , "ws_url": ["WSS", "wss://fstream.binance.com/ws"] - - , "REST": { - # https://fapi.binance.com/fapi/v1/depth?symbol=BNBBTC&limit=1000 - "depth_snapshot_url": ["GET", "https://fapi.binance.com/fapi/v1/depth"], - } - } - } - } - } - , "comm": @inc=http://@env{CONFIG_SERVICE}/apps/common/comm - - , "md_recorder": { - "instrument_groups": { - "BNBFUT_CLD21": [ - "BNBFUT:PERP-BTC-USDT" - , "BNBFUT:PERP-ETH-USDT" - ] - "BNBFUT_CVTTDATA": [ - "BNBFUT:PERP-BTC-USDT" - , "BNBFUT:PERP-ETH-USDT" - ] - , "BNBSPOT_CLD21": [ - "BNBSPOT:PAIR-ADA-USDT" - , "BNBSPOT:PAIR-BCH-USDT" - , "BNBSPOT:PAIR-BTC-USDT" - , "BNBSPOT:PAIR-DOT-USDT" - , "BNBSPOT:PAIR-ETH-USDT" - , "BNBSPOT:PAIR-LTC-USDT" - , "BNBSPOT:PAIR-SOL-USDT" - , "BNBSPOT:PAIR-USDC-USDT" - , "BNBSPOT:PAIR-XRP-USDT" - ] - , "BNBSPOT_CVTTDATA": [ - "BNBSPOT:PAIR-ADA-USDT" - , "BNBSPOT:PAIR-BCH-USDT" - , "BNBSPOT:PAIR-BTC-USDT" - , "BNBSPOT:PAIR-DOT-USDT" - , "BNBSPOT:PAIR-ETH-USDT" - , "BNBSPOT:PAIR-LTC-USDT" - , "BNBSPOT:PAIR-SOL-USDT" - , "BNBSPOT:PAIR-USDC-USDT" - , "BNBSPOT:PAIR-XRP-USDT" - ] - , "COINBASE_CLD21": [ - "COINBASE:PAIR-ADA-USD" - , "COINBASE:PAIR-BCH-USD" - , "COINBASE:PAIR-BTC-USD" - , "COINBASE:PAIR-DOT-USD" - , "COINBASE:PAIR-ETH-USD" - , "COINBASE:PAIR-LTC-USD" - , "COINBASE:PAIR-SOL-USD" - , "COINBASE:PAIR-XRP-USD" - ] - , "COINBASE_CVTTDATA": [ - "COINBASE:PAIR-ADA-USD" - , "COINBASE:PAIR-BCH-USD" - , "COINBASE:PAIR-BTC-USD" - , "COINBASE:PAIR-DOT-USD" - , "COINBASE:PAIR-ETH-USD" - , "COINBASE:PAIR-LTC-USD" - , "COINBASE:PAIR-SOL-USD" - , "COINBASE:PAIR-XRP-USD" - ] - } - , "db": { - "class": "cvttpy.tools.db.timescale.tsdb_client.TimescaleDbClient" - } - , "flush_interval_sec": 0.5 - - , "collections": { - "__dummy__": null - , "ALPACA": { - # dynamic instruments names - "tables": { - "trades": "alpaca_iex.md_trades" - , "booktops": "alpaca_iex.md_booktops" - , "booksnaps": "alpaca_iex.md_booksnaps" - } - } - , "BNBSPOT": { - "instruments": { - "PAIR-ADA-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-BCH-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-BTC-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-DOT-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-ETH-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-LTC-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-SOL-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-USDC-USDT": ["TRADES", "BOOK_TOP"] - , "PAIR-XRP-USDT": ["TRADES", "BOOK_TOP"] - } - , "tables": { - "trades": "bnbspot.md_trades" - , "booktops": "bnbspot.md_booktops" - , "booksnaps": "bnbspot.md_booksnaps" - } - } - , "BNBFUT": { - "instruments": { - "PERP-BTC-USDT": ["TRADES", "BOOK_TOP"] - , "PERP-ETH-USDT": ["TRADES", "BOOK_TOP"] - } - , "tables": { - "trades": "bnbfut.md_trades" - , "booktops": "bnbfut.md_booktops" - , "booksnaps": "bnbfut.md_booksnaps" - } - } - , "COINBASE": { - "instruments": { - "PAIR-ADA-USD": ["TRADES", "BOOK_TOP"] - , "PAIR-BCH-USD": ["TRADES", "BOOK_TOP"] - , "PAIR-BTC-USD": ["TRADES", "BOOK_TOP"] - , "PAIR-DOT-USD": ["TRADES", "BOOK_TOP"] - , "PAIR-ETH-USD": ["TRADES", "BOOK_TOP"] - , "PAIR-LTC-USD": ["TRADES", "BOOK_TOP"] - , "PAIR-SOL-USD": ["TRADES", "BOOK_TOP"] - , "PAIR-XRP-USD": ["TRADES", "BOOK_TOP"] - } - , "tables": { - "trades": "coinbase.md_trades" - , "booktops": "coinbase.md_booktops" - , "booksnaps": "coinbase.md_booksnaps" - } - } - } - } - - # ---------------------------------- - , "exchanges_settings": { - "*": { - "order_entry": { - "enabled": false - , "streaming": false - }, - "mkt_data": { - "enabled": true - , "streaming": true - }, - "accounting": { - "enabled": false - , "streaming": false - } - } - } -} - diff --git a/__DECO__/md_recorder/entrypoint.sh b/__DECO__/md_recorder/entrypoint.sh deleted file mode 100755 index a40916f..0000000 --- a/__DECO__/md_recorder/entrypoint.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# runs in container - - -Cmd="python3.12" -Cmd+=" cvttpy/apps/md/md_recorder.py" - -Cmd+=" --config=${CONFIG_FILE:-/config/cvtt_musvc.cfg}" -Cmd+=" --credentials_file=${CREDS_FILE:-/config/.creds}" - -Cmd="${Cmd} --instrument_group=${INSTRUMENT_GROUP}" -Cmd="${Cmd} --exch_acct_cfgname=${EXCHANGE_ACCT_NAME}" -Cmd="${Cmd} --db_credentials_key=${DB_CRED_KEY}" -Cmd="${Cmd} --admin_port=7200" - -Cmd+=" --log_file=${LOG_FILE:-/logs/%T.MD_REC.${INSTRUMENT_GROUP}.log}" -Cmd+=" ${ADD_ARGS}" - -echo ${Cmd} -exec ${Cmd} - diff --git a/__DECO__/md_recorder/requirements.txt b/__DECO__/md_recorder/requirements.txt deleted file mode 100644 index 6edb609..0000000 --- a/__DECO__/md_recorder/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -aiohttp>=3.7.4.post0 -nest-asyncio>=1.5.5 -psycopg>=3.2.1 -hjson>=3.1.0 -pandas>=1.5.3 -sortedcontainers>=2.4.0 -redis>=5.0.8 -debugpy>=1.8.13 diff --git a/__DECO__/microservices/.env b/__DECO__/microservices/.env deleted file mode 100644 index 3e3a6d3..0000000 --- a/__DECO__/microservices/.env +++ /dev/null @@ -1,38 +0,0 @@ -CONFIG_SERVICE=cloud16.cvtt.vpn:6789 -CONFIG_COMM_SETTINGS=comm/pubsub/redis/docker_microservices -CONFIG_FILE="http://${CONFIG_SERVICE}/apps/cvtt_musvc" - -CVTT_USER=1001:1001 -CVTT_VERSION=0.0.6 - -# MDGW_CREDS_FILE=.creds -MDGW_LOG_FILE=%T.md_gateway.log -MDGW_ADD_ARGS= - -# OEGW_CREDS_FILE=.creds -OEGW_LOG_FILE=%T.oe_gateway.log -#OEGW_ADD_ARGS="--log_level=DEBUG --debug_mode" -OEGW_ADD_ARGS="--debug_mode" - -# ACGW_CREDS_FILE=.creds -ACGW_LOG_FILE=%T.ac_gateway.log -ACGW_ADD_ARGS= - -PXER_LOG_FILE=%T.pricer.log -PXER_ADD_ARGS= - -COORD_LOG_FILE=%T.coordinator.log -COORD_ADD_ARGS= - -BKPR_CREDS_FILE= -BKPR_LOG_FILE=%T.bookkeeper.log -BKPR_ADD_ARGS= - -RMGR_LOG_FILE=%T.riskmrg.log -RMGR_ADD_ARGS= - -QUANT_LOG_FILE=%T.quant.log -QUANT_ADD_ARGS= - -TRDR_LOG_FILE=%T.trader.log -TRDR_ADD_ARGS= diff --git a/__DECO__/microservices/VERSION b/__DECO__/microservices/VERSION deleted file mode 100644 index 5c4511c..0000000 --- a/__DECO__/microservices/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.7 \ No newline at end of file diff --git a/__DECO__/microservices/ac_gateway/.dockerignore b/__DECO__/microservices/ac_gateway/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/__DECO__/microservices/ac_gateway/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/__DECO__/microservices/ac_gateway/Dockerfile b/__DECO__/microservices/ac_gateway/Dockerfile deleted file mode 100644 index 33e3bc2..0000000 --- a/__DECO__/microservices/ac_gateway/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM python:3.12-slim - -COPY requirements.txt / - -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy - -RUN mkdir -p /logs /config - -SHELL ["/bin/bash", "-c"] - -ENV PYTHONPATH=/ - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/__DECO__/microservices/ac_gateway/entrypoint.sh b/__DECO__/microservices/ac_gateway/entrypoint.sh deleted file mode 100755 index d0d63aa..0000000 --- a/__DECO__/microservices/ac_gateway/entrypoint.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -LogDir=/logs - -Cmd="python3.12" -Cmd+=" cvttpy/apps/microservices/market_gateways/accounting_gateway.py" - -Cmd+=" --config=${CONFIG_FILE:-/config/cvtt_musvc.cfg}" -Cmd+=" --credentials_file=${ACGW_CREDS_FILE:-/config/.creds}" - -Cmd+=" --log_file=${LogDir}/${ACGW_LOG_FILE:-%T.ac_gateway.log}" -Cmd+=" ${ACGW_ADD_ARGS}" - -echo ${Cmd} -exec ${Cmd} - diff --git a/__DECO__/microservices/ac_gateway/requirements.txt b/__DECO__/microservices/ac_gateway/requirements.txt deleted file mode 100644 index e840a84..0000000 --- a/__DECO__/microservices/ac_gateway/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/__DECO__/microservices/bookkeeper/.dockerignore b/__DECO__/microservices/bookkeeper/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/__DECO__/microservices/bookkeeper/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/__DECO__/microservices/bookkeeper/Dockerfile b/__DECO__/microservices/bookkeeper/Dockerfile deleted file mode 100644 index c20dda4..0000000 --- a/__DECO__/microservices/bookkeeper/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM python:3.12-slim - -# libpq needed for Timescale -RUN apt-get update && apt-get install -y \ - apt-utils \ - libpq-dev \ - build-essential - - COPY requirements.txt / - -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy - -RUN mkdir -p /logs /config - -SHELL ["/bin/bash", "-c"] - -ENV PYTHONPATH=/ - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/__DECO__/microservices/bookkeeper/entrypoint.sh b/__DECO__/microservices/bookkeeper/entrypoint.sh deleted file mode 100755 index 65638ed..0000000 --- a/__DECO__/microservices/bookkeeper/entrypoint.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -LogDir=/logs - -Cmd="python3.12" -Cmd+=" cvttpy/apps/microservices/book_keeper/book_keeper.py" - -Cmd+=" --config=${CONFIG_FILE}" -Cmd+=" --log_file=${LogDir}/${BKPR_LOG_FILE}" -Cmd+=" --credentials_file=${BKPR_CREDS_FILE:-/config/.creds}" - - -Cmd+=" ${BKPR_ADD_ARGS}" -echo ${Cmd} -exec ${Cmd} - diff --git a/__DECO__/microservices/bookkeeper/requirements.txt b/__DECO__/microservices/bookkeeper/requirements.txt deleted file mode 100644 index 3bc6254..0000000 --- a/__DECO__/microservices/bookkeeper/requirements.txt +++ /dev/null @@ -1,11 +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 -psycopg>=3.2.1 -pandas>=1.5.3 diff --git a/__DECO__/microservices/build.sh b/__DECO__/microservices/build.sh deleted file mode 100755 index 001c568..0000000 --- a/__DECO__/microservices/build.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/bash - -# --- Settings -RegistryService=cloud21.cvtt.vpn:5500 - -ValidImages=() -ValidImages+=(md_gateway) -ValidImages+=(oe_gateway) -ValidImages+=(ac_gateway) -ValidImages+=(pricer) -ValidImages+=(coordinator) -ValidImages+=(bookkeeper) -ValidImages+=(risk_manager) -ValidImages+=(quant) -ValidImages+=(trader) - -ScriptPath=$(realpath $(dirname ${0})) -BashFunctionCode=${ScriptPath}/../dckr_bld_functions.sh -ImageVersion=$(cat ${ScriptPath}/VERSION) - -# --- Settings - -usage() { - echo "Usage: $0 -I -L : [-V ] " - exit 1 -} - - -# ---------------- cmdline -while getopts "I:V:L:" opt; do - case ${opt} in - I ) - ImageName=$OPTARG - ;; - V ) - ImageVersion=$OPTARG - ;; - L ) - Library=$OPTARG - ;; - \? ) - echo "Invalid option: -$OPTARG" >&2 - usage - ;; - : ) - echo "Option -$OPTARG requires an argument." >&2 - usage - ;; - esac -done -# ---------------- cmdline - -if [ "${ImageName}" == "" ] -then - usage -fi - -if [ "${ImageVersion}" == "" ] -then - usage -fi - -Project= -ProjectVersion= -if [ "${Library}" != "" ] ; then - IFS=':' read -ra parts <<< "${Library}" - Project=${parts[0]} - ProjectVersion=${parts[1]} -fi -# exit - -build_musvc_image() { - ImageName=${1} - Project=${2} - ProjectVersion=${3} - - DockerDir=${ScriptPath}/${ImageName} - Cmd="cd ${DockerDir}" - echo ${Cmd} && eval ${Cmd} - - if [ "${Project}" != "" ]; then - get_project_version ${Project} ${ProjectVersion} - fi - - function cleanup { - cd ${DockerDir} - rm -rf cvttpy - } - trap cleanup RETURN - - build_docker_image ${ImageName} ${RegistryService} ${ImageVersion} ${Project} ${ProjectVersion} -} - - -source ${BashFunctionCode} -if [ "${ImageName}" == "__ALL__" ]; then - Images=(${ValidImages[@]}) -else - if [[ " ${ValidImages[*]} " == *" ${ImageName}"* ]]; then - Images=(${ImageName}) - else - echo "ERROR: invalid image name \"${ImageName}\"" - exit 1 - fi -fi -for ImageName in "${Images[@]}"; do - build_musvc_image ${ImageName} ${Project} ${ProjectVersion} -done - -echo "***** ${0} D O N E" - - diff --git a/__DECO__/microservices/coordinator/.dockerignore b/__DECO__/microservices/coordinator/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/__DECO__/microservices/coordinator/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/__DECO__/microservices/coordinator/Dockerfile b/__DECO__/microservices/coordinator/Dockerfile deleted file mode 100644 index 33e3bc2..0000000 --- a/__DECO__/microservices/coordinator/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM python:3.12-slim - -COPY requirements.txt / - -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy - -RUN mkdir -p /logs /config - -SHELL ["/bin/bash", "-c"] - -ENV PYTHONPATH=/ - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/__DECO__/microservices/coordinator/entrypoint.sh b/__DECO__/microservices/coordinator/entrypoint.sh deleted file mode 100755 index 891f1dd..0000000 --- a/__DECO__/microservices/coordinator/entrypoint.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -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}" - -Cmd+=" --log_file=${LogDir}/${COORD_LOG_FILE:-%T.coordinator.log}" -Cmd+=" ${COORD_ADD_ARGS}" -echo ${Cmd} -exec ${Cmd} - diff --git a/__DECO__/microservices/coordinator/requirements.txt b/__DECO__/microservices/coordinator/requirements.txt deleted file mode 100644 index ceeb72d..0000000 --- a/__DECO__/microservices/coordinator/requirements.txt +++ /dev/null @@ -1,10 +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 -debugpy>=1.8.13 diff --git a/__DECO__/microservices/docker-compose.yml b/__DECO__/microservices/docker-compose.yml deleted file mode 100644 index 83c7ba3..0000000 --- a/__DECO__/microservices/docker-compose.yml +++ /dev/null @@ -1,183 +0,0 @@ -# CVTT Microservices -services: - trader: - image: cloud21.cvtt.vpn:5500/trader:${CVTT_VERSION} - container_name: cvtt-trader - pull_policy: always - user: ${CVTT_USER:-1001:1001} - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_COMM_SETTINGS: ${CONFIG_COMM_SETTINGS:-comm/pubsub/redis/docker_microservices} - CONFIG_FILE: ${CONFIG_FILE:-http://${CONFIG_SERVICE}/apps/cvtt_musvc} - TRDR_LOG_FILE: ${TRDR_LOG_FILE:-%T.trader.log} - TRDR_ADD_ARGS: ${TRDR_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - depends_on: - - md_gateway - - oe_gateway - - quant - - bookkeeper - - risk_manager - - redis - - quant: - image: cloud21.cvtt.vpn:5500/quant:${CVTT_VERSION} - container_name: cvtt-quant - pull_policy: always - user: ${CVTT_USER:-1001:1001} - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_COMM_SETTINGS: ${CONFIG_COMM_SETTINGS:-comm/pubsub/redis/docker_microservices} - CONFIG_FILE: ${CONFIG_FILE:-http://${CONFIG_SERVICE}/apps/cvtt_musvc} - QUANT_LOG_FILE: ${QUANT_LOG_FILE:-%T.quant.log} - QUANT_ADD_ARGS: ${QUANT_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - depends_on: - - md_gateway - - bookkeeper - - redis - - coordinator: - image: cloud21.cvtt.vpn:5500/coordinator:${CVTT_VERSION} - container_name: cvtt-coordinator - pull_policy: always - user: ${CVTT_USER:-1001:1001} - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_COMM_SETTINGS: ${CONFIG_COMM_SETTINGS:-comm/pubsub/redis/docker_microservices} - CONFIG_FILE: ${CONFIG_FILE:-cvtt_musvc.cfg} - COORD_LOG_FILE: ${COORD_LOG_FILE:-%T.coordinator.log} - COORD_ADD_ARGS: ${COORD_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - depends_on: - - pricer - # - quant - # - trader - - risk_manager - - redis - - pricer: - image: cloud21.cvtt.vpn:5500/pricer:${CVTT_VERSION} - container_name: cvtt-pricer - pull_policy: always - user: ${CVTT_USER:-1001:1001} - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_COMM_SETTINGS: ${CONFIG_COMM_SETTINGS:-comm/pubsub/redis/docker_microservices} - CONFIG_FILE: ${CONFIG_FILE:-http://${CONFIG_SERVICE}/apps/cvtt_musvc} - PXER_LOG_FILE: ${PXER_LOG_FILE:-%T.pricer.log} - PXER_ADD_ARGS: ${PXER_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - depends_on: - - md_gateway - - redis - - risk_manager: - image: cloud21.cvtt.vpn:5500/risk_manager:${CVTT_VERSION} - container_name: cvtt-risk_manager - pull_policy: always - user: ${CVTT_USER:-1001:1001} - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_COMM_SETTINGS: ${CONFIG_COMM_SETTINGS:-comm/pubsub/redis/docker_microservices} - CONFIG_FILE: ${CONFIG_FILE:-http://${CONFIG_SERVICE}/apps/cvtt_musvc} - RMGR_LOG_FILE: ${RMGR_LOG_FILE:-%T.riskmrg.log} - RMGR_ADD_ARGS: ${RMGR_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - depends_on: - - md_gateway - - ac_gateway - - bookkeeper - - redis - - - bookkeeper: - image: cloud21.cvtt.vpn:5500/bookkeeper:${CVTT_VERSION} - container_name: cvtt-bookkeeper - pull_policy: always - user: ${CVTT_USER:-1001:1001} - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_COMM_SETTINGS: ${CONFIG_COMM_SETTINGS:-comm/pubsub/redis/docker_microservices} - CONFIG_FILE: ${CONFIG_FILE:-http://${CONFIG_SERVICE}/apps/cvtt_musvc} - BKPR_LOG_FILE: ${BKPR_LOG_FILE:-%T.bookkeeper.log} - BKPR_ADD_ARGS: ${BKPR_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - depends_on: - - ac_gateway - #- trader - - redis - - md_gateway: - image: cloud21.cvtt.vpn:5500/md_gateway:${CVTT_VERSION} - container_name: md_gateway - pull_policy: always - user: ${CVTT_USER:-1001:1001} - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_COMM_SETTINGS: ${CONFIG_COMM_SETTINGS:-comm/pubsub/redis/docker_microservices} - CONFIG_FILE: ${CONFIG_FILE:-http://${CONFIG_SERVICE}/apps/cvtt_musvc} - MDGW_CREDS_FILE: ${MDGW_CREDS_FILE:-/config/.creds} - MDGW_LOG_FILE: ${MDGW_LOG_FILE:-%T.md_gateway.log} - MDGW_ADD_ARGS: ${MDGW_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - depends_on: - - redis - - oe_gateway: - image: cloud21.cvtt.vpn:5500/oe_gateway:${CVTT_VERSION} - container_name: oe_gateway - pull_policy: always - user: ${CVTT_USER:-1001:1001} - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_COMM_SETTINGS: ${CONFIG_COMM_SETTINGS:-comm/pubsub/redis/docker_microservices} - CONFIG_FILE: ${CONFIG_FILE:-http://${CONFIG_SERVICE}/apps/cvtt_musvc} - OEGW_CREDS_FILE: ${OEGW_CREDS_FILE:-/config/.creds} - OEGW_LOG_FILE: ${OEGW_LOG_FILE:-%T.oe_gateway.log} - OEGW_ADD_ARGS: ${OEGW_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - depends_on: - - redis - - ac_gateway: - image: cloud21.cvtt.vpn:5500/ac_gateway:${CVTT_VERSION} - container_name: ac_gateway - pull_policy: always - user: ${CVTT_USER:-1001:1001} - environment: - CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789} - CONFIG_COMM_SETTINGS: ${CONFIG_COMM_SETTINGS:-comm/pubsub/redis/docker_microservices} - CONFIG_FILE: ${CONFIG_FILE:-http://${CONFIG_SERVICE}/apps/cvtt_musvc} - ACGW_CREDS_FILE: ${ACGW_CREDS_FILE:-/config/.creds} - ACGW_LOG_FILE: ${ACGW_LOG_FILE:-%T.ac_gateway.log} - ACGW_ADD_ARGS: ${ACGW_ADD_ARGS:-} - volumes: - - ./config:/config - - ./logs:/logs - depends_on: - - redis - - redis: - image: redis:latest - container_name: redis-cvtt - ports: - - "16379:6379" - volumes: - - ./data/redis:/data diff --git a/__DECO__/microservices/md_gateway/.dockerignore b/__DECO__/microservices/md_gateway/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/__DECO__/microservices/md_gateway/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/__DECO__/microservices/md_gateway/Dockerfile b/__DECO__/microservices/md_gateway/Dockerfile deleted file mode 100644 index 33e3bc2..0000000 --- a/__DECO__/microservices/md_gateway/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM python:3.12-slim - -COPY requirements.txt / - -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy - -RUN mkdir -p /logs /config - -SHELL ["/bin/bash", "-c"] - -ENV PYTHONPATH=/ - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/__DECO__/microservices/md_gateway/entrypoint.sh b/__DECO__/microservices/md_gateway/entrypoint.sh deleted file mode 100755 index 8023018..0000000 --- a/__DECO__/microservices/md_gateway/entrypoint.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -LogDir=/logs - -Cmd="python3.12" -Cmd+=" cvttpy/apps/microservices/market_gateways/md_gateway.py" - -Cmd+=" --config=${CONFIG_FILE:-/config/cvtt_musvc.cfg}" -Cmd+=" --credentials_file=${MDGW_CREDS_FILE:-/config/.creds}" - -Cmd+=" --log_file=${LogDir}/${MDGW_LOG_FILE:-%T.md_gateway.log}" -Cmd+=" ${MDGW_ADD_ARGS}" -echo ${Cmd} -exec ${Cmd} - diff --git a/__DECO__/microservices/md_gateway/requirements.txt b/__DECO__/microservices/md_gateway/requirements.txt deleted file mode 100644 index e840a84..0000000 --- a/__DECO__/microservices/md_gateway/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/__DECO__/microservices/oe_gateway/.dockerignore b/__DECO__/microservices/oe_gateway/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/__DECO__/microservices/oe_gateway/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/__DECO__/microservices/oe_gateway/Dockerfile b/__DECO__/microservices/oe_gateway/Dockerfile deleted file mode 100644 index 33e3bc2..0000000 --- a/__DECO__/microservices/oe_gateway/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM python:3.12-slim - -COPY requirements.txt / - -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy - -RUN mkdir -p /logs /config - -SHELL ["/bin/bash", "-c"] - -ENV PYTHONPATH=/ - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/__DECO__/microservices/oe_gateway/entrypoint.sh b/__DECO__/microservices/oe_gateway/entrypoint.sh deleted file mode 100755 index c872c73..0000000 --- a/__DECO__/microservices/oe_gateway/entrypoint.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -LogDir=/logs - -Cmd="python3.12" -Cmd+=" cvttpy/apps/microservices/market_gateways/order_entry_gateway.py" - -Cmd+=" --config=${CONFIG_FILE:-/config/cvtt_musvc.cfg}" -Cmd+=" --credentials_file=${OEGW_CREDS_FILE:-/config/.creds}" - -Cmd+=" --log_file=${LogDir}/${OEGW_LOG_FILE:-%T.oe_gateway.log}" -Cmd+=" ${OEGW_ADD_ARGS}" -echo ${Cmd} -exec ${Cmd} - diff --git a/__DECO__/microservices/oe_gateway/requirements.txt b/__DECO__/microservices/oe_gateway/requirements.txt deleted file mode 100644 index d23f46d..0000000 --- a/__DECO__/microservices/oe_gateway/requirements.txt +++ /dev/null @@ -1,11 +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/__DECO__/microservices/pricer/.dockerignore b/__DECO__/microservices/pricer/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/__DECO__/microservices/pricer/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/__DECO__/microservices/pricer/Dockerfile b/__DECO__/microservices/pricer/Dockerfile deleted file mode 100644 index 33e3bc2..0000000 --- a/__DECO__/microservices/pricer/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM python:3.12-slim - -COPY requirements.txt / - -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy - -RUN mkdir -p /logs /config - -SHELL ["/bin/bash", "-c"] - -ENV PYTHONPATH=/ - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/__DECO__/microservices/pricer/entrypoint.sh b/__DECO__/microservices/pricer/entrypoint.sh deleted file mode 100755 index d0dc929..0000000 --- a/__DECO__/microservices/pricer/entrypoint.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -LogDir=/logs - -Cmd="python3.12" -Cmd+=" cvttpy/apps/microservices/pricer/pricer.py" - -Cmd+=" --config=${CONFIG_FILE:-/config/cvtt_musvc.cfg}" -Cmd+=" --log_file=${LogDir}/${PXER_LOG_FILE:-%T.pricer.log}" - -Cmd+=" ${PXER_ADD_ARGS}" -echo ${Cmd} -exec ${Cmd} - diff --git a/__DECO__/microservices/pricer/requirements.txt b/__DECO__/microservices/pricer/requirements.txt deleted file mode 100644 index e840a84..0000000 --- a/__DECO__/microservices/pricer/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/__DECO__/microservices/quant/.dockerignore b/__DECO__/microservices/quant/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/__DECO__/microservices/quant/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/__DECO__/microservices/quant/Dockerfile b/__DECO__/microservices/quant/Dockerfile deleted file mode 100644 index 33e3bc2..0000000 --- a/__DECO__/microservices/quant/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM python:3.12-slim - -COPY requirements.txt / - -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy - -RUN mkdir -p /logs /config - -SHELL ["/bin/bash", "-c"] - -ENV PYTHONPATH=/ - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/__DECO__/microservices/quant/entrypoint.sh b/__DECO__/microservices/quant/entrypoint.sh deleted file mode 100755 index 7b402d9..0000000 --- a/__DECO__/microservices/quant/entrypoint.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -LogDir=/logs - -Cmd="python3.12" -Cmd+=" cvttpy/apps/microservices/quant/quant.py" - -Cmd+=" --config=${CONFIG_FILE:-/config/cvtt_musvc.cfg}" -Cmd+=" --log_file=${LogDir}/${QUANT_LOG_FILE}" - -Cmd+=" ${QUANT_ADD_ARGS}" -echo ${Cmd} -exec ${Cmd} - diff --git a/__DECO__/microservices/quant/requirements.txt b/__DECO__/microservices/quant/requirements.txt deleted file mode 100644 index e840a84..0000000 --- a/__DECO__/microservices/quant/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/__DECO__/microservices/risk_manager/.dockerignore b/__DECO__/microservices/risk_manager/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/__DECO__/microservices/risk_manager/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/__DECO__/microservices/risk_manager/Dockerfile b/__DECO__/microservices/risk_manager/Dockerfile deleted file mode 100644 index 33e3bc2..0000000 --- a/__DECO__/microservices/risk_manager/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM python:3.12-slim - -COPY requirements.txt / - -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy - -RUN mkdir -p /logs /config - -SHELL ["/bin/bash", "-c"] - -ENV PYTHONPATH=/ - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/__DECO__/microservices/risk_manager/entrypoint.sh b/__DECO__/microservices/risk_manager/entrypoint.sh deleted file mode 100755 index 5c68875..0000000 --- a/__DECO__/microservices/risk_manager/entrypoint.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -LogDir=/logs - -Cmd="python3.12" -Cmd+=" cvttpy/apps/microservices/risk_manager/risk_manager.py" - -Cmd+=" --config=${CONFIG_FILE}" -Cmd+=" --log_file=${LogDir}/${RMGR_LOG_FILE}" - -Cmd+=" ${RMGR_ADD_ARGS}" -echo ${Cmd} -exec ${Cmd} - diff --git a/__DECO__/microservices/risk_manager/requirements.txt b/__DECO__/microservices/risk_manager/requirements.txt deleted file mode 100644 index e840a84..0000000 --- a/__DECO__/microservices/risk_manager/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/__DECO__/microservices/trader/.dockerignore b/__DECO__/microservices/trader/.dockerignore deleted file mode 100644 index a4f7c14..0000000 --- a/__DECO__/microservices/trader/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git -**/__pycache__ -.pipenv \ No newline at end of file diff --git a/__DECO__/microservices/trader/Dockerfile b/__DECO__/microservices/trader/Dockerfile deleted file mode 100644 index 33e3bc2..0000000 --- a/__DECO__/microservices/trader/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM python:3.12-slim - -COPY requirements.txt / - -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy - -RUN mkdir -p /logs /config - -SHELL ["/bin/bash", "-c"] - -ENV PYTHONPATH=/ - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/__DECO__/microservices/trader/entrypoint.sh b/__DECO__/microservices/trader/entrypoint.sh deleted file mode 100755 index 872c3e7..0000000 --- a/__DECO__/microservices/trader/entrypoint.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -LogDir=/logs - -Cmd="python3.12" -Cmd+=" cvttpy/apps/microservices/trader/trader.py" - -Cmd+=" --config=${CONFIG_FILE:-/config/cvtt_musvc.cfg}" -Cmd+=" --log_file=${LogDir}/${TRDR_LOG_FILE}" - -Cmd+=" ${TRDR_ADD_ARGS}" -echo ${Cmd} -exec ${Cmd} - diff --git a/__DECO__/microservices/trader/requirements.txt b/__DECO__/microservices/trader/requirements.txt deleted file mode 100644 index e840a84..0000000 --- a/__DECO__/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/__DECO__/trading_simulator/Dockerfile b/__DECO__/trading_simulator/Dockerfile deleted file mode 100644 index 26381be..0000000 --- a/__DECO__/trading_simulator/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM python:3.12-slim - -COPY requirements.txt / - -RUN pip install --upgrade pip --root-user-action=ignore -RUN pip install -r /requirements.txt --root-user-action=ignore - -COPY cvttpy /cvttpy - -RUN mkdir -p /logs /config /data - -SHELL ["/bin/bash", "-c"] - -ENV PYTHONPATH=/ - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/__DECO__/trading_simulator/VERSION b/__DECO__/trading_simulator/VERSION deleted file mode 100644 index 8a9ecc2..0000000 --- a/__DECO__/trading_simulator/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.1 \ No newline at end of file diff --git a/__DECO__/trading_simulator/build.sh b/__DECO__/trading_simulator/build.sh deleted file mode 100755 index f3ff95f..0000000 --- a/__DECO__/trading_simulator/build.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash - -# --- Settings -RegistryService=cloud21.cvtt.vpn:5500 -ImageName=trading_simulator -BashFunctionCode=$(realpath $(dirname ${0}))/../dckr_bld_functions.sh -ImageVersion=$(cat $(realpath $(dirname ${0}))/VERSION) -# --- Settings - -usage() { - echo "Usage: $0 -L : [-V ] " - exit 1 -} - - -# ---------------- cmdline -while getopts "I:V:L:" opt; do - case ${opt} in - V ) - ImageVersion=$OPTARG - ;; - L ) - Library=$OPTARG - ;; - \? ) - echo "Invalid option: -$OPTARG" >&2 - usage - ;; - : ) - echo "Option -$OPTARG requires an argument." >&2 - usage - ;; - esac -done -# ---------------- cmdline - -if [ "${ImageName}" == "" ] -then - usage -fi - -if [ "${ImageVersion}" == "" ] -then - usage -fi - -DockerDir=$(realpath $(dirname ${0})/${ImageName}) -cd ${DockerDir} - -Project= -ProjectVersion= -if [ "${Library}" != "" ] ; then - IFS=':' read -ra parts <<< "${Library}" - Project=${parts[0]} - ProjectVersion=${parts[1]} -fi -# exit - -build_musvc_image() { - ImageName=${1} - Project=${2} - ProjectVersion=${3} - - DockerDir=$(realpath $(dirname ${0})) - cd ${DockerDir} - - if [ "${Project}" != "" ]; then - get_project_version ${Project} ${ProjectVersion} - fi - - function cleanup { - cd ${DockerDir} - rm -rf cvttpy - } - trap cleanup RETURN - - build_docker_image ${ImageName} ${RegistryService} ${ImageVersion} ${Project} ${ProjectVersion} -} - - -source ${BashFunctionCode} -build_musvc_image ${ImageName} ${Project} ${ProjectVersion} - -# echo "**** D E B U G E X I T" && exit -echo "***** ${0} D O N E" - - diff --git a/__DECO__/trading_simulator/deployment/.env b/__DECO__/trading_simulator/deployment/.env deleted file mode 100644 index cbd54d7..0000000 --- a/__DECO__/trading_simulator/deployment/.env +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index cb5f270..0000000 --- a/__DECO__/trading_simulator/deployment/config/simulation.cfg +++ /dev/null @@ -1,131 +0,0 @@ -@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 deleted file mode 100644 index f67dc63..0000000 --- a/__DECO__/trading_simulator/deployment/docker-compose.yml +++ /dev/null @@ -1,16 +0,0 @@ -# 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/__DECO__/trading_simulator/entrypoint.sh b/__DECO__/trading_simulator/entrypoint.sh deleted file mode 100755 index fc5940b..0000000 --- a/__DECO__/trading_simulator/entrypoint.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -LogDir=/logs - -Cmd="python3.12" -Cmd+=" cvttpy/apps/trading_simulator/main.py" - -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+=" ${TRDSIM_ADD_ARGS}" -echo ${Cmd} -exec ${Cmd} - diff --git a/__DECO__/trading_simulator/requirements.txt b/__DECO__/trading_simulator/requirements.txt deleted file mode 100644 index 975615c..0000000 --- a/__DECO__/trading_simulator/requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -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/market_data/alpaca_hbar/Dockerfile b/market_data/alpaca_hbar/Dockerfile index 137b78e..e850297 100644 --- a/market_data/alpaca_hbar/Dockerfile +++ b/market_data/alpaca_hbar/Dockerfile @@ -24,7 +24,6 @@ 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 mkdir -p /data RUN mkdir /logs