Compare commits

...

3 Commits

Author SHA1 Message Date
oleg 618a7eb0cf md eqty checklist to use new structure 2024-11-01 13:15:34 -04:00
oleg 512f5ce14d build for cvtt-rust uses cargo install 2024-10-31 23:35:41 -04:00
oleg 9a3215524e build for cvtt-rust 2024-10-31 19:50:56 -04:00
3 changed files with 55 additions and 20 deletions
+39 -8
View File
@@ -6,6 +6,7 @@ declare -A git_repo_arr
git_repo_arr[cvttpy]=git@cloud21.cvtt.vpn:/opt/store/git/cvttpy.git git_repo_arr[cvttpy]=git@cloud21.cvtt.vpn:/opt/store/git/cvttpy.git
git_repo_arr[ops]=git@cloud21.cvtt.vpn:/opt/store/git/ops.git git_repo_arr[ops]=git@cloud21.cvtt.vpn:/opt/store/git/ops.git
git_repo_arr[research]=git@cloud21.cvtt.vpn:/opt/store/git/research.git git_repo_arr[research]=git@cloud21.cvtt.vpn:/opt/store/git/research.git
git_repo_arr[cvtt-rust]=git@cloud21.cvtt.vpn:/opt/store/git/cvtt2/cvtt-rust.git
dist_root=/home/cvttdist/software/cvtt2 dist_root=/home/cvttdist/software/cvtt2
dist_user=cvttdist dist_user=cvttdist
@@ -48,13 +49,29 @@ while getopts ":p:b:i" opt; do
done done
# ---------------- cmdline # ---------------- cmdline
function confirm { confirm() {
if [ "${interactive}" == "Y" ]; then if [ "${interactive}" == "Y" ]; then
echo "--------------------------------" echo "--------------------------------"
echo -n "Press <Enter> to continue" && read echo -n "Press <Enter> to continue" && read
fi fi
} }
rust_binaries() {
res=()
for binname in $(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].targets[] | select(.kind | index("bin")) | .name'); do
res+=("${binname}")
done
echo "${res[@]}"
}
rust_libraries() {
res=()
for libname in $(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].targets[] | select(.kind | index("lib")) | .name'); do
res+=("lib${libname}.rlib")
done
echo "${res[@]}"
}
if [ "${interactive}" == "Y" ]; then if [ "${interactive}" == "Y" ]; then
echo -n "Enter project [${prj}]: " echo -n "Enter project [${prj}]: "
read project read project
@@ -149,6 +166,24 @@ cmd_arr+=("${Cmd}")
Cmd="rm -rf .git" Cmd="rm -rf .git"
cmd_arr+=("${Cmd}") cmd_arr+=("${Cmd}")
SourceLoc=../${project}
if [ "${project}" == "cvtt-rust" ]; then
cmd_arr+=("cd ${prj_dir}")
cmd_arr+=("mkdir -p ${prj_dir}/dist/release")
cmd_arr+=("cp release_version.txt ./dist/release")
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)
for app in ${apps[@]}; do
app=${app//\"/} # remove quotes
cmd_arr+=("cargo install --root ${prj_dir}/dist/release --path ${prj_dir}/apps/${app}")
done
SourceLoc=${prj_dir}/dist/release
fi
dist_path="${dist_root}/${project}/${release_version}" dist_path="${dist_root}/${project}/${release_version}"
for dist_loc in ${dist_locations}; do for dist_loc in ${dist_locations}; do
@@ -156,9 +191,9 @@ for dist_loc in ${dist_locations}; do
dist_host=${dhp[0]} dist_host=${dhp[0]}
dist_port=${dhp[1]} dist_port=${dhp[1]}
Cmd="rsync -avzh" Cmd="rsync -avzh"
Cmd="${Cmd} --rsync-path=\"mkdir -p ${dist_path} && rsync\"" Cmd="${Cmd} --rsync-path=\"mkdir -p ${dist_path}"
Cmd="${Cmd} -e \"ssh -p ${dist_ssh_port}\"" Cmd="${Cmd} && rsync\" -e \"ssh -p ${dist_ssh_port}\""
Cmd="${Cmd} ../${project} ${dist_user}@${dist_host}:${dist_path}/" Cmd="${Cmd} $SourceLoc ${dist_user}@${dist_host}:${dist_path}/"
cmd_arr+=("${Cmd}") cmd_arr+=("${Cmd}")
done done
@@ -179,8 +214,4 @@ do
pwd && echo ${cmd} && eval ${cmd} pwd && echo ${cmd} && eval ${cmd}
done done
echo "PROJECT ${project} **** P U L L N E W T A G S F R O M o r i g i n ****"
echo "----"
echo "(cd ${project}; git pull --tags; git pushall)"
echo "----"
echo "$0 Done ${project} ${release_version}" echo "$0 Done ${project} ${release_version}"
+1 -1
View File
@@ -1 +1 @@
1.7.8,case insensitive to_check parameter host and services avalability check 1.8.2,md eqty checklist to use new structure
+15 -11
View File
@@ -7,7 +7,6 @@ usage() {
} }
RootDir="${HOME}/prod" RootDir="${HOME}/prod"
# RootDir=/home/oleg/develop/cvtt2 ###### D E B U G
export PYTHONPATH=${RootDir} export PYTHONPATH=${RootDir}
@@ -15,28 +14,33 @@ StatusChannel="MD-Status"
Sender=${RootDir}/ops/utils/send_mmost.sh Sender=${RootDir}/ops/utils/send_mmost.sh
# ----- For DEBUGGING # ----- For DEBUGGING
# Sender=cat # RootDir=/home/oleg/develop/cvtt2 ###### D E B U G
# StatusChannel= # Sender=cat #### D E B U G
# StatusChannel= #### D E B U G
run_checklist() { run_checklist() {
yr=$(date -d 'yesterday' '+%Y') yr=$(date -d 'yesterday' '+%Y')
CheckSymbols="A/AAPL N/NVDA M/META"
declare -A Commands 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"]=""
Commands["homestore"]+="; echo" for sym in ${CheckSymbols}; do
Commands["homestore"]+="; ssh cvtt@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/N/NVDA/${yr} | tail -3" Commands["homestore"]+="ssh cvtt@homestore.cvtt.vpn ls -l /works/cvtt/md_archive/equity/alpaca_md/${yr}/${sym} | tail -3; "
done
Commands["homestore"]+="echo"
Commands["cloud21"]="ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/cvtt/md_archive/equity/alpaca_md/A/AAPL/${yr} | tail -3" Commands["cloud21"]=""
Commands["cloud21"]+="; echo" for sym in ${CheckSymbols}; do
Commands["cloud21"]+="; ssh cvtt@cloud21.cvtt.vpn ls -l /opt/store/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/${yr}/${sym} | tail -3; "
done
Commands["cloud21"]+="echo"
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'"
for name in $(printf "%s\n" "${!Commands[@]}" | sort); do for name in $(printf "%s\n" "${!Commands[@]}" | sort); do
Cmd=${Commands[${name}]}
echo "------- ${name}" echo "------- ${name}"
Cmd=${Commands[${name}]}
echo ${Cmd} echo ${Cmd}
eval ${Cmd} eval ${Cmd}
done done