runrail 0.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. runrail-0.3.1/.gitignore +16 -0
  2. runrail-0.3.1/CHANGELOG.md +71 -0
  3. runrail-0.3.1/LICENSE +201 -0
  4. runrail-0.3.1/PKG-INFO +194 -0
  5. runrail-0.3.1/README.md +142 -0
  6. runrail-0.3.1/pyproject.toml +77 -0
  7. runrail-0.3.1/src/runrail/__init__.py +4 -0
  8. runrail-0.3.1/src/runrail/api/__init__.py +1 -0
  9. runrail-0.3.1/src/runrail/api/app.py +52 -0
  10. runrail-0.3.1/src/runrail/api/crud.py +75 -0
  11. runrail-0.3.1/src/runrail/api/routes_resources.py +202 -0
  12. runrail-0.3.1/src/runrail/api/routes_runs.py +193 -0
  13. runrail-0.3.1/src/runrail/api/routes_workflows.py +168 -0
  14. runrail-0.3.1/src/runrail/api/routes_ws.py +80 -0
  15. runrail-0.3.1/src/runrail/api/ws.py +40 -0
  16. runrail-0.3.1/src/runrail/cli.py +305 -0
  17. runrail-0.3.1/src/runrail/config.py +68 -0
  18. runrail-0.3.1/src/runrail/db.py +52 -0
  19. runrail-0.3.1/src/runrail/environments.py +306 -0
  20. runrail-0.3.1/src/runrail/importer.py +132 -0
  21. runrail-0.3.1/src/runrail/maintenance.py +76 -0
  22. runrail-0.3.1/src/runrail/migrations/env.py +25 -0
  23. runrail-0.3.1/src/runrail/migrations/script.py.mako +12 -0
  24. runrail-0.3.1/src/runrail/migrations/versions/b3e7f91a2c04_workflow_project_env.py +18 -0
  25. runrail-0.3.1/src/runrail/migrations/versions/cc9cf8e3d4ad_initial_schema.py +138 -0
  26. runrail-0.3.1/src/runrail/migrations/versions/d7a4b18c2f10_managed_environment_lifecycle.py +47 -0
  27. runrail-0.3.1/src/runrail/migrations/versions/e2f96a3d710b_adopt_legacy_managed_environments.py +74 -0
  28. runrail-0.3.1/src/runrail/migrations/versions/f8b2c41e9d06_managed_notebook_runtime.py +27 -0
  29. runrail-0.3.1/src/runrail/migrations/versions/g3d7a09f42ce_active_environment_packages.py +21 -0
  30. runrail-0.3.1/src/runrail/migrations/versions/h5e2b71c9a3d_workflow_notifications.py +19 -0
  31. runrail-0.3.1/src/runrail/models.py +206 -0
  32. runrail-0.3.1/src/runrail/notify.py +91 -0
  33. runrail-0.3.1/src/runrail/scheduler/__init__.py +1 -0
  34. runrail-0.3.1/src/runrail/scheduler/service.py +102 -0
  35. runrail-0.3.1/src/runrail/schemas.py +192 -0
  36. runrail-0.3.1/src/runrail/web/static/assets/index-CxoNVeSC.css +1 -0
  37. runrail-0.3.1/src/runrail/web/static/assets/index-DVXGj4jA.js +23 -0
  38. runrail-0.3.1/src/runrail/web/static/index.html +21 -0
  39. runrail-0.3.1/src/runrail/worker/__init__.py +1 -0
  40. runrail-0.3.1/src/runrail/worker/queue.py +58 -0
  41. runrail-0.3.1/src/runrail/worker/runners.py +147 -0
  42. runrail-0.3.1/src/runrail/worker/service.py +497 -0
  43. runrail-0.3.1/src/runrail/worker/templating.py +15 -0
  44. runrail-0.3.1/src/runrail/workflow_io.py +163 -0
@@ -0,0 +1,16 @@
1
+ .runrail/
2
+ .env
3
+ .venv/
4
+ __pycache__/
5
+ *.py[cod]
6
+ .pytest_cache/
7
+ .ruff_cache/
8
+ frontend/node_modules/
9
+ dist/
10
+ *.egg-info/
11
+
12
+ # macOS
13
+ .DS_Store
14
+
15
+ # Local Claude Code settings (machine-specific, may contain local paths)
16
+ .claude/
@@ -0,0 +1,71 @@
1
+ # Changelog
2
+
3
+ Notable changes to RunRail. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow [Semantic Versioning](https://semver.org/).
4
+
5
+ ## [0.3.1] — 2026-07-15
6
+
7
+ ### Packaging
8
+ - Available on PyPI — `pipx install runrail`. The wheel bundles the prebuilt web UI, so no Node is needed at runtime, and `pyproject.toml` now carries full metadata (description, Rutr Labs authors, keywords, trove classifiers, and project URLs).
9
+ - Releases publish to PyPI via Trusted Publishing (OIDC) from CI when a release is published; a manual dispatch can dry-run to TestPyPI.
10
+ - Data now lives in a stable per-user application-data directory by default — `~/Library/Application Support/RunRail` (macOS), `~/.local/share/RunRail` (Linux, honouring `$XDG_DATA_HOME`), `%LOCALAPPDATA%\RunRail` (Windows) — instead of `./.runrail` in the current directory. Override with `RUNRAIL_HOME` (e.g. `RUNRAIL_HOME=./.runrail`). `runrail serve` creates the directory and database on first run, so a fresh install needs only `pipx install runrail && runrail serve`.
11
+
12
+ ### Added
13
+ - Aggregated stats endpoints: `GET /api/stats/summary` computes the dashboard and run-history metrics (live counts, 24-hour totals, 7-day success rate, average duration) in SQL, so the numbers stay accurate no matter how much history the browser has loaded.
14
+ - Activity heatmap range selector: 4, 8, or 16 weeks or 6 months on the dashboard and workflow pages, remembered across sessions. The grid runs Monday through Sunday with every weekday labelled.
15
+ - Task timeouts can be entered in seconds, minutes, hours, or days; values are stored as seconds and shown in the friendliest unit.
16
+ - First-run import: when `runrail serve` targets a brand-new home from an interactive terminal, it offers to bring over an existing setup — either a previous RunRail data directory (database, logs, artifacts, and environments are copied after an integrity check, then upgraded by the normal startup migrations) or a workflows YAML from `runrail export`. Also available any time as `runrail import <path>`; it never overwrites an existing database.
17
+
18
+ ### Changed
19
+ - Running progress bars redesigned as a comet: the fill grows with progress behind a bright twinkling head and leaves a dimmer, still-lit dot trail. Past the median duration the trail gradually shifts toward amber — fully amber at 135% — while the head holds its color until it catches up. One reusable treatment covers the wallboard, the run timeline, and indeterminate loaders.
20
+ - The run timeline renders while a run is executing; running bars grow against the wall clock instead of the timeline appearing only after the run finishes.
21
+ - Wallboard tiles are larger and clickable — each tile links to its workflow page.
22
+ - Scheduled runs no longer record a `ds` parameter they never used; `{{ ds }}` still renders (defaulting to the run date) and backfills still set it explicitly.
23
+ - Legibility pass: status chips use full-strength status colors, project cards match the workflow-card layout, and dependency-graph nodes got larger type.
24
+
25
+ ### Docs
26
+ - Clarified the concurrency model to remove a wording contradiction: different workflows and independent tasks run concurrently on one machine, runs of the same workflow serialize by `max_concurrent_runs`, and distributed/remote workers are not supported yet.
27
+
28
+ ## [0.3.0] — 2026-07-09
29
+
30
+ ### Added
31
+ - Live dependency graph: workflow pages render the task DAG, and run pages overlay live statuses — nodes highlight while running, edges trace as branches execute.
32
+ - Gantt timeline v2: one lane per task with retry attempts as separate bars, a time axis, and detailed hover tooltips; parallel execution is visible at a glance, and running bars grow live against the wall clock.
33
+ - ANSI color rendering in the log viewer (16-color, 256-color, and truecolor), plus in-log search with match navigation and tail-follow.
34
+ - Daily activity heatmap on the dashboard and per workflow, backed by a new `GET /api/stats/daily` aggregation endpoint.
35
+ - Wallboard: a full-screen, auto-refreshing status view at `/wallboard` for a team TV — health verdict, live-run cards with ETA, urgency-sorted tiles, failure streaks, overdue-schedule detection, and a failures strip.
36
+ - Sparkle-fill progress indicator: running progress bars render as a dot-matrix that fills left-to-right with a scattered sparkle as a run advances toward its median duration; reused as a shared `LoadingBar` for environment builds and queued runs.
37
+ - Graceful shutdown: `runrail serve` reports which runs are still executing (with a median-based ETA) on the first Ctrl+C and force-quits on the second; interrupted runs are recovered as failed on the next start so a killed worker never leaves a phantom run holding a concurrency slot.
38
+
39
+ ### Changed
40
+ - Dashboard reorganized: the activity heatmap moved into the hero beside the headline, removing a large half-empty panel.
41
+ - Run and dashboard views refresh reliably while live — a polling regression (the interval was torn down every render) is fixed, so the Gantt and statuses update without a manual reload.
42
+
43
+ ### Fixed
44
+ - Removed a heavy visual-effects pass (film grain, cursor-tracked specular wash, and a modal depth-of-field blur) that desaturated content and hurt readability; surfaces are flat and legible again in both themes.
45
+ - WebSocket log streams close promptly instead of hanging graceful shutdown, and no longer emit `CancelledError` tracebacks on exit.
46
+
47
+ ## [0.2.0] — 2026-07-08
48
+
49
+ ### Added
50
+ - Failure notifications: per-workflow or global webhook (`RUNRAIL_NOTIFY_WEBHOOK_URL`), posting on the first failure after a success and again on recovery. Slack and Teams incoming webhooks work without configuration.
51
+ - Auto-pause: workflows can disable themselves after N consecutive failures, with a webhook notice.
52
+ - Run retry: `POST /api/runs/{id}/retry` and a Retry button on the run page re-queue any finished run with identical parameters.
53
+ - Workflows as code: `runrail export` and `runrail apply` round-trip workflow and task definitions through YAML, referencing projects and environments by name for portability across machines.
54
+ - GitHub Actions CI: lint and tests on Python 3.11/3.12 plus a frontend typecheck and build.
55
+ - Live log tailing follows output as it streams, with a terminal-style caret while a task is running.
56
+
57
+ ### Fixed
58
+ - Windows: managed environment builds no longer fail with `WinError 5` when OneDrive or antivirus briefly locks the build directory; directory promotion now retries and falls back to copy.
59
+ - Hourly cron schedules (`30 * * * *`) were displayed as daily; schedule previews and the Upcoming list now interpret them correctly.
60
+ - Schedule labels now render in the viewer's local timezone, matching the timestamps shown beside them.
61
+ - Dark mode: native dropdown options and the date-picker icon are now legible on all platforms.
62
+ - Reduced-motion environments (including Windows with animation effects off) keep functional indicators: running spinners continue, entrances fall back to fades instead of disappearing.
63
+
64
+ ## [0.1.0] — 2026-07-06
65
+
66
+ Initial public release: projects, managed Python environments, workflows with dependency-ordered tasks (shell, Python, notebook, SQL), cron scheduling with coalescing, parallel task execution, backfills, retries, live logs, artifacts with retention cleanup, and the bundled web UI.
67
+
68
+ [0.3.1]: https://github.com/rutr-labs/runrail/compare/v0.3.0...v0.3.1
69
+ [0.3.0]: https://github.com/rutr-labs/runrail/compare/v0.2.0...v0.3.0
70
+ [0.2.0]: https://github.com/rutr-labs/runrail/compare/v0.1.0...v0.2.0
71
+ [0.1.0]: https://github.com/rutr-labs/runrail/releases/tag/v0.1.0
runrail-0.3.1/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 rutr-labs
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
runrail-0.3.1/PKG-INFO ADDED
@@ -0,0 +1,194 @@
1
+ Metadata-Version: 2.4
2
+ Name: runrail
3
+ Version: 0.3.1
4
+ Summary: A self-hosted workflow orchestrator for the Python scripts, notebooks, SQL, and shell commands you already have.
5
+ Project-URL: Homepage, https://github.com/rutr-labs/runrail
6
+ Project-URL: Repository, https://github.com/rutr-labs/runrail
7
+ Project-URL: Documentation, https://github.com/rutr-labs/runrail#readme
8
+ Project-URL: Issues, https://github.com/rutr-labs/runrail/issues
9
+ Project-URL: Changelog, https://github.com/rutr-labs/runrail/blob/main/CHANGELOG.md
10
+ Author-email: Rutr Labs <therutr@outlook.com>
11
+ Maintainer-email: Rutr Labs <therutr@outlook.com>
12
+ License: Apache-2.0
13
+ License-File: LICENSE
14
+ Keywords: airflow-alternative,cron,dag,data-engineering,elt,etl,jobs,notebooks,orchestration,orchestrator,papermill,pipelines,scheduler,self-hosted,workflow
15
+ Classifier: Development Status :: 4 - Beta
16
+ Classifier: Environment :: Web Environment
17
+ Classifier: Framework :: FastAPI
18
+ Classifier: Intended Audience :: Developers
19
+ Classifier: Intended Audience :: Information Technology
20
+ Classifier: Intended Audience :: System Administrators
21
+ Classifier: License :: OSI Approved :: Apache Software License
22
+ Classifier: Operating System :: OS Independent
23
+ Classifier: Programming Language :: Python :: 3
24
+ Classifier: Programming Language :: Python :: 3.11
25
+ Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
27
+ Classifier: Topic :: Office/Business :: Scheduling
28
+ Classifier: Topic :: Software Development :: Build Tools
29
+ Classifier: Topic :: System :: Monitoring
30
+ Classifier: Typing :: Typed
31
+ Requires-Python: >=3.11
32
+ Requires-Dist: alembic>=1.13
33
+ Requires-Dist: apscheduler<4,>=3.10
34
+ Requires-Dist: fastapi>=0.115
35
+ Requires-Dist: jinja2>=3.1
36
+ Requires-Dist: platformdirs>=4
37
+ Requires-Dist: psycopg[binary]>=3.2
38
+ Requires-Dist: pydantic-settings>=2.5
39
+ Requires-Dist: pyyaml>=6.0
40
+ Requires-Dist: sqlalchemy>=2.0
41
+ Requires-Dist: typer>=0.12
42
+ Requires-Dist: uvicorn[standard]>=0.30
43
+ Provides-Extra: dev
44
+ Requires-Dist: build>=1.2; extra == 'dev'
45
+ Requires-Dist: httpx>=0.27; extra == 'dev'
46
+ Requires-Dist: pytest>=8; extra == 'dev'
47
+ Requires-Dist: ruff>=0.6; extra == 'dev'
48
+ Provides-Extra: notebook
49
+ Requires-Dist: nbconvert>=7.16; extra == 'notebook'
50
+ Requires-Dist: papermill>=2.6; extra == 'notebook'
51
+ Description-Content-Type: text/markdown
52
+
53
+ # RunRail
54
+
55
+ **A self-hosted workflow orchestrator for the scripts you already have.** Schedule Python scripts, Jupyter notebooks, SQL files, and shell commands with dependencies, retries, logs, backfills, and a fast web UI — without rewriting anything.
56
+
57
+ [![CI](https://github.com/rutr-labs/runrail/actions/workflows/ci.yml/badge.svg)](https://github.com/rutr-labs/runrail/actions/workflows/ci.yml)
58
+ [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
59
+ ![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue)
60
+
61
+ Most teams outgrow cron long before they need a distributed orchestrator. RunRail covers that middle ground: one process, one SQLite file, and your existing code running on a real scheduler with full observability. No DAG files to author, no decorators to add, no platform to operate.
62
+
63
+ ## Features
64
+
65
+ - **Bring your own code** — point RunRail at a folder; scripts, notebooks, SQL, and shell commands run as-is in isolated subprocesses
66
+ - **Dependency graphs with parallel execution** — independent tasks run concurrently; each task starts the moment its dependencies succeed
67
+ - **Cron scheduling built for high frequency** — minute-level schedules with per-workflow concurrency limits, coalescing, and missed-run tolerance
68
+ - **Managed Python environments** — declare pip requirements in the UI; RunRail builds and atomically swaps isolated virtualenvs, keeping the last working build on failure
69
+ - **Failure webhooks with sane semantics** — one alert on the first failure, one on recovery; Slack and Teams incoming webhooks work as-is
70
+ - **Auto-pause** — optionally disable a workflow after N consecutive failures instead of failing hundreds of times overnight
71
+ - **Backfills and retries** — queue one run per date over a range; re-run any finished run with identical parameters in one click
72
+ - **Workflows as code** — `runrail export` / `runrail apply` round-trip definitions through YAML for version control and code review
73
+ - **Live dependency graph** — every run renders its task DAG with statuses updating in place as branches execute
74
+ - **Live logs and artifacts** — streamed stdout/stderr with ANSI colors, search, tail-follow, timestamped notebook outputs, automatic retention cleanup
75
+ - **A UI you'll actually use** — command palette (⌘K), Gantt timelines, activity heatmaps, a full-screen wallboard for the team TV, dark and light themes
76
+
77
+ ## Install
78
+
79
+ RunRail ships as a single Python package with the web UI bundled in — **no Node required to run it**. Python 3.11+ is the only prerequisite.
80
+
81
+ ```bash
82
+ pipx install runrail # isolated, recommended — or: pip install runrail
83
+ runrail serve
84
+ ```
85
+
86
+ Then open **http://127.0.0.1:8080**. That's the whole setup.
87
+
88
+ On first launch RunRail creates its database, logs, and artifact store automatically and starts the API, web UI, scheduler, and worker in a single process — no separate `init` step, no migrations to run by hand. Everything lives in a per-user application-data directory:
89
+
90
+ | OS | Default location |
91
+ |---|---|
92
+ | macOS | `~/Library/Application Support/RunRail` |
93
+ | Linux | `~/.local/share/RunRail` (honours `$XDG_DATA_HOME`) |
94
+ | Windows | `%LOCALAPPDATA%\RunRail` |
95
+
96
+ Set `RUNRAIL_HOME` to store everything somewhere else (e.g. `RUNRAIL_HOME=./.runrail` to keep data beside a project). For notebook tasks, install the extra: `pipx install "runrail[notebook]"`.
97
+
98
+ From the UI, connect a project folder, add an environment, and build your first workflow.
99
+
100
+ ## Core concepts
101
+
102
+ **Projects** point at directories where your code lives. **Environments** define how Python runs — a managed virtualenv built from declared pip requirements, an existing interpreter, or a Conda environment. **Workflows** group **tasks** into a dependency graph with an optional cron schedule. Environments resolve per task, falling back to the workflow default, then the project default; Python and notebook tasks never silently run on RunRail's own interpreter.
103
+
104
+ The recommended environment setup is *Environments → New environment → Managed Python*: declare requirements such as `pandas==2.3.0`, and RunRail builds an isolated virtualenv, records the build log and Python version, and rebuilds atomically when the requirements change. A failed rebuild preserves the previous working runtime.
105
+
106
+ ## CLI
107
+
108
+ ```bash
109
+ runrail run daily-refresh --param region=ca # queue a manual run
110
+ runrail backfill daily-refresh --from 2026-06-01 --to 2026-06-30
111
+ runrail export -o workflows.yml # workflows as version-controllable YAML
112
+ runrail apply workflows.yml # declarative upsert by name
113
+ runrail import ~/old/.runrail # bring a previous setup into this home
114
+ runrail cleanup --older-than-days 30 --dry-run # prune old runs, logs, artifacts
115
+ runrail status
116
+
117
+ # run components as separate processes
118
+ runrail api
119
+ runrail scheduler
120
+ runrail worker --concurrency 8
121
+ ```
122
+
123
+ ## Templating
124
+
125
+ Task commands and paths are Jinja templates. Every run receives:
126
+
127
+ | Variable | Meaning |
128
+ |---|---|
129
+ | `ds` | Logical date (`2026-07-08`); injected per-date during backfills |
130
+ | `ts` / `ts_nodash` | Run timestamp, ISO and compact (`20260708T141005`) |
131
+ | `run_id`, `task_run_id` | Identifiers for the current execution |
132
+ | `project_root`, `artifacts_dir` | Resolved paths for the run |
133
+ | *your parameters* | Run parameters and per-task parameters, merged |
134
+
135
+ ```bash
136
+ python scripts/daily.py --date {{ ds }} --region {{ region }}
137
+ ```
138
+
139
+ ## Notifications
140
+
141
+ Set `RUNRAIL_NOTIFY_WEBHOOK_URL` globally or a webhook per workflow. RunRail posts on the first failure after a success and again on recovery — never once per red run, so a broken two-minute schedule produces one alert rather than three hundred. The payload's `text` field renders directly in Slack and Microsoft Teams; structured fields are included for custom receivers. Pair with per-workflow auto-pause to stop repeat failures entirely.
142
+
143
+ ## Docker
144
+
145
+ ```bash
146
+ docker compose up --build
147
+ ```
148
+
149
+ Compose starts RunRail with PostgreSQL and persistent volumes on port 8080. Docker is optional for local use.
150
+
151
+ ## Architecture
152
+
153
+ A FastAPI process serves the API and the prebuilt React UI. APScheduler acts purely as a clock, writing due runs to the database; while a run executes, the next scheduled iteration coalesces to a single queued run instead of piling up or being dropped. A bounded worker pool (`RUNRAIL_WORKER_CONCURRENCY`) claims queued runs atomically, so **different workflows execute concurrently** and a long job never blocks a frequent one. Runs of the *same* workflow are serialized by its `max_concurrent_runs` (default 1) so a slow run can't overlap its own next iteration. Within a run, the task graph executes with real parallelism (`RUNRAIL_TASK_PARALLELISM`): **independent tasks run concurrently**, each starting the moment its dependencies succeed, and every task is a subprocess with its own logs, timeout, and process-group cleanup.
154
+
155
+ All of that concurrency happens on one machine (threads and subprocesses); RunRail does not yet distribute work across remote worker nodes.
156
+
157
+ SQLite in WAL mode is the default store; set `RUNRAIL_DB_URL` for PostgreSQL. Logs live under `$RUNRAIL_HOME/logs/run_<id>/`, artifacts under `$RUNRAIL_HOME/artifacts/<id>/` with timestamped filenames so frequent runs and retries never collide.
158
+
159
+ ## Configuration
160
+
161
+ | Variable | Default |
162
+ |---|---|
163
+ | `RUNRAIL_HOME` | Per-user data dir (see [Install](#install)) |
164
+ | `RUNRAIL_DB_URL` | SQLite at `$RUNRAIL_HOME/runrail.db` |
165
+ | `RUNRAIL_HOST` / `RUNRAIL_PORT` | `127.0.0.1` / `8080` |
166
+ | `RUNRAIL_WORKER_CONCURRENCY` | `4` concurrent runs |
167
+ | `RUNRAIL_TASK_PARALLELISM` | `4` concurrent tasks per run |
168
+ | `RUNRAIL_RETENTION_DAYS` | unset; when set, finished runs older than this are deleted with their logs and artifacts |
169
+ | `RUNRAIL_NOTIFY_WEBHOOK_URL` | unset; default failure/recovery webhook |
170
+ | `RUNRAIL_BROWSE_ROOT` | user home; confines the UI file picker |
171
+
172
+ Schedules evaluate in UTC; the UI displays them in your local timezone. For deployments reachable beyond localhost, set `RUNRAIL_BROWSE_ROOT` to a narrow directory and place the server behind authentication — RunRail does not yet ship its own.
173
+
174
+ ## Current limitations
175
+
176
+ - Runs on a single machine — workflows and independent tasks run concurrently there, but work is not distributed across remote worker nodes yet
177
+ - No built-in authentication or RBAC
178
+ - SQL tasks execute against SQLite only
179
+ - Secrets are plain environment variables
180
+
181
+ ## Roadmap
182
+
183
+ Warehouse and database adapters, artifact previews, secrets management, API tokens and authentication, and richer run analytics. See open issues for details.
184
+
185
+ ## Development
186
+
187
+ ```bash
188
+ pip install -e '.[dev]'
189
+ pytest
190
+ ruff check .
191
+ cd frontend && npm install && npm run build # writes the bundle into src/runrail/web/static
192
+ ```
193
+
194
+ Licensed under [Apache-2.0](LICENSE).
@@ -0,0 +1,142 @@
1
+ # RunRail
2
+
3
+ **A self-hosted workflow orchestrator for the scripts you already have.** Schedule Python scripts, Jupyter notebooks, SQL files, and shell commands with dependencies, retries, logs, backfills, and a fast web UI — without rewriting anything.
4
+
5
+ [![CI](https://github.com/rutr-labs/runrail/actions/workflows/ci.yml/badge.svg)](https://github.com/rutr-labs/runrail/actions/workflows/ci.yml)
6
+ [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
7
+ ![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue)
8
+
9
+ Most teams outgrow cron long before they need a distributed orchestrator. RunRail covers that middle ground: one process, one SQLite file, and your existing code running on a real scheduler with full observability. No DAG files to author, no decorators to add, no platform to operate.
10
+
11
+ ## Features
12
+
13
+ - **Bring your own code** — point RunRail at a folder; scripts, notebooks, SQL, and shell commands run as-is in isolated subprocesses
14
+ - **Dependency graphs with parallel execution** — independent tasks run concurrently; each task starts the moment its dependencies succeed
15
+ - **Cron scheduling built for high frequency** — minute-level schedules with per-workflow concurrency limits, coalescing, and missed-run tolerance
16
+ - **Managed Python environments** — declare pip requirements in the UI; RunRail builds and atomically swaps isolated virtualenvs, keeping the last working build on failure
17
+ - **Failure webhooks with sane semantics** — one alert on the first failure, one on recovery; Slack and Teams incoming webhooks work as-is
18
+ - **Auto-pause** — optionally disable a workflow after N consecutive failures instead of failing hundreds of times overnight
19
+ - **Backfills and retries** — queue one run per date over a range; re-run any finished run with identical parameters in one click
20
+ - **Workflows as code** — `runrail export` / `runrail apply` round-trip definitions through YAML for version control and code review
21
+ - **Live dependency graph** — every run renders its task DAG with statuses updating in place as branches execute
22
+ - **Live logs and artifacts** — streamed stdout/stderr with ANSI colors, search, tail-follow, timestamped notebook outputs, automatic retention cleanup
23
+ - **A UI you'll actually use** — command palette (⌘K), Gantt timelines, activity heatmaps, a full-screen wallboard for the team TV, dark and light themes
24
+
25
+ ## Install
26
+
27
+ RunRail ships as a single Python package with the web UI bundled in — **no Node required to run it**. Python 3.11+ is the only prerequisite.
28
+
29
+ ```bash
30
+ pipx install runrail # isolated, recommended — or: pip install runrail
31
+ runrail serve
32
+ ```
33
+
34
+ Then open **http://127.0.0.1:8080**. That's the whole setup.
35
+
36
+ On first launch RunRail creates its database, logs, and artifact store automatically and starts the API, web UI, scheduler, and worker in a single process — no separate `init` step, no migrations to run by hand. Everything lives in a per-user application-data directory:
37
+
38
+ | OS | Default location |
39
+ |---|---|
40
+ | macOS | `~/Library/Application Support/RunRail` |
41
+ | Linux | `~/.local/share/RunRail` (honours `$XDG_DATA_HOME`) |
42
+ | Windows | `%LOCALAPPDATA%\RunRail` |
43
+
44
+ Set `RUNRAIL_HOME` to store everything somewhere else (e.g. `RUNRAIL_HOME=./.runrail` to keep data beside a project). For notebook tasks, install the extra: `pipx install "runrail[notebook]"`.
45
+
46
+ From the UI, connect a project folder, add an environment, and build your first workflow.
47
+
48
+ ## Core concepts
49
+
50
+ **Projects** point at directories where your code lives. **Environments** define how Python runs — a managed virtualenv built from declared pip requirements, an existing interpreter, or a Conda environment. **Workflows** group **tasks** into a dependency graph with an optional cron schedule. Environments resolve per task, falling back to the workflow default, then the project default; Python and notebook tasks never silently run on RunRail's own interpreter.
51
+
52
+ The recommended environment setup is *Environments → New environment → Managed Python*: declare requirements such as `pandas==2.3.0`, and RunRail builds an isolated virtualenv, records the build log and Python version, and rebuilds atomically when the requirements change. A failed rebuild preserves the previous working runtime.
53
+
54
+ ## CLI
55
+
56
+ ```bash
57
+ runrail run daily-refresh --param region=ca # queue a manual run
58
+ runrail backfill daily-refresh --from 2026-06-01 --to 2026-06-30
59
+ runrail export -o workflows.yml # workflows as version-controllable YAML
60
+ runrail apply workflows.yml # declarative upsert by name
61
+ runrail import ~/old/.runrail # bring a previous setup into this home
62
+ runrail cleanup --older-than-days 30 --dry-run # prune old runs, logs, artifacts
63
+ runrail status
64
+
65
+ # run components as separate processes
66
+ runrail api
67
+ runrail scheduler
68
+ runrail worker --concurrency 8
69
+ ```
70
+
71
+ ## Templating
72
+
73
+ Task commands and paths are Jinja templates. Every run receives:
74
+
75
+ | Variable | Meaning |
76
+ |---|---|
77
+ | `ds` | Logical date (`2026-07-08`); injected per-date during backfills |
78
+ | `ts` / `ts_nodash` | Run timestamp, ISO and compact (`20260708T141005`) |
79
+ | `run_id`, `task_run_id` | Identifiers for the current execution |
80
+ | `project_root`, `artifacts_dir` | Resolved paths for the run |
81
+ | *your parameters* | Run parameters and per-task parameters, merged |
82
+
83
+ ```bash
84
+ python scripts/daily.py --date {{ ds }} --region {{ region }}
85
+ ```
86
+
87
+ ## Notifications
88
+
89
+ Set `RUNRAIL_NOTIFY_WEBHOOK_URL` globally or a webhook per workflow. RunRail posts on the first failure after a success and again on recovery — never once per red run, so a broken two-minute schedule produces one alert rather than three hundred. The payload's `text` field renders directly in Slack and Microsoft Teams; structured fields are included for custom receivers. Pair with per-workflow auto-pause to stop repeat failures entirely.
90
+
91
+ ## Docker
92
+
93
+ ```bash
94
+ docker compose up --build
95
+ ```
96
+
97
+ Compose starts RunRail with PostgreSQL and persistent volumes on port 8080. Docker is optional for local use.
98
+
99
+ ## Architecture
100
+
101
+ A FastAPI process serves the API and the prebuilt React UI. APScheduler acts purely as a clock, writing due runs to the database; while a run executes, the next scheduled iteration coalesces to a single queued run instead of piling up or being dropped. A bounded worker pool (`RUNRAIL_WORKER_CONCURRENCY`) claims queued runs atomically, so **different workflows execute concurrently** and a long job never blocks a frequent one. Runs of the *same* workflow are serialized by its `max_concurrent_runs` (default 1) so a slow run can't overlap its own next iteration. Within a run, the task graph executes with real parallelism (`RUNRAIL_TASK_PARALLELISM`): **independent tasks run concurrently**, each starting the moment its dependencies succeed, and every task is a subprocess with its own logs, timeout, and process-group cleanup.
102
+
103
+ All of that concurrency happens on one machine (threads and subprocesses); RunRail does not yet distribute work across remote worker nodes.
104
+
105
+ SQLite in WAL mode is the default store; set `RUNRAIL_DB_URL` for PostgreSQL. Logs live under `$RUNRAIL_HOME/logs/run_<id>/`, artifacts under `$RUNRAIL_HOME/artifacts/<id>/` with timestamped filenames so frequent runs and retries never collide.
106
+
107
+ ## Configuration
108
+
109
+ | Variable | Default |
110
+ |---|---|
111
+ | `RUNRAIL_HOME` | Per-user data dir (see [Install](#install)) |
112
+ | `RUNRAIL_DB_URL` | SQLite at `$RUNRAIL_HOME/runrail.db` |
113
+ | `RUNRAIL_HOST` / `RUNRAIL_PORT` | `127.0.0.1` / `8080` |
114
+ | `RUNRAIL_WORKER_CONCURRENCY` | `4` concurrent runs |
115
+ | `RUNRAIL_TASK_PARALLELISM` | `4` concurrent tasks per run |
116
+ | `RUNRAIL_RETENTION_DAYS` | unset; when set, finished runs older than this are deleted with their logs and artifacts |
117
+ | `RUNRAIL_NOTIFY_WEBHOOK_URL` | unset; default failure/recovery webhook |
118
+ | `RUNRAIL_BROWSE_ROOT` | user home; confines the UI file picker |
119
+
120
+ Schedules evaluate in UTC; the UI displays them in your local timezone. For deployments reachable beyond localhost, set `RUNRAIL_BROWSE_ROOT` to a narrow directory and place the server behind authentication — RunRail does not yet ship its own.
121
+
122
+ ## Current limitations
123
+
124
+ - Runs on a single machine — workflows and independent tasks run concurrently there, but work is not distributed across remote worker nodes yet
125
+ - No built-in authentication or RBAC
126
+ - SQL tasks execute against SQLite only
127
+ - Secrets are plain environment variables
128
+
129
+ ## Roadmap
130
+
131
+ Warehouse and database adapters, artifact previews, secrets management, API tokens and authentication, and richer run analytics. See open issues for details.
132
+
133
+ ## Development
134
+
135
+ ```bash
136
+ pip install -e '.[dev]'
137
+ pytest
138
+ ruff check .
139
+ cd frontend && npm install && npm run build # writes the bundle into src/runrail/web/static
140
+ ```
141
+
142
+ Licensed under [Apache-2.0](LICENSE).