Skip to content

Commit

Permalink
[WIP] setonix script
Browse files Browse the repository at this point in the history
  • Loading branch information
d3v-null committed Sep 26, 2024
1 parent 824f867 commit 4c5ac8a
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 8 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ macOS amd64 (Intel) and arm64 (M-Series) will work, but CPU-only.

Windows users will need to use WSL2 or Docker Desktop with Git Bash.

## Setup
## Clone

Clone this repository to a machine that meets the [system requirements](#system-requirements).

Setonix note: a good place for this is either `$MYSOFTWARE` or `/software/projects/pawsey1094/${USER}/`

```bash
git clone https://github.com/MWATelescope/mwa-demo.git
cd mwa-demo
Expand All @@ -113,13 +115,16 @@ to check for updates right before the workshop starts with a `git pull`.

Download demo data (from Pawsey). You should be in the root of the repository.

Setonix note: if you intend to expand this demo further, you can change `$outdir` to `$MYSCRATCH` in `demo/00_env.sh` and `source demo/00_env.sh`

```bash
mkdir -p demo/data/1121334536/raw
curl -L -o demo/data/1121334536/raw/1121334536_20150719094841_gpubox20_00.fits 'https://projects.pawsey.org.au/mwa-demo/1121334536_20150719094841_gpubox20_00.fits'
mkdir -p demo/data/1303134032/raw
curl -L -o demo/data/1303134032/raw/1303134032_20210422134116_gpubox20_01.fits 'https://projects.pawsey.org.au/mwa-demo/1303134032_20210422134116_gpubox20_01.fits'
mkdir -p demo/data/1341914000/raw
curl -L -o demo/data/1341914000/raw/1341914000_20220715095302_ch137_000.fits 'https://projects.pawsey.org.au/mwa-demo/1341914000_20220715095302_ch137_000.fits'
export outdir=${outdir:-${PWD}/demo/data/}
mkdir -p ${outdir}/1121334536/raw
curl -L -o ${outdir}/1121334536/raw/1121334536_20150719094841_gpubox20_00.fits 'https://projects.pawsey.org.au/mwa-demo/1121334536_20150719094841_gpubox20_00.fits'
mkdir -p ${outdir}/1303134032/raw
curl -L -o ${outdir}/1303134032/raw/1303134032_20210422134116_gpubox20_01.fits 'https://projects.pawsey.org.au/mwa-demo/1303134032_20210422134116_gpubox20_01.fits'
mkdir -p ${outdir}/1341914000/raw
curl -L -o ${outdir}/1341914000/raw/1341914000_20220715095302_ch137_000.fits 'https://projects.pawsey.org.au/mwa-demo/1341914000_20220715095302_ch137_000.fits'
```

Alternatively , you can download the same demo data in your browser [here](https://curtin-my.sharepoint.com/:u:/g/personal/285446d_curtin_edu_au/EQF1Dl93KixAimsD7wi7TcYBjAUs7Y6LO08An5rKSB2cmg?e=nMtGhu) and extract it to the `demo/data` directory.
Expand Down Expand Up @@ -258,7 +263,7 @@ Most HPC environments don't allow you to run Docker (for security reasons).
You can however run Docker images in Singularity.

```bash
singularity exec -B$PWD -W$PWD --cleanenv docker://mwatelescope/mwa-demo:latest /bin/bash
singularity exec -B$PWD -B${outdir:-$PWD} -W$PWD --cleanenv docker://mwatelescope/mwa-demo:latest /bin/bash
```

</details>
Expand Down
55 changes: 55 additions & 0 deletions demo/00_setonix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash
# shellcheck disable=SC2139

export outdir=${outdir:=${MYSCRATCH}/}
module use /software/projects/pawsey1094/setonix/2024.05/modules/zen3/gcc/12.2.0
module load hyperdrive/default birli/default giant-squid/default hyperbeam/default wsclean/default mwalib/default singularity/default
module load py-pip/default py-numpy/default
pip install --user \
importlib_metadata==8.2.0 \
kneed==0.8.5 \
matplotlib==3.7.5 \
maturin[patchelf]==1.7.0 \
numpy==1.24.4 \
pandas==2.0.3 \
pip==24.2 \
pyuvdata==2.4.5 \
pyvo==1.5.2 \
seaborn==0.13.2 \
psutil==6.0.0 \
git+https://github.com/mwilensky768/SSINS.git@master \
git+https://github.com/PaulHancock/Aegean.git \
git+https://github.com/tjgalvin/fits_warp.git \
git+https://github.com/d3v-null/mwa_qa.git@dev

export singularity_base="singularity exec"
export docker_img=${docker_img:="mwatelescope/mwa-demo:latest"}

export bindir=${PWD}/bin/
export PATH=${PATH}:${bindir}
mkdir -p ${bindir}
rm ${bindir}*
while IFS='|' read -r bin argv; do
# strip spaces
bin=$(echo "$bin" | tr -d '[:space:]')
if command -v "$bin" &>/dev/null; then
echo "$bin already exists, skipping"
continue
else
echo "$bin not found, creating ${bindir}$bin"
fi
echo "#!/bin/bash" >"${bindir}$bin"
echo "$singularity_base $argv $docker_img $bin \"\$@\"" >>"${bindir}$bin"
chmod +x "${bindir}$bin"
done <<-EoF
birli
giant-squid | -e MWA_ASVO_API_KEY=\$MWA_ASVO_API_KEY
hyperdrive | -e MWA_BEAM_FILE=\$MWA_BEAM_FILE
jq
wsclean
python
plot_calqa.py
plot_prepvisqa.py
run_calqa.py
run_prepvisqa.py
EoF
12 changes: 12 additions & 0 deletions demo/02_download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,15 @@ echo ""
echo " -> download a job"
echo "giant-squid download jobid"
echo ""

echo " -> download a bunch of obsids with the script at the bottom of 02_download.sh"
exit 0

giant-squid list $obsids_csv --states ready --json | jq -r $'.[]|[.jobId,.obsid]|@tsv' | while IFS=$'\t' read -r jobid obsid; do
echo jobid=$jobid obsid=$obsid
mkdir -p $outdir/$obsid/raw;
cd $_;
if eval ls -1 ${obsid}_2*.fits; then continue; fi
giant-squid download $jobid;
cd -;
done

0 comments on commit 4c5ac8a

Please sign in to comment.