Skip to content

Commit a4dfbfa

Browse files
Remove publishDir from CE Nextflow configs (#197)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6379a56 commit a4dfbfa

4 files changed

Lines changed: 11 additions & 139 deletions

File tree

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
11
// Nextflow configuration for ARM CPU compute environments
22
// Includes base configuration and ARM-specific settings
33

4-
includeConfig 'nextflow-base.config'
5-
6-
process {
7-
publishDir = [
8-
path: { params.outdir },
9-
mode: 'copy',
10-
tags: [
11-
'compute_env': 'aws_ireland_fusionv2_nvme_cpu_ARM_snapshots',
12-
'pipeline': { workflow.manifest.name },
13-
'session': { workflow.sessionId },
14-
'timestamp': { new Date().format('yyyy-MM-dd_HH-mm-ss') },
15-
'architecture': 'arm64',
16-
'fusion': 'enabled',
17-
'fusionSnapshots': 'enabled'
18-
]
19-
]
20-
}
4+
includeConfig 'nextflow-base.config'
Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
11
// Nextflow configuration for CPU compute environments
22
// Includes base configuration and CPU-specific settings
33

4-
includeConfig 'nextflow-base.config'
5-
6-
process {
7-
publishDir = [
8-
path: { params.outdir },
9-
mode: 'copy',
10-
tags: [
11-
'compute_env': 'aws_ireland_fusionv2_nvme_cpu_snapshots',
12-
'pipeline': { workflow.manifest.name },
13-
'session': { workflow.sessionId },
14-
'timestamp': { new Date().format('yyyy-MM-dd_HH-mm-ss') },
15-
'architecture': 'x86_64',
16-
'fusion': 'enabled',
17-
'fusionSnapshots': 'enabled'
18-
]
19-
]
20-
}
4+
includeConfig 'nextflow-base.config'
Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
11
// Nextflow configuration for GPU compute environments
22
// Includes base configuration and GPU-specific settings
33

4-
includeConfig 'nextflow-base.config'
5-
6-
process {
7-
publishDir = [
8-
path: { params.outdir },
9-
mode: 'copy',
10-
tags: [
11-
'compute_env': 'aws_ireland_fusionv2_nvme_gpu_snapshots',
12-
'pipeline': { workflow.manifest.name },
13-
'session': { workflow.sessionId },
14-
'timestamp': { new Date().format('yyyy-MM-dd_HH-mm-ss') },
15-
'architecture': 'x86_64',
16-
'gpu': 'enabled',
17-
'fusion': 'enabled',
18-
'fusionSnapshots': 'enabled'
19-
]
20-
]
21-
}
4+
includeConfig 'nextflow-base.config'

pulumi/AWSMegatests/tests/unit/test_nextflow_config_loading.py

Lines changed: 8 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,6 @@ def temp_config_dir(self):
5656
// Includes base configuration and CPU-specific settings
5757
5858
includeConfig 'nextflow-base.config'
59-
60-
process {
61-
publishDir = [
62-
path: { params.outdir },
63-
mode: 'copy',
64-
tags: [
65-
'compute_env': 'aws_ireland_fusionv2_nvme_cpu_snapshots',
66-
'architecture': 'x86_64',
67-
'fusion': 'enabled'
68-
]
69-
]
70-
}
7159
""").strip()
7260

7361
cpu_config_path = os.path.join(temp_dir, "nextflow-cpu.config")
@@ -80,19 +68,6 @@ def temp_config_dir(self):
8068
// Includes base configuration and GPU-specific settings
8169
8270
includeConfig 'nextflow-base.config'
83-
84-
process {
85-
publishDir = [
86-
path: { params.outdir },
87-
mode: 'copy',
88-
tags: [
89-
'compute_env': 'aws_ireland_fusionv2_nvme_gpu_snapshots',
90-
'architecture': 'x86_64',
91-
'gpu': 'enabled',
92-
'fusion': 'enabled'
93-
]
94-
]
95-
}
9671
""").strip()
9772

9873
gpu_config_path = os.path.join(temp_dir, "nextflow-gpu.config")
@@ -141,19 +116,9 @@ def test_load_nextflow_config_merges_base_and_env_configs(
141116
in cpu_config
142117
)
143118

144-
# Verify environment-specific config content is included
145-
assert "'compute_env': 'aws_ireland_fusionv2_nvme_cpu_snapshots'" in cpu_config
146-
assert "'architecture': 'x86_64'" in cpu_config
147-
assert "'fusion': 'enabled'" in cpu_config
148-
149119
# Verify includeConfig line is removed
150120
assert "includeConfig" not in cpu_config
151121

152-
# Verify base config comes before environment config
153-
base_index = cpu_config.find("aws.batch.maxSpotAttempts")
154-
env_index = cpu_config.find("compute_env")
155-
assert base_index < env_index
156-
157122
def test_load_nextflow_config_removes_include_statements(
158123
self, temp_config_dir, monkeypatch
159124
):
@@ -172,8 +137,7 @@ def test_load_nextflow_config_removes_include_statements(
172137
assert "nextflow-base.config" not in gpu_config
173138

174139
# Verify the rest of the config is intact
175-
assert "'compute_env': 'aws_ireland_fusionv2_nvme_gpu_snapshots'" in gpu_config
176-
assert "'gpu': 'enabled'" in gpu_config
140+
assert "// Nextflow configuration for GPU compute environments" in gpu_config
177141

178142
def test_load_nextflow_config_works_without_base_config(self, monkeypatch):
179143
"""Test that function works when base config doesn't exist."""
@@ -182,10 +146,7 @@ def test_load_nextflow_config_works_without_base_config(self, monkeypatch):
182146
env_config_content = dedent("""
183147
// Environment-only configuration
184148
process {
185-
publishDir = [
186-
path: { params.outdir },
187-
tags: ['test': 'value']
188-
]
149+
maxRetries = 3
189150
}
190151
""").strip()
191152

@@ -203,7 +164,7 @@ def test_load_nextflow_config_works_without_base_config(self, monkeypatch):
203164

204165
# Should return just the environment config
205166
assert "Environment-only configuration" in config
206-
assert "'test': 'value'" in config
167+
assert "maxRetries = 3" in config
207168
assert "aws.batch.maxSpotAttempts" not in config # No base config
208169

209170
def test_load_nextflow_config_handles_multiple_include_statements(
@@ -219,7 +180,7 @@ def test_load_nextflow_config_handles_multiple_include_statements(
219180
includeConfig 'third.config' // Indented include
220181
221182
process {
222-
publishDir = [path: { params.outdir }]
183+
maxRetries = 3
223184
}
224185
""").strip()
225186

@@ -243,7 +204,7 @@ def test_load_nextflow_config_handles_multiple_include_statements(
243204

244205
# Rest of config should be intact
245206
assert "Configuration with multiple includes" in config
246-
assert "publishDir = [path: { params.outdir }]" in config
207+
assert "maxRetries = 3" in config
247208

248209
def test_load_nextflow_config_raises_error_for_missing_env_type(self, monkeypatch):
249210
"""Test that function raises error for undefined environment type."""
@@ -328,26 +289,10 @@ def test_load_nextflow_config_preserves_config_structure(
328289
assert "// Base Nextflow configuration" in config
329290
assert "// Nextflow configuration for CPU compute environments" in config
330291

331-
# Should have proper block structure
292+
# Should have proper block structure from base config
332293
assert "process {" in config
333294
assert "fusion {" in config
334295

335-
# Should preserve indentation and formatting
336-
lines = config.split("\n")
337-
338-
# Find process block lines and verify indentation is preserved
339-
in_process_block = False
340-
for line in lines:
341-
if line.strip() == "process {":
342-
in_process_block = True
343-
elif in_process_block and line.strip() == "}":
344-
in_process_block = False
345-
elif in_process_block and line.strip() and not line.startswith("//"):
346-
# Lines inside process blocks should be indented
347-
assert line.startswith(" ") or line.startswith("\t"), (
348-
f"Line not properly indented: '{line}'"
349-
)
350-
351296
def test_merged_config_content_order(self, temp_config_dir, monkeypatch):
352297
"""Test that merged config has base config first, then environment config."""
353298
mock_config_files = {"gpu": temp_config_dir["gpu_config_path"]}
@@ -360,33 +305,9 @@ def test_merged_config_content_order(self, temp_config_dir, monkeypatch):
360305

361306
# Find positions of key markers
362307
base_marker_pos = config.find("aws.batch.maxSpotAttempts")
363-
env_marker_pos = config.find("'gpu': 'enabled'")
308+
env_marker_pos = config.find("// Nextflow configuration for GPU")
364309

365310
# Base config should come before environment config
366-
assert base_marker_pos < env_marker_pos
367311
assert base_marker_pos != -1, "Base config content not found"
368312
assert env_marker_pos != -1, "Environment config content not found"
369-
370-
# Verify proper structure by checking that base config content comes before env content
371-
lines = config.split("\n")
372-
373-
# Find the line with aws.batch.maxSpotAttempts (from base config)
374-
base_config_line = None
375-
gpu_enabled_line = None
376-
377-
for i, line in enumerate(lines):
378-
if "aws.batch.maxSpotAttempts" in line:
379-
base_config_line = i
380-
if "'gpu': 'enabled'" in line:
381-
gpu_enabled_line = i
382-
383-
# Base config line should come before environment config line
384-
assert base_config_line is not None, (
385-
"Base config content not found in merged config"
386-
)
387-
assert gpu_enabled_line is not None, (
388-
"Environment config content not found in merged config"
389-
)
390-
assert base_config_line < gpu_enabled_line, (
391-
"Base config should come before environment config"
392-
)
313+
assert base_marker_pos < env_marker_pos

0 commit comments

Comments
 (0)