Skip to content

Conversation

@mirpedrol
Copy link
Member

@mirpedrol mirpedrol commented Dec 2, 2025

close #3953

Done:

  • New function to run nextflow inspect and obtain docker config file
  • New function to (re)generate all container config files
  • Container config files are regenerated with nf-core modules install|update|remove

TODO:

  • Add tests
  • Test a lot
  • What happens if the module is not found?
    • Modules form multiple repos
    • Modules included as an alias
  • Is there a case where two modules have the same name but different container? how to solve this?
  • Could the code be used to reduced duplication with download command?

@mirpedrol mirpedrol force-pushed the pipeline-container-config-builder branch from 6341cd3 to b8004aa Compare December 2, 2025 14:43
@mirpedrol mirpedrol marked this pull request as ready for review December 4, 2025 14:39

def __init__(
self,
workflow_directory: str | Path = ".",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
workflow_directory: str | Path = ".",
workflow_directory: Path = Path("."),

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make this simpler

workflow_directory: str | Path = ".",
org: str = "nf-core",
):
self.workflow_directory = Path(workflow_directory)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.workflow_directory = Path(workflow_directory)
self.workflow_directory = workflow_directory

return None


def try_generate_container_configs(directory: str | Path, path: str):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def try_generate_container_configs(directory: str | Path, path: str):
def try_generate_container_configs(directory: Path, path: Path):

let's make this simpler

Comment on lines +48 to +54
try:
# Run nextflow inspect
executable = "nextflow"
cmd_params = f"inspect -format config {self.workflow_directory}"
cmd_out = run_cmd(executable, cmd_params)
if cmd_out is None:
raise UserWarning("Failed to run `nextflow inspect`. Please check your Nextflow installation.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling we have this multiple times in our code base. should this be a utils function?

try:
# Run nextflow inspect
executable = "nextflow"
cmd_params = f"inspect -format config {self.workflow_directory}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not -format json would make it easier to parse and we would not need any regex

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so instead of writing the default out first and extracting all info from there, i would hold the config info in a dict and write it out to all configs from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants