Skip to content
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
8 changes: 3 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ TODO add summary

## BREAKING CHANGES

* `Nextflow` runner: remove deprecated `map`, `mapId`, `mapData`, `mapPassthrough` and `renameKeys` (PR #792).
* `Nextflow` runner: remove deprecated `map`, `mapId`, `mapData`, `mapPassthrough` and `renameKeys` arguments (PR #792).

* `Nextflow` runner: remove helper functions: `setWorkflowArguments`, `getWorkflowArguments`, `strictMap`, `passthroughMap`, `passthroughFlatMap` and `passthroughFilter` (PR #792).
* `Nextflow` runner: remove helper functions: `setWorkflowArguments`, `getWorkflowArguments`, `strictMap`, `passthroughMap`, `passthroughFlatMap`, `passthroughFilter`, `channelFromParams`, `runComponents` (PRs #792, #811).

* `Nextflow` runner: `channelFromParams` is now deprecated (PR #792).

* `Nextflow` runner: remove deprecated `runComponents` (PR #811).
* Deprecate `functionality` and `platforms`.

## BUG FIXES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,27 +100,3 @@ private _channelFromParams(Map params, Map config) {
def processedParams = _paramsToParamSets(params, config)
return Channel.fromList(processedParams)
}

/**
* Parse nextflow parameters based on settings defined in a viash config
* and return a nextflow channel.
*
* @param params Input parameters. Can optionaly contain a 'param_list' key that
* provides a list of arguments that can be split up into multiple events
* in the output channel possible formats of param_lists are: a csv file,
* json file, a yaml file or a yaml blob. Each parameters set (event) must
* have a unique ID.
* @param config A Map of the Viash configuration. This Map can be generated from the config file
* using the readConfig() function.
*
* @return A nextflow Channel with events. Events are formatted as a tuple that contains
* first contains the ID of the event and as second element holds a parameter map.
*
*
*/
def channelFromParams(Map params, Map config) {
log.warn "channelFromParams is deprecated and will be removed in Viash 0.10.0. ",
"Nextflow workflows can now be built into standalone components where parsed parameters ",
"are automatically provided to the input channel."
return _channelFromParams(params, config)
}
51 changes: 9 additions & 42 deletions src/main/scala/io/viash/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -198,36 +198,6 @@ object Main extends Logging {
}
case _ =>
}

// backwards compability for --platform
cli.subcommands.lastOption match {
case Some(x: ViashCommand) =>
if (x.platform.isDefined) {
if (x.runner.isDefined || x.engine.isDefined) {
throw new IllegalArgumentException("Error: --platform cannot be used together with --runner or --engine.")
}
warn("Warning: --platform is deprecated in Viash 0.9.0, will be removed in Viash 0.10.0. Use --runner or --engine instead.")
}
case Some(x: ViashNs) =>
if (x.platform.isDefined) {
if (x.runner.isDefined || x.engine.isDefined) {
throw new IllegalArgumentException("Error: --platform cannot be used together with --runner or --engine.")
}
warn("Warning: --platform is deprecated in Viash 0.9.0, will be removed in Viash 0.10.0. Use --runner or --engine instead.")
}
case _ =>
}
// backwards compability for --apply_platform
cli.subcommands match {
case List(cli.namespace, cli.namespace.exec) =>
if (cli.namespace.exec.applyPlatform()) {
if (cli.namespace.exec.applyRunner() || cli.namespace.exec.applyEngine()) {
throw new IllegalArgumentException("Error: --platform cannot be used together with --runner or --engine.")
}
warn("Warning: --apply_platform is deprecated in Viash 0.9.0, will be removed in Viash 0.10.0n. Use --apply_runner or --apply_engine instead.")
}
case _ =>
}

// see if there are package overrides passed to the viash command
val packSrc = cli.subcommands.lastOption match {
Expand Down Expand Up @@ -337,8 +307,8 @@ object Main extends Logging {
cli.namespace.list,
packageConfig = pack1,
addOptMainScript = false,
applyRunner = cli.namespace.list.runner.isDefined || cli.namespace.list.platform.isDefined,
applyEngine = cli.namespace.list.engine.isDefined || cli.namespace.list.platform.isDefined
applyRunner = cli.namespace.list.runner.isDefined,
applyEngine = cli.namespace.list.engine.isDefined
)
val configs2 = namespaceDependencies(configs, None, pack1.rootDir)
ViashNamespace.list(
Expand All @@ -351,8 +321,8 @@ object Main extends Logging {
val configs = readConfigs(
cli.namespace.exec,
packageConfig = pack1,
applyRunner = cli.namespace.exec.applyRunner() || cli.namespace.exec.applyPlatform(),
applyEngine = cli.namespace.exec.applyEngine() || cli.namespace.exec.applyPlatform()
applyRunner = cli.namespace.exec.applyRunner(),
applyEngine = cli.namespace.exec.applyEngine()
)
ViashNamespace.exec(
configs = configs,
Expand All @@ -371,7 +341,7 @@ object Main extends Logging {
cli.config.view,
packageConfig = pack1,
addOptMainScript = false,
applyRunnerAndEngine = cli.config.view.platform.isDefined || cli.config.view.runner.isDefined || cli.config.view.engine.isDefined
applyRunnerAndEngine = cli.config.view.runner.isDefined || cli.config.view.engine.isDefined
)
val config2 = DependencyResolver.modifyConfig(config.config, None, pack1.rootDir)
ViashConfig.view(
Expand Down Expand Up @@ -480,11 +450,8 @@ object Main extends Logging {
viashPackage = Some(packageConfig)
)
if (applyRunnerAndEngine) {
val runnerStr = subcommand.runner.toOption orElse subcommand.platform.toOption
val engineStr = subcommand.engine.toOption orElse subcommand.platform.toOption

val runner = config.findRunner(runnerStr)
val engines = config.findEngines(engineStr)
val runner = config.findRunner(subcommand.runner.toOption)
val engines = config.findEngines(subcommand.engine.toOption)

processConfigWithRunnerAndEngine(
appliedConfig = config,
Expand All @@ -509,8 +476,8 @@ object Main extends Logging {
val queryNamespace = subcommand.query_namespace.toOption
val queryName = subcommand.query_name.toOption
val queryConfig = subcommand.query_config.toOption
val runnerStr = subcommand.runner.toOption orElse subcommand.platform.toOption
val engineStr = subcommand.engine.toOption orElse subcommand.platform.toOption
val runnerStr = subcommand.runner.toOption
val engineStr = subcommand.engine.toOption
val configMods = packageConfig.config_mods

val configs0 = Config.readConfigs(
Expand Down
8 changes: 1 addition & 7 deletions src/main/scala/io/viash/ViashExport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,7 @@ object ViashExport extends Logging {
}

def exportResource(input: String, output: Option[Path]): Unit = {
val input2 = if (input.startsWith("platforms/")) {
warn("WARNING: The 'platforms/' prefix is deprecated. Please use 'runners/' instead.")
input.replaceFirst("platforms/", "runners/")
} else {
input
}
val pth = getClass.getResource(s"/io/viash/$input2")
val pth = getClass.getResource(s"/io/viash/$input")
val str = IO.read(pth.toURI())
if (output.isDefined) {
Files.write(output.get, str.getBytes())
Expand Down
1 change: 0 additions & 1 deletion src/main/scala/io/viash/ViashNamespace.scala
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ object ViashNamespace extends Logging {
val funName = ac.config.name
val ns = ac.config.namespace
val runnerId = ac.runner.get.id
// val engineId = ac.platform.get.id
val out =
if (flatten) {
target
Expand Down
35 changes: 0 additions & 35 deletions src/main/scala/io/viash/cli/CLIConf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@ import io.viash.helpers.Logging

trait ViashCommand {
this: DocumentedSubcommand =>
val platform = registerOpt[String](
name = "platform",
short = Some('p'),
default = None,
descr =
"Deprecated. Use --runner and --engine instead. " +
"Specifies which platform amongst those specified in the config to use. " +
"If this is not provided, the first platform will be used. " +
"If no platforms are defined in the config, the native platform will be used. " +
"In addition, the path to a platform yaml file can also be specified.",
required = false
)
val runner = registerOpt[String](
name = "runner",
default = None,
Expand Down Expand Up @@ -113,18 +101,6 @@ trait ViashNs {
descr = "A source directory containing viash config files, possibly structured in a hierarchical folder structure. Default: src/.",
default = None
)
val platform = registerOpt[String](
name = "platform",
short = Some('p'),
descr =
"Deprecated. Use --runner and --engine instead. " +
"Acts as a regular expression to filter the platform ids specified in the found config files. " +
"If this is not provided, all platforms will be used. " +
"If no platforms are defined in a config, the native platform will be used. " +
"In addition, the path to a platform yaml file can also be specified.",
default = None,
required = false
)
val runner = registerOpt[String](
name = "runner",
default = None,
Expand Down Expand Up @@ -440,7 +416,6 @@ class CLIConf(arguments: Seq[String]) extends ScallopConf(arguments) with Loggin
| * `{main-script}`: path to the main script (if any)
| * `{abs-main-script}`: absolute path to the main script (if any)
| * `{name}`: name of the component
| * `{functionality-name}`: name of the component (deprecated)
| * `{namespace}`: namespace of the component
| * `{runner}`: selected runner id (only when --apply_runner is used)
| * `{engine}`: selected engine id (only when --apply_engine is used)
Expand All @@ -453,16 +428,6 @@ class CLIConf(arguments: Seq[String]) extends ScallopConf(arguments) with Loggin
"""viash ns exec 'echo {path} \\;'
|viash ns exec 'chmod +x {main-script} +'""".stripMargin
)
val applyPlatform = registerOpt[Boolean] (
name = "apply_platform",
short = Some('a'),
default = Some(false),
descr =
"""Deprecated. Use --apply_runner and --apply_engine instead.
|Fills in the {platform} and {output} field by applying each platform to the
|config separately. Note that this results in the provided command being applied
|once for every platform that matches the --platform regex.""".stripMargin
)
val applyRunner = registerOpt[Boolean] (
name = "apply_runner",
short = Some('r'),
Expand Down
21 changes: 0 additions & 21 deletions src/main/scala/io/viash/config/Config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import io.viash.config_mods.ConfigModParser
import arguments._
import resources._
import dependencies._
import io.viash.functionality.Functionality
import io.viash.platforms.Platform
import io.viash.helpers.{Git, GitInfo, IO, Logging}
import io.viash.helpers.circe._
import io.viash.helpers.{status => BuildStatus};
Expand Down Expand Up @@ -384,14 +382,6 @@ case class Config(
@undocumented
package_config: Option[PackageConfig] = None,
) {
@description(
"""The @[functionality](functionality) describes the behaviour of the script in terms of arguments and resources.
|By specifying a few restrictions (e.g. mandatory arguments) and adding some descriptions, Viash will automatically generate a stylish command-line interface for you.
|""")
@deprecated("Functionality level is deprecated, all functionality fields are now located on the top level of the config file.", "0.9.0", "0.10.0")
@default("")
private val functionality: Functionality = Functionality("foo")

@description(
"""A list of @[arguments](argument) for this component. For each argument, a type and a name must be specified. Depending on the type of argument, different properties can be set. See these reference pages per type for more information:
|
Expand All @@ -414,17 +404,6 @@ case class Config(
@example("__merge__: ../api/common_interface.yaml", "yaml")
@since("Viash 0.6.3")
private val `__merge__`: Option[File] = None

@description(
"""A list of platforms to generate target artifacts for.
|
| - @[Native](platform_native)
| - @[Docker](platform_docker)
| - @[Nextflow](platform_nextflow)
|""")
@default("Empty")
@deprecated("Use 'engines' and 'runners' instead.", "0.9.0", "0.10.0")
private val platforms: List[Platform] = Nil

/**
* Find the runner
Expand Down
Loading
Loading