[ https://issues.apache.org/jira/browse/MESOS-5119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15255153#comment-15255153 ]
Yan Xu commented on MESOS-5119: ------------------------------- {noformat:title=} commit 3d2d3edb96c9c428f988653cdd4428a05690e747 Author: Michael Browning <mrbrown...@uber.com> Date: Fri Apr 22 17:48:24 2016 -0700 Add subdirectory support to URI.output_file field. URI.output_file allows the user to specify the path of the file that'll be saved in the sandbox when the URI is fetched, but previously it would fail at fetch time if "filename" had a directory component. This change allows users to specify a relative path for custom ouput targets within the sandbox. The protobuf field 'filename' is renamed 'output_file' due to this usage change. Review: https://reviews.apache.org/r/46168/ {noformat} > Support directory structure in CommandInfo.URI.filename in fetcher > ------------------------------------------------------------------ > > Key: MESOS-5119 > URL: https://issues.apache.org/jira/browse/MESOS-5119 > Project: Mesos > Issue Type: Improvement > Components: fetcher > Reporter: Yan Xu > Assignee: Michael Browning > > In MESOS-4735, {{CommandInfo.URI.filename}} is added but there is no > validation to make sure it's a simple basename, so people can actually > specify the filename to be something like {{path/to/file}} but the validation > [won't catch it|https://reviews.apache.org/r/45046/#comment190155]. The fetch > will fail later in {{download()}} because it cannot open a destination file > without its parent directory. > Instead of fixing this by disallowing such output filename, we could actually > support this behavior. There are use cases where multiple fetch targets have > the same basename but they are organized by a directory hierarchy. > {noformat:title=} > root/app.dat > root/parent/app.dat > root/parent/child/app.dat > {noformat} > It looks to me that supporting this is straightforward and we just need to 1) > make sure the output path is within the sandbox and 2) recursively mkdirs for > the parent dirs. -- This message was sent by Atlassian JIRA (v6.3.4#6332)