ADM-21, DEV-107
This commit is contained in:
parent
235b906a94
commit
25073c2696
@ -1,22 +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_USER=1001:1001
|
||||||
CVTT_VERSION=0.0.3
|
CVTT_VERSION=0.0.3
|
||||||
|
|
||||||
# MDGW_CONFIG_FILE=config_musvc.cfg
|
|
||||||
# MDGW_CREDS_FILE=.creds
|
# MDGW_CREDS_FILE=.creds
|
||||||
MDGW_LOG_FILE=%T.md_gateway.log
|
MDGW_LOG_FILE=%T.md_gateway.log
|
||||||
MDGW_ADD_ARGS=
|
MDGW_ADD_ARGS=
|
||||||
|
|
||||||
# OEGW_CONFIG_FILE=config_musvc.cfg
|
|
||||||
# OEGW_CREDS_FILE=.creds
|
# OEGW_CREDS_FILE=.creds
|
||||||
OEGW_LOG_FILE=%T.oe_gateway.log
|
OEGW_LOG_FILE=%T.oe_gateway.log
|
||||||
#OEGW_ADD_ARGS="--log_level=DEBUG --debug_mode"
|
#OEGW_ADD_ARGS="--log_level=DEBUG --debug_mode"
|
||||||
OEGW_ADD_ARGS="--debug_mode"
|
OEGW_ADD_ARGS="--debug_mode"
|
||||||
|
|
||||||
# ACGW_CONFIG_FILE=config_musvc.cfg
|
|
||||||
# ACGW_CREDS_FILE=.creds
|
# ACGW_CREDS_FILE=.creds
|
||||||
ACGW_LOG_FILE=%T.ac_gateway.log
|
ACGW_LOG_FILE=%T.ac_gateway.log
|
||||||
ACGW_ADD_ARGS=
|
ACGW_ADD_ARGS=
|
||||||
|
|
||||||
# PXER_CONFIG_FILE=config_musvc.cfg
|
|
||||||
PXER_LOG_FILE=%T.pricer.log
|
PXER_LOG_FILE=%T.pricer.log
|
||||||
PXER_ADD_ARGS=
|
PXER_ADD_ARGS=
|
||||||
|
|
||||||
|
COORD_LOG_FILE=%T.coordinator.log
|
||||||
|
COORD_ADD_ARGS=
|
||||||
|
|||||||
@ -1,14 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ConfigDir=/config
|
|
||||||
LogDir=/logs
|
LogDir=/logs
|
||||||
|
|
||||||
Cmd="python3.12"
|
Cmd="python3.12"
|
||||||
Cmd+=" cvttpy/apps/microservices/market_gateways/accounting_gateway.py"
|
Cmd+=" cvttpy/apps/microservices/market_gateways/accounting_gateway.py"
|
||||||
Cmd+=" --config=${ConfigDir}/${ACGW_CONFIG_FILE:-cvtt_musvc.cfg}"
|
|
||||||
Cmd+=" --credentials_file=${ConfigDir}/${ACGW_CREDS_FILE:-.creds}"
|
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+=" --log_file=${LogDir}/${ACGW_LOG_FILE:-%T.ac_gateway.log}"
|
||||||
Cmd+=" ${ACGW_ADD_ARGS}"
|
Cmd+=" ${ACGW_ADD_ARGS}"
|
||||||
|
|
||||||
echo ${Cmd}
|
echo ${Cmd}
|
||||||
exec ${Cmd}
|
exec ${Cmd}
|
||||||
|
|
||||||
|
|||||||
@ -1,15 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# --- Settings
|
||||||
|
RegistryService=cloud21.cvtt.vpn:5500
|
||||||
|
ValidImages=(md_gateway oe_gateway ac_gateway pricer coordinator)
|
||||||
|
# --- Settings
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 -I <image_name> -V <image_version> -L <library>:<library_version>"
|
echo "Usage: $0 -I <image_name> -V <image_version> -L <library>:<library_version>"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# --- Settings
|
|
||||||
RegistryService=cloud21.cvtt.vpn:5500
|
|
||||||
# --- Settings
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------- cmdline
|
# ---------------- cmdline
|
||||||
while getopts "I:V:L:" opt; do
|
while getopts "I:V:L:" opt; do
|
||||||
@ -54,24 +54,42 @@ if [ "${Library}" != "" ] ; then
|
|||||||
fi
|
fi
|
||||||
# exit
|
# exit
|
||||||
|
|
||||||
DockerDir=$(realpath $(dirname ${0})/${ImageName})
|
build_musvc_image() {
|
||||||
|
ImageName=${1}
|
||||||
|
Project=${2}
|
||||||
|
ProjectVersion=${3}
|
||||||
|
|
||||||
cd ${DockerDir}
|
DockerDir=$(realpath $(dirname ${0})/${ImageName})
|
||||||
|
cd ${DockerDir}
|
||||||
|
|
||||||
source ../mu_svc_functions.sh
|
if [ "${Project}" != "" ]; then
|
||||||
if [ "${Project}" != "" ]; then
|
|
||||||
get_project_version ${Project} ${ProjectVersion}
|
get_project_version ${Project} ${ProjectVersion}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
function cleanup {
|
||||||
function cleanup {
|
|
||||||
cd ${DockerDir}
|
cd ${DockerDir}
|
||||||
rm -rf cvttpy
|
rm -rf cvttpy
|
||||||
|
}
|
||||||
|
trap cleanup RETURN
|
||||||
|
|
||||||
|
build_docker_image ${ImageName} ${RegistryService} ${ImageVersion} ${Project} ${ProjectVersion}
|
||||||
}
|
}
|
||||||
trap cleanup EXIT
|
|
||||||
|
|
||||||
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 "**** D E B U G E X I T" && exit
|
||||||
echo "***** ${0} D O N E"
|
echo "***** ${0} D O N E"
|
||||||
|
|||||||
3
microservices/coordinator/.dockerignore
Normal file
3
microservices/coordinator/.dockerignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.git
|
||||||
|
**/__pycache__
|
||||||
|
.pipenv
|
||||||
19
microservices/coordinator/Dockerfile
Normal file
19
microservices/coordinator/Dockerfile
Normal file
@ -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"]
|
||||||
14
microservices/coordinator/entrypoint.sh
Executable file
14
microservices/coordinator/entrypoint.sh
Executable file
@ -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}
|
||||||
|
|
||||||
9
microservices/coordinator/requirements.txt
Normal file
9
microservices/coordinator/requirements.txt
Normal file
@ -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,5 +1,26 @@
|
|||||||
# CVTT Microservices
|
# CVTT Microservices
|
||||||
services:
|
services:
|
||||||
|
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
|
||||||
|
# - riskmgr
|
||||||
|
- redis
|
||||||
|
|
||||||
pricer:
|
pricer:
|
||||||
image: cloud21.cvtt.vpn:5500/pricer:${CVTT_VERSION}
|
image: cloud21.cvtt.vpn:5500/pricer:${CVTT_VERSION}
|
||||||
container_name: cvtt-pricer
|
container_name: cvtt-pricer
|
||||||
@ -7,9 +28,10 @@ services:
|
|||||||
user: ${CVTT_USER:-1001:1001}
|
user: ${CVTT_USER:-1001:1001}
|
||||||
environment:
|
environment:
|
||||||
CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789}
|
CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789}
|
||||||
PXER_CONFIG_FILE: ${PXER_CONFIG_FILE:-cvtt_musvc.cfg}
|
CONFIG_COMM_SETTINGS: ${CONFIG_COMM_SETTINGS:-comm/pubsub/redis/docker_microservices}
|
||||||
PXER_LOG_FILE: ${PXER_LOG_FILE:-%T.pricer.log}
|
CONFIG_FILE: ${CONFIG_FILE:-http://${CONFIG_SERVICE}/apps/cvtt_musvc}
|
||||||
PXER_ADD_ARGS: ${PXER_ADD_ARGS:-}
|
COORD_LOG_FILE: ${COORD_LOG_FILE:-%T.pricer.log}
|
||||||
|
COORD_ADD_ARGS: ${COORD_ADD_ARGS:-}
|
||||||
volumes:
|
volumes:
|
||||||
- ./config:/config
|
- ./config:/config
|
||||||
- ./logs:/logs
|
- ./logs:/logs
|
||||||
@ -24,8 +46,9 @@ services:
|
|||||||
user: ${CVTT_USER:-1001:1001}
|
user: ${CVTT_USER:-1001:1001}
|
||||||
environment:
|
environment:
|
||||||
CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789}
|
CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789}
|
||||||
MDGW_CONFIG_FILE: ${MDGW_CONFIG_FILE:-cvtt_musvc.cfg}
|
CONFIG_COMM_SETTINGS: ${CONFIG_COMM_SETTINGS:-comm/pubsub/redis/docker_microservices}
|
||||||
MDGW_CREDS_FILE: ${MDGW_CREDS_FILE:-.creds}
|
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_LOG_FILE: ${MDGW_LOG_FILE:-%T.md_gateway.log}
|
||||||
MDGW_ADD_ARGS: ${MDGW_ADD_ARGS:-}
|
MDGW_ADD_ARGS: ${MDGW_ADD_ARGS:-}
|
||||||
volumes:
|
volumes:
|
||||||
@ -41,8 +64,9 @@ services:
|
|||||||
user: ${CVTT_USER:-1001:1001}
|
user: ${CVTT_USER:-1001:1001}
|
||||||
environment:
|
environment:
|
||||||
CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789}
|
CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789}
|
||||||
OEGW_CONFIG_FILE: ${OEGW_CONFIG_FILE:-cvtt_musvc.cfg}
|
CONFIG_COMM_SETTINGS: ${CONFIG_COMM_SETTINGS:-comm/pubsub/redis/docker_microservices}
|
||||||
OEGW_CREDS_FILE: ${OEGW_CREDS_FILE:-.creds}
|
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_LOG_FILE: ${OEGW_LOG_FILE:-%T.oe_gateway.log}
|
||||||
OEGW_ADD_ARGS: ${OEGW_ADD_ARGS:-}
|
OEGW_ADD_ARGS: ${OEGW_ADD_ARGS:-}
|
||||||
volumes:
|
volumes:
|
||||||
@ -58,8 +82,9 @@ services:
|
|||||||
user: ${CVTT_USER:-1001:1001}
|
user: ${CVTT_USER:-1001:1001}
|
||||||
environment:
|
environment:
|
||||||
CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789}
|
CONFIG_SERVICE: ${CONFIG_SERVICE:-cloud16.cvtt.vpn:6789}
|
||||||
ACGW_CONFIG_FILE: ${ACGW_CONFIG_FILE:-cvtt_musvc.cfg}
|
CONFIG_COMM_SETTINGS: ${CONFIG_COMM_SETTINGS:-comm/pubsub/redis/docker_microservices}
|
||||||
ACGW_CREDS_FILE: ${ACGW_CREDS_FILE:-.creds}
|
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_LOG_FILE: ${ACGW_LOG_FILE:-%T.ac_gateway.log}
|
||||||
ACGW_ADD_ARGS: ${ACGW_ADD_ARGS:-}
|
ACGW_ADD_ARGS: ${ACGW_ADD_ARGS:-}
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ConfigDir=/config
|
|
||||||
LogDir=/logs
|
LogDir=/logs
|
||||||
|
|
||||||
Cmd="python3.12"
|
Cmd="python3.12"
|
||||||
Cmd+=" cvttpy/apps/microservices/market_gateways/md_gateway.py"
|
Cmd+=" cvttpy/apps/microservices/market_gateways/md_gateway.py"
|
||||||
Cmd+=" --config=${ConfigDir}/${MDGW_CONFIG_FILE:-cvtt_musvc.cfg}"
|
|
||||||
Cmd+=" --credentials_file=${ConfigDir}/${MDGW_CREDS_FILE:-.creds}"
|
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+=" --log_file=${LogDir}/${MDGW_LOG_FILE:-%T.md_gateway.log}"
|
||||||
Cmd+=" ${MDGW_ADD_ARGS}"
|
Cmd+=" ${MDGW_ADD_ARGS}"
|
||||||
echo ${Cmd}
|
echo ${Cmd}
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ConfigDir=/config
|
|
||||||
LogDir=/logs
|
LogDir=/logs
|
||||||
|
|
||||||
Cmd="python3.12"
|
Cmd="python3.12"
|
||||||
Cmd+=" cvttpy/apps/microservices/market_gateways/order_entry_gateway.py"
|
Cmd+=" cvttpy/apps/microservices/market_gateways/order_entry_gateway.py"
|
||||||
Cmd+=" --config=${ConfigDir}/${OEGW_CONFIG_FILE:-cvtt_musvc.cfg}"
|
|
||||||
Cmd+=" --credentials_file=${ConfigDir}/${OEGW_CREDS_FILE:-.creds}"
|
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+=" --log_file=${LogDir}/${OEGW_LOG_FILE:-%T.oe_gateway.log}"
|
||||||
Cmd+=" ${OEGW_ADD_ARGS}"
|
Cmd+=" ${OEGW_ADD_ARGS}"
|
||||||
echo ${Cmd}
|
echo ${Cmd}
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ConfigDir=/config
|
|
||||||
LogDir=/logs
|
LogDir=/logs
|
||||||
|
|
||||||
Cmd="python3.12"
|
Cmd="python3.12"
|
||||||
Cmd+=" cvttpy/apps/microservices/pricer/pricer.py"
|
Cmd+=" cvttpy/apps/microservices/pricer/pricer.py"
|
||||||
Cmd+=" --config=${ConfigDir}/${PXER_CONFIG_FILE:-cvtt_musvc.cfg}"
|
|
||||||
|
Cmd+=" --config=${CONFIG_FILE:-/config/cvtt_musvc.cfg}"
|
||||||
Cmd+=" --log_file=${LogDir}/${PXER_LOG_FILE:-%T.pricer.log}"
|
Cmd+=" --log_file=${LogDir}/${PXER_LOG_FILE:-%T.pricer.log}"
|
||||||
|
|
||||||
Cmd+=" ${PXER_ADD_ARGS}"
|
Cmd+=" ${PXER_ADD_ARGS}"
|
||||||
echo ${Cmd}
|
echo ${Cmd}
|
||||||
exec ${Cmd}
|
exec ${Cmd}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user