From 7c806107ca2dbaae883a21def7e9c1f1fd394443 Mon Sep 17 00:00:00 2001 From: Oleg Sheynin Date: Tue, 20 Aug 2024 21:26:00 -0400 Subject: [PATCH] executor start added --- docker/trading/executor/start_executor.sh | 66 +++++++++++++++++++++++ release_version.txt | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100755 docker/trading/executor/start_executor.sh diff --git a/docker/trading/executor/start_executor.sh b/docker/trading/executor/start_executor.sh new file mode 100755 index 0000000..3855eea --- /dev/null +++ b/docker/trading/executor/start_executor.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +usage() { + echo -n "Usage: $0" + echo -n " [-c ]" + echo -n " [-e ]" + echo -n " [-a "] + echo + exit 1 +} + +args=${*} + +ConfigServer=cloud23.cvtt.vpn:6789 +ActiveExchanges=ALPACA_SNDBX-MDPORTAL +AdminPort=7222 +Book="" + +while getopts ":c:e:a:" opt; do + case ${opt} in + c ) + ConfigServer=$OPTARG + ;; + e ) + ActiveExchanges=$OPTARG + ;; + a ) + AdminPort=$OPTARG + ;; + \? ) + echo "Invalid option: -$OPTARG" >&2 + usage + ;; + : ) + echo "Option -$OPTARG requires an argument." >&2 + usage + ;; + esac +done + +echo "ConfigServer=${ConfigServer}" +echo "ActiveExchanges=${ActiveExchanges}" +echo "Book=${Book}" +echo "AdminPort=${AdminPort}" + +if [ "${Book}" == "" ]; then + echo "Book is missing" + usage +fi + +ImageName=risk_mgr +DockerRegistry=cloud21.cvtt.vpn:5500 +DockerImage=${DockerRegistry}/${ImageName} + +Cmd="docker run" +Cmd="${Cmd} --detach" +Cmd="${Cmd} --restart=unless-stopped" +Cmd="${Cmd} --pull=always" +Cmd="${Cmd} --network=host" +Cmd="${Cmd} --name=${ImageName}.${Book}" +Cmd="${Cmd} --volume /home/cvtt/prod/logs:/logs" +Cmd="${Cmd} ${DockerImage}" +Cmd="${Cmd} ${args}" + +echo $Cmd +eval $Cmd diff --git a/release_version.txt b/release_version.txt index de5f639..51c4b8f 100644 --- a/release_version.txt +++ b/release_version.txt @@ -1 +1 @@ -1.5.4,fix: md_portal docker start +1.5.5,executor start added