I'm programming script for the operations on 2 clusters.
My aim is to focus only one cluster, it means every script source code is only on one of the cluster.
For example in Cluster A I have all scripts installed, now I want to ssh to Cluster B to run these scripts without having to install them again on Cluster B.
I knew with bash script like ssh root@ClusterB 'bash -s' < local_ClusterA_script.sh
then Cluster B run local_ClusterA_script.sh from ClusterA.
Now there is a further challenge that I have to use ssh to submit a batch job on Cluster B from Cluster A, this batch job needs a script from Cluster A.
# run.sh :
#!/bin/bash
INPUT_ARGS="$@"
qsub -v argv="$INPUT_ARGS" -l arch=x86_64 -l walltime=10:00:00 -l vmem=8GB -l nodes=1:ppn=6 $CLUSTERA_BIN/run.script
# run.script
runprogram()
{
#Input
INPUT_ARGS=`echo $argv`
$CLUSTERA_BIN/runprogram.py "$INPUT_ARGS" ;
}
So my problem is where does Cluster B find $CLUSTERA_BIN/runprogram.py
? How to make the code in run.script run successfully on Cluster B ?
One command I thought it would be ssh root@ClusterB 'bash -s' < run.sh $MYARGS
, but obviously it won't work like this.