Skip to content

Commit f7f3970

Browse files
committed
Fix FSx export report path
1 parent 231808f commit f7f3970

5 files changed

Lines changed: 85 additions & 6 deletions

File tree

daylily_ec/workflow/export_data.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,10 @@ def run_export_task(
287287
destination_s3_uri,
288288
source_path=normalized_source,
289289
)
290-
destination_parts = urlparse(destination)
291-
analysis_dir = analysis_dir_from_source_path(normalized_source)
292290
timestamp = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
293291
report_path = (
294-
f"s3://{destination_parts.netloc}/daylily-monitor/fsx-export/"
295-
f"{analysis_dir}/{timestamp}/export-report/"
292+
f"{destination.rstrip('/')}/_daylily_monitor/fsx-export/"
293+
f"{timestamp}/export-report/"
296294
)
297295
try:
298296
response = fsx_client.create_data_repository_task(
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# dra-test4 run_qc_ont_all FSx Export Ledger
2+
3+
Date: 2026-05-18
4+
5+
## Objective
6+
7+
Export the dra-test4 headnode path `/fsx/analysis_results/ubuntu/run_qc_ont_all` to the active DayOA us-west-2 bucket at `s3://lsmc-dayoa-omics-analysis-us-west-2/analysis_results/ubuntu/run_qc_ont_all/` using the explicit `dyec export` DRA workflow.
8+
9+
## Gate 0: Inventory Freeze
10+
11+
- Controlling SOP: `/Users/jmajor/.codex/docs/plan-ledger-workflow.md`
12+
- Ledger path: `docs/plans/dra_test4_run_qc_ont_export_ledger.md`
13+
- Repo path: `/Users/jmajor/.codex/worktrees/dyec-fsx-dra-mounts/daylily-ephemeral-cluster`
14+
- Branch/status: `main...origin/main`; pre-existing dirty files: `README.md`, `daylily_ec/cli.py`, `docs/LSMC_run_directory_mounting_run_analysis_spec.md`, `docs/cli_reference.md`, `docs/dra_fsx_strategy.md`, `docs/operations.md`, `docs/overview.md`, `docs/quickest_start.md`, `tests/test_run_mounts.py`
15+
- Activation: `source ./activate` resolved `CONDA_DEFAULT_ENV=DAY-EC`, `dyec=/Users/jmajor/miniconda3/envs/DAY-EC/bin/dyec`
16+
- Cluster inventory: `AWS_PROFILE=lsmc AWS_REGION=us-west-2 pcluster list-clusters --region us-west-2` showed `dra-test4` as `CREATE_COMPLETE`
17+
- Headnode info: `dyec --json headnode info --profile lsmc --region us-west-2 --cluster dra-test4` showed headnode `i-0d85f5c6569c7e475`, state `running`, compute fleet `RUNNING`
18+
- FSx inventory: `aws fsx describe-file-systems` for `parallelcluster:cluster-name=dra-test4` resolved `fs-0bcf5a60d9b48f03e`, lifecycle `AVAILABLE`, `SCRATCH_2`, 2400 GiB
19+
- Bucket inventory: `aws s3api head-bucket --bucket lsmc-dayoa-omics-analysis-us-west-2` succeeded with bucket region `us-west-2`
20+
- Existing destination inventory: `aws s3api list-objects-v2 --bucket lsmc-dayoa-omics-analysis-us-west-2 --prefix analysis_results/ubuntu/run_qc_ont_all/ --max-items 10` returned no contents
21+
- Existing DRA inventory for `fs-0bcf5a60d9b48f03e`: active run mounts under `/run_dir_mounts/`, active `/data/`, active `/analysis_results/ubuntu/run_qc_illumina_all/`, and misconfigured `/analysis_results/ubuntu/illumina_run_qc/`; no overlap with `/analysis_results/ubuntu/run_qc_ont_all/`
22+
- Source path proof: SSM via `daylily_ec.aws.ssm.run_shell` as `ubuntu` verified `/fsx/analysis_results/ubuntu/run_qc_ont_all` exists, owner `ubuntu:ubuntu`, mtime `2026-05-18 08:49:42 +0000`, 6 top-level entries, 192 files and 23 directories at max depth 4, with `/fsx` at 42G used of 2.2T
23+
24+
## Rows
25+
26+
| ID | Area | Requirement | Status | Category | Approval Gate | Owner | Evidence | Root Cause | Terminal Note |
27+
|---|---|---|---|---|---|---|---|---|---|
28+
| G0-001 | Baseline | Record repo, live cluster, FSx, bucket, destination, DRA, and source-path inventory before export. | `SUCCESS` | `legitimate_safety_handling` | Gate 0 | orchestrator | Gate 0 section above. | | Baseline complete before live export. |
29+
| PRE-001 | Source | Prove the requested headnode path exists on dra-test4 as `ubuntu`. | `SUCCESS` | `legitimate_safety_handling` | Gate 0 | orchestrator | SSM command `a8352ab0-16f6-49bc-b54e-81927466aa0d`; source directory exists with 6 top-level entries and 192 files at max depth 4. | | Requested source path is present. |
30+
| PRE-002 | Destination | Resolve and validate the explicit DayOA us-west-2 destination prefix. | `SUCCESS` | `legitimate_safety_handling` | Gate 0 | orchestrator | `s3://lsmc-dayoa-omics-analysis-us-west-2/analysis_results/ubuntu/run_qc_ont_all/`; bucket region `us-west-2`; no listed existing objects under the prefix. | | Destination is explicit and empty at preflight. |
31+
| EXP-001 | Export | Run explicit `dyec export` from source path to destination S3 prefix and preserve `fsx_export.yaml`. | `SUCCESS` | `feature_implementation` | Gate 1 | orchestrator | First `dyec export` wrote failure receipt `reports/fsx_exports/dra-test4_run_qc_ont_all_20260518T085756Z/fsx_export.yaml`; focused fix moved report path under the export destination; `pytest tests/test_export.py -q -> 17 passed`; retry wrote success receipt `reports/fsx_exports/dra-test4_run_qc_ont_all_20260518T090219Z/fsx_export.yaml`. | | Export task `task-09dd75221119a5311` completed `SUCCEEDED`; source `/analysis_results/ubuntu/run_qc_ont_all/` exported to `s3://lsmc-dayoa-omics-analysis-us-west-2/analysis_results/ubuntu/run_qc_ont_all/`. |
32+
| VER-001 | Verification | Verify export receipt success, DRA detach, and S3 object presence after export. | `SUCCESS` | `legitimate_safety_handling` | Gate 5 | orchestrator | Receipt status `success`, `task_lifecycle: SUCCEEDED`, `detached: true`, `detach_lifecycle: DELETED`; `describe-data-repository-associations` for `dra-004d5751b19bf2eae` and for `/analysis_results/ubuntu/run_qc_ont_all/` returned no active associations; S3 prefix contains 214 objects totaling 13,784,915,480 bytes; headnode source regular files total 13,784,915,480 bytes; report prefix contains 0 failed-file report objects. | | Post-export verification complete; all rows are terminal and the objective is complete. |
33+
34+
## Final Status
35+
36+
- Rows terminal: 5/5
37+
- Objective complete: yes
38+
- Export receipt: `reports/fsx_exports/dra-test4_run_qc_ont_all_20260518T090219Z/fsx_export.yaml`
39+
- S3 destination: `s3://lsmc-dayoa-omics-analysis-us-west-2/analysis_results/ubuntu/run_qc_ont_all/`
40+
- Focused test: `pytest tests/test_export.py -q -> 17 passed`
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
fsx_export:
2+
schema_version: 3
3+
status: error
4+
phase: detach
5+
cluster_name: dra-test4
6+
region: us-west-2
7+
analysis_dir: run_qc_ont_all
8+
source_path: /analysis_results/ubuntu/run_qc_ont_all/
9+
headnode_path: /fsx/analysis_results/ubuntu/run_qc_ont_all/
10+
destination_s3_uri: s3://lsmc-dayoa-omics-analysis-us-west-2/analysis_results/ubuntu/run_qc_ont_all/
11+
detached: true
12+
delete_data_in_file_system: false
13+
failure_details:
14+
message: 'Unable to start FSx export task: An error occurred (BadRequest) when
15+
calling the CreateDataRepositoryTask operation: The report path provided is
16+
not associated with a data repository linked to this file system.'
17+
fsx_file_system_id: fs-0bcf5a60d9b48f03e
18+
file_system_path: /analysis_results/ubuntu/run_qc_ont_all/
19+
association_id: dra-013f59a28f338ae60
20+
lifecycle: AVAILABLE
21+
detach_lifecycle: DELETED
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
fsx_export:
2+
schema_version: 3
3+
status: success
4+
phase: complete
5+
cluster_name: dra-test4
6+
region: us-west-2
7+
analysis_dir: run_qc_ont_all
8+
source_path: /analysis_results/ubuntu/run_qc_ont_all/
9+
headnode_path: /fsx/analysis_results/ubuntu/run_qc_ont_all/
10+
destination_s3_uri: s3://lsmc-dayoa-omics-analysis-us-west-2/analysis_results/ubuntu/run_qc_ont_all/
11+
detached: true
12+
delete_data_in_file_system: false
13+
failure_details: {}
14+
fsx_file_system_id: fs-0bcf5a60d9b48f03e
15+
file_system_path: /analysis_results/ubuntu/run_qc_ont_all/
16+
association_id: dra-004d5751b19bf2eae
17+
lifecycle: AVAILABLE
18+
task_id: task-09dd75221119a5311
19+
task_lifecycle: SUCCEEDED
20+
report_path: s3://lsmc-dayoa-omics-analysis-us-west-2/analysis_results/ubuntu/run_qc_ont_all/_daylily_monitor/fsx-export/20260518T090424Z/export-report/
21+
detach_lifecycle: DELETED

tests/test_export.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,8 @@ def test_run_export_task_starts_exact_analysis_path_and_report() -> None:
242242
assert fake.created_task["Type"] == "EXPORT_TO_REPOSITORY"
243243
assert fake.created_task["Paths"] == ["/analysis_results/ubuntu/illumina_run_qc/"]
244244
assert fake.created_task["Report"]["Path"].startswith(
245-
"s3://bucket/daylily-monitor/fsx-export/illumina_run_qc/"
245+
"s3://bucket/analysis_results/ubuntu/illumina_run_qc/_daylily_monitor/fsx-export/"
246246
)
247-
assert "/analysis_results/ubuntu/illumina_run_qc/" not in fake.created_task["Report"]["Path"]
248247

249248

250249
def test_run_export_workflow_success_writes_v3_receipt(tmp_path, monkeypatch) -> None:

0 commit comments

Comments
 (0)