Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pathogen-repo-ci): allow configuration of workflow root #57

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

corneliusroemer
Copy link
Member

@corneliusroemer corneliusroemer commented Sep 25, 2023

Current pathogen-repo-ci seems to assume that we don't need to customize workdir in nextstrain build ., i.e. we can't set nextstrain build foobar.

Our nextstrain/pathogen-repo-template, however, puts the main workflow in a folder. So we should add that feature.

See https://bedfordlab.slack.com/archives/C01LCTT7JNN/p1695664810319929 for discussion

Testing

It works: https://github.com/nextstrain/monkeypox/actions/runs/6303654582/job/17113366921

.github/workflows/pathogen-repo-ci.yaml Outdated Show resolved Hide resolved
@@ -63,6 +63,14 @@ on:
- conda
required: false

workflow-root:
Copy link
Member

@victorlin victorlin Sep 25, 2023

Choose a reason for hiding this comment

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

"Workflow" is an overloaded term in this context (GitHub workflow vs. pathogen workflow). What about a simpler name like path, root, or directory? That would look like:

jobs:
  pathogen-ci:
    uses: nextstrain/.github/.github/workflows/pathogen-repo-ci.yaml@master
    with:
      path: phylogenetic/

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, I'm not sure the simpler path is as clear. Yes there's ambiguity in workflow-root - but path is even more ambiguous.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, also fine for this to be non-blocking. It works, I don't have any better suggestions, and this is something we can change easily if it's only used internally.

Copy link
Member

Choose a reason for hiding this comment

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

build-dir, i.e. "the path for nextstrain build"

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd be happy with build-dir or build-root

Comment on lines +258 to +262
$workdir/auspice/
$workdir/results/
$workdir/benchmarks/
$workdir/logs/
$workdir/.snakemake/log/
Copy link
Member

Choose a reason for hiding this comment

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

This currently only accepts paths without a trailing slash. I think it'd be good to accept both with and without, because even if we document support for only one in the input description, the error that happens here might not be very informative and only happens after everything else is done running.

I don't think there's an easy way to do something like Python's os.path.join inline here, so the solution might be to normalize as a first step before using the value.

Copy link
Member Author

Choose a reason for hiding this comment

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

This sounds like a non-blocking feature request to me :)

Copy link
Member

Choose a reason for hiding this comment

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

Yeah it works, so this can be non-blocking.

Copy link
Member

Choose a reason for hiding this comment

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

This sounds like a non-blocking feature request to me :)

This sounds like a flippant response to a reasonable request for robustness.

The trailing slash is not even a documented requirement in the input description. But even if it was, requiring a slash is an easily-avoided tripping hazard that we don't need to subject ourselves to.

Co-authored-by: Victor Lin <13424970+victorlin@users.noreply.github.com>
Copy link
Member

@victorlin victorlin left a comment

Choose a reason for hiding this comment

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

Looks good given this was tested successfully.

@corneliusroemer corneliusroemer marked this pull request as ready for review September 25, 2023 19:22
@corneliusroemer corneliusroemer merged commit e18552a into master Sep 25, 2023
17 of 19 checks passed
@corneliusroemer corneliusroemer deleted the ci-workdir-arg branch September 25, 2023 19:22
Comment on lines +258 to +262
$workdir/auspice/
$workdir/results/
$workdir/benchmarks/
$workdir/logs/
$workdir/.snakemake/log/
Copy link
Member

Choose a reason for hiding this comment

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

This sounds like a non-blocking feature request to me :)

This sounds like a flippant response to a reasonable request for robustness.

The trailing slash is not even a documented requirement in the input description. But even if it was, requiring a slash is an easily-avoided tripping hazard that we don't need to subject ourselves to.

Comment on lines 251 to +262
- if: always()
uses: actions/upload-artifact@v3
env:
workdir: ${{ inputs.workflow-root }}
with:
name: ${{ inputs.artifact-name }}-${{ matrix.runtime }}
path: |
auspice/
results/
benchmarks/
logs/
.snakemake/log/
$workdir/auspice/
$workdir/results/
$workdir/benchmarks/
$workdir/logs/
$workdir/.snakemake/log/
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't work. The interpolation does not work like that. If you look at the "successful" test, you'll see it didn't find any files and uploaded no artifacts.

corneliusroemer added a commit that referenced this pull request Sep 25, 2023
This reverts commit e18552a, reversing
changes made to 4d6afc4.
corneliusroemer added a commit to nextstrain/mpox that referenced this pull request Sep 26, 2023
)

* Move phylogenetic workflow from top-level to folder `phylogenetic`

* wip: use the experimental workflow from nextstrain/.github#57
corneliusroemer added a commit to nextstrain/mpox that referenced this pull request Sep 26, 2023
wip: use the experimental workflow from nextstrain/.github#57

wip

wip

Add general precommit lints

Add codespell to precommit

Add shellcheck to precommit

Add tomlsort to precommit

chore: lint/formatting
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