Compare commits

...

25 Commits

Author SHA1 Message Date
oleg f61518ae20 homestore /works/cvtt ownership moved to cvtt 2024-09-02 16:42:04 -04:00
oleg 25fd9ab3c4 homestore /works/cvtt ownership moved to cvtt 2024-09-02 16:34:28 -04:00
oleg 66b5cd16dd homestore /works/cvtt ownership moved to cvtt 2024-09-02 16:28:43 -04:00
oleg 1db0d08547 added cvtt_ts_status_checks.sh 2024-08-30 18:26:18 -04:00
oleg b61c3a684a load eqt to research - fix 2024-08-28 10:49:07 -04:00
oleg 78382df12d load eqt to research - fix 2024-08-26 16:59:01 -04:00
oleg bbfb7112bb trading recorder -> docker 2024-08-24 19:19:18 -04:00
oleg 23603ad076 md_portal uses different config 2024-08-24 18:23:27 -04:00
oleg 81fe6372e9 added quant docker start script 2024-08-22 18:36:29 -04:00
oleg 48f77e5280 added quant docker start script 2024-08-22 18:31:14 -04:00
oleg 2c88bc613c added trader docker start script 2024-08-22 15:59:02 -04:00
oleg 085f1af3da added trader docker start script 2024-08-22 15:52:05 -04:00
oleg fa93450b3d fix executor start 2024-08-20 21:55:13 -04:00
oleg 4188dd7c7c fix executor start 2024-08-20 21:50:54 -04:00
oleg 929953c1c4 fix executor start 2024-08-20 21:48:45 -04:00
oleg e562716b73 renamed 2024-08-20 21:45:52 -04:00
oleg 7c806107ca executor start added 2024-08-20 21:26:00 -04:00
oleg 85c4042d00 md_portal docker start 2024-08-19 13:00:44 -04:00
oleg dcca83a3ae trading: risk manager docker initial 2024-08-18 21:25:14 -04:00
oleg e192766c9a load EQT md to GPUshnik fix 2024-08-18 17:31:33 -04:00
oleg 9d9b9c17f6 renamed2 2024-08-18 17:05:06 -04:00
oleg 5ad576b704 renaming checklist script 2024-08-18 17:02:42 -04:00
oleg 6d0e32f6ad progress. md checklists 2024-08-18 16:44:19 -04:00
oleg b57fb2257f progress - intermediate for md checklists 2024-08-18 16:29:40 -04:00
oleg 1dafab8971 fix 2024-08-17 14:39:07 -04:00
22 changed files with 674 additions and 41 deletions
+19 -7
View File
@@ -1,15 +1,30 @@
#!/bin/bash #!/bin/bash
usage() {
echo -n "Usage: ${0}"
echo -n " [-C <config (dflt: apps/cvtt_eqt_alpaca)>]"
echo -n " [-c <config_server (dflt: cloud23.cvtt.vpn:6789)>]"
echo -n " [-e <active_exchanges (ALPACA_SNBOX)>]"
echo -n " [-a <admin_port (7220)>]"
echo -n " [-n <portal_name (MD_PORTAL_ALPACA)>]"
echo
exit 1
}
args=${*} args=${*}
Config=apps/cvtt_eqt_alpaca
ConfigServer=cloud23.cvtt.vpn:6789 ConfigServer=cloud23.cvtt.vpn:6789
ActiveExchanges=ALPACA_SNDBX ActiveExchanges=ALPACA_SNDBX
PortalName=MD_PORTAL_ALPACA PortalName=MD_PORTAL_ALPACA_SNDBX
AdminPort=7220 AdminPort=7220
while getopts ":C:c:e:a:n:" opt; do
while getopts ":c:e:a:n:" opt; do
case ${opt} in case ${opt} in
C )
Config=$OPTARG
;;
c ) c )
ConfigServer=$OPTARG ConfigServer=$OPTARG
;; ;;
@@ -33,6 +48,7 @@ while getopts ":c:e:a:n:" opt; do
esac esac
done done
echo "Config=${Config}"
echo "ConfigServer=${ConfigServer}" echo "ConfigServer=${ConfigServer}"
echo "ActiveExchanges=${ActiveExchanges}" echo "ActiveExchanges=${ActiveExchanges}"
echo "PortalName=${PortalName}" echo "PortalName=${PortalName}"
@@ -43,10 +59,6 @@ ImageName=md_portal
DockerRegistry=cloud21.cvtt.vpn:5500 DockerRegistry=cloud21.cvtt.vpn:5500
DockerImage=${DockerRegistry}/${ImageName} DockerImage=${DockerRegistry}/${ImageName}
if [ -z ${date} ] ; then
date=$(date -d "yesterday" +%Y%m%d)
fi
Cmd="docker run" Cmd="docker run"
Cmd="${Cmd} --detach" Cmd="${Cmd} --detach"
Cmd="${Cmd} --restart=unless-stopped" Cmd="${Cmd} --restart=unless-stopped"
+61
View File
@@ -0,0 +1,61 @@
#!/bin/bash
usage() {
echo -n "Usage: $0"
echo -n " [-c <config_server (dflt: cloud23.cvtt.vpn:6789)>]"
echo -n " [-e <active_exchanges (ALPACA_SNDBX-MDPORTAL)>]"
echo -n " [-a <admin_port (7222)>"]
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 "AdminPort=${AdminPort}"
ImageName=executor
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}"
Cmd="${Cmd} --volume /home/cvtt/prod/logs:/logs"
Cmd="${Cmd} ${DockerImage}"
Cmd="${Cmd} ${args}"
echo $Cmd
eval $Cmd
+86
View File
@@ -0,0 +1,86 @@
#!/bin/bash
usage() {
echo -n "Usage: $0"
echo -n " -b <book>"
echo -n " -S <strategy> (dflt: TRDALGO_001)"
echo -n " [-c <config_server (dflt: cloud23.cvtt.vpn:6789)>]"
echo -n " [-e <active_exchanges (ALPACA_SNDBX-MDPORTAL)>]"
echo -n " [-a <admin_port (7224)>"]
echo
exit 1
}
args=${*}
ConfigServer=cloud23.cvtt.vpn:6789
ActiveExchanges=ALPACA_SNDBX-MDPORTAL
AdminPort=7224
Strategy=DAILY_STOCK_001
Book=""
while getopts ":b:c:e:a:S:" opt; do
case ${opt} in
c )
ConfigServer=$OPTARG
;;
e )
ActiveExchanges=$OPTARG
;;
a )
AdminPort=$OPTARG
;;
b )
Book=$OPTARG
;;
S )
Strategy=$OPTARG
;;
\? )
echo "Invalid option: -$OPTARG" >&2
usage
;;
: )
echo "Option -$OPTARG requires an argument." >&2
usage
;;
esac
done
if [ "${Book}" == "" ]; then
echo "Book is missing"
usage
fi
echo "ConfigServer=${ConfigServer}"
echo "ActiveExchanges=${ActiveExchanges}"
echo "Book=${Book}"
echo "Strategy=${Strategy}"
echo "AdminPort=${AdminPort}"
if [ "${Book}" == "" ]; then
echo "Book is missing"
usage
fi
ImageName=quant
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
+74
View File
@@ -0,0 +1,74 @@
#!/bin/bash
usage() {
echo -n "Usage: $0"
echo -n " -b <book>"
echo -n " [-c <config_server (dflt: cloud23.cvtt.vpn:6789)>]"
echo -n " [-e <active_exchanges (ALPACA_SNDBX-MDPORTAL)>]"
echo -n " [-a <admin_port (7223)>"]
echo
exit 1
}
args=${*}
ConfigServer=cloud23.cvtt.vpn:6789
ActiveExchanges=ALPACA_SNDBX-MDPORTAL
AdminPort=7223
Book=""
while getopts ":b:c:e:a:" opt; do
case ${opt} in
c )
ConfigServer=$OPTARG
;;
e )
ActiveExchanges=$OPTARG
;;
a )
AdminPort=$OPTARG
;;
b )
Book=$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
+87
View File
@@ -0,0 +1,87 @@
#!/bin/bash
usage() {
echo -n "Usage: $0"
echo -n " -b <book>"
echo -n " -A <algo> (dflt: TRDALGO_001)"
echo -n " [-c <config_server (dflt: cloud23.cvtt.vpn:6789)>]"
echo -n " [-e <active_exchanges (ALPACA_SNDBX-MDPORTAL)>]"
echo -n " [-a <admin_port (7223)>"]
echo
exit 1
}
args=${*}
# ConfigServer=cloud16.cvtt.vpn
ConfigServer=cloud23.cvtt.vpn:6789
ActiveExchanges=ALPACA_SNDBX-MDPORTAL
AdminPort=7226
Algo=TRDALGO_001
Book=""
while getopts ":b:c:e:a:" opt; do
case ${opt} in
c )
ConfigServer=$OPTARG
;;
e )
ActiveExchanges=$OPTARG
;;
a )
AdminPort=$OPTARG
;;
b )
Book=$OPTARG
;;
A )
Algo=$OPTARG
;;
\? )
echo "Invalid option: -$OPTARG" >&2
usage
;;
: )
echo "Option -$OPTARG requires an argument." >&2
usage
;;
esac
done
if [ "${Book}" == "" ]; then
echo "Book is missing"
usage
fi
echo "ConfigServer=${ConfigServer}"
echo "ActiveExchanges=${ActiveExchanges}"
echo "Book=${Book}"
echo "Algo=${Algo}"
echo "AdminPort=${AdminPort}"
if [ "${Book}" == "" ]; then
echo "Book is missing"
usage
fi
ImageName=trader
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
@@ -0,0 +1,81 @@
#!/bin/bash
usage() {
echo -n "Usage: $0"
echo -n " -b <book>"
echo -n " [-C <config (dflt: apps/cvtt_eqt_alpaca)>]"
echo -n " [-c <config_server (dflt: cloud23.cvtt.vpn:6789)>]"
echo -n " [-e <active_exchanges (ALPACA_SNDBX-MDPORTAL)>]"
echo -n " [-a <admin_port (7223)>"]
echo
exit 1
}
args=${*}
# ConfigServer=cloud16.cvtt.vpn
ConfigServer=cloud23.cvtt.vpn:6789
ActiveExchanges=ALPACA_SNDBX-MDPORTAL
AdminPort=7225
Book=""
Config=apps/cvtt_eqt_alpaca
while getopts ":C:b:c:e:a:" opt; do
case ${opt} in
c )
ConfigServer=$OPTARG
;;
e )
ActiveExchanges=$OPTARG
;;
a )
AdminPort=$OPTARG
;;
b )
Book=$OPTARG
;;
\? )
echo "Invalid option: -$OPTARG" >&2
usage
;;
: )
echo "Option -$OPTARG requires an argument." >&2
usage
;;
esac
done
if [ "${Book}" == "" ]; then
echo "Book is missing"
usage
fi
echo "Config=${Config}"
echo "ConfigServer=${ConfigServer}"
echo "ActiveExchanges=${ActiveExchanges}"
echo "Book=${Book}"
echo "AdminPort=${AdminPort}"
if [ "${Book}" == "" ]; then
echo "Book is missing"
usage
fi
ImageName=trading_recorder
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
+1 -1
View File
@@ -1 +1 @@
1.4.8F,mostly cleaning+fix 1.6.3F2,homestore /works/cvtt ownership moved to cvtt
+1 -1
View File
@@ -69,7 +69,7 @@ if [ "${host}" == "cloud21" ] ; then
SourceRootDir="/opt/store/cvtt/md_archive/crypto/${source}" SourceRootDir="/opt/store/cvtt/md_archive/crypto/${source}"
elif [ "${host}" == "homestore" ]; then elif [ "${host}" == "homestore" ]; then
SourceHost=homestore.cvtt.vpn SourceHost=homestore.cvtt.vpn
SourceUser=oleg SourceUser=cvtt
SourceRootDir=/works/cvtt/md_archive/crypto/${source} SourceRootDir=/works/cvtt/md_archive/crypto/${source}
else else
usage usage
+17 -6
View File
@@ -9,6 +9,7 @@ usage() {
echo echo
exit 1 exit 1
} }
if [[ "$(uname)" == "Darwin" ]]; then if [[ "$(uname)" == "Darwin" ]]; then
# macOS # macOS
date='gdate' date='gdate'
@@ -22,6 +23,8 @@ host=homestore
stocks=COIN,GBTC,SQ stocks=COIN,GBTC,SQ
TargetDir="/opt/jupyter_gpu/data/eqty_md" TargetDir="/opt/jupyter_gpu/data/eqty_md"
# TargetDir="/tmp" # -------= D E B U G
mkdir -p ${TargetDir} mkdir -p ${TargetDir}
Table=md_1min_bars Table=md_1min_bars
@@ -88,8 +91,6 @@ TargetFile=$(${date} -d ${md_date} "+%Y%m%d.eqty.mktdata.ohlcv.db")
TargetFilePath="${TargetDir}/${TargetFile}" TargetFilePath="${TargetDir}/${TargetFile}"
mv ${TargetFilePath} "${TargetFilePath}.saved.$(${date} '+%Y%m%d_%H%M%S')" mv ${TargetFilePath} "${TargetFilePath}.saved.$(${date} '+%Y%m%d_%H%M%S')"
touch ${TargetFilePath}
# ---- temp dir # ---- temp dir
echo ${SourceFile} echo ${SourceFile}
@@ -109,7 +110,7 @@ if [ "${host}" == "cloud21" ] ; then
SourceRootDir="/opt/store/cvtt/md_archive/equity/alpaca_md" SourceRootDir="/opt/store/cvtt/md_archive/equity/alpaca_md"
elif [ "${host}" == "homestore" ]; then elif [ "${host}" == "homestore" ]; then
SourceHost=homestore.cvtt.vpn SourceHost=homestore.cvtt.vpn
SourceUser=oleg SourceUser=cvtt
SourceRootDir="/works/cvtt/md_archive/equity/alpaca_md" SourceRootDir="/works/cvtt/md_archive/equity/alpaca_md"
else else
usage usage
@@ -136,11 +137,19 @@ function download_file {
Cmd="${Cmd} ${SourceUser}@${SourceHost}:${SourceFilePath} ${tmp_dir}/" Cmd="${Cmd} ${SourceUser}@${SourceHost}:${SourceFilePath} ${tmp_dir}/"
echo ${Cmd} echo ${Cmd}
eval ${Cmd} eval ${Cmd}
if [[ ! -f ${tmp_dir}/${SourceFileZip} ]] ; then
echo "File ${SourceUser}@${SourceHost}:${SourceFilePath} is missing. Skipped."
return
fi
ls -lh ${tmp_dir} ls -lh ${tmp_dir}
Cmd="gunzip ${tmp_dir}/${SourceFileZip}" Cmd="gunzip ${tmp_dir}/${SourceFileZip}"
echo ${Cmd} && eval ${Cmd} echo ${Cmd} && eval ${Cmd}
DbFile=${tmp_dir}/${SourceFile} DbFile=${tmp_dir}/${SourceFile}
touch ${TargetFilePath}
# --- T E M P - for files older than 20240813 # --- T E M P - for files older than 20240813
sqlite3 ${DbFile} <<EOF sqlite3 ${DbFile} <<EOF
@@ -149,7 +158,7 @@ CREATE UNIQUE INDEX IF NOT EXISTS md_1min_bars_idx on md_1min_bars(tstamp, excha
EOF EOF
# --- T E M P # --- T E M P
Cmd="sqlite3 ${DbFile} \".dump ${table}\" | sqlite3 ${TargetFilePath}" Cmd="sqlite3 ${DbFile} \".dump\" | sqlite3 ${TargetFilePath}"
echo ${Cmd} echo ${Cmd}
eval ${Cmd} eval ${Cmd}
@@ -167,8 +176,10 @@ for stock in "${Stocks[@]}"; do
download_file ${SourceFilePath} download_file ${SourceFilePath}
done done
chmod 600 ${TargetFilePath} if [ -f ${TargetFilePath} ]; then
ls -lh ${TargetFilePath} chmod 600
ls -lh ${TargetFilePath}
fi
# mkdir -p /tmp/aaa # mkdir -p /tmp/aaa
# cp -r ${tmp_dir}/* /tmp/aaa/ # cp -r ${tmp_dir}/* /tmp/aaa/
+88
View File
@@ -0,0 +1,88 @@
#!/bin/bash
usage() {
echo -n "Usage: ${0}"
echo -n " [-c <config (dflt: apps/cvtt_eqt_alpaca)>]"
echo -n " [-s <config_serverice (dflt: http://cloud23.cvtt.vpn:6789)>]"
echo -n " [-N <name (dflt: ALPACA-SNDBX)>]"
echo
exit 1
}
Python="${HOME}/.pyenv/python3.10-venv/bin/python3.10"
RootDir="${HOME}/prod"
# **** D E B U G
RootDir=/home/oleg/develop/cvtt2
# **** D E B U G
export PYTHONPATH=${RootDir}
StatusChannel=Status-CVTT
AlertChannel=Alerts-CVTT
Sender=${RootDir}/ops/utils/send_mmost.sh
ConfigService=http://cloud23.cvtt.vpn:6789
Config=apps/cvtt_eqt_alpaca
Name="ALPACA-SNDBX"
echo $0 $* | /usr/bin/ts '[%Y-%m-%d %H:%M:%S]'
while getopts ":s:c:n:" opt; do
case ${opt} in
c )
Config=$OPTARG
;;
s )
ConfigService=$OPTARG
;;
n )
Name=$OPTARG
;;
\? )
echo "Invalid option: -$OPTARG" >&2
usage
;;
: )
echo "Option -$OPTARG requires an argument." >&2
usage
;;
esac
done
# ----- For DEBUGGING
# Sender=cat
# StatusChannel=
tmpfile=$(mktemp)
function cleanup {
# echo Cleaing up temporary files: ${TempFiles}
if [ "" != "${TempFiles}" ]; then
rm -f ${TempFiles}
fi
}
trap cleanup EXIT
Cmd="${Python}"
Cmd="${Cmd} ${RootDir}/cvttpy/apps/utils/services_checker.py"
Cmd="${Cmd} --config=${ConfigService}/${Config}"
Cmd="${Cmd} --log_level=ERROR"
Cmd="${Cmd} --log_stdout"
Cmd="${Cmd} | tee ${tmpfile} 2>&1"
echo ${Cmd}
eval ${Cmd}
cat ${tmpfile}
exit
# echo "## :card_file_box: STORAGE HEALTH CHECK" >> ${tmpfile}
# echo >> ${tmpfile}
# echo "| host | filesystem | usage |" >> ${tmpfile}
# echo "| --- | --- | --- |" >> ${tmpfile}
# cat ${tmpfile2} | sort -h -r | awk -F'%' '{printf "%s%%%s\n",$2,$3}' >> ${tmpfile}
# cat ${tmpfile} | ${Sender} ${StatusChannel}
+58
View File
@@ -0,0 +1,58 @@
#!/usr/bin/env bash
usage() {
echo -n "Usage: ${0}"
echo
exit 1
}
RootDir="${HOME}/prod"
# RootDir=/home/oleg/develop/cvtt2 ###### D E B U G
export PYTHONPATH=${RootDir}
StatusChannel="MD-Status"
Sender=${RootDir}/ops/utils/send_mmost.sh
# ----- For DEBUGGING
# Sender=cat
# StatusChannel=
run_checklist() {
yr=$(date -d 'yesterday' '+%Y')
mn=$(date -d 'yesterday' '+%m')
declare -A Commands
Commands=(
["homestore:cloud21"]="ssh cvtt@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/crypto/cloud21/${yr}/${mn} | tail -5"
["homestore:cvttdata"]="ssh cvtt@homestore.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"
["cloud21:cvttdata"]="ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/crypto/cvttdata/${yr}/${mn} | tail -5"
["gpushnik"]="ssh oleg@gpushnik.cvtt.vpn 'ls -l /opt/jupyter_gpu/data/crypto_md | tail -10'"
)
for name in $(printf "%s\n" "${!Commands[@]}" | sort); do
Cmd=${Commands[${name}]}
echo "------- ${name}"
echo ${Cmd}
eval ${Cmd}
done
}
tmpfile=$(mktemp)
function cleanup {
cd ${HOME}
rm -f ${tmpfile}
}
trap cleanup EXIT
echo "## :hearts: CRYPTO MD HEALTH CHECK" >> ${tmpfile}
echo '```' >> ${tmpfile}
run_checklist >> ${tmpfile}
echo '```' >> ${tmpfile}
cat ${tmpfile} | ${Sender} ${StatusChannel}
cat $tmpfile
+74
View File
@@ -0,0 +1,74 @@
#!/usr/bin/env bash
usage() {
echo -n "Usage: ${0}"
echo
exit 1
}
RootDir="${HOME}/prod"
# RootDir=/home/oleg/develop/cvtt2 ###### D E B U G
export PYTHONPATH=${RootDir}
StatusChannel="MD-Status"
Sender=${RootDir}/ops/utils/send_mmost.sh
# ----- For DEBUGGING
# Sender=cat
# StatusChannel=
run_checklist() {
yr=$(date -d 'yesterday' '+%Y')
declare -A Commands
Commands["homestore"]="ssh cvtt@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/A/AAPL/${yr} | tail -3"
Commands["homestore"]+="; echo"
Commands["homestore"]+="; ssh cvtt@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/N/NVDA/${yr} | tail -3"
Commands["cloud21"]="ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/equity/alpaca_md/A/AAPL/${yr} | tail -3"
Commands["cloud21"]+="; echo"
Commands["cloud21"]+="; ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/equity/alpaca_md/N/NVDA/${yr} | tail -3"
Commands["gpushnik"]="ssh oleg@gpushnik.cvtt.vpn 'ls -l /opt/jupyter_gpu/data/eqty_md | tail -10'"
for name in $(printf "%s\n" "${!Commands[@]}" | sort); do
Cmd=${Commands[${name}]}
echo "------- ${name}"
echo ${Cmd}
eval ${Cmd}
done
}
# run_checklist
tmpfile=$(mktemp)
function cleanup {
cd ${HOME}
rm -f ${tmpfile}
}
trap cleanup EXIT
echo "## :fire: EQUITY MD HEALTH CHECK" >> ${tmpfile}
echo '```' >> ${tmpfile}
run_checklist >> ${tmpfile}
echo '```' >> ${tmpfile}
cat ${tmpfile} | ${Sender} ${StatusChannel}
exit
# homestore
echo homestore
ssh cvtt@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/A/AAPL/${yr} | tail -3
echo
ssh cvtt@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/N/NVDA/${yr} | tail -3
echo cloud21
ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/equity/alpaca_md/A/AAPL/${yr} | tail -3
echo
ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/equity/alpaca_md/N/NVDA/${yr} | tail -3
echo "------ gpushnik"
ssh oleg@gpushnik.cvtt.vpn 'ls -l /opt/jupyter_gpu/data/eqty_md | tail -10'
@@ -2,7 +2,7 @@
Source=/home/cvtt/prod/archive/md_archive/ Source=/home/cvtt/prod/archive/md_archive/
Targets= Targets=
Targets="${Targets} oleg@homestore.cvtt.vpn:/works/cvtt/md_archive/" Targets="${Targets} cvtt@homestore.cvtt.vpn:/works/cvtt/md_archive/"
Targets="${Targets} cvtt@cloud21.cvtt.vpn:/opt/store/cvtt/md_archive/" Targets="${Targets} cvtt@cloud21.cvtt.vpn:/opt/store/cvtt/md_archive/"
+4 -3
View File
@@ -4,7 +4,7 @@
# user "git" owned remote repository # user "git" owned remote repository
# #
# must run on remote server # must run on remote server
# change HostName and RemoteName # change GitTopDir, HostName and RemoteName
# --------------------- # ---------------------
# R e s u l t E x a m p l e: # R e s u l t E x a m p l e:
# sudo bash -c 'mkdir /opt/store/git/cvtt2/tests.git && cd /opt/store/git/cvtt2/tests.git && git init --bare && chown -R git:git /opt/store/git/cvtt2/tests.git' # sudo bash -c 'mkdir /opt/store/git/cvtt2/tests.git && cd /opt/store/git/cvtt2/tests.git && git init --bare && chown -R git:git /opt/store/git/cvtt2/tests.git'
@@ -12,12 +12,13 @@
# #
# ----- S e t t i n g s # ----- S e t t i n g s
GitTopDir=/ops/store/git
HostName=cloud21.cvtt.vpn HostName=cloud21.cvtt.vpn
RemoteName=origin RemoteName=origin
# ----- S e t t i n g s # ----- S e t t i n g s
usage() { usage() {
echo "Usage: ${0} <repo_name> [<repo_parent_dir> */opt/store/git/cvtt2]" echo "Usage: ${0} <repo_name> [<repo_parent_dir> *${GitTopDir}/cvtt2]"
exit 1 exit 1
} }
@@ -27,7 +28,7 @@ if [ "" == "${RepoName}" ] ; then
usage usage
fi fi
RepoParentDir=/opt/store/git/cvtt2 RepoParentDir=${GitTopDir}/cvtt2
if [ "${2}" != "" ] ; then if [ "${2}" != "" ] ; then
RepoParentDir=${2} RepoParentDir=${2}
fi fi