Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
7818ddf
Initial DAG for LINC+delay
tikk3r May 23, 2026
da28933
Add download step
tikk3r May 28, 2026
e3c5ae1
Fix small errors
tikk3r May 28, 2026
e9612d6
delay cal, rundir and outdir
tikk3r May 31, 2026
5bd78a3
dd cal dag entry
tikk3r Jun 5, 2026
9910c17
Tweak dd cal
tikk3r Jun 5, 2026
834d888
Return field from linc target validation
tikk3r Jun 9, 2026
0b698a5
Get dd status column
tikk3r Jun 9, 2026
125de55
Fix target retrieval in ddcal
tikk3r Jun 9, 2026
abd97e8
Set whole field to finished once ddcal finishes successfully
tikk3r Jun 9, 2026
245b360
One target list per field
tikk3r Jun 9, 2026
137c456
Sort priority descending
tikk3r Jun 9, 2026
f1966ca
Empty explicit paths
tikk3r Jun 10, 2026
cc5421b
Fix delay sols search path
tikk3r Jun 10, 2026
b72eec1
Fix suffix search
tikk3r Jun 10, 2026
ee81117
Tweak most recent dir
tikk3r Jun 10, 2026
e36d327
Fix target search path in delay
tikk3r Jun 15, 2026
28037f2
Fix suffix for delay calibration
tikk3r Jun 15, 2026
16781d2
More power: restarts and bad nodes
tikk3r Jun 15, 2026
2135952
Remove outdated LINC dag
tikk3r Jun 15, 2026
e9741f4
Attempt to retrieve rundir on the fly
tikk3r Jun 16, 2026
0644f6e
Small updates
tikk3r Jun 16, 2026
74dd7ef
Remove explicit paths
tikk3r Jun 18, 2026
b761683
Fix dd cal and update success check
tikk3r Jun 21, 2026
f59f56f
Add some documentation
tikk3r Jun 21, 2026
062e8bc
Implement calibrator2 and homogenise success triggers
tikk3r Jun 21, 2026
3e181ca
Fix adding a field
tikk3r Jun 24, 2026
f99d192
Draft widefield dag
tikk3r Jun 24, 2026
52a36d4
Update readme
tikk3r Jun 24, 2026
354b154
Expand readme with expected folder setup
tikk3r Jun 24, 2026
e50a28d
Allow manual approval of delay solutions for widefield
tikk3r Jun 24, 2026
7869c95
Update widefield DAG with subtract and ddcal
tikk3r Jul 16, 2026
c48cb92
Update readme
tikk3r Aug 3, 2026
a69c0a4
Add intermediate resolution imaging workflow
tikk3r Aug 3, 2026
01dd50a
Merge pull request #4 from FLOCSoft/airflow-interm-img
tikk3r Aug 3, 2026
f31ff4c
Update tmux commands
tikk3r Aug 3, 2026
b5a59f5
Fix database addition
tikk3r Aug 3, 2026
95a4d74
Update database column creation
tikk3r Aug 3, 2026
99a2199
Add facet subtract task
tikk3r Aug 3, 2026
8434d2f
Merge pull request #5 from FLOCSoft/airflow-facet-subtract
tikk3r Aug 3, 2026
c478d2f
Add facet imaging for 0.3 arcsec initially
tikk3r Aug 3, 2026
9a88b89
Merge pull request #6 from FLOCSoft/airflow-facet-img
tikk3r Aug 3, 2026
0e7b476
Fix ddf subtract status column query
tikk3r Aug 3, 2026
9ddbc4a
Fix frequency range for downloading
tikk3r Aug 3, 2026
0944be7
Update readme with secret
tikk3r Aug 4, 2026
6a6c62d
Update readme with DB initialisation
tikk3r Aug 4, 2026
ef6892c
Don't succeed delay if processing
tikk3r Aug 4, 2026
0532dcb
Fix target staged flag
tikk3r Aug 4, 2026
f65bff5
Run lofar-vlbi-plot if no delay catalogue is found
tikk3r Aug 4, 2026
d67066f
Make downloading a bit more robust with restarts
tikk3r Aug 4, 2026
598fa46
Add more download guards
tikk3r Aug 4, 2026
ba85ba7
More dl guards
tikk3r Aug 4, 2026
cd7d4c5
Be more verbose about downloading
tikk3r Aug 4, 2026
d1225be
Fix target dl reporting
tikk3r Aug 4, 2026
467bf79
Fix string formatting
tikk3r Aug 4, 2026
823d7bc
Shell in subprocess
tikk3r Aug 4, 2026
cfaa858
Only obtain field that are not currently processing
tikk3r Aug 4, 2026
68e7167
Wait for both calibrators to finish
tikk3r Aug 5, 2026
6b2adf0
Do not return field for calibrator if processing
tikk3r Aug 5, 2026
9abb427
ruff
tikk3r Aug 5, 2026
790892b
Initialise DB with enum values
tikk3r Aug 5, 2026
05730ed
Download products to output directory
tikk3r Aug 5, 2026
e19cf9c
Move delay download check inside command
tikk3r Aug 5, 2026
c444c54
Do not try to restart delay if log file not present
tikk3r Aug 5, 2026
9a3a57a
Skip calibrators if they don't exist
tikk3r Aug 5, 2026
e26583a
Make resumes more robust for the PILOT pipelines
tikk3r Aug 5, 2026
1fc9622
Skip rest of DAG if no unprocessed fields
tikk3r Aug 5, 2026
c109630
Read DAG settings from a config file
tikk3r Aug 5, 2026
53df96d
Convert row to dict
tikk3r Aug 5, 2026
0d18311
Print summary of config on launch
tikk3r Aug 5, 2026
e41f83b
evaluate bool eval for delay
tikk3r Aug 5, 2026
3bb5988
Try to fix unprocessed fields
tikk3r Aug 5, 2026
b4d6ac7
Break if unprocessed field found
tikk3r Aug 5, 2026
51e14f9
Warn inside the dag if config not found
tikk3r Aug 5, 2026
46ede5b
Make a user-friendly frontend for the airflow setup
tikk3r Aug 5, 2026
478f372
Actually launch different services
tikk3r Aug 5, 2026
05aefc4
Add calibrator selection based on Tim's code
tikk3r Aug 6, 2026
29108eb
Update readme
tikk3r Aug 6, 2026
c047e24
Merge pull request #7 from FLOCSoft/airflow-calibrator-template
tikk3r Aug 6, 2026
033cb65
Mark ddf pipeline as finished in database
tikk3r Aug 6, 2026
16dff1f
Implement both cwltool and toil for linc calibrator
tikk3r Aug 6, 2026
1750810
Run calibrator 2 in 2...
tikk3r Aug 6, 2026
88da78a
Merge pull request #8 from FLOCSoft/airflow-cwltool
tikk3r Aug 6, 2026
22b39d3
Move DB logic to submodule
tikk3r Aug 6, 2026
be36071
Merge pull request #9 from FLOCSoft/isolate-db-functions
tikk3r Aug 6, 2026
7c9f0cb
Add DB utils interface
tikk3r Aug 6, 2026
4a0bbe0
Implement cwltool for linc target
tikk3r Aug 6, 2026
7efc522
default toil for target for now
tikk3r Aug 6, 2026
ee66040
Update score choice to handle identical scores
tikk3r Aug 7, 2026
802f050
Add initial db manipulation commands
tikk3r Aug 7, 2026
fa5e48f
Add nothing status
tikk3r Aug 7, 2026
6eaea01
More db manipulation
tikk3r Aug 7, 2026
f08db75
Merge pull request #11 from FLOCSoft/db-manipulation
tikk3r Aug 7, 2026
f9c8b9a
Merge pull request #10 from FLOCSoft/airflow-cwltool-linc-target
tikk3r Aug 7, 2026
2ff0a67
Implement cwltool for delay cal
tikk3r Aug 7, 2026
00aa1ed
Fix update if statement
tikk3r Aug 7, 2026
9effc08
Rename airflow deployment
tikk3r Aug 7, 2026
df04743
Change python version bound to make ty happy
tikk3r Aug 7, 2026
17ff461
Merge pull request #12 from FLOCSoft/airflow-cwltool-pilot-delay
tikk3r Aug 7, 2026
4ab880c
Implement cwltool for ddcal
tikk3r Aug 7, 2026
f537031
Add cores to cwltool calls
tikk3r Aug 7, 2026
55fbbbf
Merge pull request #13 from FLOCSoft/airflow-cwltool-pilot-ddcal
tikk3r Aug 7, 2026
2e7696c
Extract run commands into submodule
tikk3r Aug 7, 2026
2f0ac7a
Extract intermediate resolution image
tikk3r Aug 7, 2026
8905008
Extract facet subtract
tikk3r Aug 7, 2026
7bae777
Extract facet imaging
tikk3r Aug 7, 2026
21dd0d3
Add missing db arguments
tikk3r Aug 7, 2026
20e3c09
Extract ddf subtract prep step
tikk3r Aug 7, 2026
17a654d
Extract ddf subtract prep step
tikk3r Aug 7, 2026
16b2405
Extract ddf subtract
tikk3r Aug 7, 2026
8cb3991
Implement a logs directory for most steps
tikk3r Aug 7, 2026
3966274
Extract initial ddf pipeline and actually make a logs sub directory
tikk3r Aug 7, 2026
2eb8e57
Fix unprocessed target assignment
tikk3r Aug 7, 2026
9b2508b
Fix unprocessed target assignment
tikk3r Aug 7, 2026
4945af2
Check user home for a config to be a bit more flexible for screens/tm…
tikk3r Aug 14, 2026
b6b7e6e
Resolve ddf launching
tikk3r Aug 14, 2026
fce2eaa
Output logs to the proper directory everywhere
tikk3r Aug 14, 2026
8f2bc2a
Cleanup remaining ddf logs
tikk3r Aug 14, 2026
2b57ab5
Better boolean parsing
tikk3r Aug 14, 2026
04690d6
Safeguard directory creations
tikk3r Aug 14, 2026
afc7cef
No crash if dir exists
tikk3r Aug 14, 2026
d74264e
Bunch of fixes
tikk3r Aug 14, 2026
7c2cba3
More fixes
tikk3r Aug 14, 2026
7ded59e
More fixes
tikk3r Aug 14, 2026
c1fa056
Fix model image glob
tikk3r Aug 14, 2026
30d5370
More fixes
tikk3r Aug 14, 2026
bd2f269
Really fix loop this time
tikk3r Aug 14, 2026
90af5ba
Add oom slurm failure
tikk3r Aug 14, 2026
b23ad37
Merge pull request #14 from FLOCSoft/cleanup-runners
tikk3r Aug 14, 2026
aa179ae
Add missing status columns
tikk3r Aug 14, 2026
f5c7649
Output err log for intermediate img
tikk3r Aug 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# End-to-end processing of ILT HBA data with flocs

This package aims to provide relatively simple end-to-end automatic processing of ILT HBA data. Where `flocs-runners` provides the interface to running pipelines, `flocs-processing` is the scaffolding to tie it together. Data reduction is coordinated via a dedicated SQLite database that holds information on which observations to process, which pipelines to run for them and all of the related statuses. Orchestration of all the pipelines is handled via Airflow through a DAG.

The autoPILOT package (https://github.com/LOFAR-VLBI/autoPILOT) needs to be on PYTHONPATH to enable the automatic calibrator assessment.

## Folder setup
Flocs-processing requires three folders to be setup:

* A processing folder -- this is where data is stored while processing
* A data folder -- this is where the input data is found
* An output folder -- this is where finished pipeline outputs are copied to, and searched for in steps that depend on it.

The expected naming directory structure for input data is `<data folder>/<field name>/{calibrator,target}`. Inside the calibrator and target folders, the observations should follow the usual `LXXXXXX` naming scheme. These **must** match the SAS IDs in the database for flocs to be able to find them.

## Database setup
A database for processing is created via `flocs-processing create-database`. This will create an empty database with the necessary columns. Datasets to process can be added via `flocs-processing add-field`.

## Processing data
To start processing data, Airflow needs to be running. This will be delegated to `flocs-processing process-from-database` in the future, but for now requires running Airflow manually. For setup do the following:

1. Install airflow: `uv pip install apache-airflow`
2. Set up a folder that wil contain all of Airflow's own stuff and assign it to the `AIRFLOW_HOME` environment variable.
3. Run `airflow config list --defaults > "${AIRFLOW_HOME}/airflow.cfg"`
4. Define `AIRFLOW__CORE__DAGS_FOLDER` as `${AIRFLOW_HOME}/dags` and create the folder. Copy the DAGs inside `flocs_processing/dags` to this folder.
5. Define `AIRFLOW__CORE__LOAD_EXAMPLES` as `False`

Finally, define the following airflow variables:

```
export AIRFLOW_HOME=/path/to/some/folder/for/airflow
export AIRFLOW__CORE__DAGS_FOLDER=$AIRFLOW_HOME/dags
export AIRFLOW__CORE__LOAD_EXAMPLES=False
export AIRFLOW__CORE__PARALLELISM=32
export AIRFLOW__LOGGING__DAG_PROCESSOR_CHILD_PROCESS_LOG_DIRECTORY=$AIRFLOW_HOME/logs/dag_processor
export AIRFLOW__CORE__PLUGINS_FOLDER=$AIRFLOW_HOME/plugins
export AIRFLOW__DATABASE__SQL_ALCHEMY_CONN="sqlite:///$AIRFLOW_HOME/airflow.db"
export AIRFLOW__LOGGING__BASE_LOG_FOLDER=$AIRFLOW_HOME/logs
```

For a small test, you can run `airflow standalone` to start the Airflow instance for a small test. For proper deployment, it is recommended by the Airflow docs to not use `standalone`. First we'll set up a persistent JWT secret for authentication purpose.

```
mkdir -p "$HOME/.config/airflow"
chmod 700 "$HOME/.config/airflow"
openssl rand -hex 32 > "$HOME/.config/airflow/jwt_secret"
chmod 600 "$HOME/.config/airflow/jwt_secret"
export AIRFLOW__API_AUTH__JWT_SECRET="$(cat "$HOME/.config/airflow/jwt_secret")"
```

Next, initialise Airflow's own database with

```
airflow db migrate
```

Finally, to start the necessary Airflow services, execute them like follows:

```
tmux new-session -d -s airflow-api-server "bash -c 'source $HOME/source_airflow.sh && airflow api-server; exec bash'"
tmux new-session -d -s airflow-triggerer "bash -c 'source $HOME/source_airflow.sh && airflow triggerer; exec bash'"
tmux new-session -d -s airflow-dag-processor "bash -c 'source $HOME/source_airflow.sh && airflow dag-processor; exec bash'"
tmux new-session -d -s airflow-scheduler "bash -c 'source $HOME/source_airflow.sh && airflow scheduler; exec bash'"
```

This should start four tmux sessions with these services running in the background. The credentials to log into e.g. the web interface will be stored in `${AIRFLOW_HOME}/simple_auth_manager_passwords.json.generated`. The Airflow instance will start on port 8080. You can access it via `localhost:8080` in your browser. If it is running on a remote cluster, you can set up a tunnel via e.g. `ssh -N -L 8080:localhost:8080 <remote>` to forward it to your local machine.

Once `flocs-processing` is complete the processing loop will be automatic, but for now the user must trigger the DAG manually. On the "Dags" tab you should now see the flocs DAGs available. To manually trigger one, click on the name and on the subsequent page use the "Trigger" button in the top right.

Loading