Skip to content

Commit

Permalink
71 support path in input uri (#178)
Browse files Browse the repository at this point in the history
debug build
v0.7.8
  • Loading branch information
drernie authored Jan 30, 2024
1 parent 98e1410 commit e707166
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 9 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Changelog

## [0.7.7] 2024-01-24
## [0.7.9] 2024-01-30

- Auto-install (needed for < 23.12?)

## [0.7.8] 2024-01-30 UNOFFICIAL

- Add debugging for installs

## [0.7.7] 2024-01-24 UNOFFICIAL

- Properly implement and test getFilename()
- Install package just before download
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ WRITE_BUCKET ?= quilt-example
FRAGMENT ?= &path=.
NF_DIR ?= ../nextflow
NF_BIN ?= ./launch.sh
PATH_NF ?= ./main.path.nf
PID ?= $$$$
PIPELINE ?= sarek
QUERY ?= ?Name=$(USER)&Owner=Kevin+Moore&Date=2023-03-07&Type=CRISPR&Notebook+URL=http%3A%2F%2Fexample.com
Expand Down Expand Up @@ -67,7 +68,7 @@ pkg-fail: compile

path-input: clean compile #-all
echo "$(TEST_URI)"
$(NF_BIN) run ./main.path.nf -profile standard -plugins $(PROJECT) --outdir "./results"
$(NF_BIN) run $(PATH_NF) -profile standard -plugins $(PROJECT) --outdir "./results"

tower-test: $(NF_BIN)
$(NF_BIN) run "https://github.com/quiltdata/nf-quilt" -name local_einstein -with-tower -r main -latest --pub "$(TEST_URI)"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ From the command-line, do, e.g.:

```bash
# export NXF_VER=23.04.3
export NXF_PLUGINS_TEST_REPOSITORY=https://github.com/quiltdata/nf-quilt/releases/download/0.7.7/nf-quilt-0.7.7-meta.json
nextflow run main.nf -plugins nf-quilt@0.7.7
export NXF_PLUGINS_TEST_REPOSITORY=https://github.com/quiltdata/nf-quilt/releases/download/0.7.9/nf-quilt-0.7.9-meta.json
nextflow run main.nf -plugins nf-quilt@0.7.9
```

For Tower, you can use the "Pre-run script" to set the environment variables.
Expand Down
29 changes: 29 additions & 0 deletions main.gallery.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env nextflow
/* groovylint-disable CompileStatic */

nextflow.enable.dsl=2

test_file_local = 'README.md'
test_file_s3 = 's3://nf-core-gallery/nf-core/hlatyping/README_NF_QUILT.md'
test_file_quilt = 'quilt+s3://nf-core-gallery#package=nf-core/hlatyping&path=README_NF_QUILT.md'
// file(test_file_local), file(test_file_s3), file(test_file_quilt)
myFileChannel = Channel.fromList([file(test_file_s3), file(test_file_quilt)])

process CHECK_INPUT {
input:
path input

output:
path 'README_NF_QUILT.md', emit: output

script:
"""
ls -l
echo $input
cp -f $input ../../tmp
"""
}

workflow {
CHECK_INPUT(myFileChannel)
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class QuiltPackage {
void setup() {
Files.createDirectories(this.folder)
this.installed = false
install() // FIXME: only needed for nextflow < 23.12?
}

boolean is_force() {
Expand Down Expand Up @@ -197,7 +198,7 @@ class QuiltPackage {
log.error("failed to install $packageName")
// this is non-fatal error, so we don't want to stop the pipeline
/* groovylint-disable-next-line ReturnNullFromCatchBlock */
return
return null
}

installed = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class QuiltParser {
result[key] = value
}
}

}
return result
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,22 @@ class QuiltFileSystemProvider extends FileSystemProvider implements FileSystemTr
}

void download(Path remoteFile, Path localDestination, CopyOption... options) throws IOException {
// log.debug "QuiltFileSystemProvider.download: ${remoteFile} -> ${localDestination}"
log.debug "QuiltFileSystemProvider.download: ${remoteFile} -> ${localDestination}"
QuiltPath qPath = asQuiltPath(remoteFile)
Path cachedFile = qPath.localPath()
QuiltPackage pkg = qPath.pkg()
if (!pkg.installed) {
pkg.install()
log.info "download.install Quilt package: ${pkg}"
Path dest = pkg.install()
if (!dest) {
log.error "download.install failed: ${pkg}"
throw new IOException("Failed to install Quilt package: ${pkg}")
}
log.info "download.installed Quilt package to: $dest"
}

if (!Files.exists(cachedFile)) {
log.error "download: File ${cachedFile} not found"
throw new NoSuchFileException(remoteFile.toString())
}

Expand All @@ -128,6 +135,7 @@ class QuiltFileSystemProvider extends FileSystemProvider implements FileSystemTr
FileHelper.deletePath(localDestination)
}
else if (Files.exists(localDestination)) {
log.error "download: File ${localDestination} already exists"
throw new FileAlreadyExistsException(localDestination.toString())
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Plugin-Class: nextflow.quilt.QuiltPlugin
Plugin-Id: nf-quilt
Plugin-Version: 0.7.7
Plugin-Version: 0.7.9
Plugin-Provider: Quilt Data
Plugin-Requires: >=22.10.6

0 comments on commit e707166

Please sign in to comment.