Skip to content

Commit

Permalink
Add support for fusion tags (#3609) [ci fast]
Browse files Browse the repository at this point in the history
  • Loading branch information
pditommaso committed Feb 8, 2023
1 parent 85b6e7d commit 8385ec2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class FusionScriptLauncher extends BashWrapperBuilder {
final work = toContainerMount(remoteWorkDir).toString()
final result = new LinkedHashMap(10)
result.FUSION_WORK = work
result.FUSION_TAGS="[.command.*|.exitcode|.fusion.*](nextflow.io/metadata=true),[*](nextflow.io/temporary=true)"
// foreign env
final provider = new FusionEnvProvider()
result.putAll(provider.getEnvironment(scheme))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class GridTaskHandlerTest extends Specification {
result == '''\
#!/bin/bash
#$ directive=one
docker run -i -e "FUSION_WORK=/fusion/http/foo.com/some/dir" ubuntu:latest /usr/bin/fusion bash '/fusion/http/foo.com/some/dir/.command.run'
docker run -i -e "FUSION_WORK=/fusion/http/foo.com/some/dir" -e "FUSION_TAGS=[.command.*|.exitcode|.fusion.*](nextflow.io/metadata=true),[*](nextflow.io/temporary=true)" ubuntu:latest /usr/bin/fusion bash '/fusion/http/foo.com/some/dir/.command.run'
'''.stripIndent(true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ class FusionScriptLauncherTest extends Specification {
remoteWorkDir: XPath.get('http://foo/work'))

expect:
fusion.fusionEnv() == [FUSION_WORK: '/fusion/http/foo/work']
fusion.fusionEnv() == [
FUSION_WORK: '/fusion/http/foo/work',
FUSION_TAGS: "[.command.*|.exitcode|.fusion.*](nextflow.io/metadata=true),[*](nextflow.io/temporary=true)"
]
}

def 'should get header script' () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class LocalTaskHandlerTest extends Specification {
then:
handler.fusionEnabled() >> true
and:
builder.command() == ['sh','-c','docker run -i -e "FUSION_WORK=/fusion/http/some/work/dir" --rm --privileged ubuntu:latest /usr/bin/fusion bash \'/fusion/http/some/work/dir/.command.run\'']
builder.command() == ['sh','-c','docker run -i -e "FUSION_WORK=/fusion/http/some/work/dir" -e "FUSION_TAGS=[.command.*|.exitcode|.fusion.*](nextflow.io/metadata=true),[*](nextflow.io/temporary=true)" --rm --privileged ubuntu:latest /usr/bin/fusion bash \'/fusion/http/some/work/dir/.command.run\'']
builder.directory() == null
builder.redirectErrorStream()
builder.redirectOutput().file()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ class FusionScriptLauncherS3Test extends Specification {

expect:
fusion.fusionEnv() == [AWS_S3_ENDPOINT: 'http://foo.com',
FUSION_WORK: '/fusion/s3/foo/work']
FUSION_WORK: '/fusion/s3/foo/work',
FUSION_TAGS: "[.command.*|.exitcode|.fusion.*](nextflow.io/metadata=true),[*](nextflow.io/temporary=true)"
]

cleanup:
SysEnv.pop()
Expand All @@ -79,7 +81,9 @@ class FusionScriptLauncherS3Test extends Specification {
expect:
fusion.fusionEnv() == [AWS_ACCESS_KEY_ID: 'xxx',
AWS_SECRET_ACCESS_KEY: 'zzz',
FUSION_WORK: '/fusion/s3/foo/work']
FUSION_WORK: '/fusion/s3/foo/work',
FUSION_TAGS: "[.command.*|.exitcode|.fusion.*](nextflow.io/metadata=true),[*](nextflow.io/temporary=true)"
]

cleanup:
Global.config = null
Expand All @@ -102,7 +106,9 @@ class FusionScriptLauncherS3Test extends Specification {
fusion.fusionEnv() == [AWS_ACCESS_KEY_ID: 'k1',
AWS_SECRET_ACCESS_KEY: 's1',
AWS_S3_ENDPOINT: 'http://minio.com',
FUSION_WORK: '/fusion/s3/foo/work']
FUSION_WORK: '/fusion/s3/foo/work',
FUSION_TAGS: "[.command.*|.exitcode|.fusion.*](nextflow.io/metadata=true),[*](nextflow.io/temporary=true)"
]

cleanup:
Global.config = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class WaveClient {
return sendRequest0(request, attempt+1)
}
else
throw new UnauthorizedException("Unauthorised [401] - Verify you have provided a valid access token")
throw new UnauthorizedException("Unauthorized [401] - Verify you have provided a valid access token")
}
else
throw new BadResponseException("Wave invalid response: [${resp.statusCode()}] ${resp.body()}")
Expand Down

0 comments on commit 8385ec2

Please sign in to comment.