4 Commits

Author SHA1 Message Date
oleg 7165d611c6 alpaca creds 2024-12-16 16:05:56 -05:00
oleg b4f818ac1a added musvcs:oe_gateway 2024-12-13 20:01:45 -05:00
oleg 3190cf5d4d musvcs progress 2024-12-13 13:41:37 -05:00
oleg a5ecf4550c progress 2024-12-11 15:45:04 -05:00
15 changed files with 306 additions and 5 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"__dummy__": null "__dummy__": null
, "ALPACA_SANDBOX": { , "ALPACA_SANDBOX": {
"api_key": "PKLZSLFZMFMN1R28K9HK" "api_key": "PKM1ASU8ULKSGO45ZZBV"
, "secret_key": "SKbxwLWJNs4kpn618DgGaopN6x1xzKwLM4Z7aymA" , "secret_key": "XDBrrkOsxl9rMDs4GAFvG1WYiC3oLba04WbEZjR9"
} }
} }
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"__dummy__": null "__dummy__": null
, "ALPACA_SANDBOX": { , "ALPACA_SANDBOX": {
"api_key": "PKLZSLFZMFMN1R28K9HK" "api_key": "PKM1ASU8ULKSGO45ZZBV"
, "secret_key": "SKbxwLWJNs4kpn618DgGaopN6x1xzKwLM4Z7aymA" , "secret_key": "XDBrrkOsxl9rMDs4GAFvG1WYiC3oLba04WbEZjR9"
} }
} }
+7
View File
@@ -0,0 +1,7 @@
{
"__dummy__": null
, "ALPACA_SANDBOX": {
"api_key": "PKLZSLFZMFMN1R28K9HK"
, "secret_key": "SKbxwLWJNs4kpn618DgGaopN6x1xzKwLM4Z7aymA"
}
}
+51
View File
@@ -0,0 +1,51 @@
version: "3.9"
services:
md_gateway:
image: cloud21.cvtt.vpn:5500/md_gateway:latest
container_name: md_gateway
environment:
- REDIS_HOST=redis
volumes:
- ./config:/config
- ./logs:/logs
- ./data:/data
depends_on:
- redis
tester:
image: cloud21.cvtt.vpn:5500/tester:latest
container_name: tester
environment:
- REDIS_HOST=redis
volumes:
- ./config:/config
- ./logs:/logs
- ./data:/data
depends_on:
- redis
- md_gateway
redis:
image: redis:latest
container_name: redis
ports:
- "6379:6379"
volumes:
- ./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:
+3
View File
@@ -0,0 +1,3 @@
.git
**/__pycache__
.pipenv
+25
View File
@@ -0,0 +1,25 @@
FROM python:3.12-slim
ARG ROOT_MCRSVC_DIR=docker_dev/microservices
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 -r /requirements.txt --root-user-action=ignore
COPY cvttpy /cvttpy
COPY ${ROOT_MCRSVC_DIR}/.creds /.creds
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"]
ENV PYTHONPATH=/
ENTRYPOINT [ "/run_mdgw.sh" ]
+48
View File
@@ -0,0 +1,48 @@
#!/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}
+3
View File
@@ -0,0 +1,3 @@
.git
**/__pycache__
.pipenv
+25
View File
@@ -0,0 +1,25 @@
FROM python:3.12-slim
ARG ROOT_MCRSVC_DIR=docker_dev/microservices
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 -r /requirements.txt --root-user-action=ignore
COPY cvttpy /cvttpy
COPY ${ROOT_MCRSVC_DIR}/.creds /.creds
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"]
ENV PYTHONPATH=/
ENTRYPOINT [ "/run_oegw.sh" ]
+48
View File
@@ -0,0 +1,48 @@
#!/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}
+7
View File
@@ -0,0 +1,7 @@
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
+3
View File
@@ -0,0 +1,3 @@
.git
**/__pycache__
.pipenv
+26
View File
@@ -0,0 +1,26 @@
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" ]
+55
View File
@@ -0,0 +1,55 @@
#!/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 -1
View File
@@ -1 +1 @@
0.0.5,16->23 0.0.6,musvcs progress