Compare commits
36 Commits
v0.0.7
...
25073c2696
| Author | SHA1 | Date | |
|---|---|---|---|
| 25073c2696 | |||
| 235b906a94 | |||
| e898d0c8e4 | |||
| c0bb8616f5 | |||
| 5e8bc4cf5d | |||
| 6ca68092de | |||
| 9bebe14e40 | |||
| bbcc5a9541 | |||
| 0cb9eeafd2 | |||
| 25a262b01f | |||
| fe1f229744 | |||
| 6dd31615c5 | |||
| d0079d6f56 | |||
| 930981b260 | |||
| b78304b620 | |||
| 87ae8f229c | |||
| ffbf50606c | |||
| 62d76b0f85 | |||
| 3e1a22d572 | |||
| 27153fcd3c | |||
| 4e41960cc4 | |||
| d09732de33 | |||
| b79d3c3f04 | |||
| 0502a687ed | |||
| 863f09d0b9 | |||
| 8beacf9917 | |||
| 510fcfe348 | |||
| 1b73f38627 | |||
| 9981d649be | |||
| 421d5310ec | |||
| 9586af2566 | |||
| ef77f6012a | |||
| f9e29ec555 | |||
| 98146f0fc0 | |||
| 539034a93c | |||
| 06a473dbc4 |
@@ -1,74 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
echo "Script $0 does not work yet. Aborted" && exit
|
|
||||||
|
|
||||||
function usage {
|
|
||||||
echo "Usage: ${0} <app_path (e.g. market_data/md_recorder_monitor)> <version>"
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
AppPath=${1}
|
|
||||||
CvttpyVersion=${2}
|
|
||||||
|
|
||||||
if [ "${AppPath}" == "" ]
|
|
||||||
then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --- Settings
|
|
||||||
DockerDir=$(realpath $(dirname ${0})/${AppPath})
|
|
||||||
RootDir=$(realpath $(dirname ${0})/..)
|
|
||||||
RegistryService=cloud21.cvtt.vpn:5500
|
|
||||||
|
|
||||||
AppName=$(basename ${AppPath})
|
|
||||||
|
|
||||||
ImageName=${AppName}
|
|
||||||
ImageDir=${HOME}/docker_images
|
|
||||||
mkdir -p ${ImageDir}
|
|
||||||
|
|
||||||
Version=$(cat ${RootDir}/cvttpy/release_version.txt | awk -F, '{print $1}')
|
|
||||||
|
|
||||||
cd ${RootDir}
|
|
||||||
|
|
||||||
# Create a new builder instance
|
|
||||||
Cmd="docker buildx create --name ${AppName}_builder"
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd} || exit
|
|
||||||
|
|
||||||
# Switch to the newly created builder
|
|
||||||
Cmd="docker buildx use ${AppName}_builder"
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
# Ensure buildx is bootstrapped
|
|
||||||
Cmd="docker buildx inspect ${AppName}_builder --bootstrap"
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
# Build the image using buildx, tagging with both 'latest' and the version number, and pushing directly
|
|
||||||
Cmd="docker buildx build --platform linux/amd64,linux/arm64 -t ${ImageName}:latest -t ${ImageName}:${Version} -f ${DockerDir}/Dockerfile . --push"
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
# Tagging the images with the registry
|
|
||||||
Cmd="docker tag ${ImageName}:latest ${RegistryService}/${ImageName}:latest"
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
Cmd="docker tag ${ImageName}:${Version} ${RegistryService}/${ImageName}:${Version}"
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
# Push the images to the registry
|
|
||||||
Cmd="docker push ${RegistryService}/${ImageName}:latest"
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
Cmd="docker push ${RegistryService}/${ImageName}:${Version}"
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
# Optionally, remove the builder to clean up
|
|
||||||
Cmd="docker buildx rm ${AppName}_builder"
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
@@ -25,7 +25,7 @@ ImageDir=${HOME}/docker_images
|
|||||||
mkdir -p ${ImageDir}
|
mkdir -p ${ImageDir}
|
||||||
|
|
||||||
|
|
||||||
Version=$(cat ${RootDir}/${Project}/release_version.txt | awk -F, '{print $1}')
|
Version=$(cat ${RootDir}/${Project}/VERSION | awk -F, '{print $1}')
|
||||||
# Version=${ProjectVersion}
|
# Version=${ProjectVersion}
|
||||||
|
|
||||||
cd ${RootDir}
|
cd ${RootDir}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
## Build
|
## Build
|
||||||
```bash
|
```bash
|
||||||
TgtHostname=cloud16.cvtt.vpn
|
TgtHostname=cloud16.cvtt.vpn
|
||||||
Version=$(cat cvttpy/release_version.txt)
|
Version=$(cat cvttpy/VERSION)
|
||||||
|
|
||||||
cd /home/oleg/develop/cvtt2
|
cd /home/oleg/develop/cvtt2
|
||||||
docker build -t config_service -t config_service:${Version} -f cvttpy/utils/docker/config_service/Dockerfile .
|
docker build -t config_service -t config_service:${Version} -f cvttpy/utils/docker/config_service/Dockerfile .
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ COPY ${FROM_DIR}/alpaca_hbar.sh /alpaca_hbar.sh
|
|||||||
|
|
||||||
COPY docker_dev/shared/id_rsa /root/.ssh/id_rsa
|
COPY docker_dev/shared/id_rsa /root/.ssh/id_rsa
|
||||||
COPY docker_dev/shared/id_rsa.pub /root/.ssh/id_rsa.pub
|
COPY docker_dev/shared/id_rsa.pub /root/.ssh/id_rsa.pub
|
||||||
COPY docker_dev/shared/known_hosts /root/.ssh/known_hosts
|
|
||||||
|
|
||||||
RUN chmod 600 /root/.ssh/id_rsa /root/.ssh/id_rsa.pub /root/.ssh/known_hosts
|
RUN chmod 600 /root/.ssh/id_rsa /root/.ssh/id_rsa.pub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Shared Volumes
|
# Shared Volumes
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ mkdir -p ${LogDir}
|
|||||||
|
|
||||||
echo "CommandLine: ${*}"
|
echo "CommandLine: ${*}"
|
||||||
|
|
||||||
export CalendarURL=http://cloud23.cvtt.vpn:8000/api/v1/markets/hours?mic=XNYS
|
export CalendarURL=https://trading-calendar.cvtt.net/api/v1/markets/hours?mic=XNYS
|
||||||
|
|
||||||
|
|
||||||
if [ -z ${Start} ] ; then
|
if [ -z ${Start} ] ; then
|
||||||
@@ -93,13 +93,15 @@ done
|
|||||||
|
|
||||||
Source=/data/
|
Source=/data/
|
||||||
Targets=
|
Targets=
|
||||||
Targets="${Targets} cvtt@homestore.cvtt.vpn:/works/cvtt/md_archive/equity"
|
Targets="${Targets} cvtt@hs01.cvtt.vpn:/works/cvtt/md_archive/equity"
|
||||||
Targets="${Targets} cvtt@cloud21.cvtt.vpn:/opt/store/cvtt/md_archive/equity"
|
Targets="${Targets} cvtt@cloud21.cvtt.vpn:/opt/store/cvtt/md_archive/equity"
|
||||||
|
|
||||||
|
|
||||||
for tgt in ${Targets}
|
for tgt in ${Targets}
|
||||||
do
|
do
|
||||||
Cmd="/usr/bin/rsync -ahv ${Source} ${tgt}"
|
Cmd="/usr/bin/rsync -ahv"
|
||||||
|
Cmd+=" -e 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'"
|
||||||
|
Cmd+=" ${Source} ${tgt}"
|
||||||
echo $Cmd
|
echo $Cmd
|
||||||
eval $Cmd
|
eval $Cmd
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -21,9 +21,8 @@ COPY ${FROM_DIR}/alpaca_qat.sh /alpaca_qat.sh
|
|||||||
|
|
||||||
COPY docker_dev/shared/id_rsa /root/.ssh/id_rsa
|
COPY docker_dev/shared/id_rsa /root/.ssh/id_rsa
|
||||||
COPY docker_dev/shared/id_rsa.pub /root/.ssh/id_rsa.pub
|
COPY docker_dev/shared/id_rsa.pub /root/.ssh/id_rsa.pub
|
||||||
COPY docker_dev/shared/known_hosts /root/.ssh/known_hosts
|
|
||||||
|
|
||||||
RUN chmod 600 /root/.ssh/id_rsa /root/.ssh/id_rsa.pub /root/.ssh/known_hosts
|
RUN chmod 600 /root/.ssh/id_rsa /root/.ssh/id_rsa.pub
|
||||||
|
|
||||||
|
|
||||||
# Shared Volumes
|
# Shared Volumes
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ mkdir -p ${LogDir}
|
|||||||
|
|
||||||
echo "CommandLine: ${*}"
|
echo "CommandLine: ${*}"
|
||||||
|
|
||||||
export CalendarURL=http://cloud23.cvtt.vpn:8000/api/v1/markets/hours?mic=XNYS
|
export CalendarURL=https://trading-calendar.cvtt.net/api/v1/markets/hours?mic=XNYS
|
||||||
|
|
||||||
|
|
||||||
if [ -z ${Start} ] ; then
|
if [ -z ${Start} ] ; then
|
||||||
@@ -95,13 +95,15 @@ done
|
|||||||
|
|
||||||
Source=/data/
|
Source=/data/
|
||||||
Targets=
|
Targets=
|
||||||
Targets="${Targets} cvtt@homestore.cvtt.vpn:/works/cvtt/md_archive/equity"
|
Targets="${Targets} cvtt@hs01.cvtt.vpn:/works/cvtt/md_archive/equity"
|
||||||
Targets="${Targets} cvtt@cloud21.cvtt.vpn:/opt/store/cvtt/md_archive/equity"
|
Targets="${Targets} cvtt@cloud21.cvtt.vpn:/opt/store/cvtt/md_archive/equity"
|
||||||
|
|
||||||
|
|
||||||
for tgt in ${Targets}
|
for tgt in ${Targets}
|
||||||
do
|
do
|
||||||
Cmd="/usr/bin/rsync -ahv ${Source} ${tgt}"
|
Cmd="/usr/bin/rsync -ahv"
|
||||||
|
Cmd+=" -e 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'"
|
||||||
|
Cmd+=" ${Source} ${tgt}"
|
||||||
echo $Cmd
|
echo $Cmd
|
||||||
eval $Cmd
|
eval $Cmd
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ COPY ${FROM_DIR}/requirements.txt /
|
|||||||
|
|
||||||
|
|
||||||
COPY cvttpy /cvttpy
|
COPY cvttpy /cvttpy
|
||||||
COPY ${FROM_DIR}/.creds /.creds
|
|
||||||
COPY ${FROM_DIR}/crypto_md_day.sh /crypto_md_day.sh
|
COPY ${FROM_DIR}/crypto_md_day.sh /crypto_md_day.sh
|
||||||
|
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
RUN pip install --upgrade pip --root-user-action=ignore
|
||||||
@@ -19,9 +18,8 @@ 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 /root/.ssh/id_rsa
|
||||||
COPY docker_dev/shared/id_rsa.pub /root/.ssh/id_rsa.pub
|
COPY docker_dev/shared/id_rsa.pub /root/.ssh/id_rsa.pub
|
||||||
COPY docker_dev/shared/known_hosts /root/.ssh/known_hosts
|
|
||||||
|
|
||||||
RUN chmod 600 /root/.ssh/id_rsa /root/.ssh/id_rsa.pub /root/.ssh/known_hosts
|
RUN chmod 600 /root/.ssh/id_rsa /root/.ssh/id_rsa.pub
|
||||||
|
|
||||||
|
|
||||||
# Shared Volumes
|
# Shared Volumes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Build/Dev Host
|
# Build/Dev Host
|
||||||
## Build
|
## Build
|
||||||
```bash
|
```bash
|
||||||
Version=$(cat /home/oleg/develop/cvtt2/cvttpy/release_version.txt)
|
Version=$(cat /home/oleg/develop/cvtt2/cvttpy/VERSION)
|
||||||
|
|
||||||
cd /home/oleg/develop/cvtt2
|
cd /home/oleg/develop/cvtt2
|
||||||
docker build -t crypto_md_day -t crypto_md_day:${Version} -f docker_dev/crypto_md_day/Dockerfile .
|
docker build -t crypto_md_day -t crypto_md_day:${Version} -f docker_dev/crypto_md_day/Dockerfile .
|
||||||
|
|||||||
@@ -51,16 +51,16 @@ fi
|
|||||||
export PYTHONPATH=/
|
export PYTHONPATH=/
|
||||||
|
|
||||||
Cmd="python3.12"
|
Cmd="python3.12"
|
||||||
Cmd="${Cmd} cvttpy/research/utils/archive_ts_md.py"
|
Cmd+=" cvttpy/research/utils/archive_ts_md.py"
|
||||||
Cmd="${Cmd} --config=http://cloud23.cvtt.vpn:6789/apps/md_recorder"
|
Cmd+=" --config=http://cloud16.cvtt.vpn:6789/apps/md_recorder"
|
||||||
Cmd="${Cmd} --db_credentials_key=${CredKey}"
|
Cmd+=" --db_credentials_key=${CredKey}"
|
||||||
Cmd="${Cmd} --credentials_file=/.creds"
|
Cmd+=" --credentials_file=/.creds"
|
||||||
Cmd="${Cmd} --date=${Date}"
|
Cmd+=" --date=${Date}"
|
||||||
Cmd="${Cmd} --schemas=${Schemas}"
|
Cmd+=" --schemas=${Schemas}"
|
||||||
Cmd="${Cmd} --root_dir=/app/data/${DbHost}"
|
Cmd+=" --root_dir=/app/data/${DbHost}"
|
||||||
Cmd="${Cmd} --format=SQLite"
|
Cmd+=" --format=SQLite"
|
||||||
Cmd="${Cmd} --compress"
|
Cmd+=" --compress"
|
||||||
# Cmd="${Cmd} --log_file=/logs/%T.crypto_md_day.log"
|
# Cmd+=" --log_file=/logs/%T.crypto_md_day.log"
|
||||||
|
|
||||||
echo ${Cmd}
|
echo ${Cmd}
|
||||||
eval ${Cmd}
|
eval ${Cmd}
|
||||||
@@ -69,13 +69,14 @@ echo "Data Sync"
|
|||||||
|
|
||||||
Source=/app/data/
|
Source=/app/data/
|
||||||
Targets=
|
Targets=
|
||||||
Targets="${Targets} cvtt@homestore.cvtt.vpn:/works/cvtt/md_archive/crypto"
|
|
||||||
Targets="${Targets} cvtt@cloud21.cvtt.vpn:/opt/store/cvtt/md_archive/crypto"
|
Targets="${Targets} cvtt@cloud21.cvtt.vpn:/opt/store/cvtt/md_archive/crypto"
|
||||||
|
Targets="${Targets} cvtt@hs01.cvtt.vpn:/works/cvtt/md_archive/crypto"
|
||||||
|
|
||||||
for tgt in ${Targets}
|
for tgt in ${Targets}
|
||||||
do
|
do
|
||||||
Cmd="/usr/bin/rsync -ahv ${Source} ${tgt}"
|
Cmd="/usr/bin/rsync -ahv"
|
||||||
|
Cmd+=" -e 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'"
|
||||||
|
Cmd+=" ${Source} ${tgt}"
|
||||||
echo $Cmd
|
echo $Cmd
|
||||||
eval $Cmd
|
eval $Cmd
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ RUN pip install --upgrade pip --root-user-action=ignore
|
|||||||
RUN pip install -r /requirements.txt --root-user-action=ignore
|
RUN pip install -r /requirements.txt --root-user-action=ignore
|
||||||
|
|
||||||
COPY cvttpy /cvttpy
|
COPY cvttpy /cvttpy
|
||||||
# COPY ${FROM_DIR}/.creds /.creds
|
|
||||||
COPY ${FROM_DIR}/run_md_recorder.sh /run_md_recorder.sh
|
COPY ${FROM_DIR}/run_md_recorder.sh /run_md_recorder.sh
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ if ! is_valid "${job}"; then
|
|||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ConfigServer=cloud23.cvtt.vpn:6789
|
ConfigServer=cloud16.cvtt.vpn:6789
|
||||||
|
|
||||||
Cmd="python3.12"
|
Cmd="python3.12"
|
||||||
Cmd="${Cmd} cvttpy/apps/md/md_recorder.py"
|
Cmd="${Cmd} cvttpy/apps/md/md_recorder.py"
|
||||||
@@ -36,27 +36,27 @@ Cmd="${Cmd} --compress_log"
|
|||||||
Cmd="${Cmd} --instrument_group=${job}"
|
Cmd="${Cmd} --instrument_group=${job}"
|
||||||
Cmd="${Cmd} --log_file=/logs/%T.MD_REC.${job}.log"
|
Cmd="${Cmd} --log_file=/logs/%T.MD_REC.${job}.log"
|
||||||
if [ "${job}" == "BNBFUT_CLD21" ] ; then
|
if [ "${job}" == "BNBFUT_CLD21" ] ; then
|
||||||
Cmd="${Cmd} --active_exchanges=BNBFUT"
|
Cmd="${Cmd} --exch_acct_cfgname=BNBFUT"
|
||||||
Cmd="${Cmd} --db_credentials_key=TSDB_MD_CLD21"
|
Cmd="${Cmd} --db_credentials_key=TSDB_MD_CLD21"
|
||||||
Cmd="${Cmd} --admin_port=7201"
|
Cmd="${Cmd} --admin_port=7201"
|
||||||
elif [ "${job}" == "COINBASE_CLD21" ] ; then
|
elif [ "${job}" == "COINBASE_CLD21" ] ; then
|
||||||
Cmd="${Cmd} --active_exchanges=COINBASE_AT"
|
Cmd="${Cmd} --exch_acct_cfgname=COINBASE_AT"
|
||||||
Cmd="${Cmd} --db_credentials_key=TSDB_MD_CLD21"
|
Cmd="${Cmd} --db_credentials_key=TSDB_MD_CLD21"
|
||||||
Cmd="${Cmd} --admin_port=7202"
|
Cmd="${Cmd} --admin_port=7202"
|
||||||
elif [ "${job}" == "BNBSPOT_CLD21" ] ; then
|
elif [ "${job}" == "BNBSPOT_CLD21" ] ; then
|
||||||
Cmd="${Cmd} --active_exchanges=BNBSPOT"
|
Cmd="${Cmd} --exch_acct_cfgname=BNBSPOT"
|
||||||
Cmd="${Cmd} --db_credentials_key=TSDB_MD_CLD21"
|
Cmd="${Cmd} --db_credentials_key=TSDB_MD_CLD21"
|
||||||
Cmd="${Cmd} --admin_port=7203"
|
Cmd="${Cmd} --admin_port=7203"
|
||||||
elif [ "${job}" == "BNBSPOT_CVTTDATA" ] ; then
|
elif [ "${job}" == "BNBSPOT_CVTTDATA" ] ; then
|
||||||
Cmd="${Cmd} --active_exchanges=BNBSPOT"
|
Cmd="${Cmd} --exch_acct_cfgname=BNBSPOT"
|
||||||
Cmd="${Cmd} --db_credentials_key=TSDB_MD_CVTTDATA"
|
Cmd="${Cmd} --db_credentials_key=TSDB_MD_CVTTDATA"
|
||||||
Cmd="${Cmd} --admin_port=7204"
|
Cmd="${Cmd} --admin_port=7204"
|
||||||
elif [ "${job}" == "BNBFUT_CVTTDATA" ] ; then
|
elif [ "${job}" == "BNBFUT_CVTTDATA" ] ; then
|
||||||
Cmd="${Cmd} --active_exchanges=BNBFUT"
|
Cmd="${Cmd} --exch_acct_cfgname=BNBFUT"
|
||||||
Cmd="${Cmd} --db_credentials_key=TSDB_MD_CVTTDATA"
|
Cmd="${Cmd} --db_credentials_key=TSDB_MD_CVTTDATA"
|
||||||
Cmd="${Cmd} --admin_port=7205"
|
Cmd="${Cmd} --admin_port=7205"
|
||||||
elif [ "${job}" == "COINBASE_CVTTDATA" ] ; then
|
elif [ "${job}" == "COINBASE_CVTTDATA" ] ; then
|
||||||
Cmd="${Cmd} --active_exchanges=COINBASE_AT"
|
Cmd="${Cmd} --exch_acct_cfgname=COINBASE_AT"
|
||||||
Cmd="${Cmd} --db_credentials_key=TSDB_MD_CVTTDATA"
|
Cmd="${Cmd} --db_credentials_key=TSDB_MD_CVTTDATA"
|
||||||
Cmd="${Cmd} --admin_port=7206"
|
Cmd="${Cmd} --admin_port=7206"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ if [ "${2}" != "" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
ConfigServer=cloud23.cvtt.vpn:6789
|
ConfigServer=cloud16.cvtt.vpn:6789
|
||||||
|
|
||||||
Cmd="python3.12"
|
Cmd="python3.12"
|
||||||
Cmd="${Cmd} cvttpy/apps/md/md_rec_monitor.py"
|
Cmd="${Cmd} cvttpy/apps/md/md_rec_monitor.py"
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"__dummy": null
|
||||||
|
, "INFISICAL": {
|
||||||
|
"url": "https://infisical.cvtt.net"
|
||||||
|
, "client_id": "e330a1c4-08dc-452f-ac02-5b37fff4ab3e"
|
||||||
|
, "client_secret": "190554828c3c342f63517320ac029f822b6358aa6187aec266465d0bde4d6b3c"
|
||||||
|
, "workspace_id": "6923c950-8473-4cec-818f-10df41d8b39c"
|
||||||
|
, "environment": "dev"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
FROM python:3.12-slim
|
FROM python:3.12-slim
|
||||||
|
ARG FROM_DIR=docker_dev/market_data/relative_liquidity
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
COPY docker_dev/relative_liquidity/requirements.txt /
|
COPY ${FROM_DIR}/.creds /.creds
|
||||||
|
COPY ${FROM_DIR}/requirements.txt /requirements.txt
|
||||||
|
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
RUN pip install --upgrade pip --root-user-action=ignore
|
||||||
RUN pip install -r /requirements.txt --root-user-action=ignore
|
RUN pip install -r /requirements.txt --root-user-action=ignore
|
||||||
|
|
||||||
@@ -12,22 +15,12 @@ RUN mkdir -p /app/data
|
|||||||
RUN mkdir /logs
|
RUN mkdir /logs
|
||||||
|
|
||||||
ENV PYTHONPATH=/
|
ENV PYTHONPATH=/
|
||||||
CMD [ \
|
CMD [ \
|
||||||
"python3.12", \
|
"python3.12", \
|
||||||
"cvttpy/apps/md/rel_lqdt_server.py", \
|
"cvttpy/apps/md/rel_lqdt_server.py", \
|
||||||
"--port=5678", \
|
"--config=http://cloud16.cvtt.vpn:6789/apps/minimal_md_eqt", \
|
||||||
|
"--credentials_file=/.creds", \
|
||||||
|
"--port=5678", \
|
||||||
"--db_file=/app/data/rel_liquidity.db", \
|
"--db_file=/app/data/rel_liquidity.db", \
|
||||||
"--log_file=/logs/%T.REL_LIQUIDITY_SVC.log" \
|
"--log_file=/logs/%D.REL_LIQUIDITY_SVC.log" \
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
# Cmd="docker run"
|
|
||||||
# Cmd="${Cmd} -d"
|
|
||||||
# Cmd="${Cmd} --rm"
|
|
||||||
# Cmd="${Cmd} --pull=always"
|
|
||||||
# Cmd="${Cmd} --name=relative_liquidity_svc"
|
|
||||||
# Cmd="${Cmd} -p 5678:5678"
|
|
||||||
# Cmd="${Cmd} -v /home/cvtt/prod/data:/app/data"
|
|
||||||
# Cmd="${Cmd} -v /home/cvtt/prod/logs:/logs"
|
|
||||||
# Cmd="${Cmd} cloud21.cvtt.vpn:5500/relative_liquidity:latest"
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ nest-asyncio>=1.5.5
|
|||||||
numpy>=1.24.1
|
numpy>=1.24.1
|
||||||
hjson>=3.1.0
|
hjson>=3.1.0
|
||||||
pandas>=1.5.3
|
pandas>=1.5.3
|
||||||
# sortedcontainers>=2.4.0
|
sortedcontainers>=2.4.0
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
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.3
|
||||||
|
|
||||||
|
# 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=
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
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"]
|
||||||
Executable
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#!/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}
|
||||||
|
|
||||||
@@ -5,3 +5,5 @@ sortedcontainers>=2.4.0
|
|||||||
redis>=5.0.8
|
redis>=5.0.8
|
||||||
python-dateutil>=2.8.2
|
python-dateutil>=2.8.2
|
||||||
types-python-dateutil>=2.8.19.6
|
types-python-dateutil>=2.8.19.6
|
||||||
|
cryptography>=43.0.0
|
||||||
|
PyJWT>=2.10.1
|
||||||
Executable
+97
@@ -0,0 +1,97 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# --- Settings
|
||||||
|
RegistryService=cloud21.cvtt.vpn:5500
|
||||||
|
ValidImages=(md_gateway oe_gateway ac_gateway pricer coordinator)
|
||||||
|
# --- Settings
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 -I <image_name> -V <image_version> -L <library>:<library_version>"
|
||||||
|
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=$(realpath $(dirname ${0})/${ImageName})
|
||||||
|
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 $(realpath $(dirname ${0}))/mu_svc_functions.sh # ASSUMED same directory
|
||||||
|
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 "**** D E B U G E X I T" && exit
|
||||||
|
echo "***** ${0} D O N E"
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
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"]
|
||||||
Executable
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
LogDir=/logs
|
||||||
|
|
||||||
|
Cmd="python3.12"
|
||||||
|
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}
|
||||||
|
|
||||||
@@ -5,3 +5,5 @@ sortedcontainers>=2.4.0
|
|||||||
redis>=5.0.8
|
redis>=5.0.8
|
||||||
python-dateutil>=2.8.2
|
python-dateutil>=2.8.2
|
||||||
types-python-dateutil>=2.8.19.6
|
types-python-dateutil>=2.8.19.6
|
||||||
|
cryptography>=43.0.0
|
||||||
|
PyJWT>=2.10.1
|
||||||
@@ -1,52 +1,102 @@
|
|||||||
version: "3.9"
|
# CVTT Microservices
|
||||||
|
|
||||||
services:
|
services:
|
||||||
md_gateway:
|
coordinator:
|
||||||
image: cloud21.cvtt.vpn:5500/md_gateway:latest
|
image: cloud21.cvtt.vpn:5500/coordinator:${CVTT_VERSION}
|
||||||
container_name: md_gateway
|
container_name: cvtt-coordinator
|
||||||
|
pull_policy: always
|
||||||
|
user: ${CVTT_USER:-1001:1001}
|
||||||
environment:
|
environment:
|
||||||
- REDIS_HOST=redis
|
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
|
||||||
|
# - riskmgr
|
||||||
|
- 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}
|
||||||
|
COORD_LOG_FILE: ${COORD_LOG_FILE:-%T.pricer.log}
|
||||||
|
COORD_ADD_ARGS: ${COORD_ADD_ARGS:-}
|
||||||
|
volumes:
|
||||||
|
- ./config:/config
|
||||||
|
- ./logs:/logs
|
||||||
|
depends_on:
|
||||||
|
- md_gateway
|
||||||
|
- 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:
|
volumes:
|
||||||
- ./.creds:/.creds
|
|
||||||
- ./config:/config
|
- ./config:/config
|
||||||
- ./logs:/logs
|
- ./logs:/logs
|
||||||
- ./data:/data
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
|
|
||||||
tester:
|
oe_gateway:
|
||||||
image: cloud21.cvtt.vpn:5500/tester:latest
|
image: cloud21.cvtt.vpn:5500/oe_gateway:${CVTT_VERSION}
|
||||||
container_name: tester
|
container_name: oe_gateway
|
||||||
|
pull_policy: always
|
||||||
|
user: ${CVTT_USER:-1001:1001}
|
||||||
environment:
|
environment:
|
||||||
- REDIS_HOST=redis
|
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:
|
volumes:
|
||||||
- ./config:/config
|
- ./config:/config
|
||||||
- ./logs:/logs
|
- ./logs:/logs
|
||||||
- ./data:/data
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
- md_gateway
|
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:latest
|
image: redis:latest
|
||||||
container_name: redis
|
container_name: redis-cvtt
|
||||||
ports:
|
ports:
|
||||||
- "6379:6379"
|
- "16379:6379"
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/redis:/data
|
- ./data/redis:/data
|
||||||
|
|
||||||
|
|
||||||
# test_program:
|
|
||||||
# image: your_test_program_image:latest
|
|
||||||
# container_name: test_program
|
|
||||||
# environment:
|
|
||||||
# - REDIS_HOST=redis
|
|
||||||
# volumes:
|
|
||||||
# - ./config:/shared/config
|
|
||||||
# - ./logs:/shared/logs
|
|
||||||
# depends_on:
|
|
||||||
# - market_data_gateway
|
|
||||||
# - redis
|
|
||||||
|
|
||||||
# volumes:
|
|
||||||
# redis_data:
|
|
||||||
|
|||||||
@@ -1,25 +1,19 @@
|
|||||||
FROM python:3.12-slim
|
FROM python:3.12-slim
|
||||||
|
|
||||||
ARG ROOT_MCRSVC_DIR=docker_dev/microservices
|
COPY requirements.txt /
|
||||||
ARG FROM_DIR=${ROOT_MCRSVC_DIR}/md_gateway
|
|
||||||
|
|
||||||
COPY ${ROOT_MCRSVC_DIR}/requirements.txt /
|
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
RUN pip install --upgrade pip --root-user-action=ignore
|
||||||
RUN pip install -r /requirements.txt --root-user-action=ignore
|
RUN pip install -r /requirements.txt --root-user-action=ignore
|
||||||
|
|
||||||
COPY cvttpy /cvttpy
|
COPY cvttpy /cvttpy
|
||||||
# COPY ${ROOT_MCRSVC_DIR}/.creds /.creds
|
|
||||||
|
|
||||||
|
RUN mkdir -p /logs /config
|
||||||
|
|
||||||
COPY ${FROM_DIR}/run_mdgw.sh /run_mdgw.sh
|
|
||||||
RUN chmod +x /run_mdgw.sh
|
|
||||||
|
|
||||||
RUN mkdir /logs
|
|
||||||
RUN mkdir -p /config
|
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
SHELL ["/bin/bash", "-c"]
|
||||||
ENV PYTHONPATH=/
|
|
||||||
ENTRYPOINT [ "/run_mdgw.sh" ]
|
|
||||||
|
|
||||||
|
ENV PYTHONPATH=/
|
||||||
|
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|||||||
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
#!/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}
|
||||||
|
|
||||||
@@ -5,3 +5,5 @@ sortedcontainers>=2.4.0
|
|||||||
redis>=5.0.8
|
redis>=5.0.8
|
||||||
python-dateutil>=2.8.2
|
python-dateutil>=2.8.2
|
||||||
types-python-dateutil>=2.8.19.6
|
types-python-dateutil>=2.8.19.6
|
||||||
|
cryptography>=43.0.0
|
||||||
|
PyJWT>=2.10.1
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# runs in container
|
|
||||||
|
|
||||||
# runs on host to start container
|
|
||||||
usage() {
|
|
||||||
echo -n "Usage: ${0}"
|
|
||||||
echo -n " [-c <config (/config/cvtt.cfg)>]"
|
|
||||||
echo -n " [-a <admin_port (7220)>]"
|
|
||||||
echo -n " [-z (compress log)"]
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Config=/config/cvtt.cfg
|
|
||||||
AdminPort=7220
|
|
||||||
COMPRESS_LOG=false
|
|
||||||
|
|
||||||
|
|
||||||
while getopts "c:a:z" opt; do
|
|
||||||
case ${opt} in
|
|
||||||
c ) Config=$OPTARG ;;
|
|
||||||
a ) AdminPort=$OPTARG ;;
|
|
||||||
z ) COMPRESS_LOG=true ;;
|
|
||||||
\? )
|
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
: )
|
|
||||||
echo "Option -$OPTARG requires an argument." >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
Cmd="python3.12"
|
|
||||||
Cmd="${Cmd} cvttpy/apps/microservices/market_gateways/md_gateway.py"
|
|
||||||
Cmd="${Cmd} --config=${Config}"
|
|
||||||
Cmd="${Cmd} --credentials_file=/.creds"
|
|
||||||
Cmd="${Cmd} --admin_port=${AdminPort}"
|
|
||||||
Cmd="${Cmd} --log_file=/logs/%T.md_gateway.log"
|
|
||||||
if ${COMPRESS_LOG} ; then
|
|
||||||
Cmd="${Cmd} --compress_log"
|
|
||||||
fi
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
|
|
||||||
Executable
+76
@@ -0,0 +1,76 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
get_project_version() {
|
||||||
|
Project=${1}
|
||||||
|
Version=${2}
|
||||||
|
|
||||||
|
host="cloud21.cvtt.vpn"
|
||||||
|
port="22"
|
||||||
|
user="cvttdist"
|
||||||
|
rel_dir="/home/cvttdist/software/cvtt2"
|
||||||
|
|
||||||
|
if [ "${Version}" == "latest" ]; then
|
||||||
|
echo "Checking for latest version of ${Project} on ${user}@${host}:${rel_dir}"
|
||||||
|
Version=$(ssh -q -p ${port} ${user}@${host} "ls -tr ${rel_dir}/${Project} | tail -1" )
|
||||||
|
echo "Latest version is ${Version}"
|
||||||
|
fi
|
||||||
|
echo "Checking ${user}@${host} for ${rel_dir}/${Project}/${Version} ..."
|
||||||
|
if ssh -q -p ${port} ${user}@${host} "test -d ${rel_dir}/${Project}/${Version}"
|
||||||
|
then
|
||||||
|
echo "Version ${Version} found..."
|
||||||
|
rsync_cmd="rsync -ahv -e \"ssh -p ${port}\""
|
||||||
|
rsync_cmd="${rsync_cmd} ${user}@${host}:${rel_dir}/${Project}/${Version}/"
|
||||||
|
rsync_cmd="${rsync_cmd} ./"
|
||||||
|
echo ${rsync_cmd}
|
||||||
|
eval ${rsync_cmd}
|
||||||
|
status=$?
|
||||||
|
if [ ${status} -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "Loading successful..."
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Not Found ${rel_dir}/${Project}/${Version} on ${user}@${host}"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
build_docker_image() {
|
||||||
|
ImageName=${1}
|
||||||
|
RegistryService=${2}
|
||||||
|
Version=${3}
|
||||||
|
Project=${4}
|
||||||
|
ProjectVersion=${5}
|
||||||
|
|
||||||
|
Cmd="docker build"
|
||||||
|
if [ "${ProjectVersion}" != "" ]; then
|
||||||
|
Cmd+=" --label ${Project}=\"${ProjectVersion}\""
|
||||||
|
fi
|
||||||
|
Cmd+=" -t ${ImageName}"
|
||||||
|
Cmd+=" -t ${ImageName}:latest"
|
||||||
|
Cmd+=" -t ${ImageName}:${Version}"
|
||||||
|
Cmd+=" -f Dockerfile"
|
||||||
|
Cmd+=" ."
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd} || exit
|
||||||
|
|
||||||
|
Cmd="docker tag ${ImageName}:latest ${RegistryService}/${ImageName}:latest"
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd} || exit
|
||||||
|
|
||||||
|
Cmd="docker tag ${ImageName}:${Version} ${RegistryService}/${ImageName}:${Version}"
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd} || exit
|
||||||
|
|
||||||
|
Cmd="docker push ${RegistryService}/${ImageName}:latest"
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd} || exit
|
||||||
|
|
||||||
|
Cmd="docker push ${RegistryService}/${ImageName}:${Version}"
|
||||||
|
echo ${Cmd}
|
||||||
|
eval ${Cmd} || exit
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1,25 +1,19 @@
|
|||||||
FROM python:3.12-slim
|
FROM python:3.12-slim
|
||||||
|
|
||||||
ARG ROOT_MCRSVC_DIR=docker_dev/microservices
|
COPY requirements.txt /
|
||||||
ARG FROM_DIR=${ROOT_MCRSVC_DIR}/oe_gateway
|
|
||||||
|
|
||||||
COPY ${ROOT_MCRSVC_DIR}/requirements.txt /
|
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
RUN pip install --upgrade pip --root-user-action=ignore
|
||||||
RUN pip install -r /requirements.txt --root-user-action=ignore
|
RUN pip install -r /requirements.txt --root-user-action=ignore
|
||||||
|
|
||||||
COPY cvttpy /cvttpy
|
COPY cvttpy /cvttpy
|
||||||
COPY ${ROOT_MCRSVC_DIR}/.creds /.creds
|
|
||||||
|
|
||||||
|
RUN mkdir -p /logs /config
|
||||||
|
|
||||||
COPY ${FROM_DIR}/run_oegw.sh /run_oegw.sh
|
|
||||||
RUN chmod +x /run_oegw.sh
|
|
||||||
|
|
||||||
RUN mkdir /logs
|
|
||||||
RUN mkdir -p /config
|
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
SHELL ["/bin/bash", "-c"]
|
||||||
ENV PYTHONPATH=/
|
|
||||||
ENTRYPOINT [ "/run_oegw.sh" ]
|
|
||||||
|
|
||||||
|
ENV PYTHONPATH=/
|
||||||
|
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|||||||
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
#!/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}
|
||||||
|
|
||||||
@@ -2,14 +2,10 @@ aiohttp>=3.7.4.post0
|
|||||||
nest-asyncio>=1.5.5
|
nest-asyncio>=1.5.5
|
||||||
hjson>=3.1.0
|
hjson>=3.1.0
|
||||||
sortedcontainers>=2.4.0
|
sortedcontainers>=2.4.0
|
||||||
pandas>=1.5.3
|
|
||||||
#
|
|
||||||
redis>=5.0.8
|
redis>=5.0.8
|
||||||
#
|
|
||||||
python-dateutil>=2.8.2
|
python-dateutil>=2.8.2
|
||||||
types-python-dateutil>=2.8.19.6
|
types-python-dateutil>=2.8.19.6
|
||||||
#
|
cryptography>=43.0.0
|
||||||
psycopg>=3.2.1
|
PyJWT>=2.10.1
|
||||||
psycopg-binary>=3.2.1
|
|
||||||
psycopg2-binary>=2.9.6
|
|
||||||
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# runs in container
|
|
||||||
|
|
||||||
# runs on host to start container
|
|
||||||
usage() {
|
|
||||||
echo -n "Usage: ${0}"
|
|
||||||
echo -n " [-c <config (/config/cvtt.cfg)>]"
|
|
||||||
echo -n " [-a <admin_port (7220)>]"
|
|
||||||
echo -n " [-z (compress log)"]
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Config=/config/cvtt.cfg
|
|
||||||
AdminPort=7220
|
|
||||||
COMPRESS_LOG=false
|
|
||||||
|
|
||||||
|
|
||||||
while getopts "c:a:z" opt; do
|
|
||||||
case ${opt} in
|
|
||||||
c ) Config=$OPTARG ;;
|
|
||||||
a ) AdminPort=$OPTARG ;;
|
|
||||||
z ) COMPRESS_LOG=true ;;
|
|
||||||
\? )
|
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
: )
|
|
||||||
echo "Option -$OPTARG requires an argument." >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
Cmd="python3.12"
|
|
||||||
Cmd="${Cmd} cvttpy/apps/microservices/market_gateways/order_entry_gateway.py"
|
|
||||||
Cmd="${Cmd} --config=${Config}"
|
|
||||||
Cmd="${Cmd} --credentials_file=/.creds"
|
|
||||||
Cmd="${Cmd} --admin_port=${AdminPort}"
|
|
||||||
Cmd="${Cmd} --log_file=/logs/%T.md_gateway.log"
|
|
||||||
if ${COMPRESS_LOG} ; then
|
|
||||||
Cmd="${Cmd} --compress_log"
|
|
||||||
fi
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
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"]
|
||||||
Executable
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#!/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}
|
||||||
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
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
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
FROM python:3.12-slim
|
|
||||||
|
|
||||||
ARG ROOT_MUSVC_DIR=docker_dev/microservices
|
|
||||||
ARG FROM_DIR=${ROOT_MUSVC_DIR}/tester
|
|
||||||
|
|
||||||
COPY ${ROOT_MUSVC_DIR}/requirements.txt /
|
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
|
||||||
RUN pip install -r /requirements.txt --root-user-action=ignore
|
|
||||||
|
|
||||||
COPY cvttpy /cvttpy
|
|
||||||
# COPY ${ROOT_MUSVC_DIR}/.creds /.creds
|
|
||||||
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/run_tester.sh /run_tester.sh
|
|
||||||
RUN chmod +x /run_tester.sh
|
|
||||||
|
|
||||||
RUN mkdir /logs
|
|
||||||
RUN mkdir -p /config
|
|
||||||
RUN mkdir -p /data
|
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
|
||||||
ENV PYTHONPATH=/
|
|
||||||
ENTRYPOINT [ "/run_tester.sh" ]
|
|
||||||
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# runs in container
|
|
||||||
|
|
||||||
# runs on host to start container
|
|
||||||
usage() {
|
|
||||||
echo -n "Usage: ${0}"
|
|
||||||
echo -n " [-c <config (/config/cvtt.cfg) >]"
|
|
||||||
echo -n " [-i <instruments (COINBASE:PAIR-BTC-USD,BNBFUT:PERP-BTC-USDT) >]"
|
|
||||||
echo -n " [-d <data types (TRADES) >]"
|
|
||||||
echo -n " [-a <admin_port (7221) >]"
|
|
||||||
echo -n " [-z (compress log (false))"]
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Config=/config/cvtt.cfg
|
|
||||||
AdminPort=7221
|
|
||||||
COMPRESS_LOG=false
|
|
||||||
Instruments="COINBASE:PAIR-BTC-USD,BNBFUT:PERP-BTC-USDT"
|
|
||||||
DataTypes="TRADES"
|
|
||||||
|
|
||||||
while getopts "a:c:d:i:z" opt; do
|
|
||||||
case ${opt} in
|
|
||||||
c ) Config=$OPTARG ;;
|
|
||||||
a ) AdminPort=$OPTARG ;;
|
|
||||||
i ) Instruments=$OPTARG ;;
|
|
||||||
d ) DataTypes=$OPTARG ;;
|
|
||||||
z ) COMPRESS_LOG=true ;;
|
|
||||||
\? )
|
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
: )
|
|
||||||
echo "Option -$OPTARG requires an argument." >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
Cmd="python3.12"
|
|
||||||
Cmd="${Cmd} cvttpy/apps/microservices/tester/musvc_tester.py"
|
|
||||||
Cmd="${Cmd} --config=${Config}"
|
|
||||||
Cmd="${Cmd} --credentials_file=/.creds"
|
|
||||||
Cmd="${Cmd} --admin_port=${AdminPort}"
|
|
||||||
Cmd="${Cmd} --data_types=${DataTypes}"
|
|
||||||
Cmd="${Cmd} --instruments=${Instruments}"
|
|
||||||
Cmd="${Cmd} --log_file=/logs/%T.tester.log"
|
|
||||||
if ${COMPRESS_LOG} ; then
|
|
||||||
Cmd="${Cmd} --compress_log"
|
|
||||||
fi
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
0.0.7,creds to be taken from volumes
|
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
FROM python:3.12-slim
|
FROM python:3.12-slim
|
||||||
|
|
||||||
|
ARG FROM_DIR=./docker_dev/research/crypto_exch_stats
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
COPY docker_dev/research/crypto_exch_stats/requirements.txt /
|
COPY ${FROM_DIR}/requirements.txt /
|
||||||
|
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
RUN pip install --upgrade pip --root-user-action=ignore
|
||||||
RUN pip install -r /requirements.txt --root-user-action=ignore
|
RUN pip install -r /requirements.txt --root-user-action=ignore
|
||||||
@@ -16,7 +18,7 @@ ENV PYTHONPATH=/
|
|||||||
CMD [ \
|
CMD [ \
|
||||||
"python3.12", \
|
"python3.12", \
|
||||||
"cvttpy/apps//research/exchange_trading_stats.py", \
|
"cvttpy/apps//research/exchange_trading_stats.py", \
|
||||||
"--config=http://cloud23.cvtt.vpn:6789/apps/tests/listen_market_data", \
|
"--config=http://cloud16.cvtt.vpn:6789/apps/tests/listen_market_data", \
|
||||||
"--active_exchanges=OKX,GEMINI,BITSTAMP,COINBASE_AT,BNBSPOT,KRAKEN", \
|
"--active_exchanges=OKX,GEMINI,BITSTAMP,COINBASE_AT,BNBSPOT,KRAKEN", \
|
||||||
"--instruments=OKX:PAIR-BTC-USDT,GEMINI:PAIR-BTC-USD,BITSTAMP:PAIR-BTC-USD,COINBASE:PAIR-BTC-USD,BNBSPOT:PAIR-BTC-USDT,KRAKEN:PAIR-BTC-USD", \
|
"--instruments=OKX:PAIR-BTC-USDT,GEMINI:PAIR-BTC-USD,BITSTAMP:PAIR-BTC-USD,COINBASE:PAIR-BTC-USD,BNBSPOT:PAIR-BTC-USDT,KRAKEN:PAIR-BTC-USD", \
|
||||||
"--db_file=/app/data/exchange_trading_stats.db", \
|
"--db_file=/app/data/exchange_trading_stats.db", \
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
|1|yT6WmkWOPxXSQeNECVJIX7M3upw=|wQPqbw6mXxwfO83sWVH9IRapSe0= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDNIOY8dNaWBcUu31F2OOuXUFGam2sx3Admn51SZR37MOMDEeKzpX+w0OnDGME9uOfuBToDW5F8ZoC+/p492uywZb4ZvUqVE8ic3uTaMro7zB9sykt4AO2rifM/0k7Fo1WoNWSaQptS3qyf7Umgl+qD5H8PxEM1OqKQl38BI5hfKUGx/WSYawgGIKkyO1eFwdjmSJ4RgQpN6/p5+1wJqbqbzkk0cEvZ06BbUbY+nUSUYY5WKa8ICBI0GKDdgRg9FXTV18r0YPT62HhShIyScbmg2h9hDKb7q9lLNLs2qg11jpSZCsIYTR2yms60uqXXq+isReLZ+W4z0t/8YVoID4Q82UlJ8R/LEqiJd8VcjZHaRVqtr7oVQjSurg1ChgCnOHHjvjZLVUg7QRMbCVT2/6PMAjjTyHUx8TKscYjz21ctPMn63pH/6lYzncQrt7ZT6PromVtnBs7p8dHaCyv18z9EBvGuE2rYOsfsCuR7FNlno7ej/gbe6CoaT2KwcNU8vpc=
|
|
||||||
|1|QgYdyhwM1uy97fUH/l9jXfRnYlE=|P575Q9H/V0Hoszk+G9As1GozQmE= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHlFA8BawdNbgYsFPPUJiG7xfuWI6dwNIFkuUwqco+TPXanMG4CvZ0TjRgb2fwdMXAGyoNAmwcr8eR5HU8wTg8g=
|
|
||||||
|1|vSzhghnKpUIGuOOgELHWGrbMxd8=|GY2Acsr6iqo4Y/dDS8V5glZ7tmA= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKz0QyrgFpp9NsPvZVwkjoua57SztFOMUnEzOLfW7kPr
|
|
||||||
|1|LJg/h/d7KSfFYzdtrrEFpcpnF/4=|xRkJEoqiptYGTTt5EuQo4f3zo6c= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDKnC41A86Q2mVQWyRXHKzht6t8J1JJsRbYrQRpcMzh6VkVmOPDdAtl4P5iOH/GUaHr+HNhS7Y/QZS0yyjv8u1yOjb6ovfKvIuysj7f87wI1UOtQaUgX/PG5wupk/SgiUcfkpG+hg5wUACbsbMjp+HbE/OB7Nk5ZzUHNZcwQ55mRis8AzLW3IuFEboE+tJCxqTz8mr95ecqEWXdG4cJdDp7BMuCzsPCsOWgpcJiH+kgimok9n4qJPgoFSTVvHKBj0uJlm33rc8ns/Uu8knq6QfeSlzlN7uW0Xue6irW4Uaz69NbSUcFCeG83WNGO7tceYc7tmVM+9jjAtyhh9x1kGyk6thBMimRE5taa+5+bZP5tMctFsze6LVUGOothYW2MVgllJ+ovNFV/lin1y1591eAl340uSs4E4AJH6F/2Tta9OVGvNaXGMTYzKOLBYwo9sXJRHFuPjFxEs0Ya4pFUoCa8B53reNiOafrtwRU8/8G6zMgrF5z4FhCYBcIzoJdWCE=
|
|
||||||
|1|9oemW7STLSSF7uf+SBwD7JWe0K8=|YCblOLOrxHLzbHkMuZfiUP8nkTU= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPEpfGoofmKWz3/t3Svaahh5ieq4LJ6/n+y3M0rOK/RgndUCESaTZXbw701NOF8BPcJczTQTuQPO2AJwrwQYcK0=
|
|
||||||
|1|EC/isVVKdC1w/IthdEuhT29iU+w=|VClak/HfuZVXh4zlhhtx9euaTT0= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA2qvtcS1snKAdWKJefMCuKKgVlz0haOT0sElceM06qV
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
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" ]
|
||||||
|
|
||||||
Executable
+19
@@ -0,0 +1,19 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
FROM python:3.12-slim
|
|
||||||
|
|
||||||
|
|
||||||
ARG FROM_DIR=docker_dev/trading/executor
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/requirements.txt /
|
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
|
||||||
RUN pip install -r /requirements.txt --root-user-action=ignore
|
|
||||||
|
|
||||||
COPY cvttpy /cvttpy
|
|
||||||
COPY ${FROM_DIR}/.creds /.creds
|
|
||||||
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/run_executor.sh /run_executor.sh
|
|
||||||
RUN chmod +x /run_executor.sh
|
|
||||||
|
|
||||||
RUN mkdir /logs
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
|
||||||
ENV PYTHONPATH=/
|
|
||||||
ENTRYPOINT [ "/run_executor.sh" ]
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
aiohttp>=3.7.4.post0
|
|
||||||
redis>=5.0.8
|
|
||||||
nest-asyncio>=1.5.5
|
|
||||||
hjson>=3.1.0
|
|
||||||
sortedcontainers>=2.4.0
|
|
||||||
pandas>=1.5.3
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# runs in container
|
|
||||||
|
|
||||||
|
|
||||||
# runs on host to start container
|
|
||||||
usage() {
|
|
||||||
echo -n "Usage: $0"
|
|
||||||
echo -n " [-c <config (dflt: http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca)>]"
|
|
||||||
echo -n " [-e <active_exchanges (ALPACA_SNDBX-MDPORTAL)>]"
|
|
||||||
echo -n " [-a <admin_port (7222)>"]
|
|
||||||
echo -n " [-z (compress log)"]
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Config=http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca
|
|
||||||
ActiveExchanges=ALPACA_SNDBX
|
|
||||||
AdminPort=7222
|
|
||||||
COMPRESS_LOG=false
|
|
||||||
|
|
||||||
while getopts "c:e:a:z" opt; do
|
|
||||||
case ${opt} in
|
|
||||||
c ) Config=$OPTARG ;;
|
|
||||||
e ) ActiveExchanges=$OPTARG ;;
|
|
||||||
a ) AdminPort=$OPTARG ;;
|
|
||||||
z ) COMPRESS_LOG=true ;;
|
|
||||||
\? )
|
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
: )
|
|
||||||
echo "Option -$OPTARG requires an argument." >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
Cmd="python3.12"
|
|
||||||
Cmd="${Cmd} /cvttpy/apps/executor_app.py"
|
|
||||||
Cmd="${Cmd} --config=${Config}"
|
|
||||||
Cmd="${Cmd} --credentials_file=/.creds"
|
|
||||||
Cmd="${Cmd} --allow_dynamic_exch_inst"
|
|
||||||
Cmd="${Cmd} --active_exchanges=${ActiveExchanges}"
|
|
||||||
Cmd="${Cmd} --admin_port=${AdminPort}"
|
|
||||||
Cmd="${Cmd} --log_file=/logs/%T.EXECUTOR_APP.log"
|
|
||||||
if ${COMPRESS_LOG}; then
|
|
||||||
Cmd="${Cmd} --compress_log"
|
|
||||||
fi
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
FROM python:3.12-slim
|
|
||||||
|
|
||||||
ARG FROM_DIR=docker_dev/trading/md_portal
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/requirements.txt /
|
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
|
||||||
RUN pip install -r /requirements.txt --root-user-action=ignore
|
|
||||||
|
|
||||||
COPY cvttpy /cvttpy
|
|
||||||
COPY ${FROM_DIR}/.creds /.creds
|
|
||||||
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/run_md_portal.sh /run_md_portal.sh
|
|
||||||
RUN chmod +x /run_md_portal.sh
|
|
||||||
|
|
||||||
RUN mkdir /logs
|
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
|
||||||
ENV PYTHONPATH=/
|
|
||||||
ENTRYPOINT [ "/run_md_portal.sh" ]
|
|
||||||
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# runs in container
|
|
||||||
|
|
||||||
# runs on host to start container
|
|
||||||
usage() {
|
|
||||||
echo -n "Usage: ${0}"
|
|
||||||
echo -n " [-c <config (dflt: http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca)>]"
|
|
||||||
echo -n " [-e <active_exchanges (ALPACA_SNBOX)>]"
|
|
||||||
echo -n " [-a <admin_port (7220)>]"
|
|
||||||
echo -n " [-n <portal_name (MD_PORTAL_ALPACA)>]"
|
|
||||||
echo -n " [-z (compress log)"]
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Config=http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca
|
|
||||||
ActiveExchanges=ALPACA_SNDBX
|
|
||||||
PortalName=MD_PORTAL_ALPACA_SNDBX
|
|
||||||
AdminPort=7220
|
|
||||||
COMPRESS_LOG=false
|
|
||||||
|
|
||||||
|
|
||||||
while getopts "c:e:a:n:z" opt; do
|
|
||||||
case ${opt} in
|
|
||||||
c ) Config=$OPTARG ;;
|
|
||||||
e ) ActiveExchanges=$OPTARG ;;
|
|
||||||
a ) AdminPort=$OPTARG ;;
|
|
||||||
z ) COMPRESS_LOG=true ;;
|
|
||||||
n ) PortalName=$OPTARG ;;
|
|
||||||
\? )
|
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
: )
|
|
||||||
echo "Option -$OPTARG requires an argument." >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
Cmd="python3.12"
|
|
||||||
Cmd="${Cmd} cvttpy/apps/md/md_portal.py"
|
|
||||||
Cmd="${Cmd} --config=${Config}"
|
|
||||||
Cmd="${Cmd} --credentials_file=/.creds"
|
|
||||||
Cmd="${Cmd} --active_exchanges=${ActiveExchanges}"
|
|
||||||
Cmd="${Cmd} --portal_name=${PortalName}"
|
|
||||||
Cmd="${Cmd} --admin_port=${AdminPort}"
|
|
||||||
Cmd="${Cmd} --log_file=/logs/%T.${PortalName}.log"
|
|
||||||
if ${COMPRESS_LOG}; then
|
|
||||||
Cmd="${Cmd} --compress_log"
|
|
||||||
fi
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
.git
|
|
||||||
**/__pycache__
|
|
||||||
.pipenv
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
FROM python:3.12-slim
|
|
||||||
|
|
||||||
|
|
||||||
ARG FROM_DIR=docker_dev/trading/quant
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/requirements.txt /
|
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
|
||||||
RUN pip install -r /requirements.txt --root-user-action=ignore
|
|
||||||
|
|
||||||
COPY cvttpy /cvttpy
|
|
||||||
COPY ${FROM_DIR}/.creds /.creds
|
|
||||||
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/run_quant.sh /run_quant.sh
|
|
||||||
RUN chmod +x /run_quant.sh
|
|
||||||
|
|
||||||
RUN mkdir /logs
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
|
||||||
ENV PYTHONPATH=/
|
|
||||||
ENTRYPOINT [ "/run_quant.sh" ]
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
aiohttp>=3.7.4.post0
|
|
||||||
nest-asyncio>=1.5.5
|
|
||||||
hjson>=3.1.0
|
|
||||||
sortedcontainers>=2.4.0
|
|
||||||
pandas>=1.5.3
|
|
||||||
#
|
|
||||||
ta>=0.10.2
|
|
||||||
tables>=3.9.1
|
|
||||||
psycopg>=3.2.1
|
|
||||||
#
|
|
||||||
redis>=5.0.8
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# runs on host to start container
|
|
||||||
usage() {
|
|
||||||
echo -n "Usage: $0"
|
|
||||||
echo -n " -b <book>"
|
|
||||||
|
|
||||||
echo -n " -S <strategy> (dflt: TRDALGO_001)"
|
|
||||||
|
|
||||||
echo -n " [-c <config (dflt: http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca)>]"
|
|
||||||
echo -n " [-e <active_exchanges (ALPACA_SNDBX-MDPORTAL)>]"
|
|
||||||
echo -n " [-a <admin_port (7224)>"]
|
|
||||||
echo -n " [-z (compress log)"]
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Config=http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca
|
|
||||||
ActiveExchanges=ALPACA_SNDBX-MDPORTAL
|
|
||||||
AdminPort=7224
|
|
||||||
Strategy=DAILY_STOCK_001
|
|
||||||
Book=""
|
|
||||||
COMPRESS_LOG=false
|
|
||||||
|
|
||||||
|
|
||||||
while getopts "b:c:e:a:S:z" opt; do
|
|
||||||
case ${opt} in
|
|
||||||
c ) Config=$OPTARG ;;
|
|
||||||
e ) ActiveExchanges=$OPTARG ;;
|
|
||||||
a ) AdminPort=$OPTARG ;;
|
|
||||||
z ) COMPRESS_LOG=true ;;
|
|
||||||
b ) Book=$OPTARG ;;
|
|
||||||
S ) Strategy=$OPTARG ;;
|
|
||||||
\? )
|
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
: )
|
|
||||||
echo "Option -$OPTARG requires an argument." >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "${Book}" == "" ]; then
|
|
||||||
echo "Book is missing"
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
Cmd="python3.12"
|
|
||||||
Cmd="${Cmd} cvttpy/apps/quant_app.py"
|
|
||||||
Cmd="${Cmd} --config=${Config}"
|
|
||||||
Cmd="${Cmd} --credentials_file=/.creds"
|
|
||||||
Cmd="${Cmd} --book=${Book}"
|
|
||||||
Cmd="${Cmd} --strategy=${Strategy}"
|
|
||||||
Cmd="${Cmd} --allow_dynamic_exch_inst"
|
|
||||||
Cmd="${Cmd} --active_exchanges=${ActiveExchanges}"
|
|
||||||
Cmd="${Cmd} --admin_port=${AdminPort}"
|
|
||||||
Cmd="${Cmd} --log_file=/logs/%T.QUANT.${Book}.log"
|
|
||||||
if ${COMPRESS_LOG}; then
|
|
||||||
Cmd="${Cmd} --compress_log"
|
|
||||||
fi
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
.git
|
|
||||||
**/__pycache__
|
|
||||||
.pipenv
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
FROM python:3.12-slim
|
|
||||||
|
|
||||||
ARG FROM_DIR=docker_dev/trading/risk_mgr
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/requirements.txt /
|
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
|
||||||
RUN pip install -r /requirements.txt --root-user-action=ignore
|
|
||||||
|
|
||||||
COPY cvttpy /cvttpy
|
|
||||||
COPY ${FROM_DIR}/.creds /.creds
|
|
||||||
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/run_risk_mgr.sh /run_risk_mgr.sh
|
|
||||||
RUN chmod +x /run_risk_mgr.sh
|
|
||||||
|
|
||||||
RUN mkdir /logs
|
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
|
||||||
ENV PYTHONPATH=/
|
|
||||||
ENTRYPOINT [ "/run_risk_mgr.sh" ]
|
|
||||||
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# runs in container
|
|
||||||
|
|
||||||
# runs on host to start container
|
|
||||||
usage() {
|
|
||||||
echo -n "Usage: $0"
|
|
||||||
echo -n " -b <book>"
|
|
||||||
echo -n " [-c <config (dflt: http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca)>]"
|
|
||||||
echo -n " [-e <active_exchanges (ALPACA_SNDBX-MDPORTAL)>]"
|
|
||||||
echo -n " [-a <admin_port (7223)>"]
|
|
||||||
echo -n " [-z (compress log)"]
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Config=http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca
|
|
||||||
ActiveExchanges=ALPACA_SNDBX-MDPORTAL
|
|
||||||
AdminPort=7223
|
|
||||||
Book=""
|
|
||||||
COMPRESS_LOG=false
|
|
||||||
|
|
||||||
|
|
||||||
while getopts "b:c:e:a:z" opt; do
|
|
||||||
case ${opt} in
|
|
||||||
c ) Config=$OPTARG ;;
|
|
||||||
e ) ActiveExchanges=$OPTARG ;;
|
|
||||||
a ) AdminPort=$OPTARG ;;
|
|
||||||
z ) COMPRESS_LOG=true ;;
|
|
||||||
b ) Book=$OPTARG ;;
|
|
||||||
\? )
|
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
: )
|
|
||||||
echo "Option -$OPTARG requires an argument." >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "${Book}" == "" ]; then
|
|
||||||
echo "Book is missing"
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
Cmd="python3.12"
|
|
||||||
Cmd="${Cmd} cvttpy/apps/risk_manager_app.py"
|
|
||||||
Cmd="${Cmd} --config=${Config}"
|
|
||||||
Cmd="${Cmd} --credentials_file=/.creds"
|
|
||||||
Cmd="${Cmd} --book=${Book}"
|
|
||||||
Cmd="${Cmd} --allow_dynamic_exch_inst"
|
|
||||||
Cmd="${Cmd} --active_exchanges=${ActiveExchanges}"
|
|
||||||
Cmd="${Cmd} --admin_port=${AdminPort}"
|
|
||||||
Cmd="${Cmd} --log_file=/logs/%T.RISK_MGR.${Book}.log"
|
|
||||||
if ${COMPRESS_LOG}; then
|
|
||||||
Cmd="${Cmd} --compress_log"
|
|
||||||
fi
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
FROM python:3.12-slim
|
|
||||||
|
|
||||||
ARG FROM_DIR=docker_dev/trading/service_checker
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y telnet redis-tools
|
|
||||||
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/requirements.txt /
|
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
|
||||||
RUN pip install -r /requirements.txt --root-user-action=ignore
|
|
||||||
|
|
||||||
COPY cvttpy /cvttpy
|
|
||||||
COPY ${FROM_DIR}/.creds /.creds
|
|
||||||
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/run_svc_checker.sh /run_svc_checker.sh
|
|
||||||
RUN chmod +x /run_svc_checker.sh
|
|
||||||
|
|
||||||
# RUN mkdir /logs
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
|
||||||
ENV PYTHONPATH=/
|
|
||||||
ENTRYPOINT [ "/run_svc_checker.sh" ]
|
|
||||||
# ENTRYPOINT [ "/usr/bin/bash" ]
|
|
||||||
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# runs in container
|
|
||||||
|
|
||||||
# runs on host to start container
|
|
||||||
usage() {
|
|
||||||
echo -n "Usage: ${0}"
|
|
||||||
echo -n " [-c <config (dflt: http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca)>]"
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Config=http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca
|
|
||||||
|
|
||||||
|
|
||||||
while getopts ":c:" opt; do
|
|
||||||
case ${opt} in
|
|
||||||
c )
|
|
||||||
Config=$OPTARG
|
|
||||||
;;
|
|
||||||
\? )
|
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
: )
|
|
||||||
echo "Option -$OPTARG requires an argument." >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
Cmd="python3.12"
|
|
||||||
Cmd="${Cmd} cvttpy/apps/utils/services_checker.py"
|
|
||||||
Cmd="${Cmd} --config=${Config}"
|
|
||||||
Cmd="${Cmd} --credentials_file=/.creds"
|
|
||||||
Cmd="${Cmd} --log_level=ERROR"
|
|
||||||
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
.git
|
|
||||||
**/__pycache__
|
|
||||||
.pipenv
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
FROM python:3.12-slim
|
|
||||||
|
|
||||||
|
|
||||||
ARG FROM_DIR=docker_dev/trading/trader
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/requirements.txt /
|
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
|
||||||
RUN pip install -r /requirements.txt --root-user-action=ignore
|
|
||||||
|
|
||||||
COPY cvttpy /cvttpy
|
|
||||||
COPY ${FROM_DIR}/.creds /.creds
|
|
||||||
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/run_trader.sh /run_trader.sh
|
|
||||||
RUN chmod +x /run_trader.sh
|
|
||||||
|
|
||||||
RUN mkdir /logs
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
|
||||||
ENV PYTHONPATH=/
|
|
||||||
ENTRYPOINT [ "/run_trader.sh" ]
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
aiohttp>=3.7.4.post0
|
|
||||||
redis>=5.0.8
|
|
||||||
nest-asyncio>=1.5.5
|
|
||||||
hjson>=3.1.0
|
|
||||||
sortedcontainers>=2.4.0
|
|
||||||
pandas>=1.5.3
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# runs in container
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# runs on host to start container
|
|
||||||
usage() {
|
|
||||||
echo -n "Usage: $0"
|
|
||||||
echo -n " -b <book>"
|
|
||||||
|
|
||||||
echo -n " -A <algo> (dflt: TRDALGO_001)"
|
|
||||||
|
|
||||||
echo -n " [-c <config (dflt: http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca)>]"
|
|
||||||
echo -n " [-e <active_exchanges (ALPACA_SNDBX-MDPORTAL)>]"
|
|
||||||
echo -n " [-a <admin_port (7223)>"]
|
|
||||||
echo -n " [-z (compress log)"]
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Config=http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca
|
|
||||||
ActiveExchanges=ALPACA_SNDBX-MDPORTAL
|
|
||||||
AdminPort=7226
|
|
||||||
Algo=TRDALGO_001
|
|
||||||
Book=""
|
|
||||||
COMPRESS_LOG=false
|
|
||||||
|
|
||||||
|
|
||||||
while getopts "b:c:e:a:A:z" opt; do
|
|
||||||
case ${opt} in
|
|
||||||
c ) Config=$OPTARG ;;
|
|
||||||
e ) ActiveExchanges=$OPTARG ;;
|
|
||||||
a ) AdminPort=$OPTARG ;;
|
|
||||||
z ) COMPRESS_LOG=true ;;
|
|
||||||
b ) Book=$OPTARG ;;
|
|
||||||
A ) Algo=$OPTARG ;;
|
|
||||||
\? )
|
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
: )
|
|
||||||
echo "Option -$OPTARG requires an argument." >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "${Book}" == "" ]; then
|
|
||||||
echo "Book is missing"
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
Cmd="python3.12"
|
|
||||||
Cmd="${Cmd} cvttpy/apps/trader_app.py"
|
|
||||||
Cmd="${Cmd} --config=${Config}"
|
|
||||||
Cmd="${Cmd} --credentials_file=/.creds"
|
|
||||||
Cmd="${Cmd} --book=${Book}"
|
|
||||||
Cmd="${Cmd} --algo=${Algo}"
|
|
||||||
Cmd="${Cmd} --allow_dynamic_exch_inst"
|
|
||||||
Cmd="${Cmd} --active_exchanges=${ActiveExchanges}"
|
|
||||||
Cmd="${Cmd} --admin_port=${AdminPort}"
|
|
||||||
Cmd="${Cmd} --log_file=/logs/%T.TRADER.${Book}.log"
|
|
||||||
if ${COMPRESS_LOG}; then
|
|
||||||
Cmd="${Cmd} --compress_log"
|
|
||||||
fi
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
.git
|
|
||||||
**/__pycache__
|
|
||||||
.pipenv
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
FROM python:3.12-slim
|
|
||||||
|
|
||||||
ARG FROM_DIR=docker_dev/trading/trading_recorder
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/requirements.txt /
|
|
||||||
RUN pip install --upgrade pip --root-user-action=ignore
|
|
||||||
RUN pip install -r /requirements.txt --root-user-action=ignore
|
|
||||||
|
|
||||||
COPY cvttpy /cvttpy
|
|
||||||
COPY ${FROM_DIR}/.creds /.creds
|
|
||||||
|
|
||||||
|
|
||||||
COPY ${FROM_DIR}/run_trading_recorder.sh /run_trading_recorder.sh
|
|
||||||
RUN chmod +x /run_trading_recorder.sh
|
|
||||||
|
|
||||||
RUN mkdir /logs
|
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
|
||||||
ENV PYTHONPATH=/
|
|
||||||
ENTRYPOINT [ "/run_trading_recorder.sh" ]
|
|
||||||
|
|
||||||
@@ -1,15 +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
|
|
||||||
#
|
|
||||||
psycopg>=3.2.1
|
|
||||||
psycopg-binary>=3.2.1
|
|
||||||
psycopg2-binary>=2.9.6
|
|
||||||
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# runs on host to start container
|
|
||||||
usage() {
|
|
||||||
echo -n "Usage: $0"
|
|
||||||
echo -n " -b <book>"
|
|
||||||
echo -n " [-c <config (dflt: http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca)>]"
|
|
||||||
echo -n " [-e <active_exchanges (ALPACA_SNDBX-MDPORTAL)>]"
|
|
||||||
echo -n " [-a <admin_port (7223)>"]
|
|
||||||
echo -n " [-z (compress log)"]
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
ActiveExchanges=ALPACA_SNDBX-MDPORTAL
|
|
||||||
AdminPort=7225
|
|
||||||
Book=""
|
|
||||||
Config=http://cloud23.cvtt.vpn:6789/apps/cvtt_eqt_alpaca
|
|
||||||
COMPRESS_LOG=false
|
|
||||||
|
|
||||||
|
|
||||||
while getopts "b:c:e:a:z" opt; do
|
|
||||||
case ${opt} in
|
|
||||||
c ) Config=$OPTARG ;;
|
|
||||||
e ) ActiveExchanges=$OPTARG ;;
|
|
||||||
a ) AdminPort=$OPTARG ;;
|
|
||||||
z ) COMPRESS_LOG=true ;;
|
|
||||||
b ) Book=$OPTARG ;;
|
|
||||||
\? )
|
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
: )
|
|
||||||
echo "Option -$OPTARG requires an argument." >&2
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "${Book}" == "" ]; then
|
|
||||||
echo "Book is missing"
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
Cmd="python3.12"
|
|
||||||
Cmd="${Cmd} cvttpy/apps/trade_recorder.py"
|
|
||||||
Cmd="${Cmd} --config=${Config}"
|
|
||||||
Cmd="${Cmd} --credentials_file=/.creds"
|
|
||||||
Cmd="${Cmd} --book=${Book}"
|
|
||||||
Cmd="${Cmd} --allow_dynamic_exch_inst"
|
|
||||||
Cmd="${Cmd} --active_exchanges=${ActiveExchanges}"
|
|
||||||
Cmd="${Cmd} --admin_port=${AdminPort}"
|
|
||||||
Cmd="${Cmd} --log_file=/logs/%T.TRADING_RECORDER.${Book}.log"
|
|
||||||
if ${COMPRESS_LOG}; then
|
|
||||||
Cmd="${Cmd} --compress_log"
|
|
||||||
fi
|
|
||||||
echo ${Cmd}
|
|
||||||
eval ${Cmd}
|
|
||||||
Binary file not shown.
Reference in New Issue
Block a user