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

🐛 view_lineage() never completes if run output_artifacts contains a subset of input_artifacts #2001

Closed
Zethson opened this issue Sep 30, 2024 · 4 comments · Fixed by #2041
Assignees
Labels

Comments

@Zethson
Copy link
Member

Zethson commented Sep 30, 2024

Report

Discovered while playing with Nextflow use case.

af.view_lineage() never completes if af.run.output_artifacts contains Artifacts that are also in af.run.input_artifacts. I think this should error instead.

Version information

No response

@sunnyosun
Copy link
Member

if af.run.output_artifacts contains Artifacts that are also in af.run.input_artifacts

How does this happen? Did you do that manually? In tracked notebooks, it never happens because we specifically account for it.

@Zethson
Copy link
Member Author

Zethson commented Sep 30, 2024

I think it was something like the following in a script:

run = ln.context.run

# register input
input_af = ln.Artifact.from_dir(args.input)
ln.save(input_af)
run.input_artifacts.set(input_af)

output_af = ln.Artifact.from_dir(args.output)
ln.save(output_af)

@falexwolf
Copy link
Member

falexwolf commented Sep 30, 2024

Yes, we're not allowing cycles. It gotta be a DAG and @sunnyosun's viz code probably assumes it is one.

We could run some kind of check first but that's also really expensive and will likely slow things down 🤔

I agree it should error; probably it's stuck in a recursion

@falexwolf falexwolf changed the title view_artifacts() never completes if run output_artifacts contains a subset of input_artifacts 🐛 view_artifacts() never completes if run output_artifacts contains a subset of input_artifacts Sep 30, 2024
@falexwolf falexwolf removed their assignment Sep 30, 2024
@sunnyosun
Copy link
Member

sunnyosun commented Sep 30, 2024

input_af = ln.Artifact.from_dir(args.input)
ln.save(input_af)
run.input_artifacts.set(input_af)

This is problematic, you are registering the artifacts as output with ln.Artifact.from_dir(args.input), then as inputs via run.input_artifacts.set(input_af).

You need to pass ln.Artifact.from_dir(args.input, run=False)

@sunnyosun sunnyosun linked a pull request Oct 10, 2024 that will close this issue
@sunnyosun sunnyosun changed the title 🐛 view_artifacts() never completes if run output_artifacts contains a subset of input_artifacts 🐛 view_lineage() never completes if run output_artifacts contains a subset of input_artifacts Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants