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

Update support for local TES executor with GA4GH TES Plugin #4608

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class TesFileCopyStrategy implements ScriptFileCopyStrategy {
copy.remove('PATH')
// when a remote bin directory is provide managed it properly
if( remoteBinDir ) {
result << "mkdir \$PWD/nextflow-bin/\n"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line resolves an error we were encountering when attempting to run the .command.run file within the container:

root@<container id>:/work $ ./.command.run
cp: cannot create regular file '/work/nextflow-bin/': Not a directory

result << "cp -r ${remoteBinDir}/* \$PWD/nextflow-bin/\n"
result << "chmod +x \$PWD/nextflow-bin/* || true\n"
result << "export PATH=\$PWD/nextflow-bin:\$PATH\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ class TesTaskHandler extends TaskHandler {
body.addInputsItem(inItem(scriptFile))
body.addInputsItem(inItem(wrapperFile))

Path remoteBinDir = executor.getRemoteBinDir()
if (remoteBinDir) {
body.addInputsItem(inItem(remoteBinDir, null, true))
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where each file in bin is added as a TES input.


Copy link
Contributor Author

@lbeckman314 lbeckman314 Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated here to only pass the bin directory as a TES Input (passes the directory itself as opposed to individual files, need to confirm that this is compatible with the TES Schema).

Copy link
Contributor Author

@lbeckman314 lbeckman314 Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed with @kellrott that passing a directory as a TES input is compatible with the schema (as long as all items in that directory are recursively added as TES inputs by the executor).

// add task input files
if(inputFile.exists()) body.addInputsItem(inItem(inputFile))

Expand Down Expand Up @@ -234,11 +239,12 @@ class TesTaskHandler extends TaskHandler {
return size != null ? ((double)size.bytes)/1073741824 : null
}

private TesInput inItem( Path realPath, String fileName = null) {
private TesInput inItem( Path realPath, String fileName = null, boolean isBin = false) {
def result = new TesInput()
result.url = realPath.toUriString()
result.path = fileName ? "$WORK_DIR/$fileName" : "$WORK_DIR/${realPath.getName()}"
log.trace "[TES] Adding INPUT file: $result"
result.path = isBin ? realPath : result.path
Copy link
Contributor Author

@lbeckman314 lbeckman314 Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will result in the bin directory being mounted in the container at the same path as Nextflow's main working directory.

All other "non-bin" TES inputs will be mounted at /work by default in the container.

return result
}

Expand Down
Loading