Gül Sena Altıntaş commited on
Commit
fb396ec
·
1 Parent(s): 889a42a

Fixed issue with job_id

Browse files
Files changed (1) hide show
  1. serve_on_killarney.sh +8 -2
serve_on_killarney.sh CHANGED
@@ -18,7 +18,6 @@ CPUS_PER_TASK=4
18
  MEM="8G"
19
  TIME="02:00:00"
20
  GRADIO_PORT=7861
21
- LOCAL_PORT=7861
22
  script_location="$APP_DIR/$SCRIPT_NAME"
23
 
24
  ENV_PATH="/home/$CLUSTER_USER/tokenizers/.venv/bin/activate"
@@ -56,6 +55,8 @@ echo "Allocated nodes: \$SLURM_JOB_NODELIST"
56
  echo "Working directory: \$(pwd)"
57
  echo "Starting time: \$(date)"
58
 
 
 
59
  # Load necessary modules
60
  module load slurm/killarney/24.05.7 StdEnv/2023 gcc/13.3 openmpi/5.0.3 cuda/12.6 python/3.10.13
61
 
@@ -84,7 +85,12 @@ if [ $? -ne 0 ]; then
84
  fi
85
 
86
  echo "Submitting job to cluster..."
87
- JOB_ID=$(ssh -t "$CLUSTER_USER@$CLUSTER_HOST" "bash -l -c 'cd $APP_DIR && sbatch --parsable $script_location'")
 
 
 
 
 
88
 
89
  if [ $? -ne 0 ]; then
90
  echo "Error: Failed to submit job to cluster"
 
18
  MEM="8G"
19
  TIME="02:00:00"
20
  GRADIO_PORT=7861
 
21
  script_location="$APP_DIR/$SCRIPT_NAME"
22
 
23
  ENV_PATH="/home/$CLUSTER_USER/tokenizers/.venv/bin/activate"
 
55
  echo "Working directory: \$(pwd)"
56
  echo "Starting time: \$(date)"
57
 
58
+ source /home/$CLUSTER_USER/.bashrc
59
+
60
  # Load necessary modules
61
  module load slurm/killarney/24.05.7 StdEnv/2023 gcc/13.3 openmpi/5.0.3 cuda/12.6 python/3.10.13
62
 
 
85
  fi
86
 
87
  echo "Submitting job to cluster..."
88
+ # JOB_ID=$(ssh -t "$CLUSTER_USER@$CLUSTER_HOST" "bash -l -c 'cd $APP_DIR && sbatch --parsable $script_location'")
89
+ # ssh "$CLUSTER_USER@$CLUSTER_HOST" "bash -l -c 'tail \"${OUTPUT_DIR}/${JOB_ID}.out\"'"
90
+
91
+ JOB_ID=$(ssh -t "$CLUSTER_USER@$CLUSTER_HOST" \
92
+ "bash -l -c 'cd \"$APP_DIR\" && sbatch --parsable \"$script_location\"'" \
93
+ | tr -d '\r\n')
94
 
95
  if [ $? -ne 0 ]; then
96
  echo "Error: Failed to submit job to cluster"