Skip to content

Commit

Permalink
adding service account credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
nmerket committed Nov 10, 2023
1 parent 9a3446e commit c67bf19
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions buildstockbatch/hpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,10 @@ def queue_post_processing(self, after_jobids=[], upload_only=False, hipri=False)
logger.debug("sbatch: {}".format(line))

def get_dask_client(self):
# Keep this, helpful for debugging on a bigmem node
# from dask.distributed import LocalCluster
# cluster = LocalCluster(local_directory="/tmp/scratch/dask", n_workers=90, memory_limit="16GiB")
# return Client(cluster)
return Client(scheduler_file=os.path.join(self.output_dir, "dask_scheduler.json"))

def process_results(self, *args, **kwargs):
Expand Down
1 change: 1 addition & 0 deletions buildstockbatch/kestrel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ df -h

module load python apptainer
source "$MY_PYTHON_ENV/bin/activate"
source /kfs2/shared-projects/buildstock/aws_credentials.sh

time python -u -m buildstockbatch.hpc kestrel "$PROJECTFILE"
3 changes: 2 additions & 1 deletion buildstockbatch/kestrel_postprocessing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ df -h

module load python apptainer
source "$MY_PYTHON_ENV/bin/activate"
source /kfs2/shared-projects/buildstock/aws_credentials.sh

export POSTPROCESS=1

Expand All @@ -29,6 +30,6 @@ pdsh -w $SLURM_JOB_NODELIST_PACK_GROUP_1 "free -h"
pdsh -w $SLURM_JOB_NODELIST_PACK_GROUP_1 "df -i; df -h"

$MY_PYTHON_ENV/bin/dask scheduler --scheduler-file $SCHEDULER_FILE &> $OUT_DIR/dask_scheduler.out &
pdsh -w $SLURM_JOB_NODELIST_PACK_GROUP_1 "$MY_PYTHON_ENV/bin/dask worker --scheduler-file $SCHEDULER_FILE --local-directory /tmp/scratch/dask --nworkers ${NPROCS} --nthreads 1 --memory-limit ${MEMORY}MB" &> $OUT_DIR/dask_workers.out &
pdsh -w $SLURM_JOB_NODELIST_PACK_GROUP_1 "source /kfs2/shared-projects/buildstock/aws_credentials.sh; $MY_PYTHON_ENV/bin/dask worker --scheduler-file $SCHEDULER_FILE --local-directory /tmp/scratch/dask --nworkers ${NPROCS} --nthreads 1 --memory-limit ${MEMORY}MB" &> $OUT_DIR/dask_workers.out &

time python -u -m buildstockbatch.hpc kestrel "$PROJECTFILE"

0 comments on commit c67bf19

Please sign in to comment.