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

Workflow publish directive for channels can not take empty relative path #5371

Closed
siddharthab opened this issue Oct 5, 2024 · 4 comments · Fixed by #5185
Closed

Workflow publish directive for channels can not take empty relative path #5371

siddharthab opened this issue Oct 5, 2024 · 4 comments · Fixed by #5185

Comments

@siddharthab
Copy link
Contributor

Bug report

Expected behavior and actual behavior

When using the new output feature, the root output directory is specified separately, and then each channel takes a relative path. There is currently no way to specify that the files should be written to the output directory directly. One could use '.', but that is a POSIX specific syntax and not valid syntax for cloud storage URLs like Google Cloud Storage.

I think this is just a side-effect of using the truthy-ness of the values to check whether to publish or not.

Steps to reproduce the problem

workflow {
  ch = Channel.fromPath('*')
  publish:
  ch >> ''
}

output {
  directory 'gs://my-cloud-path'
}

Program output

Program completes execution without the files being copied.

Environment

  • Nextflow version: 24.04.4 build 5917
  • Java version: OpenJDK Runtime Environment Zulu21.28+85-CA (build 21+35)
  • Operating system: macOS
  • Bash version: zsh 5.9 (arm64-apple-darwin24.0)

Additional context

@bentsherman
Copy link
Member

You can configure the relative path in the output block:

workflow {
  ch = Channel.fromPath('*')
  publish:
  ch >> 'foo'
}

output {
  directory 'gs://my-cloud-path'

  'foo' {
    path '.'
  }
}

It works for both local and remote paths

@siddharthab
Copy link
Contributor Author

It's the same issue. I think paths with . will need to be normalized in Nextflow for cloud storage paths. This is what I get with your suggestion:

java.lang.IllegalArgumentException: I/O not allowed on dot-dirs or extra slashes when !permitEmptyPathComponents: /sidb/workflow-test/sample/./sample.bam
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:218)
        at com.google.cloud.storage.contrib.nio.CloudStoragePath.toRealPathInternal(CloudStoragePath.java:195)
        at com.google.cloud.storage.contrib.nio.CloudStoragePath.toRealPath(CloudStoragePath.java:189)
        at com.google.cloud.storage.contrib.nio.CloudStoragePath.getBlobId(CloudStoragePath.java:84)
        at com.google.cloud.storage.contrib.nio.CloudStorageFileSystemProvider.copy(CloudStorageFileSystemProvider.java:561)
        at nextflow.file.FileHelper.copyPath(FileHelper.groovy:990)
        at nextflow.processor.PublishDir.processFileImpl(PublishDir.groovy:507)

@bentsherman
Copy link
Member

bentsherman commented Oct 7, 2024

Good catch, I thought these paths were being normalized but I guess not. I'll make a note to address this in #5185

@bentsherman bentsherman linked a pull request Oct 7, 2024 that will close this issue
10 tasks
@siddharthab
Copy link
Contributor Author

Thank you! I will leave this issue open, but please feel free to close if you are tracking somewhere else.

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 a pull request may close this issue.

2 participants