-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first iteration in secrets implementation
Signed-off-by: Jorge Aguilera <[email protected]>
- Loading branch information
Showing
8 changed files
with
130 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
plugins/nf-nomad/src/main/nextflow/nomad/NomadSecretProvider.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package nextflow.nomad | ||
|
||
import groovy.util.logging.Slf4j | ||
import nextflow.plugin.Priority | ||
import nextflow.secret.Secret | ||
import nextflow.secret.SecretsProvider | ||
|
||
@Slf4j | ||
@Priority(-100) // high priority | ||
class NomadSecretProvider implements SecretsProvider, Closeable{ | ||
|
||
@Override | ||
void close() throws IOException { | ||
} | ||
|
||
@Override | ||
boolean activable() { | ||
return true | ||
} | ||
|
||
@Override | ||
SecretsProvider load() { | ||
this | ||
} | ||
|
||
@Override | ||
Secret getSecret(String name) { | ||
log.error("NomadSecretProvider can't get secret, use nomad cli or disable it") | ||
null | ||
} | ||
|
||
@Override | ||
String getSecretsEnv(List<String> secretNames) { | ||
log.error("NomadSecretProvider can't get secret, use nomad cli or disable it") | ||
null | ||
} | ||
|
||
@Override | ||
String getSecretsEnv() { | ||
log.error("NomadSecretProvider can't get secret, use nomad cli or disable it") | ||
null | ||
} | ||
|
||
@Override | ||
void putSecret(String name, String value) { | ||
throw new UnsupportedOperationException("NomadSecretProvider can't put secret, use nomad cli") | ||
} | ||
|
||
@Override | ||
void removeSecret(String name) { | ||
throw new UnsupportedOperationException("NomadSecretProvider can't remove secret, use nomad cli") | ||
} | ||
|
||
@Override | ||
Set<String> listSecretsNames() { | ||
log.error("NomadSecretProvider can't get secret, use nomad cli or disable it") | ||
null | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
process sayHello { | ||
container 'ubuntu:20.04' | ||
secret 'MY_ACCESS_KEY' | ||
secret 'MY_SECRET_KEY' | ||
|
||
input: | ||
val x | ||
output: | ||
stdout | ||
|
||
""" | ||
echo $x world! the access \$MY_ACCESS_KEY and the secret \$MY_SECRET_KEY | ||
""" | ||
} | ||
|
||
workflow { | ||
Channel.of('Bonjour', 'Ciao', 'Hello', 'Hola') | sayHello | view | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
plugins { | ||
id "nf-nomad@${System.getenv("NOMAD_PLUGIN_VERSION") ?: "latest"}" | ||
} | ||
|
||
process { | ||
executor = "nomad" | ||
} | ||
|
||
nomad { | ||
|
||
client { | ||
address = "http://localhost:4646" | ||
} | ||
|
||
jobs { | ||
deleteOnCompletion = false | ||
volume = { type "host" name "scratchdir" } | ||
} | ||
|
||
} | ||
|