Compare commits

..

7 Commits

Author SHA1 Message Date
Cryptoval2 06610de992 OPS-10 2025-03-21 17:04:23 +00:00
oleg 9aaf356048 OPS-6 2025-03-18 13:47:51 -04:00
oleg f2bb798fff fix 2025-03-07 23:16:48 -05:00
oleg b0a0080a4a replacing "latest" with real docker image tag 2025-03-07 23:12:38 -05:00
oleg e35b15f024 replacing "latest" with real docker image tag 2025-03-07 23:09:39 -05:00
oleg 3bd31b7d8b crypto_md_day - specific docker tag 2025-03-07 23:02:06 -05:00
oleg 085308ff9c using specific version for md_recorder 2025-03-07 22:42:46 -05:00
7 changed files with 62 additions and 17 deletions
+1 -1
View File
@@ -1 +1 @@
2.0.1,using HA trading-calendar and config service 2.0.7,OPS-10
+21 -4
View File
@@ -1,15 +1,32 @@
#!/bin/bash #!/bin/bash
usage() {
echo "Usage: ${0} <docker_image_tag> <host> [<date>]"
exit 1
}
host=${1} # ------- Settings
date=${2}
DockerRegistry=cloud21.cvtt.vpn:5500 DockerRegistry=cloud21.cvtt.vpn:5500
DockerImage=${DockerRegistry}/crypto_md_day # ------- Settings
ImageTag=${1}
host=${2}
date=${3}
if [ -z ${ImageTag} ] ; then
usage
fi
if [ -z ${host} ] ; then
usage
fi
if [ -z ${date} ] ; then if [ -z ${date} ] ; then
date=$(date -d "yesterday" +%Y%m%d) date=$(date -d "yesterday" +%Y%m%d)
fi fi
DockerImage=${DockerRegistry}/crypto_md_day:${ImageTag}
Cmd="docker run" Cmd="docker run"
Cmd+=" --pull=always" Cmd+=" --pull=always"
Cmd+=" --network=host" Cmd+=" --network=host"
+9 -3
View File
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
usage() { usage() {
echo "Usage: $0 -N <num_symbols> [-L <LogDir>] [-d <YYYYMMDD Date>]" echo "Usage: $0 -N <num_symbols> [-L <LogDir>] [-d <YYYYMMDD Date>] [-t <docker_image_tag>]"
exit 1 exit 1
} }
@@ -45,12 +45,12 @@ export -f get_prev_business_day
# ----- Settings # ----- Settings
DockerRegistry=cloud21.cvtt.vpn:5500 DockerRegistry=cloud21.cvtt.vpn:5500
DockerImage=${DockerRegistry}/alpaca_hbar #:latest
ContainerName=alpaca_hbar ContainerName=alpaca_hbar
LogDir=/home/cvtt/prod/logs LogDir=/home/cvtt/prod/logs
ImageTag=0.1.7
# ----- Settings # ----- Settings
while getopts ":d:N:L:" opt; do while getopts ":d:N:L:t:" opt; do
case ${opt} in case ${opt} in
d ) d )
date_to_load=$OPTARG date_to_load=$OPTARG
@@ -61,6 +61,9 @@ while getopts ":d:N:L:" opt; do
L ) L )
LogDir=$OPTARG LogDir=$OPTARG
;; ;;
t )
ImageTag=$OPTARG
;;
\? ) \? )
echo "Invalid option: -$OPTARG" >&2 echo "Invalid option: -$OPTARG" >&2
usage usage
@@ -72,6 +75,9 @@ while getopts ":d:N:L:" opt; do
esac esac
done done
DockerImage=${DockerRegistry}/alpaca_hbar:${ImageTag} #:latest
if is_container_running "$ContainerName"; then if is_container_running "$ContainerName"; then
echo "Container ${ContainerName} is already running." echo "Container ${ContainerName} is already running."
exit 3 exit 3
+8 -3
View File
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
usage() { usage() {
echo "Usage: $0 -S <symbols> [-L <LogDir>] [-d <YYYYMMDD Date>]" echo "Usage: $0 -S <symbols> [-L <LogDir>] [-d <YYYYMMDD Date>] [-t <docker_image_tag>]"
exit 1 exit 1
} }
@@ -45,12 +45,12 @@ export -f get_prev_business_day
# ----- Settings # ----- Settings
DockerRegistry=cloud21.cvtt.vpn:5500 DockerRegistry=cloud21.cvtt.vpn:5500
DockerImage=${DockerRegistry}/alpaca_qat #:latest
ContainerName=alpaca_qat ContainerName=alpaca_qat
LogDir=/home/cvtt/prod/logs LogDir=/home/cvtt/prod/logs
ImageTag=0.1.7
# ----- Settings # ----- Settings
while getopts ":d:S:L:" opt; do while getopts ":d:S:L:t:" opt; do
case ${opt} in case ${opt} in
d ) d )
date_to_load=$OPTARG date_to_load=$OPTARG
@@ -61,6 +61,9 @@ while getopts ":d:S:L:" opt; do
L ) L )
LogDir=$OPTARG LogDir=$OPTARG
;; ;;
t )
ImageTag=$OPTARG
;;
\? ) \? )
echo "Invalid option: -$OPTARG" >&2 echo "Invalid option: -$OPTARG" >&2
usage usage
@@ -82,6 +85,8 @@ if is_container_running "$ContainerName"; then
exit 3 exit 3
fi fi
DockerImage=${DockerRegistry}/alpaca_qat:${ImageTag} #:latest
if [ -z "${date_to_load}" ]; then if [ -z "${date_to_load}" ]; then
echo "date_to_load is empty" echo "date_to_load is empty"
date_to_load=$(get_prev_business_day $(date -d "yesterday" '+%Y-%m-%d')) date_to_load=$(get_prev_business_day $(date -d "yesterday" '+%Y-%m-%d'))
+9 -3
View File
@@ -3,7 +3,7 @@
ValidJobs=('BNBFUT_CLD21' 'BNBSPOT_CLD21' 'COINBASE_CLD21' 'BNBFUT_CVTTDATA' 'BNBSPOT_CVTTDATA' 'COINBASE_CVTTDATA') ValidJobs=('BNBFUT_CLD21' 'BNBSPOT_CLD21' 'COINBASE_CLD21' 'BNBFUT_CVTTDATA' 'BNBSPOT_CVTTDATA' 'COINBASE_CVTTDATA')
# runs on host to start container # runs on host to start container
usage() { usage() {
echo "Usage: $0 <job_name; one of (${ValidJobs[@]})>" echo "Usage: $0 <job_name; one of (${ValidJobs[@]})> [image_tag]"
exit 1 exit 1
} }
@@ -35,6 +35,12 @@ if ! is_valid "${job}"; then
usage usage
fi fi
ImageTag=${2}
if [ "${ImageTag}" == "" ] ; then
ImageTag="1.6.9"
fi
DockerImage=cloud21.cvtt.vpn:5500/md_recorder:${ImageTag}
ContainerName="md_recorder.${job}" ContainerName="md_recorder.${job}"
if is_container_running "$ContainerName"; then if is_container_running "$ContainerName"; then
@@ -47,13 +53,13 @@ Cmd="docker run"
Cmd+=" -d" Cmd+=" -d"
Cmd+=" --rm" Cmd+=" --rm"
Cmd+=" --network=host" Cmd+=" --network=host"
Cmd+=" --pull=always" # Cmd+=" --pull=always"
Cmd+=" --name=${ContainerName}" Cmd+=" --name=${ContainerName}"
Cmd+=" -v /home/cvtt/.creds:/.creds" Cmd+=" -v /home/cvtt/.creds:/.creds"
Cmd+=" -v /home/cvtt/prod/data:/app/data" Cmd+=" -v /home/cvtt/prod/data:/app/data"
Cmd+=" -v /home/cvtt/prod/logs:/logs" Cmd+=" -v /home/cvtt/prod/logs:/logs"
Cmd+=" -e CONFIG_SERVICE=cloud16.cvtt.vpn:6789" Cmd+=" -e CONFIG_SERVICE=cloud16.cvtt.vpn:6789"
Cmd+=" cloud21.cvtt.vpn:5500/md_recorder:latest" Cmd+=" ${DockerImage}"
Cmd+=" ${job}" Cmd+=" ${job}"
echo ${Cmd} echo ${Cmd}
@@ -27,8 +27,10 @@ run_checklist() {
Commands=( Commands=(
["hs01:cloud21"]="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cloud21/${yr}/${mn} | tail -5" ["hs01:cloud21"]="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cloud21/${yr}/${mn} | tail -5"
["hs01:cvttdata"]="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cvttdata/${yr}/${mn} | tail -5" ["hs01:cvttdata"]="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cvttdata/${yr}/${mn} | tail -5"
["cloud21:cloud21"]="ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/crypto/cloud21/${yr}/${mn} | tail -5" ["hs01:sim"]="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/sim/ | tail -5"
["cloud21:cvttdata"]="ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/crypto/cvttdata/${yr}/${mn} | tail -5" ["cloud21:cloud21"]="ssh cvtt@cloud21.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cloud21/${yr}/${mn} | tail -5"
["cloud21:cvttdata"]="ssh cvtt@cloud21.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cvttdata/${yr}/${mn} | tail -5"
["cloud21:sim"]="ssh cvtt@cloud21.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/sim | tail -5"
["gpushnik"]="ssh oleg@gpushnik.cvtt.vpn 'ls -l /opt/jupyter_gpu/data/crypto_md | tail -10'" ["gpushnik"]="ssh oleg@gpushnik.cvtt.vpn 'ls -l /opt/jupyter_gpu/data/crypto_md | tail -10'"
) )
+10 -1
View File
@@ -29,12 +29,14 @@ run_checklist() {
Commands["hs01"]+="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/${yr}/${sym} | tail -3; " Commands["hs01"]+="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/${yr}/${sym} | tail -3; "
done done
Commands["hs01"]+="echo" Commands["hs01"]+="echo"
Commands["hs01:sim"]="ssh cvtt@hs01.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/sim | tail -5"
Commands["cloud21"]="" Commands["cloud21"]=""
for sym in ${CheckSymbols}; do for sym in ${CheckSymbols}; do
Commands["cloud21"]+="ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/equity/alpaca_md/${yr}/${sym} | tail -3; " Commands["cloud21"]+="ssh cvtt@cloud21.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/${yr}/${sym} | tail -3; "
done done
Commands["cloud21"]+="echo" Commands["cloud21"]+="echo"
Commands["cloud21:sim"]="ssh cvtt@cloud21.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/sim | tail -5"
Commands["gpushnik"]="ssh oleg@gpushnik.cvtt.vpn 'ls -l /opt/jupyter_gpu/data/eqty_md | tail -10'" Commands["gpushnik"]="ssh oleg@gpushnik.cvtt.vpn 'ls -l /opt/jupyter_gpu/data/eqty_md | tail -10'"
@@ -46,6 +48,13 @@ run_checklist() {
done done
} }
tmpfile=$(mktemp)
function cleanup {
cd ${HOME}
rm -f ${tmpfile}
}
trap cleanup EXIT
# run_checklist # run_checklist
tmpfile=$(mktemp) tmpfile=$(mktemp)