How to run on the AWS DP HPC cluster interactively
The Rapthor Prefect prototype can be run on a single node on AWS using the example aws-interactive.sh shell script provided. This script will load dependencies available via spack and install additional python dependencies (via poetry) in a virtual environment. It will then start a local prefect server and run the code in poc.py. The script has been tested on the AWS DP HPC cluster using an interactive compute node and 8 CPUs.
If you want to run inside a container on your local machine instead, see the quickstart guide.
If you want to run via a SLURM job on a single node instead using a prefect server running on the headnode, see the instructions for running via SLURM.
Prerequisites
An account on the AWS DP HPC cluster
Optional: SSH tunnel to the compute node you will be using to forward port 4200 (for the Prefect UI) and port 8787 (for the Dask dashboard) to your local machine.
Steps
Log into the DP HPC headnode. Information about the DP HPC cluster, including how to gain access is available from this confluence page.
Change to a directory where you want to clone the project.
Clone the project repository using git.
git clone https://gitlab.com/ska-telescope/sdp/ska-sdp-rapthor-prefect-prototype.gitChange to the project directory.
cd ska-sdp-rapthor-prefect-prototypeOptionally check out the branch of the repo that you want to test:
git checkout <feature-branch>
Start an interactive compute node.
srun --nodes=1 --partition=any-r7i-24xl-spt --cpus-per-task=8 --ntasks-per-node=1 --time=1:00:00 --pty bash -iIf you want to use an SSH tunnel to access the Prefect UI and Dask dashboard on your local machine, follow these additional steps:
Get the hostname of the compute node and use this to set up port forwarding from your local machine to the compute node. Copy the compute node hostname after running the command below.
echo $HOSTNAMEOn your local machine, set up an SSH tunnel to the compute node to forward port 4200 for the Prefect UI and port 8787 for the Dask dashboard.
ssh -L 127.0.0.1:4200:<compute-node-hostname>:4200 -L 127.0.0.1:8787:<compute-node-hostname>:8787 dp-hpc-headnode
Edit the
aws-interactive.shscript to set the correct path to the project directory. It will use the current directory by default.Run the
aws-interactive.shscript. This will install the project and dependencies via poetry, check the installation, and then run the start.sh script to launch the pipeline. The output of the script will be saved in a log file../aws-interactive.sh | tee rpp-aws-`date +"%FT%T"`.log
The Prefect server will start automatically. The code in
poc.pywill run automatically when the script starts. If you have set up the SSH tunnel, once the Prefect server is up, you can monitor the progress of the flow in the Prefect UI at http://localhost:4200 and the Dask dashboard at http://localhost:8787.When the flow has completed, you can stop the prefect server by pressing
CTRL-Cin the terminal where you ran the script.