Commit 0c88774
authored
[CATALYST-262] Stage Stitch job JAR via Unity Catalog volume (#91)
## Summary
Jira ticket: [CATALYST-262]
Consumer-side wire-up for the chuck-api change in [CATALYST-253]. When
the cluster init script lives in a Unity Catalog volume, we now generate
a timestamped `JOB_JAR_VOL_PATH` co-located with it, export it in
`spark_env_vars`, and switch the `Run_Stitch` task's library JAR from
the local `file:///opt/amperity/job.jar` to that volume path. The
chuck-api init script copies the downloaded JAR into `JOB_JAR_VOL_PATH`,
and Databricks' synchronous library load blocks `Run_Stitch` until the
JAR materializes there — no separate preflight task needed.
## Changes
- `chuck_data/clients/databricks.py`
- New `_generate_jar_volume_path(init_script_path)` helper returning
`<volume-dir>/job-YYYYMMDD-HHMMSS.jar`.
- `_build_libraries` accepts an optional `main_jar_path` override so the
Run_Stitch library jar can point at the volume path.
- `submit_job_run` populates `JOB_JAR_VOL_PATH` in `spark_env_vars` and
passes the volume path to `_build_libraries` when the init script is a
Volumes path. S3 init scripts (Redshift) keep the local `file:///` jar —
there is no Unity Catalog volume to stage to.
- `tests/unit/test_workspace_and_init_scripts.py`
- New tests for the volumes path (timestamped jar + env var + library
consistency) and the S3 path (no `JOB_JAR_VOL_PATH`, library jar
unchanged).
## Testing
- `python -m pytest tests/unit` — 1221 passed.
## Rollout
Standard release. The change requires the matching chuck-api init script
(CATALYST-253), which is already merged.
[CATALYST-262]:
https://amperity.atlassian.net/browse/CATALYST-262?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[CATALYST-253]:
https://amperity.atlassian.net/browse/CATALYST-253?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ1 parent a61b92a commit 0c88774
2 files changed
Lines changed: 102 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
579 | | - | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
580 | 595 | | |
581 | 596 | | |
582 | 597 | | |
583 | 598 | | |
584 | 599 | | |
585 | 600 | | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
586 | 609 | | |
587 | | - | |
| 610 | + | |
588 | 611 | | |
589 | 612 | | |
590 | 613 | | |
| |||
634 | 657 | | |
635 | 658 | | |
636 | 659 | | |
| 660 | + | |
637 | 661 | | |
638 | | - | |
639 | | - | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
640 | 665 | | |
641 | 666 | | |
642 | 667 | | |
| |||
650 | 675 | | |
651 | 676 | | |
652 | 677 | | |
653 | | - | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
654 | 682 | | |
655 | 683 | | |
656 | 684 | | |
657 | 685 | | |
658 | 686 | | |
659 | 687 | | |
660 | 688 | | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
661 | 699 | | |
662 | 700 | | |
663 | 701 | | |
| |||
669 | 707 | | |
670 | 708 | | |
671 | 709 | | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
| 710 | + | |
678 | 711 | | |
679 | 712 | | |
680 | 713 | | |
| |||
704 | 737 | | |
705 | 738 | | |
706 | 739 | | |
707 | | - | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
708 | 744 | | |
709 | 745 | | |
710 | 746 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
115 | 168 | | |
116 | 169 | | |
117 | 170 | | |
| |||
0 commit comments