bacalhau: Inconsistent behaviour: multiple `--inputs` fail, multiple `--input-urls` do not
This fails:
> bacalhau docker run \
--inputs bafybeig3xawqpx2i2s6ct5nmfavmm5avyw5h364gzslgrmszgcufpf7zz4 \
--inputs bafybeig63whfqyuvwqqrp5456fl4anceju24ttyycexef3k5eurg5uvrq4 \
--wait \
ubuntu ls /inputs
...
Stderr:
Error response from daemon: Duplicate mount point: /inputs
This runs but ignores the second input-urls:
❯ bacalhau docker run \
--input-urls https://gist.githubusercontent.com/enricorotundo/4c7f158f20ae4997e710e66531b8b54f/raw/ee5228ea06117a6ae97a98fed4ae7b1f1776d564/hepscore-new.md \
--input-urls https://gist.githubusercontent.com/enricorotundo/990f0ad01a50d08dfb580e4ad404870e/raw/aa6934257351a0da93f1e740c72f27128590cebc/foo_data.txt \
--wait \
ubuntu ls /inputs
...
Stdout:
foo_data.txt
Tested on v0.3.6
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (10 by maintainers)
Commits related to this issue
- Bump watchdog from 0.9.0 to 3.0.0 in /integration (#2910) Bumps [watchdog](https://github.com/gorakhargosh/watchdog) from 0.9.0 to 3.0.0. <details> <summary>Release notes</summary> <p><em>Sourced fro... — committed to bacalhau-project/bacalhau by dependabot[bot] 3 years ago
- Bump watchdog from 0.9.0 to 3.0.0 in /integration (#2910) Bumps [watchdog](https://github.com/gorakhargosh/watchdog) from 0.9.0 to 3.0.0. <details> <summary>Release notes</summary> <p><em>Sourced fro... — committed to bacalhau-project/bacalhau by dependabot[bot] 3 years ago
So I think we need to provide some clarification on what the job to be done here is. Currently:
--inputsresults in a (server-side) error--input-urlsresults in no error, but missing dataSo the scope of this ticket is to ensure that both of those paths return an error, ideally on the client side before submission. So @kcmuspace please go ahead and pick this up if it sounds interesting.
@thetechnocrat-dev You can already use multiple CIDs using the
--input-volumesflag, which can be specified multiple times. See https://docs.bacalhau.org/all-flags/#docker-run@kcmuspace @enricorotundo, multiple CIDS would help us out at LabDAO. Just want to check in on timelines to start this ticket and how I can help get this over the finish line.
If we’re going to change it, why not go one step further and reduce it down to one flag which can optionally take a target mount point? Let’s explore that idea.
Cid.parse)s3://)--inputs ANYTHING-SUPPORTED:target-mountmounts ANYTHING-SUPPORTED into target-mount.--inputs ANYTHING-SUPPORTEDmounts ANYTHING-SUPPORTED into/inputs.--inputswithout a target-mount more than once.What do you think?
I think the reason that this wasn’t already done is because URLs can of course contain colons, and it’s ambiguous whether that will be a target mount or part of the URL, e.g. with
--inputs https://en.wikipedia.org/wiki/Template:Welcome, it’s not clear whetherWelcomeis a target-mount of part of the URL. However, URLs support percent-encoding, so a way out of this is just to require that colons in the path segment are percent-encoded (or people can just use a job spec).There is another colon in the URL though, at the start in the protocol section.
I think this therefore would require parsing logic that looks like:
/inputs.With a simple example of parsing
https://example.com, this looks like:httpsas the source and//example.comas the target mount.httpsis not a valid CID, hopefully not an existant file, and is not a valid URL//example.comis not a valid mount point (is this true? – it might be fine on Windows?)https://example.comas the source and""as the target mount./inputs, so ok.… this does not really spark joy, does it? It fails ungracefully in the situation where there are oddly named files on the local filesystem, like
https, and certainly is a bit complex to reason about.So I think I agree with your simpler approach – by telling the client whether it should expect a target-mount component or not, we can do away with trying to deal with the ambiguity.
TL;DR: we should do what Enrico suggested.
Hello @simonwo. I would like to work on this issue.
I’m wondering if the desired behavior is accepting both inputs or making one flag consistent with the other.
Also, Could I have any background information/any pointers related to this bug? thank you so much 😃
Hi @enricorotundo . I’ve been trying but unfortunately I’ve made minimal progress(I think due to my unfamiliarity with the codebase). I can see that this issue is more important( and more complex) than I originally thought evidenced by the linked issues. Would this requirement need to be completed ASAP?
I think this could take me a while. I understand if someone more experienced wants to take over. I can work on something other than this.