-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canfar run v1.4 #677
base: develop
Are you sure you want to change the base?
Canfar run v1.4 #677
Changes from all commits
6934d27
82bc72a
5b44743
29c609e
da18970
5770367
3166e3c
373722e
b025b6a
ba135f2
07cafb4
92a999c
2b6600d
b6e5c97
bc66565
0b3aac6
69317cb
d35bd69
d93a60e
fb83a27
e33972b
edbec76
9aa16be
e5d0335
49d8880
d02347e
12e6b63
7d20699
1d3df1a
b05f2a5
45942d5
7d1891e
02affa8
d8ad328
60c3cd1
0737c0f
7dba136
c65d75a
1e7b633
b006368
85f0c99
d0c3d9f
323d44a
dedbc3f
e67f549
55677e7
b6cb27d
096af60
3c37250
667eb7b
bc20ab2
1b4b3bf
bd82f95
33ea4a1
50df9a7
ba17ebc
394e464
94428b4
9ac9dc1
1d25a8b
3d2b127
ca6b602
cf69907
c643d0c
523b10f
53d9d35
ce1179e
a005119
64f04cf
22ee0f3
c62861d
b682e7c
9b9dbf1
dd57fd8
7fc3645
15a4b7b
0d56e23
fde5982
9c5cad4
ac0a339
4048bf1
0a3f80e
d81bdf2
672001d
cc96a0c
87bb2b7
76c08a6
faa0836
85f6d91
4f81635
5574393
d4cb47c
2ffba3b
67c966c
efb2799
1f36bf5
9f81502
6eb11cf
485da58
ef3a2c9
a20cb4f
29b463b
cb67e8f
f0acd65
1bc602b
d6ff437
1a81ae3
93d6c6e
9c0b9a5
b19ad03
af38556
8c9921f
18d104c
4276fea
3f15533
cfefcfb
24480e2
48e6114
cd7c61b
9a964c5
e0100ca
984ec90
842e382
d9846e9
c5deb34
d507780
b4e0aa0
f8a07d7
30116b8
9e44fa6
3ab923f
ee5b3ad
79cb00a
92e4308
a86b6fd
1d928d4
403e8c5
a6d8b52
1a2d47d
de82961
8928c86
fc5a7df
e882df3
7cdcd73
802a8cf
2fb58eb
160c1b4
93e86e9
8b92dbf
fe1eb3a
720afe9
07a5924
4ce26ba
a6bf8a5
339f13f
bddc491
4dffd47
41cfd97
5675c06
14569b2
b406438
fe66831
282d76b
9ac6bb4
25ef4e2
75fb975
376bbf1
06564a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Create and publish a Docker image | ||
|
||
on: | ||
push: | ||
branches: ['master'] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
FROM continuumio/miniconda3 | ||
|
||
LABEL Description="ShapePipe Docker Image" | ||
ENV SHELL /bin/bash | ||
|
||
ARG CC=gcc-9 | ||
ARG CXX=g++-9 | ||
|
||
# gcc < 10 is required to compile ww | ||
ENV CC=gcc-9 | ||
ENV CXX=g++-9 | ||
|
||
RUN apt-get update --allow-releaseinfo-change && \ | ||
apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install apt-utils -y && \ | ||
apt-get install make -y && \ | ||
apt-get install automake -y && \ | ||
apt-get install autoconf -y && \ | ||
apt-get install gcc-9 g++-9 -y && \ | ||
apt-get install locales -y && \ | ||
apt-get install libgl1-mesa-glx -y && \ | ||
apt-get install xterm -y && \ | ||
apt-get install cmake protobuf-compiler -y && \ | ||
apt-get install libtool libtool-bin libtool-doc -y && \ | ||
apt-get install libfftw3-bin libfftw3-dev -y && \ | ||
apt-get install libatlas-base-dev liblapack-dev libblas-dev -y && \ | ||
apt-get install vim -y && \ | ||
apt-get install locate -y && \ | ||
apt-get install curl -y && \ | ||
apt-get install acl -y && \ | ||
apt-get install sssd -y && \ | ||
apt-get clean | ||
|
||
ADD nsswitch.conf /etc/ | ||
|
||
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ | ||
locale-gen | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
|
||
SHELL ["/bin/bash", "--login", "-c"] | ||
|
||
COPY ./environment.yml ./ | ||
COPY install_shapepipe README.rst setup.py setup.cfg ./ | ||
Comment on lines
+45
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @martinkilbinger is there any particular reason you are copying things to |
||
RUN touch ./README.md | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this for? |
||
|
||
RUN conda update -n base -c defaults conda -c defaults | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this needed to get things working? |
||
RUN conda env create --file environment.yml | ||
|
||
COPY shapepipe ./shapepipe | ||
COPY scripts ./scripts | ||
Comment on lines
+52
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, is there any reason you only copy these directories and now the whole repo? |
||
|
||
RUN source activate shapepipe | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The following line will generate an Image that will launch containers with ShapePipe pre-activated. RUN echo "conda activate shapepipe" >> ~/.bashrc |
||
#RUN pip install jupyter |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
000.000 | ||
052.332 | ||
053.331 | ||
053.332 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Running `shapepipe` on the canfar science portal | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. General instructions hotwo run ShapePipe on the canfar science portal run. |
||
|
||
## Introduction | ||
|
||
## Steps from testing to parallel running | ||
|
||
Before starting a batch remote session job on a large number of images (step 5.), | ||
it is recommended to perform some or all of the testing steps (1. - 4.). | ||
|
||
|
||
1. Run the basic `shapepipe` runner script to test (one or several) modules in question, specified by a given config file, on one image. | ||
This step has to be run in the image run directory. The command is | ||
```bash | ||
shapepipe_run -c config.ini | ||
``` | ||
|
||
2. Run the job script to test the job management, on one image. | ||
This step has to be run in the image run directory. The command is | ||
```bash | ||
job_sp_canfar -j JOB [OPTIONS] | ||
``` | ||
|
||
3. Run the pipeline script to test the processing step(s), on one image. | ||
This step has to be run in the patch base directory. | ||
|
||
1. First, run in dry mode: | ||
```bash | ||
init_run_exclusive_canfar.sh -j JOB -e ID -p [psfex|mccd] -k [tile|exp] -n | ||
``` | ||
2. Next, perform a real run with | ||
```bash | ||
init_run_exclusive_canfar.sh -j JOB -e ID -p [psfex|mccd] -k [tile|exp] -n | ||
``` | ||
|
||
4. Run remote session script to test job submission using docker images, on one image. | ||
This step has to be run in the patch base directory. | ||
1. First, run in dry mode=2, to display curl command, with | ||
```bash | ||
curl_canfar_local.sh -j JOB -e ID -p [psfex|mccd] -k [tile|exp] -n 2 | ||
``` | ||
|
||
2. Next, run in dry mode=1, to use curl command without processing: | ||
```bash | ||
curl_canfar_local.sh -j JOB -e ID -p [psfex|mccd] -k [tile|exp] -n 1 | ||
``` | ||
3. Then, perform a real run, to use curl with processing: | ||
```bash | ||
curl_canfar_local.sh -j JOB -e ID -p [psfex|mccd] -k [tile|exp] | ||
``` | ||
|
||
5. Full run: Call remote session script and docker image with collection of images | ||
```bash | ||
curl_canfar_local.sh -j JOB -f path_IDs -p [psfex|mccd] -k [tile|exp] | ||
``` | ||
with `path_IDs` being a text file with one image ID per line. | ||
|
||
## Monitoring | ||
|
||
|
||
### Status and output of submitted job | ||
|
||
Monitoring of the currently active remote session can be performed using the session IDs `session_IDs.txt` written by the | ||
remote session script `curl_canfar_local.sh`. In the patch main directory, run | ||
```bash | ||
curl_canfar_monitor.sh events | ||
``` | ||
to display the remotely started docker image status, and | ||
```bash | ||
curl_canfar_monitor.sh logs | ||
``` | ||
to print `stdout` of the remotely run pipeline script. | ||
|
||
### Number of submitted running jobs | ||
|
||
The script | ||
```bash | ||
stats_headless_canfar.py | ||
``` | ||
returns the number of actively running headless jobs. | ||
|
||
|
||
## Post-hoc summary | ||
|
||
In the patch main directory, run | ||
```bash | ||
summary_run PATCH | ||
``` | ||
to print a summary with missing image IDs per job and module. | ||
|
||
## Deleting jobs | ||
|
||
```bash | ||
for id in `cat session_IDs.txt`; do echo $id; curl -X DELETE -E /arc/home/kilbinger/.ssl/cadcproxy.pem https://ws-uv.canfar.net/skaha/v0/session/$id; done | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
patch="P7" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Specific step-by-step commands (pipeline) to produce shape catalogue for one patch on the canfar science portal. |
||
psf="psfex" | ||
N_SMP=16 | ||
|
||
# Terminal title | ||
echo -ne "\033]0;$patch\007" | ||
|
||
# Run directory | ||
dir=~/cosmostat/v2/pre_v2/$psf/$patch | ||
cd $dir | ||
|
||
# Get tile number list | ||
ln -s ~/shapepipe/auxdir/CFIS/tiles_202106/tiles_$patch.txt tile_numbers.txt | ||
|
||
|
||
# Get images | ||
|
||
## Download and link separately | ||
|
||
### Download | ||
### Create and link to central image storage directory | ||
mkdir -p ~/cosmostat/v2/data_tiles/$patch | ||
ln -s ~/cosmostat/v2/data_tiles/$patch data_tiles | ||
|
||
### Download and move tiles | ||
ln -s ~/shapepipe/example/cfis | ||
mkdir -p output | ||
export SP_RUN=`pwd` | ||
|
||
shapepipe_run -c cfis/config_Git_vos.ini | ||
mv -i output/run_sp_Git_*/get_images_runner/output/CFIS.???.???.*fits* data_tiles | ||
rm -rf output/run_sp_tiles_Git_* | ||
update_run_log_file.py | ||
# repeat the above block | ||
|
||
### Find exposures; this run can be stopped after Fe | ||
shapepipe_run -c cfis/config_GitFe_symlink.ini | ||
|
||
### Download and move exposures | ||
|
||
shapepipe_run -c cfis/config_Gie_vos.ini | ||
mv -i output/run_sp_Gie_*/get_images_runner/output/*.fits*fz data_exp | ||
rm -rf output/run_sp_Gie_* | ||
update_run_log_file.py | ||
# repeat the above | ||
|
||
### Create links (and re-run Fe, not necessary) | ||
job_sp_canfar.bash -p $psf `cat tile_numbers.txt` -j 1 -r symlink | ||
|
||
# Uncompress weights, split exposures into single HDUs | ||
job_sp_canfar.bash -p $psf -n $N_SMP -j 2 | ||
|
||
# Mask tiles | ||
job_sp_canfar.bash -p $psf -n $N_SMP -j 4 | ||
|
||
# If not finshed: | ||
combine_runs.bash -p psfex -c flag | ||
mv output/run_sp_combined_flag output/run_sp_exp_Ma | ||
|
||
# Mask exposures | ||
job_sp_canfar.bash -p $psf -n $N_SMP -j 8 | ||
|
||
|
||
# Tile detection | ||
curl_canfar_local.sh -j 16 -f tile_numbers.txt -k tile -p $psf -N $N_SMP | ||
|
||
|
||
# Exposure detection | ||
## Get single-HDU single-exposure IDs | ||
~/shapepipe/scripts/python/summary_run.py | ||
|
||
cp summary/missing_job_32_sextractor.txt all.txt | ||
curl_canfar_local.sh -j 32 -f all.txt -k exp -p $psf -N $N_SMP | ||
|
||
# Tile preparation | ||
curl_canfar_local.sh -j 64 -f tile_numbers.txt -k tile -p $psf -N $N_SMP | ||
|
||
# Tile shape measurement | ||
curl_canfar_local.sh -j 128 -f tile_numbers.txt -k tile -p $psf -N 8 | ||
|
||
# Merge subcatalogues, and create final cat | ||
curl_canfar_local.sh -j 256 -f tile_numbers.txt -k tile -p $psf -N $N_SMP | ||
|
||
# Combine all final cats in common output dir as links | ||
combine_runs.bash -c final -p psfex | ||
|
||
# Merge all final cats | ||
# (W3: 140GB RAM) | ||
merge_final_cat -i output/run_sp_combined_final/make_catalog_runner/output -p cfis/final_cat.param -v | ||
|
||
|
||
# Delete jobs | ||
SSL=~/.ssl/cadcproxy.pem | ||
SESSION=https://ws-uv.canfar.net/skaha/v0/session | ||
for ID in `cat session_IDs.txt`; do echo $ID; curl -X DELETE -E $SSL $SESSION/$ID; done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you checked this?