Compare commits

..

11 Commits

Author SHA1 Message Date
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
oleg 9f789738e9 using HA trading-calendar and config service 2025-02-03 15:31:34 -05:00
oleg d5e1f0a446 fix 2025-01-27 18:24:47 -05:00
oleg f639bd41f5 docker build imagages script fix 2025-01-27 18:15:30 -05:00
oleg a35bcf089e minor 2025-01-27 17:07:28 -05:00
oleg 5bf02ae67a release_version.txt -> VERSION 2025-01-27 16:41:22 -05:00
oleg 43c50befc4 docker to use CONFIG_SERVICE 2025-01-24 11:39:04 -05:00
oleg 48ecf7cca2 storage healthcheck - ignore known_hosts 2025-01-22 17:48:13 -05:00
24 changed files with 205 additions and 101 deletions
+1
View File
@@ -0,0 +1 @@
2.0.4,replacing "latest" with real docker image tag
+6 -5
View File
@@ -14,9 +14,9 @@ dist_user=cvttdist
dist_host="cloud21.cvtt.vpn" dist_host="cloud21.cvtt.vpn"
dist_ssh_port="22" dist_ssh_port="22"
dist_locations="cloud21.cvtt.vpn:22 hs01.cvtt.vpn:22"
# ---------------- Settings # ---------------- Settings
dist_locations="cloud21.cvtt.vpn:22 hs01.cvtt.vpn:22"
version_file="VERSION"
# ---------------- cmdline # ---------------- cmdline
prj= prj=
brnch=master brnch=master
@@ -145,11 +145,12 @@ if [ "${?}" != "0" ]; then
fi fi
release_version=$(cat release_version.txt | awk -F',' '{print $1}') release_version=$(cat ${version_file} | awk -F',' '{print $1}')
whats_new=$(cat release_version.txt | awk -F',' '{print $2}') whats_new=$(cat ${version_file} | awk -F',' '{print $2}')
echo "--------------------------------" echo "--------------------------------"
echo "Version file: ${version_file}"
echo "Release version: ${release_version}" echo "Release version: ${release_version}"
confirm confirm
@@ -175,7 +176,7 @@ if [ "${project}" == "cvtt-rust" ]; then
release_dir=${prj_dir}/dist/${project} release_dir=${prj_dir}/dist/${project}
cmd_arr+=("mkdir -p ${release_dir}") cmd_arr+=("mkdir -p ${release_dir}")
cmd_arr+=("cp release_version.txt ${release_dir}") cmd_arr+=("cp ${version_file} ${release_dir}")
jq_cmd="jq '.packages[] | select(.targets[].kind[] == \"bin\") | .name'" jq_cmd="jq '.packages[] | select(.targets[].kind[] == \"bin\") | .name'"
apps=$(cargo metadata --no-deps --format-version 1 --manifest-path=${prj_dir}/Cargo.toml | eval $jq_cmd | uniq) apps=$(cargo metadata --no-deps --format-version 1 --manifest-path=${prj_dir}/Cargo.toml | eval $jq_cmd | uniq)
+79 -7
View File
@@ -5,6 +5,11 @@ usage() {
echo echo
exit 1 exit 1
} }
error_exit() {
echo "ERROR: ${1}"
exit 1
}
# --- Settings # --- Settings
RootDir=${1} RootDir=${1}
if [ -z "${RootDir}" ] ; then if [ -z "${RootDir}" ] ; then
@@ -14,7 +19,7 @@ fi
RegistryService=cloud21.cvtt.vpn:5500 RegistryService=cloud21.cvtt.vpn:5500
RegistryProtocol=http RegistryProtocol=http
ConfigUrl=http://cloud23.cvtt.vpn:6789/admin/docker_images ConfigUrl=http://cloud16.cvtt.vpn:6789/admin/docker_images
ReleaseHost="cloud21.cvtt.vpn" ReleaseHost="cloud21.cvtt.vpn"
@@ -37,6 +42,7 @@ build_docker_image() {
image_name=${2} image_name=${2}
docker_dev_path=${3} docker_dev_path=${3}
project=${4} project=${4}
test_script=${5}
echo "Building ${title}..." echo "Building ${title}..."
echo "ImageName=${image_name}" echo "ImageName=${image_name}"
@@ -76,29 +82,93 @@ build_docker_image() {
Cmd+=" -t ${image_name}:${image_version}" Cmd+=" -t ${image_name}:${image_version}"
Cmd+=" -f ${DockerDir}/Dockerfile ${RootDir}" Cmd+=" -f ${DockerDir}/Dockerfile ${RootDir}"
echo ${Cmd} echo ${Cmd}
eval ${Cmd} 1>&2 || exit eval ${Cmd} 1>&2 || error_exit "Docker build failed"
if [ ! -z "${test_script}" ] && [ "${test_script}" != "null" ]; then
if [ ! -f ${DockerDir}/${test_script} ]; then
error_exit "Test script ${test_script} is missing"
fi
echo "Running test script ${test_script} for ${image_name}"
Cmd="docker cp ${DockerDir}/${test_script} ${image_name}:/"
echo ${Cmd}
eval ${Cmd} 1>&2 || error_exit "Test script copy failed"
Cmd="docker exec ${image_name} chmod +x /${test_script}"
echo ${Cmd}
eval ${Cmd} 1>&2 || error_exit "Test script chmod failed"
Cmd="docker run"
Cmd+=" --rm"
Cmd+=" -d"
Cmd+=" --name test-container"
Cmd+=" ${image_name}"
Cmd+=" /bin/bash -c /${TestScript}"
echo ${Cmd}
eval ${Cmd} 1>&2 || error_exit "Test script run failed"
echo "Removing test script ${test_script} from ${image_name}"
Cmd="docker exec ${image_name} rm /${test_script}"
echo ${Cmd}
eval ${Cmd} 1>&2 || error_exit "Test script remove failed"
fi
: <<'COMMENT'
-------------------------
Every single docker_dev project must have a test script
image_test.sh
that is copied to the image's root directory.
-------------------------
Cmd="docker run"
Cmd+=" --rm"
Cmd+=" -d"
Cmd+=" --name test-container"
Cmd+=" ${image_name}"
Cmd+=" /bin/bash -c /${TestScript}"
echo ${Cmd}
eval ${Cmd} 1>&2 || exit 1
# Get the exit status of the test script
docker wait test-container
# Check the exit status of the container
EXIT_STATUS=$?
# Analyze the exit status
if [ ${EXIT_STATUS} -ne 0 ]; then
echo "Tests Failed"
exit 1
fi
COMMENT
Cmd="docker tag" Cmd="docker tag"
Cmd+=" ${image_name}:latest" Cmd+=" ${image_name}:latest"
Cmd+=" ${RegistryService}/${image_name}:latest" Cmd+=" ${RegistryService}/${image_name}:latest"
echo ${Cmd} echo ${Cmd}
eval ${Cmd} || exit eval ${Cmd} || error_exit "Docker tag failed"
Cmd="docker tag" Cmd="docker tag"
Cmd+=" ${image_name}:${image_version}" Cmd+=" ${image_name}:${image_version}"
Cmd+=" ${RegistryService}/${image_name}:${image_version}" Cmd+=" ${RegistryService}/${image_name}:${image_version}"
echo ${Cmd} echo ${Cmd}
eval ${Cmd} || exit eval ${Cmd} || error_exit "Docker tag 2failed"
Cmd="docker push" Cmd="docker push"
Cmd+=" ${RegistryService}/${image_name}:latest" Cmd+=" ${RegistryService}/${image_name}:latest"
echo ${Cmd} echo ${Cmd}
eval ${Cmd} || exit eval ${Cmd} || error_exit "Docker push failed"
Cmd="docker push" Cmd="docker push"
Cmd+=" ${RegistryService}/${image_name}:${image_version}" Cmd+=" ${RegistryService}/${image_name}:${image_version}"
echo ${Cmd} echo ${Cmd}
eval ${Cmd} || exit eval ${Cmd} || error_exit "Docker push 2 failed"
echo "Removing the copy of ${project} from ${RootDir}" echo "Removing the copy of ${project} from ${RootDir}"
Cmd="rm -rf ${RootDir}/${project}" Cmd="rm -rf ${RootDir}/${project}"
@@ -166,6 +236,7 @@ get_latest_dist_version() {
echo "${Version}" echo "${Version}"
} }
echo "------------------------------------- Starting ${0} ${*}"
echo RootDir=${RootDir} echo RootDir=${RootDir}
cd ${RootDir} cd ${RootDir}
@@ -188,8 +259,9 @@ for item in "${Jobs[@]}"; do
image_name=$(echo "$item" | jq -r '.value.image_name') image_name=$(echo "$item" | jq -r '.value.image_name')
docker_dev_path=$(echo "$item" | jq -r '.value.docker_dev_path') docker_dev_path=$(echo "$item" | jq -r '.value.docker_dev_path')
project=$(echo "$item" | jq -r '.value.based_on_project') project=$(echo "$item" | jq -r '.value.based_on_project')
test_script=$(echo "$item" | jq -r '.value.test_script')
build_docker_image "$title" "$image_name" "$docker_dev_path" "$project" build_docker_image "$title" "$image_name" "$docker_dev_path" "$project" "${test_script}"
done done
Cmd="rm -rf ${RootDir}/docker_dev" Cmd="rm -rf ${RootDir}/docker_dev"
+1 -1
View File
@@ -9,7 +9,7 @@ get_user_hosts() {
local User=${1} local User=${1}
local Domain=${2} local Domain=${2}
Cmd="curl -s http://cloud23.cvtt.vpn:6789/admin/cvtt_hosts" Cmd="curl -s http://cloud16.cvtt.vpn:6789/admin/cvtt_hosts"
Cmd="${Cmd} | ${HOME}/bin/hjson -j" Cmd="${Cmd} | ${HOME}/bin/hjson -j"
Cmd="${Cmd} | jq -r" Cmd="${Cmd} | jq -r"
Cmd="${Cmd} --arg domain \"${Domain}\"" Cmd="${Cmd} --arg domain \"${Domain}\""
@@ -17,7 +17,7 @@ is_container_running() {
fi fi
} }
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
is_business_day() { is_business_day() {
dt=${1} dt=${1}
+19 -13
View File
@@ -1,26 +1,32 @@
#!/bin/bash #!/bin/bash
# ------- Settings
ImageTag=1.6.9
DockerRegistry=cloud21.cvtt.vpn:5500
DockerImage=${DockerRegistry}/crypto_md_day:${ImageTag}
# ------- Settings
host=${1} host=${1}
date=${2} date=${2}
DockerRegistry=cloud21.cvtt.vpn:5500
DockerImage=${DockerRegistry}/crypto_md_day
if [ -z ${date} ] ; then if [ -z ${date} ] ; then
date=$(date -d "yesterday" +%Y%m%d) date=$(date -d "yesterday" +%Y%m%d)
fi fi
Cmd="docker run" Cmd="docker run"
Cmd="${Cmd} --pull=always" Cmd+=" --pull=always"
Cmd="${Cmd} --network=host" Cmd+=" --network=host"
Cmd="${Cmd} --name=crypto_md_day.${host}.${date}" Cmd+=" --name=crypto_md_day.${host}.${date}"
Cmd="${Cmd} --rm" Cmd+=" --rm"
Cmd="${Cmd} --volume=${HOME}/.creds:/.creds" Cmd+=" --volume=${HOME}/.creds:/.creds"
Cmd="${Cmd} ${DockerImage}" Cmd+=" -e CONFIG_SERVICE=cloud16.cvtt.vpn:6789"
Cmd="${Cmd} -h ${host}" Cmd+=" ${DockerImage}"
Cmd="${Cmd} -d ${date}" Cmd+=" -h ${host}"
# Cmd="${Cmd} -s coinbase,bnbspot,bnbfut" Cmd+=" -d ${date}"
Cmd="${Cmd} -s coinbase,bnbspot" # Cmd+=" -s coinbase,bnbspot,bnbfut"
Cmd+=" -s coinbase,bnbspot"
echo $Cmd echo $Cmd
eval $Cmd eval $Cmd
+20 -13
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
} }
@@ -15,7 +15,7 @@ is_container_running() {
fi fi
} }
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
is_business_day() { is_business_day() {
dt=${1} dt=${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
@@ -86,16 +92,17 @@ fi
echo "date_to_load=${date_to_load}" echo "date_to_load=${date_to_load}"
Cmd="docker run" Cmd="docker run"
Cmd="${Cmd} --pull=always" Cmd+=" --pull=always"
Cmd="${Cmd} --network=host" Cmd+=" --network=host"
Cmd="${Cmd} --name=${ContainerName}" Cmd+=" --name=${ContainerName}"
Cmd="${Cmd} --rm" Cmd+=" --rm"
Cmd="${Cmd} --volume=${LogDir}:/logs" Cmd+=" --volume=${LogDir}:/logs"
Cmd="${Cmd} --volume=${HOME}/.creds:/.creds" Cmd+=" --volume=${HOME}/.creds:/.creds"
Cmd="${Cmd} ${DockerImage}" Cmd+=" -e CONFIG_SERVICE=cloud16.cvtt.vpn:6789"
Cmd="${Cmd} -d ${date_to_load}" Cmd+=" ${DockerImage}"
Cmd+=" -d ${date_to_load}"
if [ -n "${NumSymbols}" ]; then if [ -n "${NumSymbols}" ]; then
Cmd="${Cmd} -N ${NumSymbols}" Cmd+=" -N ${NumSymbols}"
fi fi
echo $Cmd echo $Cmd
+19 -13
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
} }
@@ -15,7 +15,7 @@ is_container_running() {
fi fi
} }
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
is_business_day() { is_business_day() {
dt=${1} dt=${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'))
@@ -91,15 +96,16 @@ fi
echo "date_to_load=${date_to_load}" echo "date_to_load=${date_to_load}"
Cmd="docker run" Cmd="docker run"
Cmd="${Cmd} --pull=always" Cmd+=" --pull=always"
Cmd="${Cmd} --network=host" Cmd+=" --network=host"
Cmd="${Cmd} --name=${ContainerName}" Cmd+=" --name=${ContainerName}"
Cmd="${Cmd} --rm" Cmd+=" --rm"
Cmd="${Cmd} --volume=${LogDir}:/logs" Cmd+=" --volume=${LogDir}:/logs"
Cmd="${Cmd} --volume=${HOME}/.creds:/.creds" Cmd+=" --volume=${HOME}/.creds:/.creds"
Cmd="${Cmd} ${DockerImage}" Cmd+=" -e CONFIG_SERVICE=cloud16.cvtt.vpn:6789"
Cmd="${Cmd} -d ${date_to_load}" Cmd+=" ${DockerImage}"
Cmd="${Cmd} -S ${Symbols}" Cmd+=" -d ${date_to_load}"
Cmd+=" -S ${Symbols}"
echo $Cmd echo $Cmd
eval $Cmd eval $Cmd
+18 -11
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
@@ -44,16 +50,17 @@ fi
Cmd="docker run" Cmd="docker run"
Cmd="${Cmd} -d" Cmd+=" -d"
Cmd="${Cmd} --rm" Cmd+=" --rm"
Cmd="${Cmd} --network=host" Cmd+=" --network=host"
Cmd="${Cmd} --pull=always" # Cmd+=" --pull=always"
Cmd="${Cmd} --name=${ContainerName}" Cmd+=" --name=${ContainerName}"
Cmd="${Cmd} -v /home/cvtt/.creds:/.creds" Cmd+=" -v /home/cvtt/.creds:/.creds"
Cmd="${Cmd} -v /home/cvtt/prod/data:/app/data" Cmd+=" -v /home/cvtt/prod/data:/app/data"
Cmd="${Cmd} -v /home/cvtt/prod/logs:/logs" Cmd+=" -v /home/cvtt/prod/logs:/logs"
Cmd="${Cmd} cloud21.cvtt.vpn:5500/md_recorder:latest" Cmd+=" -e CONFIG_SERVICE=cloud16.cvtt.vpn:6789"
Cmd="${Cmd} ${job}" Cmd+=" ${DockerImage}"
Cmd+=" ${job}"
echo ${Cmd} echo ${Cmd}
eval ${Cmd} eval ${Cmd}
@@ -45,15 +45,16 @@ if is_container_running "$ContainerName"; then
fi fi
Cmd="docker run" Cmd="docker run"
Cmd="${Cmd} -d" Cmd+=" -d"
Cmd="${Cmd} --rm" Cmd+=" --rm"
Cmd="${Cmd} --network=host" Cmd+=" --network=host"
Cmd="${Cmd} --pull=always" Cmd+=" --pull=always"
Cmd="${Cmd} --name=${ContainerName}" Cmd+=" --name=${ContainerName}"
Cmd="${Cmd} -v /home/cvtt/.creds:/.creds" Cmd+=" -v /home/cvtt/.creds:/.creds"
Cmd="${Cmd} -v /home/cvtt/prod/logs:/logs" Cmd+=" -v /home/cvtt/prod/logs:/logs"
Cmd="${Cmd} cloud21.cvtt.vpn:5500/md_recorder_monitor:latest" Cmd+=" -e CONFIG_SERVICE=cloud16.cvtt.vpn:6789"
Cmd="${Cmd} ${Instance} ${AdminPort}" Cmd+=" cloud21.cvtt.vpn:5500/md_recorder_monitor:latest"
Cmd+=" ${Instance} ${AdminPort}"
echo ${Cmd} echo ${Cmd}
eval ${Cmd} eval ${Cmd}
+1
View File
@@ -8,6 +8,7 @@ Cmd+=" --network=host"
Cmd+=" --name=crypto_exch_stats" Cmd+=" --name=crypto_exch_stats"
Cmd+=" --volume=${HOME}/prod/data:/app/data" Cmd+=" --volume=${HOME}/prod/data:/app/data"
Cmd+=" --volume=${HOME}/prod/logs:/logs" Cmd+=" --volume=${HOME}/prod/logs:/logs"
Cmd+=" -e CONFIG_SERVICE=cloud16.cvtt.vpn:6789"
Cmd+=" cloud21.cvtt.vpn:5500/crypto_exch_stats:latest" Cmd+=" cloud21.cvtt.vpn:5500/crypto_exch_stats:latest"
echo ${Cmd} echo ${Cmd}
-1
View File
@@ -1 +0,0 @@
1.9.5,homestore ==> hs01
+1 -1
View File
@@ -15,7 +15,7 @@ is_business_day() {
dt=${1} dt=${1}
date=$(date -d "${dt}" +"%Y-%m-%d") date=$(date -d "${dt}" +"%Y-%m-%d")
CalendarURL=http://cloud23.cvtt.vpn:8000/api/v1/markets/hours?mic=XNYS CalendarURL=https://trading-calendar.cvtt.net/api/v1/markets/hours?mic=XNYS
URL="${CalendarURL}&start=${date}&end=${date}" URL="${CalendarURL}&start=${date}&end=${date}"
open_time=$(curl -s "${URL}" | jq '.[] | .open_time') open_time=$(curl -s "${URL}" | jq '.[] | .open_time')
if [ -n "${open_time}" ]; then if [ -n "${open_time}" ]; then
@@ -31,7 +31,7 @@ echo "Schemas=${Schemas}"
Cmd= Cmd=
Cmd="${Python}" Cmd="${Python}"
Cmd="${Cmd} ${RootDir}/cvttpy/research/utils/archive_ts_md.py" Cmd="${Cmd} ${RootDir}/cvttpy/research/utils/archive_ts_md.py"
Cmd="${Cmd} --config=http://cloud23.cvtt.vpn:6789/apps/md_recorder" Cmd="${Cmd} --config=http://cloud16.cvtt.vpn:6789/apps/md_recorder"
Cmd="${Cmd} --db_credentials_key=${CredKey}" Cmd="${Cmd} --db_credentials_key=${CredKey}"
Cmd="${Cmd} --date=${yesterday}" Cmd="${Cmd} --date=${yesterday}"
Cmd="${Cmd} --schemas=${Schemas}" Cmd="${Cmd} --schemas=${Schemas}"
+2 -2
View File
@@ -3,7 +3,7 @@
usage() { usage() {
echo -n "Usage: ${0}" echo -n "Usage: ${0}"
echo -n " [-c <config (dflt: apps/cvtt_eqt_alpaca)>]" echo -n " [-c <config (dflt: apps/cvtt_eqt_alpaca)>]"
echo -n " [-s <config_serverice (dflt: http://cloud23.cvtt.vpn:6789)>]" echo -n " [-s <config_serverice (dflt: http://cloud16.cvtt.vpn:6789)>]"
echo -n " [-N <name (dflt: ALPACA-SNDBX)>]" echo -n " [-N <name (dflt: ALPACA-SNDBX)>]"
echo echo
exit 1 exit 1
@@ -23,7 +23,7 @@ export PYTHONPATH=${RootDir}
StatusChannel=Status-CVTT StatusChannel=Status-CVTT
AlertChannel=Alerts-CVTT AlertChannel=Alerts-CVTT
Sender=${RootDir}/ops/utils/send_mmost.sh Sender=${RootDir}/ops/utils/send_mmost.sh
ConfigService=http://cloud23.cvtt.vpn:6789 ConfigService=http://cloud16.cvtt.vpn:6789
Config=apps/cvtt_eqt_alpaca Config=apps/cvtt_eqt_alpaca
Name="ALPACA-SNDBX" Name="ALPACA-SNDBX"
+1 -1
View File
@@ -13,7 +13,7 @@ RootDir="${HOME}/prod"
AlertChannel=Alerts-CVTT AlertChannel=Alerts-CVTT
Sender=${RootDir}/ops/utils/send_mmost.sh Sender=${RootDir}/ops/utils/send_mmost.sh
ConfigUrl=http://cloud23.cvtt.vpn:6789/admin/cvtt_hosts ConfigUrl=http://cloud16.cvtt.vpn:6789/admin/cvtt_hosts
HOSTS_CONFIG=$(curl -s ${ConfigUrl} | ${HOME}/bin/hjson -j) HOSTS_CONFIG=$(curl -s ${ConfigUrl} | ${HOME}/bin/hjson -j)
+1 -1
View File
@@ -12,7 +12,7 @@ RootDir="${HOME}/prod"
AlertChannel=Alerts-CVTT AlertChannel=Alerts-CVTT
Sender=${RootDir}/ops/utils/send_mmost.sh Sender=${RootDir}/ops/utils/send_mmost.sh
ConfigUrl=http://cloud23.cvtt.vpn:6789/admin/cvtt_services ConfigUrl=http://cloud16.cvtt.vpn:6789/admin/cvtt_services
SERVICES_CONFIG=$(curl -s ${ConfigUrl} | ${HOME}/bin/hjson -j) SERVICES_CONFIG=$(curl -s ${ConfigUrl} | ${HOME}/bin/hjson -j)
+17 -14
View File
@@ -18,14 +18,14 @@ get_user_hosts() {
local User=${1} local User=${1}
local Domain=${2} local Domain=${2}
Cmd="curl -s http://cloud23.cvtt.vpn:6789/admin/cvtt_hosts" Cmd="curl -s http://cloud16.cvtt.vpn:6789/admin/cvtt_hosts"
Cmd="${Cmd} | ${HOME}/bin/hjson -j" Cmd+=" | ${HOME}/bin/hjson -j"
Cmd="${Cmd} | jq -r" Cmd+=" | jq -r"
Cmd="${Cmd} --arg domain \"${Domain}\"" Cmd+=" --arg domain \"${Domain}\""
Cmd="${Cmd} --arg usr \"${User}\"" Cmd+=" --arg usr \"${User}\""
Cmd="${Cmd} '.[\$domain] | to_entries[] | select(.value.users[] | contains(\$usr)) | .key'" Cmd+=" '.[\$domain] | to_entries[] | select(.value.users[] | contains(\$usr)) | .key'"
Cmd="${Cmd} | sed 's/\$/.${Domain}/'" Cmd+=" | sed 's/\$/.${Domain}/'"
eval ${Cmd} eval ${Cmd}
} }
@@ -66,13 +66,16 @@ function storage_check() {
else else
port=22 port=22
fi fi
Cmd="ssh -p ${port} $host" Cmd="ssh -p ${port}"
Cmd="${Cmd} eval \"df -hTl" Cmd+=" -o StrictHostKeyChecking=no"
Cmd="${Cmd} -x squashfs" Cmd+=" -o UserKnownHostsFile=/dev/null"
Cmd="${Cmd} -x tmpfs" Cmd+=" $host"
Cmd="${Cmd} -x vfat" Cmd+=" eval \"df -hTl"
Cmd="${Cmd} -x devtmpfs" Cmd+=" -x squashfs"
Cmd="${Cmd} | grep -v Filesystem\"" Cmd+=" -x tmpfs"
Cmd+=" -x vfat"
Cmd+=" -x devtmpfs"
Cmd+=" | grep -v Filesystem\""
IFS=$'\n' ; lines=$(eval ${Cmd}) IFS=$'\n' ; lines=$(eval ${Cmd})
for ln in $lines for ln in $lines
+2 -2
View File
@@ -4,7 +4,7 @@ Start=${1}
NumJobs=${2} NumJobs=${2}
InstListFile=${3} InstListFile=${3}
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
is_business_day() { is_business_day() {
dt=${1} dt=${1}
@@ -46,7 +46,7 @@ echo "Start=${Start} End=${End} NumJobs=${NumJobs}"
export PYTHONPATH=/home/cvtt/prod export PYTHONPATH=/home/cvtt/prod
export Python=/home/cvtt/.pyenv/python3.12-venv/bin/python3 export Python=/home/cvtt/.pyenv/python3.12-venv/bin/python3
export Config=http://cloud23.cvtt.vpn:6789/apps/minimal_md export Config=http://cloud16.cvtt.vpn:6789/apps/minimal_md
export PyScript=/home/cvtt/prod/cvttpy/exchanges/alpaca/hist_md/hist_md_bars.py export PyScript=/home/cvtt/prod/cvttpy/exchanges/alpaca/hist_md/hist_md_bars.py
export OutputDir=/home/cvtt/prod/archive/md_archive/equity/alpaca_md # Local export OutputDir=/home/cvtt/prod/archive/md_archive/equity/alpaca_md # Local
@@ -5,7 +5,7 @@ export PYTHONPATH=${HOME}/prod
Python=${HOME}/.pyenv/python3.12-venv/bin/python3 Python=${HOME}/.pyenv/python3.12-venv/bin/python3
Script=${HOME}/prod/cvttpy/exchanges/alpaca/hist_md/rl_calc_loader.py Script=${HOME}/prod/cvttpy/exchanges/alpaca/hist_md/rl_calc_loader.py
DbFile=${HOME}/prod/data/rel_liquidity.db DbFile=${HOME}/prod/data/rel_liquidity.db
Config=http://cloud23.cvtt.vpn:6789/apps/minimal_md_eqt Config=http://cloud16.cvtt.vpn:6789/apps/minimal_md_eqt
Cmd="${Python}" Cmd="${Python}"
Cmd="${Cmd} ${Script}" Cmd="${Cmd} ${Script}"
@@ -3,7 +3,7 @@
is_business_day() { is_business_day() {
dt=${1} dt=${1}
CalendarURL=http://cloud23.cvtt.vpn:8000/api/v1/markets/hours?mic=XNYS CalendarURL=https://trading-calendar.cvtt.net/api/v1/markets/hours?mic=XNYS
open_time=$(curl -s "${CalendarURL}&start=${dt}&end=${dt}" | jq '.[] | .open_time') open_time=$(curl -s "${CalendarURL}&start=${dt}&end=${dt}" | jq '.[] | .open_time')
if [ -n "${open_time}" ]; then if [ -n "${open_time}" ]; then
return 0 return 0
@@ -4,7 +4,7 @@ export PYTHONPATH=/home/cvtt/prod
Cmd="/home/cvtt/.pyenv/python3.12-venv/bin/python3" Cmd="/home/cvtt/.pyenv/python3.12-venv/bin/python3"
Cmd="${Cmd} /home/cvtt/prod/cvttpy/apps/research/exchange_trading_stats.py" Cmd="${Cmd} /home/cvtt/prod/cvttpy/apps/research/exchange_trading_stats.py"
Cmd="${Cmd} --config=http://cloud23.cvtt.vpn:6789/apps/tests/listen_market_data" Cmd="${Cmd} --config=http://cloud16.cvtt.vpn:6789/apps/tests/listen_market_data"
Cmd="${Cmd} --active_exchanges=OKX,GEMINI,BITSTAMP,COINBASE_AT,BNBSPOT,KRAKEN" Cmd="${Cmd} --active_exchanges=OKX,GEMINI,BITSTAMP,COINBASE_AT,BNBSPOT,KRAKEN"
Cmd="${Cmd} --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" Cmd="${Cmd} --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"
Cmd="${Cmd} --db_file=/home/cvtt/prod/data/exchange_trading_stats.db" Cmd="${Cmd} --db_file=/home/cvtt/prod/data/exchange_trading_stats.db"
+1 -1
View File
@@ -47,7 +47,7 @@ function rsync_load_version() {
if ssh -q -p ${port} ${user}@${host} "test -d ${rel_dir}/${Project}/${Version}" if ssh -q -p ${port} ${user}@${host} "test -d ${rel_dir}/${Project}/${Version}"
then then
echo "Directory found..." echo "Directory found..."
rsync_cmd="rsync -ahvv -e \"ssh -p ${port}\"" rsync_cmd="rsync -ahv -e \"ssh -p ${port}\""
rsync_cmd="${rsync_cmd} ${user}@${host}:${rel_dir}/${Project}/${Version}" rsync_cmd="${rsync_cmd} ${user}@${host}:${rel_dir}/${Project}/${Version}"
rsync_cmd="${rsync_cmd} ${LocalSoftwareDir}/${Project}/" rsync_cmd="${rsync_cmd} ${LocalSoftwareDir}/${Project}/"
echo ${rsync_cmd} echo ${rsync_cmd}
+1 -1
View File
@@ -6,7 +6,7 @@ SUBDIRS += configs
FILES= FILES=
FILES += release_version.txt FILES += VERSION
all: install all: install