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

Prefixed (HDFS, S3) paths should be treated as absolute/off-base #157

Closed
slotrans opened this issue Jan 20, 2015 · 5 comments
Closed

Prefixed (HDFS, S3) paths should be treated as absolute/off-base #157

slotrans opened this issue Jan 20, 2015 · 5 comments

Comments

@slotrans
Copy link

When referencing an S3 path, e.g. s3://my-bucket/prefix/myfile, it is necessary to either blank-out BASE, or point it at S3, otherwise the default local-filesystem BASE will be prepended to the S3 path, giving a file reference like /Users/somejerk/someproject/s3://my-bucket/prefix/myfile, which won't work. For example...

This works:

BASE="s3://my-bucket"
drake_test.txt <-
    echo "foo" | aws s3 cp - $OUTPUT

This also works:

BASE=""
s3://my-bucket/drake_test.txt <-
    echo "foo" | aws s3 cp - $OUTPUT

This does not:

s3://my-bucket/drake_test.txt <-
    echo "foo" | aws s3 cp - $OUTPUT
@mikeivanov
Copy link

Hi @slotrans, I you should use an off-base path in this case:

!s3://my-bucket/drake_test.txt <-
    echo "foo" | aws s3 cp - $OUTPUT

Adding a "!" in front of your path turns the $BASE machinery off. Although it feels like a gotcha, I'm not sure if there's a better way of handling cases like this. If you think about how base directories work, it actually makes sense.

@slotrans
Copy link
Author

HDFS paths are recognized as absolute paths without the off-base hint, are they not?. Why should S3 work differently?

Put a different way, any filename that begins with protocol colon slash slash cannot possibly be a relative path, just like any filename that begins with slash cannot possibly be a relative path. Drake already knows how to handle the latter, so handling the former seems both trivial and necessary.

@mikeivanov
Copy link

Uh, I actually came here to ask the same question about HDFS paths and found your question. So no, they are not off-base and behave exactly the same way as s3 paths.

Oh, I see what you mean about absolute paths. Yes, I agree, prefixed paths should be automatically treated as off-base, you're absolutely right.

@mikeivanov
Copy link

May I suggest renaming this issue to "Prefixed paths should be treated as absolute and off-base"?

@slotrans
Copy link
Author

Done.

@slotrans slotrans changed the title S3 paths not recognized as absolute Prefixed (HDFS, S3) paths should be treated as absolute/off-base Feb 1, 2015
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

No branches or pull requests

2 participants