diff --git a/CHANGELOG.md b/CHANGELOG.md index dc476e87d..47e3c2628 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/main/resources/io/viash/runners/nextflow/channel/channelFromParams.nf b/src/main/resources/io/viash/runners/nextflow/channel/_channelFromParams.nf similarity index 78% rename from src/main/resources/io/viash/runners/nextflow/channel/channelFromParams.nf rename to src/main/resources/io/viash/runners/nextflow/channel/_channelFromParams.nf index 284c30e13..ae9c342af 100644 --- a/src/main/resources/io/viash/runners/nextflow/channel/channelFromParams.nf +++ b/src/main/resources/io/viash/runners/nextflow/channel/_channelFromParams.nf @@ -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) -} diff --git a/src/main/scala/io/viash/Main.scala b/src/main/scala/io/viash/Main.scala index 79909f47f..15b71adb0 100644 --- a/src/main/scala/io/viash/Main.scala +++ b/src/main/scala/io/viash/Main.scala @@ -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 { @@ -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( @@ -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, @@ -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( @@ -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, @@ -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( diff --git a/src/main/scala/io/viash/ViashExport.scala b/src/main/scala/io/viash/ViashExport.scala index 801aa38d5..13b26dae2 100644 --- a/src/main/scala/io/viash/ViashExport.scala +++ b/src/main/scala/io/viash/ViashExport.scala @@ -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()) diff --git a/src/main/scala/io/viash/ViashNamespace.scala b/src/main/scala/io/viash/ViashNamespace.scala index 6b85167ac..b7d10e33a 100644 --- a/src/main/scala/io/viash/ViashNamespace.scala +++ b/src/main/scala/io/viash/ViashNamespace.scala @@ -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 diff --git a/src/main/scala/io/viash/cli/CLIConf.scala b/src/main/scala/io/viash/cli/CLIConf.scala index a8245a1de..37d1aed6a 100644 --- a/src/main/scala/io/viash/cli/CLIConf.scala +++ b/src/main/scala/io/viash/cli/CLIConf.scala @@ -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, @@ -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, @@ -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) @@ -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'), diff --git a/src/main/scala/io/viash/config/Config.scala b/src/main/scala/io/viash/config/Config.scala index 8ae66edd8..98eb890b0 100644 --- a/src/main/scala/io/viash/config/Config.scala +++ b/src/main/scala/io/viash/config/Config.scala @@ -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}; @@ -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: | @@ -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 diff --git a/src/main/scala/io/viash/config/package.scala b/src/main/scala/io/viash/config/package.scala index b40086f6f..eae07557e 100644 --- a/src/main/scala/io/viash/config/package.scala +++ b/src/main/scala/io/viash/config/package.scala @@ -42,129 +42,11 @@ package object config { import io.viash.runners.{decodeRunner, encodeRunner} import io.viash.engines.{decodeEngine, encodeEngine} import io.viash.packageConfig.{decodePackageConfig, encodePackageConfig} - import io.viash.platforms.decodePlatform - import io.viash.functionality.decodeFunctionality // encoders and decoders for Config implicit val encodeConfig: Encoder.AsObject[Config] = deriveConfiguredEncoderStrict[Config] implicit val decodeConfig: Decoder[Config] = deriveConfiguredDecoderWithValidationCheck[Config].prepare{ checkDeprecation[Config](_) - // map platforms to runners and engines - .withFocus{ - _.mapObject{ conf => - // Transform platforms to runners and engines - val runners = conf.apply("platforms").map { - platforms => - platforms.mapArray(platformVector => { - platformVector.map{platform => - val pObj = platform.asObject.get - pObj.apply("type").get.asString.get match { - case "native" => - Json.obj( - "type" -> Json.fromString("executable"), - "id" -> pObj.apply("id").getOrElse(Json.fromString("native")), - ) - case "docker" => - Json.obj( - "type" -> Json.fromString("executable"), - "id" -> pObj.apply("id").getOrElse(Json.fromString("docker")), - "port" -> pObj.apply("port").getOrElse(Json.Null), - "workdir" -> pObj.apply("workdir").getOrElse(Json.Null), - "docker_setup_strategy" -> pObj.apply("setup_strategy").getOrElse(Json.Null), - "docker_run_args" -> pObj.apply("run_args").getOrElse(Json.Null) - ) - case "nextflow" => - Json.obj( - "type" -> Json.fromString("nextflow"), - "id" -> pObj.apply("id").getOrElse(Json.fromString("nextflow")), - "directives" -> pObj.apply("directives").getOrElse(Json.Null), - "auto" -> pObj.apply("auto").getOrElse(Json.Null), - "config" -> pObj.apply("config").getOrElse(Json.Null), - "debug" -> pObj.apply("debug").getOrElse(Json.Null), - "container" -> pObj.apply("container").getOrElse(Json.Null) - ) - } - } - }) - } - - val engines = conf.apply("platforms").map { - platforms => - platforms.mapArray(platformVector => { - platformVector.flatMap{platform => - val pObj = platform.asObject.get - pObj.apply("type").get.asString.get match { - case "native" => - Some(Json.obj( - "type" -> Json.fromString("native"), - "id" -> pObj.apply("id").getOrElse(Json.fromString("native")), - )) - case "docker" => - Some(Json.obj( - "type" -> Json.fromString("docker"), - "id" -> pObj.apply("id").getOrElse(Json.fromString("docker")), - "image" -> pObj.apply("image").getOrElse(Json.Null), - "organization" -> pObj.apply("organization").getOrElse(Json.Null), - "registry" -> pObj.apply("registry").getOrElse(Json.Null), - "tag" -> pObj.apply("tag").getOrElse(Json.Null), - "target_image" -> pObj.apply("target_image").getOrElse(Json.Null), - "target_organization" -> pObj.apply("target_organization").getOrElse(Json.Null), - "target_registry" -> pObj.apply("target_registry").getOrElse(Json.Null), - "target_tag" -> pObj.apply("target_tag").getOrElse(Json.Null), - "namespace_separator" -> pObj.apply("namespace_separator").getOrElse(Json.Null), - "target_image_source" -> pObj.apply("target_image_source").getOrElse(Json.Null), - "setup" -> pObj.apply("setup").getOrElse(Json.Null), - "test_setup" -> pObj.apply("test_setup").getOrElse(Json.Null), - "entrypoint" -> pObj.apply("entrypoint").getOrElse(Json.Null), - "cmd" -> pObj.apply("cmd").getOrElse(Json.Null) - )) - case "nextflow" => - None - } - } - }) - } - - // Add native engine if there would be no engines and a nextflow platform exists - val nextflowPlatformExists = conf.apply("platforms").flatMap { - platforms => - platforms.asArray.map(platformVector => { - platformVector.exists{ platform => - val pObj = platform.asObject.get - pObj.apply("type").get.asString.get match { - case "nextflow" => true - case _ => false - } - } - }) - }.getOrElse(false) - val noPlatformEngines = engines.map(_.asArray.get.isEmpty).getOrElse(true) - val noEnginesInConfig = conf.apply("engines").map(_.asArray.get.isEmpty).getOrElse(true) - val engines2 = - if (noEnginesInConfig && noPlatformEngines && nextflowPlatformExists) { - Some(Json.arr(Json.obj("type" -> Json.fromString("native")))) - } else { - engines - } - - // Create final config - val conf1 = conf.remove("platforms") - - val conf2 = (conf1.apply("runners"), runners) match { - case (Some(r), Some(r1)) => conf1.add("runners", Json.arr((r.asArray.get ++ r1.asArray.get):_*)) - case (None, Some(r1)) => conf1.add("runners", r1) - case _ => conf1 - } - - val conf3 = (conf2.apply("engines"), engines2) match { - case (Some(e), Some(e1)) => conf2.add("engines", Json.arr((e.asArray.get ++ e1.asArray.get):_*)) - case (None, Some(e1)) => conf2.add("engines", e1) - case _ => conf2 - } - - conf3 - } - } } .prepare { // merge arguments and argument_groups into argument_groups @@ -227,51 +109,6 @@ package object config { Json.fromJsonObject(newJsonObject.remove("arguments")) } }} - .prepare { - // Move functionality to config level, if functionality exists also move .info to .build_info - _.withFocus{ - _.mapObject{ conf => - conf.contains("functionality") match { - case true => - val functionality = conf.apply("functionality").get.asObject.get - val buildInfo = conf.apply("info") - val conf1 = buildInfo.map{ bi => - conf.remove("info").add("build_info", bi) - }.getOrElse(conf) - val conf2 = conf1.remove("functionality") - val conf3 = conf2.deepMerge(functionality) - conf3 - case false => conf - } - } - }} - .validate( - // Validate platforms and functionality only. Will get stripped in the next prepare steps. - (pred: HCursor) => { - val platforms = pred.downField("platforms") - if (platforms.succeeded) { - platforms.values.get.foreach{ p => - val validate = decodePlatform(p.hcursor) - validate.fold(_ => { - throw new ConfigParserValidationException("Platform", p.toString()) - false - }, _ => true) - } - } - val functionality = pred.downField("functionality") - if (functionality.succeeded) { - val json = functionality.focus.get - val validate = decodeFunctionality(json.hcursor) - - validate.fold(_ => { - throw new ConfigParserValidationException("Functionality", json.toString()) - false - }, _ => true) - } - true - }, - "Could not convert json to Config." - ) implicit val encodeBuildInfo: Encoder.AsObject[BuildInfo] = deriveConfiguredEncoder implicit val decodeBuildInfo: Decoder[BuildInfo] = deriveConfiguredDecoderFullChecks diff --git a/src/main/scala/io/viash/config_mods/ConfigModParser.scala b/src/main/scala/io/viash/config_mods/ConfigModParser.scala index 221f64900..a7635176f 100644 --- a/src/main/scala/io/viash/config_mods/ConfigModParser.scala +++ b/src/main/scala/io/viash/config_mods/ConfigModParser.scala @@ -28,9 +28,6 @@ import io.circe.syntax._ # setting a value .version := "0.3.0" -# setting a value after subsetting a list -.platforms[.type == "docker"].container_registry := "itx-aiv" - # add something to a list .authors += { name: "Mr. T", role: "sponsor" } @@ -38,7 +35,7 @@ import io.circe.syntax._ .authors +0= { name: "Mr. T", role: "sponsor" } # apply config mod before parsing the json - .platforms[.type == "nextflow"].variant := "vdsl3" + .runners[.type == "nextflow"].id := "foo" # delete a value del(.version) @@ -307,7 +304,7 @@ object ConfigModParser extends RegexParsers { * * Examples of 'block': * "del(.key); .foo := 'bar'" - * " .platforms[.type == 'nextflow'].variant := 'vdsl3'" + * " .runners[.type == 'nextflow'].id := 'foo'" */ def command: Parser[(Boolean, Command)] = opt("") ~ (delete | assign | append | prepend) ^^ { case maybePreparse ~ cm => (maybePreparse.isDefined, cm) diff --git a/src/main/scala/io/viash/engines/DockerEngine.scala b/src/main/scala/io/viash/engines/DockerEngine.scala index e4b6c181e..37818ed55 100644 --- a/src/main/scala/io/viash/engines/DockerEngine.scala +++ b/src/main/scala/io/viash/engines/DockerEngine.scala @@ -53,20 +53,6 @@ final case class DockerEngine( @example("image: \"bash:4.0\"", "yaml") image: String, - @description("Name of a start container's [organization](https://docs.docker.com/docker-hub/orgs/).") - @deprecated("Use the full container name in `image` instead.", "0.9.0", "0.10.0") - organization: Option[String], - - @description("The URL to the a [custom Docker registry](https://docs.docker.com/registry/) where the start container is located.") - @example("registry: https://my-docker-registry.org", "yaml") - @deprecated("Use the full container name in `image` instead.", "0.9.0", "0.10.0") - registry: Option[String] = None, - - @description("Specify a Docker image based on its tag.") - @example("tag: 4.0", "yaml") - @deprecated("Use the full container name in `image` instead.", "0.9.0", "0.10.0") - tag: Option[String] = None, - @description("If anything is specified in the setup section, running the `---setup` will result in an image with the name of `:`. If nothing is specified in the `setup` section, simply `image` will be used. Advanced usage only.") @example("target_image: myfoo", "yaml") target_image: Option[String] = None, @@ -199,13 +185,6 @@ final case class DockerEngine( ) /* Fetch from image name */ - // TODO: once registry, organization and tag are removed, `fromImageInfo.toString()` is always equal to `image` so it can be removed. - val fromImageInfo = Docker.getImageInfo( - name = Some(image), - registry = registry, - organization = organization, - tag = tag - ) /* Construct Dockerfile */ val requirements = setup ::: { if (testing) test_setup else Nil } ::: List(labelReq) @@ -215,7 +194,7 @@ final case class DockerEngine( val entrypointStr = Docker.listifyOneOrMore(entrypoint).map(s => s"\nENTRYPOINT $s").getOrElse("") val cmdStr = Docker.listifyOneOrMore(cmd).map(s => s"\nCMD $s").getOrElse("") - s"""FROM $fromImageInfo$entrypointStr$cmdStr + s"""FROM $image$entrypointStr$cmdStr |${runCommands.mkString("\n")} |""".stripMargin } diff --git a/src/main/scala/io/viash/functionality/Functionality.scala b/src/main/scala/io/viash/functionality/Functionality.scala deleted file mode 100644 index 49043729e..000000000 --- a/src/main/scala/io/viash/functionality/Functionality.scala +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Copyright (C) 2020 Data Intuitive - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package io.viash.functionality - - -import io.circe.Json -import io.viash.config.arguments._ -import io.viash.config.resources._ -import io.viash.config.Status._ -import io.viash.config.dependencies._ -import io.viash.config.{Author, ArgumentGroup, ComputationalRequirements, Status, References, Links} -import io.viash.schemas._ -import io.viash.wrapper.BashWrapper -import scala.collection.immutable.ListMap - -@description( - """The functionality-part of the config file 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") -case class Functionality( - @description("Name of the component and the filename of the executable when built with `viash build`.") - @example("name: this_is_my_component", "yaml") - name: String, - - @description("Namespace this component is a part of. See the @[Namespaces guide](namespace) for more information on namespaces.") - @example("namespace: fancy_components", "yaml") - namespace: Option[String] = None, - - @description("Version of the component. This field will be used to version the executable and the Docker container.") - @example("version: 0.8", "yaml") - version: Option[String] = None, - - @description( - """A list of @[authors](author). An author must at least have a name, but can also have a list of roles, an e-mail address, and a map of custom properties. - | - |Suggested values for roles are: - | - || Role | Abbrev. | Description | - ||------|---------|-------------| - || maintainer | mnt | for the maintainer of the code. Ideally, exactly one maintainer is specified. | - || author | aut | for persons who have made substantial contributions to the software. | - || contributor | ctb| for persons who have made smaller contributions (such as code patches). - || datacontributor | dtc | for persons or organisations that contributed data sets for the software - || copyrightholder | cph | for all copyright holders. This is a legal concept so should use the legal name of an institution or corporate body. - || funder | fnd | for persons or organizations that furnished financial support for the development of the software - | - |The [full list of roles](https://www.loc.gov/marc/relators/relaterm.html) is extremely comprehensive. - |""") - @example( - """authors: - | - name: Jane Doe - | role: [author, maintainer] - | email: jane@doe.com - | info: - | github: janedoe - | twitter: janedoe - | orcid: XXAABBCCXX - | groups: [ one, two, three ] - | - name: Tim Farbe - | roles: [author] - | email: tim@far.be - |""", "yaml") - @since("Viash 0.3.1") - @default("Empty") - authors: List[Author] = Nil, - - @description( - """A grouping of the @[arguments](argument), used to display the help message. - | - | - `name: foo`, the name of the argument group. - | - `description: Description of foo`, a description of the argument group. Multiline descriptions are supported. - | - `arguments: [arg1, arg2, ...]`, list of the arguments. - | - |""") - @example( - """argument_groups: - | - name: "Input" - | arguments: - | - name: "--id" - | type: string - | required: true - | - name: "--input" - | type: file - | required: true - | - name: "Output" - | arguments: - | - name: "--output" - | type: file - | direction: output - | required: true - | - name: "--output_optional" - | type: file - | direction: output - |""", - "yaml") - @exampleWithDescription( - """component_name - | - | Input: - | --id - | type: string - | - | --input - | type: file - | - | Output: - | --output - | type: file - | - | --optional_output - | type: file - |""", - "bash", - "This results in the following output when calling the component with the `--help` argument:") - @since("Viash 0.5.14") - @default("Empty") - argument_groups: List[ArgumentGroup] = Nil, - - @description( - """@[Resources](resources) are files that support the component. The first resource should be @[a script](scripting_languages) that will be executed when the functionality is run. Additional resources will be copied to the same directory. - | - |Common properties: - | - | * type: `file` / `r_script` / `python_script` / `bash_script` / `javascript_script` / `scala_script` / `csharp_script`, specifies the type of the resource. The first resource cannot be of type `file`. When the type is not specified, the default type is simply `file`. - | * dest: filename, the resulting name of the resource. From within a script, the file can be accessed at `meta["resources_dir"] + "/" + dest`. If unspecified, `dest` will be set to the basename of the `path` parameter. - | * path: `path/to/file`, the path of the input file. Can be a relative or an absolute path, or a URI. Mutually exclusive with `text`. - | * text: ...multiline text..., the content of the resulting file specified as a string. Mutually exclusive with `path`. - | * is_executable: `true` / `false`, whether the resulting resource file should be made executable. - |""") - @example( - """resources: - | - type: r_script - | path: script.R - | - type: file - | path: resource1.txt - |""", - "yaml") - @default("Empty") - resources: List[Resource] = Nil, - - @description("A description of the component. This will be displayed with `--help`.") - @example( - """description: | - | This component performs function Y and Z. - | It is possible to make this a multiline string. - |""", - "yaml") - description: Option[String] = None, - - @description("A description on how to use the component. This will be displayed with `--help` under the 'Usage:' section.") - @example("usage: Place the executable in a directory containing TSV files and run it", "yaml") - usage: Option[String] = None, - - @description("""One or more @[scripts](scripting_languages) to be used to test the component behaviour when `viash test` is invoked. Additional files of type `file` will be made available only during testing. Each test script should expect no command-line inputs, be platform-independent, and return an exit code >0 when unexpected behaviour occurs during testing. See @[Unit Testing](unit_testing) for more info.""") - @example( - """test_resources: - | - type: bash_script - | path: tests/test1.sh - | - type: r_script - | path: tests/test2.R - | - path: resource1.txt - |""", - "yaml") - @default("Empty") - test_resources: List[Resource] = Nil, - - @description("Structured information. Can be any shape: a string, vector, map or even nested map.") - @example( - """info: - | twitter: wizzkid - | classes: [ one, two, three ]""", "yaml") - @since("Viash 0.4.0") - @default("Empty") - info: Json = Json.Null, - - @description("Allows setting a component to active, deprecated or disabled.") - @since("Viash 0.6.0") - @default("Enabled") - status: Status = Status.Enabled, - - @description( - """@[Computational requirements](computational_requirements) related to running the component. - |`cpus` specifies the maximum number of (logical) cpus a component is allowed to use., whereas - |`memory` specifies the maximum amount of memory a component is allowed to allicate. Memory units must be - |in B, KB, MB, GB, TB or PB for SI units (1000-base), or KiB, MiB, GiB, TiB or PiB for binary IEC units (1024-base).""") - @example( - """requirements: - | cpus: 5 - | memory: 10GB - |""", - "yaml") - @since("Viash 0.6.0") - @default("Empty") - requirements: ComputationalRequirements = ComputationalRequirements(), - - @description("Allows listing Viash components required by this Viash component") - @exampleWithDescription( - """dependencies: - | - name: qc/multiqc - | repository: - | type: github - | uri: openpipelines-bio/modules - | tag: 0.3.0 - |""", - "yaml", - "Full specification of a repository") - @exampleWithDescription( - """dependencies: - | - name: qc/multiqc - | repository: "github://openpipelines-bio/modules:0.3.0" - |""", - "yaml", - "Full specification of a repository using sugar syntax") - @exampleWithDescription( - """dependencies: - | - name: qc/multiqc - | repository: "openpipelines-bio" - |""", - "yaml", - "Reference to a repository fully specified under 'repositories'") - @default("Empty") - dependencies: List[Dependency] = Nil, - - @description( - """(Pre-)defines @[repositories](repository) that can be used as repository in dependencies. - |Allows reusing repository definitions in case it is used in multiple dependencies.""") - @example( - """repositories: - | - name: openpipelines-bio - | type: github - | uri: openpipelines-bio/modules - | tag: 0.3.0 - |""", - "yaml") - @default("Empty") - repositories: List[RepositoryWithName] = Nil, - - @description("The keywords of the components.") - @example("keywords: [ bioinformatics, genomics ]", "yaml") - @default("Empty") - @since("Viash 0.9.0") - keywords: List[String] = Nil, - - @description("The license of the package.") - @example("license: MIT", "yaml") - @default("Empty") - @since("Viash 0.9.0") - license: Option[String] = None, - - @description("The organization of the package.") - @example("organization: viash-io", "yaml") - @default("Empty") - @since("Viash 0.9.0") - organization: Option[String] = None, - - @description("References to external resources related to the component.") - @example( - """references: - | doi: 10.1000/xx.123456.789 - | bibtex: | - | @article{foo, - | title={Foo}, - | author={Bar}, - | journal={Baz}, - | year={2024} - | } - |""", "yaml") - @default("Empty") - @since("Viash 0.9.0") - references: References = References(), - - @description("External links of the component.") - @example( - """links: - | repository: "https://github.com/viash-io/viash" - | docker_registry: "https://ghcr.io" - | homepage: "https://viash.io" - | documentation: "https://viash.io/reference/" - | issue_tracker: "https://github.com/viash-io/viash/issues" - |""", "yaml") - @default("Empty") - @since("Viash 0.9.0") - links: Links = Links(), - - // Allow arguments to be listed here, as Functionality it is non-functional and the arguments are merged in argument_groups in pre-parsing. - // Previously listed as a private val in the Functionality class. - // Listing it here greatly simplifies the validation of Functionality and has no downsides. - @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: - | - | - @[string](arg_string) - | - @[file](arg_file) - | - @[integer](arg_integer) - | - @[double](arg_double) - | - @[boolean](arg_boolean) - | - @[boolean_true](arg_boolean_true) - | - @[boolean_false](arg_boolean_false) - |""") - @example( - """arguments: - | - name: --foo - | type: file - | alternatives: [-f] - | description: Description of foo - | default: "/foo/bar" - | must_exist: true - | direction: output - | required: false - | multiple: true - | multiple_sep: ";" - | - name: --bar - | type: string - |""", - "yaml") - @default("Empty") - arguments: List[Argument[_]] = Nil, -) - diff --git a/src/main/scala/io/viash/functionality/package.scala b/src/main/scala/io/viash/functionality/package.scala deleted file mode 100644 index 61eaf22aa..000000000 --- a/src/main/scala/io/viash/functionality/package.scala +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2020 Data Intuitive - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package io.viash - -import io.circe.{Decoder, Encoder, Json} -import io.circe.ACursor - -import io.viash.helpers.Logging -import io.circe.JsonObject -import io.viash.config.arguments.decodeDataArgument - -import config.ArgumentGroup -import config.Author -import config.ComputationalRequirements -import config.Links -import config.References -import config.Status._ -import config.arguments._ - -package object functionality extends Logging { - // import implicits - import io.viash.helpers.circe._ - - import io.viash.config.{decodeAuthor, decodeArgumentGroup, decodeStatus, decodeComputationalRequirements, decodeReferences, decodeLinks} - import io.viash.config.resources.decodeResource - import io.viash.config.dependencies.{decodeDependency, decodeRepositoryWithName} - - // encoder and decoder for Functionality - // implicit val encodeFunctionality: Encoder.AsObject[Functionality] = deriveConfiguredEncoderStrict[Functionality] - implicit val decodeFunctionality: Decoder[Functionality] = deriveConfiguredDecoderFullChecks - -} diff --git a/src/main/scala/io/viash/helpers/DependencyResolver.scala b/src/main/scala/io/viash/helpers/DependencyResolver.scala index 8bffb000e..7b1c3bce1 100644 --- a/src/main/scala/io/viash/helpers/DependencyResolver.scala +++ b/src/main/scala/io/viash/helpers/DependencyResolver.scala @@ -178,7 +178,7 @@ object DependencyResolver extends Logging { case (k, Some(s: String)) => (k, s) case (k, None) => (k, "") }.toMap - // Add the functionality name and namespace to it + // Add the component name and namespace to it val map2 = Map( ("name" -> c.name), ("namespace" -> c.namespace.getOrElse("")) @@ -212,18 +212,16 @@ object DependencyResolver extends Logging { } .filter{ case(scriptPath, info) => - (runnerId, info.get("runner"), info.get("platform")) match { // also try matching on platform as fallback, fetch it already - case (None, _, _) => true // if we don't filter for the incoming runnerId, we want all the output runners - case (Some(id), Some(runner), _) => runner == id // default behaviour, filter for the incoming runnerId - case (Some("executable"), _, Some("native")) => true // legacy code for platform, match executable runner to native platform - case (Some(id), _, Some(plat)) => plat == id // legacy code for platform, filter for the incoming runnerId matching platform id + (runnerId, info.get("runner")) match { + case (None, _) => true // if we don't filter for the incoming runnerId, we want all the output runners + case (Some(id), Some(runner)) => runner == id // default behaviour, filter for the incoming runnerId case _ => false } } .headOption } - // Read a config file from a built target. Get meta info, functionality name & namespace + // Read a config file from a built target. Get meta info, component name & namespace def getSparseConfigInfo(configPath: String): Map[String, String] = { try { // No support for package configs, config mods, ... @@ -231,26 +229,15 @@ object DependencyResolver extends Logging { // We're also assuming that the file will be proper yaml and an actual viash config file val yamlText = IO.read(IO.uri(configPath)) val json = Convert.textToJson(yamlText, configPath) - val legacyMode = json.hcursor.downField("functionality").succeeded def getName(json: Json): Option[String] = { - if (legacyMode) - json.hcursor.downField("functionality").downField("name").as[String].toOption - else - json.hcursor.downField("name").as[String].toOption + json.hcursor.downField("name").as[String].toOption } def getNamespace(json: Json): Option[String] = { - if (legacyMode) - json.hcursor.downField("functionality").downField("namespace").as[String].toOption - else - json.hcursor.downField("namespace").as[String].toOption + json.hcursor.downField("namespace").as[String].toOption } def getInfo(json: Json): Option[Map[String, String]] = { - val info = - if (legacyMode) - json.hcursor.downField("info") - else - json.hcursor.downField("build_info") + val info = json.hcursor.downField("build_info") info.keys.map(_.map(k => (k, info.downField(k).as[String].toOption.getOrElse("Not a string"))).toMap) } @@ -270,18 +257,8 @@ object DependencyResolver extends Logging { try { val yamlText = IO.read(IO.uri(configPath)) val json = Convert.textToJson(yamlText, configPath) - val legacyMode = json.hcursor.downField("functionality").succeeded - - val dependencies = - if (legacyMode) { - val jsonVec = json.hcursor.downField("functionality").downField("dependencies").focus.flatMap(_.asArray).get - jsonVec.flatMap(_.hcursor.downField("writtenPath").as[String].toOption).toList - } - else { - val jsonVec = json.hcursor.downField("build_info").downField("dependencies").focus.flatMap(_.asArray).get - jsonVec.flatMap(_.hcursor.as[String].toOption).toList - } - dependencies + val jsonVec = json.hcursor.downField("build_info").downField("dependencies").focus.flatMap(_.asArray).get + jsonVec.flatMap(_.hcursor.as[String].toOption).toList } catch { case _: Throwable => Nil } diff --git a/src/main/scala/io/viash/helpers/NsExecData.scala b/src/main/scala/io/viash/helpers/NsExecData.scala index 5c40c56ba..313541cb3 100644 --- a/src/main/scala/io/viash/helpers/NsExecData.scala +++ b/src/main/scala/io/viash/helpers/NsExecData.scala @@ -31,7 +31,6 @@ final case class NsExecData( absoluteDir: String, mainScript: String, absoluteMainScript: String, - functionalityName: String, name: String, namespace: Option[String], runnerId: Option[String], @@ -51,8 +50,7 @@ final case class NsExecData( case "abs-dir" => Some(this.absoluteDir) case "main-script" => Some(this.mainScript) case "abs-main-script" => Some(this.absoluteMainScript) - case "functionality-name" => Some(this.functionalityName) - case "name" => Some(this.functionalityName) + case "name" => Some(this.name) case "namespace" => this.namespace case "runner" => this.runnerId case "engine" => this.engineId @@ -93,7 +91,6 @@ object NsExecData { absoluteDir = dirPathAbs.toString, mainScript = mainScriptRel.map(_.toString).getOrElse(""), absoluteMainScript = mainScriptAbs.map(_.toString).getOrElse(""), - functionalityName = config.name, name = config.name, namespace = config.namespace, runnerId = runner.map(_.id), @@ -111,7 +108,6 @@ object NsExecData { absoluteDir = data.map(_.absoluteDir).mkString(" "), mainScript = data.map(_.mainScript).mkString(" "), absoluteMainScript = data.map(_.absoluteMainScript).mkString(" "), - functionalityName = data.map(_.functionalityName).mkString(" "), name = data.map(_.name).mkString(" "), namespace = Some(data.flatMap(_.namespace).mkString(" ")), runnerId = Some(data.flatMap(_.runnerId).mkString(" ")), diff --git a/src/main/scala/io/viash/platforms/DockerPlatform.scala b/src/main/scala/io/viash/platforms/DockerPlatform.scala deleted file mode 100644 index 7bb600e66..000000000 --- a/src/main/scala/io/viash/platforms/DockerPlatform.scala +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (C) 2020 Data Intuitive - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package io.viash.platforms - -import io.viash.schemas._ -import io.viash.helpers.data_structures._ -import io.viash.runners.executable.{IfNeedBePullElseCachedBuild, DockerSetupStrategy} -import io.viash.engines.requirements.Requirements -import io.viash.engines.docker.{DockerResolveVolume, Automatic} - - -@description( - """Run a Viash component on a Docker backend platform. - |By specifying which dependencies your component needs, users will be able to build a docker container from scratch using the setup flag, or pull it from a docker repository. - |""") -@example( - """platforms: - | - type: docker - | image: "bash:4.0" - | setup: - | - type: apt - | packages: [ curl ] - |""", - "yaml") -@deprecated("Use 'engines' and 'runners' instead.", "0.9.0", "0.10.0") -@subclass("docker") -case class DockerPlatform( - @description("As with all platforms, you can give a platform a different name. By specifying `id: foo`, you can target this platform (only) by specifying `-p foo` in any of the Viash commands.") - @example("id: foo", "yaml") - @default("docker") - id: String = "docker", - - @description("The base container to start from. You can also add the tag here if you wish.") - @example("image: \"bash:4.0\"", "yaml") - image: String, - - @description("Name of a container's [organization](https://docs.docker.com/docker-hub/orgs/).") - organization: Option[String], - - @description("The URL to the a [custom Docker registry](https://docs.docker.com/registry/)") - @example("registry: https://my-docker-registry.org", "yaml") - registry: Option[String] = None, - - @description("Specify a Docker image based on its tag.") - @example("tag: 4.0", "yaml") - tag: Option[String] = None, - - @description("If anything is specified in the setup section, running the `---setup` will result in an image with the name of `:`. If nothing is specified in the `setup` section, simply `image` will be used. Advanced usage only.") - @example("target_image: myfoo", "yaml") - target_image: Option[String] = None, - - @description("The organization set in the resulting image. Advanced usage only.") - @example("target_organization: viash-io", "yaml") - target_organization: Option[String] = None, - - @description("The URL where the resulting image will be pushed to. Advanced usage only.") - @example("target_registry: https://my-docker-registry.org", "yaml") - target_registry: Option[String] = None, - - @description("The tag the resulting image gets. Advanced usage only.") - @example("target_tag: 0.5.0", "yaml") - target_tag: Option[String] = None, - - @description("The separator between the namespace and the name of the component, used for determining the image name. Default: `\"/\"`.") - @example("namespace_separator: \"_\"", "yaml") - @default("/") - namespace_separator: String = "/", - - @description("Enables or disables automatic volume mapping. Enabled when set to `Automatic` or disabled when set to `Manual`. Default: `Automatic`.") - @default("Automatic") - resolve_volume: DockerResolveVolume = Automatic, - - @description("In Linux, files created by a Docker container will be owned by `root`. With `chown: true`, Viash will automatically change the ownership of output files (arguments with `type: file` and `direction: output`) to the user running the Viash command after execution of the component. Default value: `true`.") - @example("chown: false", "yaml") - @default("True") - @removed("Compability not provided with the Runners functionality.", "0.8.0", "0.8.0") - chown: Boolean = true, - - @description("A list of enabled ports. This doesn't change the Dockerfile but gets added as a command-line argument at runtime.") - @example( - """port: - | - 80 - | - 8080 - |""", - "yaml") - @default("Empty") - port: OneOrMore[String] = Nil, - - @description("The working directory when starting the container. This doesn't change the Dockerfile but gets added as a command-line argument at runtime.") - @example("workdir: /home/user", "yaml") - workdir: Option[String] = None, - - @description( - """The Docker setup strategy to use when building a container. - | - || Strategy | Description | - ||-----|----------| - || `alwaysbuild` / `build` / `b` | Always build the image from the dockerfile. This is the default setup strategy. - || `alwayscachedbuild` / `cachedbuild` / `cb` | Always build the image from the dockerfile, with caching enabled. - || `ifneedbebuild` | Build the image if it does not exist locally. - || `ifneedbecachedbuild` | Build the image with caching enabled if it does not exist locally, with caching enabled. - || `alwayspull` / `pull` / `p` | Try to pull the container from [Docker Hub](https://hub.docker.com) or the @[specified docker registry](docker_registry). - || `alwayspullelsebuild` / `pullelsebuild` | Try to pull the image from a registry and build it if it does not exist. - || `alwayspullelsecachedbuild` / `pullelsecachedbuild` | Try to pull the image from a registry and build it with caching if it does not exist. - || `ifneedbepull` | If the image does not exist locally, pull the image. - || `ifneedbepullelsebuild` | Do nothing if the image exists locally. Else, try to pull the image from a registry. Otherwise build the image from scratch. - || `ifneedbepullelsecachedbuild` | Do nothing if the image exists locally. Else, try to pull the image from a registry. Otherwise build the image with caching enabled. - || `push` | Push the container to [Docker Hub](https://hub.docker.com) or the @[specified docker registry](docker_registry). - || `pushifnotpresent` | Push the container to [Docker Hub](https://hub.docker.com) or the @[specified docker registry](docker_registry) if the @[tag](docker_tag) does not exist yet. - || `donothing` / `meh` | Do not build or pull anything. - | - |""") - @example("setup_strategy: alwaysbuild", "yaml") - @default("ifneedbepullelsecachedbuild") - setup_strategy: DockerSetupStrategy = IfNeedBePullElseCachedBuild, - - @description("Add [docker run](https://docs.docker.com/engine/reference/run/) arguments.") - @default("Empty") - run_args: OneOrMore[String] = Nil, - - @description("The source of the target image. This is used for defining labels in the dockerfile.") - @example("target_image_source: https://github.com/foo/bar", "yaml") - target_image_source: Option[String] = None, - `type`: String = "docker", - - // setup variables - @description( - """A list of requirements for installing the following types of packages: - | - | - @[apt](apt_req) - | - @[apk](apk_req) - | - @[Docker setup instructions](docker_req) - | - @[JavaScript](javascript_req) - | - @[Python](python_req) - | - @[R](r_req) - | - @[Ruby](ruby_req) - | - @[yum](yum_req) - | - |The order in which these dependencies are specified determines the order in which they will be installed. - |""") - @default("Empty") - setup: List[Requirements] = Nil, - - @description("Additional requirements specific for running unit tests.") - @since("Viash 0.5.13") - @default("Empty") - test_setup: List[Requirements] = Nil, - - @description("Override the entrypoint of the base container. Default set `ENTRYPOINT []`.") - @exampleWithDescription("entrypoint: ", "yaml", "Disable the default override.") - @exampleWithDescription("""entrypoint: ["top", "-b"]""", "yaml", "Entrypoint of the container in the exec format, which is the prefered form.") - @exampleWithDescription("""entrypoint: "top -b"""", "yaml", "Entrypoint of the container in the shell format.") - @since("Viash 0.7.4") - @default("[]") - entrypoint: Option[Either[String, List[String]]] = Some(Right(Nil)), - - @description("Set the default command being executed when running the Docker container.") - @exampleWithDescription("""cmd: ["echo", "$HOME"]""", "yaml", "Set CMD using the exec format, which is the prefered form.") - @exampleWithDescription("""cmd: "echo $HOME"""", "yaml", "Set CMD using the shell format.") - @since("Viash 0.7.4") - cmd: Option[Either[String, List[String]]] = None - -) extends Platform diff --git a/src/main/scala/io/viash/platforms/NativePlatform.scala b/src/main/scala/io/viash/platforms/NativePlatform.scala deleted file mode 100644 index fb60d6cd2..000000000 --- a/src/main/scala/io/viash/platforms/NativePlatform.scala +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2020 Data Intuitive - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package io.viash.platforms - -import io.viash.schemas._ - -@description( - """Running a Viash component on a native platform means that the script will be executed in your current environment. - |Any dependencies are assumed to have been installed by the user, so the native platform is meant for developers (who know what they're doing) or for simple bash scripts (which have no extra dependencies). - |""") -@example( - """platforms: - | - type: native - |""", - "yaml") -@deprecated("Use 'engines' and 'runners' instead.", "0.9.0", "0.10.0") -@subclass("native") -case class NativePlatform( - @description("As with all platforms, you can give a platform a different name. By specifying `id: foo`, you can target this platform (only) by specifying `-p foo` in any of the Viash commands.") - @example("id: foo", "yaml") - @default("native") - id: String = "native", - `type`: String = "native" -) extends Platform \ No newline at end of file diff --git a/src/main/scala/io/viash/platforms/NextflowPlatform.scala b/src/main/scala/io/viash/platforms/NextflowPlatform.scala deleted file mode 100644 index bf89c470f..000000000 --- a/src/main/scala/io/viash/platforms/NextflowPlatform.scala +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2020 Data Intuitive - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package io.viash.platforms - -import io.viash.schemas._ -import io.viash.runners.nextflow._ - -/** - * A Platform class for generating Nextflow (DSL2) modules. - */ -@description("""Platform for generating Nextflow VDSL3 modules.""") -// todo: add link to guide -@example( - """platforms: - | - type: nextflow - | directives: - | label: [lowcpu, midmem] - |""", - "yaml") -@deprecated("Use 'engines' and 'runners' instead.", "0.9.0", "0.10.0") -@subclass("nextflow") -case class NextflowPlatform( - @description("Every platform can be given a specific id that can later be referred to explicitly when running or building the Viash component.") - @example("id: foo", "yaml") - @default("nextflow") - id: String = "nextflow", - - `type`: String = "nextflow", - - // nxf params - @description( - """@[Directives](nextflow_directives) are optional settings that affect the execution of the process. These mostly match up with the Nextflow counterparts. - |""") - @example( - """directives: - | container: rocker/r-ver:4.1 - | label: highcpu - | cpus: 4 - | memory: 16 GB""", - "yaml") - @default("Empty") - directives: NextflowDirectives = NextflowDirectives(), - - @description( - """@[Automated processing flags](nextflow_auto) which can be toggled on or off: - | - || Flag | Description | Default | - ||---|---------|----| - || `simplifyInput` | If `true`, an input tuple only containing only a single File (e.g. `["foo", file("in.h5ad")]`) is automatically transformed to a map (i.e. `["foo", [ input: file("in.h5ad") ] ]`). | `true` | - || `simplifyOutput` | If `true`, an output tuple containing a map with a File (e.g. `["foo", [ output: file("out.h5ad") ] ]`) is automatically transformed to a map (i.e. `["foo", file("out.h5ad")]`). | `false` | - || `transcript` | If `true`, the module's transcripts from `work/` are automatically published to `params.transcriptDir`. If not defined, `params.publishDir + "/_transcripts"` will be used. Will throw an error if neither are defined. | `false` | - || `publish` | If `true`, the module's outputs are automatically published to `params.publishDir`. If equal to `"state"`, also a `.state.yaml` file will be published in the publish dir. Will throw an error if `params.publishDir` is not defined. | `false` | - | - |""") - @example( - """auto: - | publish: true""", - "yaml") - @default( - """simplifyInput: true - |simplifyOutput: false - |transcript: false - |publish: false - |""") - auto: NextflowAuto = NextflowAuto(), - - @description("Allows tweaking how the @[Nextflow Config](nextflow_config) file is generated.") - @since("Viash 0.7.4") - @default("A series of default labels to specify memory and cpu constraints") - config: NextflowConfig = NextflowConfig(), - - @description("Whether or not to print debug messages.") - @default("False") - debug: Boolean = false, - - // TODO: solve differently - @description("Specifies the Docker platform id to be used to run Nextflow.") - @default("docker") - container: String = "docker" -) extends Platform diff --git a/src/main/scala/io/viash/platforms/Platform.scala b/src/main/scala/io/viash/platforms/Platform.scala deleted file mode 100644 index 351e0f0ae..000000000 --- a/src/main/scala/io/viash/platforms/Platform.scala +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2020 Data Intuitive - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package io.viash.platforms - -import io.viash.schemas._ -import io.viash.engines.requirements.Requirements - -@description( - """A list of platforms to generate target artifacts for. - | - | * @[Native](platform_native) - | * @[Docker](platform_docker) - | * @[Nextflow](platform_nextflow) - |""") -@example( - """platforms: - | - type: docker - | image: "bash:4.0" - | - type: native - | - type: nextflow - | directives: - | label: [lowcpu, midmem] - |""", - "yaml") -@deprecated("Use 'engines' and 'runners' instead.", "0.9.0", "0.10.0") -@subclass("NativePlatform") -@subclass("DockerPlatform") -@subclass("NextflowPlatform") -@deprecated("Use 'engines' and 'runners' instead.", "0.9.0", "0.10.0") -trait Platform { - @description("Specifies the type of the platform.") - val `type`: String - - val id: String - - val requirements: List[Requirements] = Nil -} diff --git a/src/main/scala/io/viash/platforms/package.scala b/src/main/scala/io/viash/platforms/package.scala deleted file mode 100644 index c83ceeb70..000000000 --- a/src/main/scala/io/viash/platforms/package.scala +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2020 Data Intuitive - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package io.viash - -import io.circe.{Decoder, Encoder, Json} -import cats.syntax.functor._ // for .widen - -package object platforms { - import io.viash.helpers.circe._ - - import io.viash.runners.nextflow.decodeNextflowDirectives - import io.viash.engines.docker.decodeResolveVolume - import io.viash.runners.executable.decodeSetupStrategy - import io.viash.engines.requirements.decodeRequirements - import io.viash.runners.nextflow.decodeNextflowAuto - import io.viash.runners.nextflow.decodeNextflowConfig - - // implicit val encodeDockerPlatform: Encoder.AsObject[DockerPlatform] = deriveConfiguredEncoder - implicit val decodeDockerPlatform: Decoder[DockerPlatform] = deriveConfiguredDecoderFullChecks - - // implicit val encodeNextflowPlatform: Encoder.AsObject[NextflowPlatform] = deriveConfiguredEncoder - implicit val decodeNextflowPlatform: Decoder[NextflowPlatform] = deriveConfiguredDecoderFullChecks - - // implicit val encodeNativePlatform: Encoder.AsObject[NativePlatform] = deriveConfiguredEncoder - implicit val decodeNativePlatform: Decoder[NativePlatform] = deriveConfiguredDecoderFullChecks - - // implicit def encodePlatform[A <: Platform]: Encoder[A] = Encoder.instance { - // platform => - // val typeJson = Json.obj("type" -> Json.fromString(platform.`type`)) - // val objJson = platform match { - // case s: DockerPlatform => encodeDockerPlatform(s) - // case s: NextflowPlatform => encodeNextflowPlatform(s) - // case s: NativePlatform => encodeNativePlatform(s) - // } - // objJson deepMerge typeJson - // } - - implicit def decodePlatform: Decoder[Platform] = Decoder.instance { - cursor => - val decoder: Decoder[Platform] = - cursor.downField("type").as[String] match { - case Right("docker") => decodeDockerPlatform.widen - case Right("native") => decodeNativePlatform.widen - case Right("nextflow") => decodeNextflowPlatform.widen - case Right(typ) => - //throw new RuntimeException("Type " + typ + " is not recognised.") - DeriveConfiguredDecoderWithValidationCheck.invalidSubTypeDecoder[NativePlatform](typ, List("docker", "native", "nextflow")).widen - case Left(exception) => throw exception - } - - decoder(cursor) - } -} diff --git a/src/main/scala/io/viash/schemas/CollectedSchemas.scala b/src/main/scala/io/viash/schemas/CollectedSchemas.scala index a4cafa90a..6adf2ae01 100644 --- a/src/main/scala/io/viash/schemas/CollectedSchemas.scala +++ b/src/main/scala/io/viash/schemas/CollectedSchemas.scala @@ -20,10 +20,8 @@ package io.viash.schemas import io.circe.{Encoder, Printer => JsonPrinter} import io.circe.syntax.EncoderOps -import io.viash.functionality._ import io.viash.runners._ import io.viash.engines._ -import io.viash.platforms._ import io.circe.Json import io.viash.config.Config import io.viash.config.BuildInfo @@ -70,7 +68,6 @@ object CollectedSchemas { getMembers[BuildInfo](), getMembers[SysEnvCC](), - getMembers[Functionality](), getMembers[Author](), getMembers[ComputationalRequirements](), getMembers[ArgumentGroup](), @@ -84,12 +81,7 @@ object CollectedSchemas { getMembers[Engine](), getMembers[NativeEngine](), - getMembers[DockerEngine](), - - getMembers[Platform](), - getMembers[NativePlatform](), - getMembers[DockerPlatform](), - getMembers[NextflowPlatform](), + getMembers[DockerEngine]() ) } object memberData_part2 { diff --git a/src/main/scala/io/viash/schemas/JsonSchema.scala b/src/main/scala/io/viash/schemas/JsonSchema.scala index 0fb96dd99..5b1e391d4 100644 --- a/src/main/scala/io/viash/schemas/JsonSchema.scala +++ b/src/main/scala/io/viash/schemas/JsonSchema.scala @@ -134,7 +134,7 @@ object JsonSchema { info .filter(p => !p.name.startsWith("__")) // remove __this__ .filter(p => !p.removed.isDefined && (!config.strict || !p.deprecated.isDefined)) // always remove 'removed' arguments and if need be create a strict schema by removing deprecated - .filter(p => !config.strict || !(p.name == "arguments" && (thisParameter.`type` == "Functionality" || thisParameter.`type` == "Config"))) // exception: remove 'arguments' in 'Functionality' for strict schema + .filter(p => !config.strict || !(p.name == "arguments" && thisParameter.`type` == "Config")) // exception: remove 'arguments' in 'Config' for strict schema val propertiesJson = properties.map(p => { val pDescription = p.description.map(s => removeMarkup(s)) val trimmedType = p.`type` match { diff --git a/src/main/scala/io/viash/wrapper/BashWrapper.scala b/src/main/scala/io/viash/wrapper/BashWrapper.scala index 2d9f4813c..2048dacb0 100644 --- a/src/main/scala/io/viash/wrapper/BashWrapper.scala +++ b/src/main/scala/io/viash/wrapper/BashWrapper.scala @@ -31,7 +31,6 @@ object BashWrapper { val metaArgs: List[Argument[_]] = { List( StringArgument("name", required = true, dest = "meta"), - StringArgument("functionality_name", required = true, dest = "meta"), // filearguments set to 'must_exist = false, create_parent = false' because of config inject FileArgument("resources_dir", required = true, dest = "meta", must_exist = false, create_parent = false), FileArgument("executable", required = true, dest = "meta", must_exist = false, create_parent = false), @@ -291,7 +290,6 @@ object BashWrapper { | |# define meta fields |VIASH_META_NAME="${config.name}" - |VIASH_META_FUNCTIONALITY_NAME="${config.name}" |VIASH_META_EXECUTABLE="$$VIASH_META_RESOURCES_DIR/$$VIASH_META_NAME" |VIASH_META_CONFIG="$$VIASH_META_RESOURCES_DIR/${ConfigMeta.metaFilename}" |VIASH_META_TEMP_DIR="$$VIASH_TEMP" diff --git a/src/test/resources/test_languages/bash/code.sh b/src/test/resources/test_languages/bash/code.sh index 5dbf001d7..94bcf262b 100755 --- a/src/test/resources/test_languages/bash/code.sh +++ b/src/test/resources/test_languages/bash/code.sh @@ -12,7 +12,6 @@ par_output="output.txt" par_log="log.txt" par_optional="help" par_optional_with_default="me" -meta_functionality_name="testbash" meta_resources_dir="." # VIASH END @@ -61,7 +60,6 @@ output "multiple: |$par_multiple|" output "multiple_pos: |$par_multiple_pos|" output "meta_name: |$meta_name|" -output "meta_functionality_name: |$meta_functionality_name|" output "meta_resources_dir: |$meta_resources_dir|" output "meta_cpus: |$meta_cpus|" output "meta_memory_b: |$meta_memory_b|" diff --git a/src/test/resources/test_languages/bash/config.vsh.yaml b/src/test/resources/test_languages/bash/config.vsh.yaml index 64574c8ca..95e7563b2 100755 --- a/src/test/resources/test_languages/bash/config.vsh.yaml +++ b/src/test/resources/test_languages/bash/config.vsh.yaml @@ -14,4 +14,4 @@ engines: setup: - type: apk packages: - - fortune \ No newline at end of file + - fortune diff --git a/src/test/resources/test_languages/common.yaml b/src/test/resources/test_languages/common.yaml index f232c7b00..739270ef6 100644 --- a/src/test/resources/test_languages/common.yaml +++ b/src/test/resources/test_languages/common.yaml @@ -75,4 +75,4 @@ info: custom_tag: custom_value requirements: cpus: 2 - memory: 2GB \ No newline at end of file + memory: 2GB diff --git a/src/test/resources/test_languages/csharp/config.vsh.yaml b/src/test/resources/test_languages/csharp/config.vsh.yaml index 17f408b5a..de2e2278e 100644 --- a/src/test/resources/test_languages/csharp/config.vsh.yaml +++ b/src/test/resources/test_languages/csharp/config.vsh.yaml @@ -9,4 +9,4 @@ engines: image: ghcr.io/data-intuitive/dotnet-script:1.3.1 setup: - type: apk - packages: [ bash ] \ No newline at end of file + packages: [ bash ] diff --git a/src/test/resources/test_languages/executable/config.vsh.yaml b/src/test/resources/test_languages/executable/config.vsh.yaml index 7737d726d..6dfe4f417 100644 --- a/src/test/resources/test_languages/executable/config.vsh.yaml +++ b/src/test/resources/test_languages/executable/config.vsh.yaml @@ -19,4 +19,4 @@ __merge__: [../common-runners.yaml] engines: - type: native - type: docker - image: "bash" \ No newline at end of file + image: "bash" diff --git a/src/test/resources/test_languages/js/config.vsh.yaml b/src/test/resources/test_languages/js/config.vsh.yaml index 47294a1ce..90b46fef5 100644 --- a/src/test/resources/test_languages/js/config.vsh.yaml +++ b/src/test/resources/test_languages/js/config.vsh.yaml @@ -9,4 +9,4 @@ engines: image: node:15-buster setup: - type: javascript - npm: [ plot ] \ No newline at end of file + npm: [ plot ] diff --git a/src/test/resources/test_languages/python/config.vsh.yaml b/src/test/resources/test_languages/python/config.vsh.yaml index 6ba631bc9..3f7d24283 100644 --- a/src/test/resources/test_languages/python/config.vsh.yaml +++ b/src/test/resources/test_languages/python/config.vsh.yaml @@ -13,4 +13,4 @@ engines: - TESTING_FOO=bar - type: python packages: - - "argparse<1.4" \ No newline at end of file + - "argparse<1.4" diff --git a/src/test/resources/test_languages/scala/config.vsh.yaml b/src/test/resources/test_languages/scala/config.vsh.yaml index 412d74c27..1da5787af 100644 --- a/src/test/resources/test_languages/scala/config.vsh.yaml +++ b/src/test/resources/test_languages/scala/config.vsh.yaml @@ -6,4 +6,4 @@ resources: engines: - type: native - type: docker - image: hseeberger/scala-sbt:eclipse-temurin-11.0.14.1_1.6.2_2.13.8 \ No newline at end of file + image: hseeberger/scala-sbt:eclipse-temurin-11.0.14.1_1.6.2_2.13.8 diff --git a/src/test/resources/test_languages/test.sh b/src/test/resources/test_languages/test.sh index 7417599e7..26150d0a8 100755 --- a/src/test/resources/test_languages/test.sh +++ b/src/test/resources/test_languages/test.sh @@ -32,7 +32,6 @@ grep -q 'optional_with_default: |bar|' output.txt grep -q 'multiple: |one;two|' output.txt grep -q 'multiple_pos: |a;b;c;d;e;f|' output.txt grep -q 'meta_name: |test_languages_.*|' output.txt -grep -q 'meta_functionality_name: |test_languages_.*|' output.txt grep -q 'meta_resources_dir: |..*|' output.txt grep -q 'meta_cpus: |2|' output.txt grep -q 'meta_memory_b: |2000000000|' output.txt @@ -80,7 +79,6 @@ grep -q 'multiple: ||' output2.txt grep -q 'multiple_pos: ||' output2.txt grep -q 'meta_name: |test_languages_.*|' output2.txt -grep -q 'meta_functionality_name: |test_languages_.*|' output2.txt grep -q 'meta_resources_dir: |..*|' output2.txt grep -q 'meta_cpus: |666|' output2.txt grep -q 'meta_memory_b: |100000000000000000|' output2.txt diff --git a/src/test/resources/testbash/code.sh b/src/test/resources/testbash/code.sh index d341a11e4..e45a31077 100755 --- a/src/test/resources/testbash/code.sh +++ b/src/test/resources/testbash/code.sh @@ -13,7 +13,6 @@ par_multiple_output="output*.txt" par_log="log.txt" par_optional="help" par_optional_with_default="me" -meta_functionality_name="testbash" meta_resources_dir="." # VIASH END diff --git a/src/test/resources/testbash/config_deprecated_argument_groups.vsh.yaml b/src/test/resources/testbash/config_deprecated_argument_groups.vsh.yaml deleted file mode 100755 index e03732ec7..000000000 --- a/src/test/resources/testbash/config_deprecated_argument_groups.vsh.yaml +++ /dev/null @@ -1,94 +0,0 @@ -name: testbash -version: 0.1 -description: | - Prints out the parameter values. - Checking what happens with multiline descriptions. -authors: - - name: Bob Cando - roles: [maintainer, author] - email: bob@cando.com - info: {github: bobcando, orcid: XXXAAABBB} -arguments: - - name: "input" - type: file - description: | - An input file with positional arguments. - More checks for multiline descriptions. - Testing some characters that should be escaped: ` $ \ - direction: input - required: true - must_exist: true - example: input.txt - - name: "--real_number" - type: double - description: A real number with positional arguments. - required: true - - name: "--whole_number" - type: integer - description: A whole number with a standard flag. - required: true - - name: "-s" - type: string - description: A sentence or word with a short flag. - required: true - - name: "--truth" - type: boolean_true - description: A switch flag. - - name: "--falsehood" - type: boolean_false - description: A switch flag which is false when specified. - - name: "--reality" - type: boolean - description: A switch flag without predetermined state. - - name: "--output" - alternatives: [ "-o" ] - type: file - description: Write the parameters to a json file. - direction: output - - name: "--log" - type: file - description: An optional log file. - direction: output - - name: "--optional" - type: string - description: An optional string. - - name: "--optional_with_default" - type: string - default: "The default value." - - name: "--multiple" - type: string - multiple: true - - name: "multiple_pos" - type: string - multiple: true -argument_groups: - - name: First group - arguments: [ input, real_number, whole_number, s ] - - name: Second group - arguments: [ truth, falsehood, reality ] - description: Foo -resources: - - type: bash_script - path: ./code.sh - - path: resource1.txt - - path: https://raw.githubusercontent.com/scala/scala/fff4ec3539ac58f56fdc8f1382c365f32a9fd25a/NOTICE -test_resources: - - type: bash_script - path: tests/check_outputs.sh - - type: bash_script - path: tests/fail.sh - - path: resource2.txt -info: - foo: bar - custom_tag: custom_value -requirements: - cpus: 2 - memory: 2GB -engines: - - type: native - - type: docker - image: "bash:3.2" - - type: docker - image: "busybox" - id: "busybox" - # - type: nextflow \ No newline at end of file diff --git a/src/test/resources/testbash/config_with_functionality.vsh.yaml b/src/test/resources/testbash/config_with_functionality.vsh.yaml deleted file mode 100644 index 95f239f6c..000000000 --- a/src/test/resources/testbash/config_with_functionality.vsh.yaml +++ /dev/null @@ -1,107 +0,0 @@ -functionality: - name: testbash - version: 0.1 - description: | - Prints out the parameter values. - Checking what happens with multiline descriptions. - authors: - - name: Bob ''' """ \n ` $ \ Cando - roles: [maintainer, author] - email: bob@cando.com - info: {github: bobcando, orcid: XXXAAABBB} - argument_groups: - - name: First group - arguments: - - name: "input" - type: file - description: | - An input file with positional arguments. - More checks for multiline descriptions. - Testing some characters that should be escaped: ''' """ \n ` $ \ - direction: input - required: true - must_exist: true - example: input.txt - - name: "--real_number" - type: double - description: A real number with positional arguments. - required: true - - name: "--whole_number" - type: integer - description: A whole number with a standard flag. - required: true - - name: "--long_number" - type: long - description: A long - - name: "-s" - type: string - description: A sentence or word with a short flag. - required: true - - name: Second group - description: Foo - arguments: - - name: "--truth" - type: boolean_true - description: A switch flag. - - name: "--falsehood" - type: boolean_false - description: A switch flag which is false when specified. - - name: "--reality" - type: boolean - description: A switch flag without predetermined state. - - name: Arguments - arguments: - - name: "--output" - alternatives: [ "-o" ] - type: file - description: Write the parameters to a json file. - direction: output - - name: "--log" - type: file - description: An optional log file. - direction: output - - name: "--optional" - type: string - description: An optional string. - - name: "--optional_with_default" - type: string - default: "The default value." - - name: "--multiple" - type: string - multiple: true - - name: "multiple_pos" - type: string - multiple: true - resources: - - type: bash_script - path: ./code.sh - - path: resource1.txt - - path: https://raw.githubusercontent.com/scala/scala/fff4ec3539ac58f56fdc8f1382c365f32a9fd25a/NOTICE - test_resources: - - type: bash_script - path: tests/check_outputs.sh - - type: bash_script - path: tests/fail.sh - - path: resource2.txt - info: - foo: bar - custom_tag: custom_value - requirements: - cpus: 2 - memory: 2GB -runners: - - type: executable - - type: nextflow -engines: - - type: native - id: native - - type: docker - image: "bash:3.2" - - type: docker - id: throwawayimage - image: "bash:3.2" - target_image: "mytestbash" - setup: - - type: apk - packages: - - fortune \ No newline at end of file diff --git a/src/test/resources/testnextflowvdsl3/src/integer_as_double/config.vsh.yaml b/src/test/resources/testnextflowvdsl3/src/integer_as_double/config.vsh.yaml index 83337114f..b18a81bc2 100644 --- a/src/test/resources/testnextflowvdsl3/src/integer_as_double/config.vsh.yaml +++ b/src/test/resources/testnextflowvdsl3/src/integer_as_double/config.vsh.yaml @@ -1,25 +1,26 @@ -functionality: - name: integer_as_double - arguments: - - name: "--input" - type: file - required: true - example: input.txt - - name: "--output" - type: file - required: true - direction: output - example: output.txt - - name: "--double" - type: double - required: true - direction: input - example: 10.5 - resources: - - type: bash_script - path: script.sh -platforms: +name: integer_as_double +arguments: + - name: "--input" + type: file + required: true + example: input.txt + - name: "--output" + type: file + required: true + direction: output + example: output.txt + - name: "--double" + type: double + required: true + direction: input + example: 10.5 +resources: + - type: bash_script + path: script.sh +engines: - type: native - type: docker image: nextflow/bash:latest +runners: + - type: executable - type: nextflow diff --git a/src/test/resources/testnextflowvdsl3/src/multiple_emit_channels/config.vsh.yaml b/src/test/resources/testnextflowvdsl3/src/multiple_emit_channels/config.vsh.yaml index 77d26638b..b2a60dce8 100644 --- a/src/test/resources/testnextflowvdsl3/src/multiple_emit_channels/config.vsh.yaml +++ b/src/test/resources/testnextflowvdsl3/src/multiple_emit_channels/config.vsh.yaml @@ -27,5 +27,7 @@ resources: dependencies: - name: step1 - name: step3 -platforms: +engines: + - type: native +runners: - type: nextflow diff --git a/src/test/resources/testnextflowvdsl3/src/multiple_output/config.vsh.yaml b/src/test/resources/testnextflowvdsl3/src/multiple_output/config.vsh.yaml index 94d0eeec5..a552fa0d0 100644 --- a/src/test/resources/testnextflowvdsl3/src/multiple_output/config.vsh.yaml +++ b/src/test/resources/testnextflowvdsl3/src/multiple_output/config.vsh.yaml @@ -1,24 +1,25 @@ -functionality: - name: multiple_output - arguments: - - name: "--input" - type: file - multiple: true - required: true - example: input.txt - multiple_sep: ";" - - name: "--output" - type: file - required: true - direction: output - multiple: true - multiple_sep: ";" - example: output_*.txt - resources: - - type: bash_script - path: script.sh -platforms: +name: multiple_output +arguments: + - name: "--input" + type: file + multiple: true + required: true + example: input.txt + multiple_sep: ";" + - name: "--output" + type: file + required: true + direction: output + multiple: true + multiple_sep: ";" + example: output_*.txt +resources: + - type: bash_script + path: script.sh +engines: - type: native - type: docker image: nextflow/bash:latest +runners: + - type: executable - type: nextflow diff --git a/src/test/resources/testnextflowvdsl3/src/sub_workflow/config.vsh.yaml b/src/test/resources/testnextflowvdsl3/src/sub_workflow/config.vsh.yaml index 58a7a5af1..d7c5a63f5 100644 --- a/src/test/resources/testnextflowvdsl3/src/sub_workflow/config.vsh.yaml +++ b/src/test/resources/testnextflowvdsl3/src/sub_workflow/config.vsh.yaml @@ -21,5 +21,7 @@ resources: entrypoint: base dependencies: - name: step1 -platforms: +engines: + - type: native +runners: - type: nextflow \ No newline at end of file diff --git a/src/test/resources/testnextflowvdsl3/src/test_wfs/alias/config.vsh.yaml b/src/test/resources/testnextflowvdsl3/src/test_wfs/alias/config.vsh.yaml index a6933026f..ebb939129 100644 --- a/src/test/resources/testnextflowvdsl3/src/test_wfs/alias/config.vsh.yaml +++ b/src/test/resources/testnextflowvdsl3/src/test_wfs/alias/config.vsh.yaml @@ -10,5 +10,7 @@ dependencies: - name: step1 - name: step1 alias: step1_alias -platforms: +engines: + - type: native +runners: - type: nextflow \ No newline at end of file diff --git a/src/test/resources/testnextflowvdsl3/src/test_wfs/concurrency/config.vsh.yaml b/src/test/resources/testnextflowvdsl3/src/test_wfs/concurrency/config.vsh.yaml index 32e6e3cb8..ec3d7d863 100644 --- a/src/test/resources/testnextflowvdsl3/src/test_wfs/concurrency/config.vsh.yaml +++ b/src/test/resources/testnextflowvdsl3/src/test_wfs/concurrency/config.vsh.yaml @@ -10,5 +10,7 @@ dependencies: - name: step1 - name: step2 - name: step3 -platforms: +engines: + - type: native +runners: - type: nextflow \ No newline at end of file diff --git a/src/test/resources/testnextflowvdsl3/src/test_wfs/filter_runif/config.vsh.yaml b/src/test/resources/testnextflowvdsl3/src/test_wfs/filter_runif/config.vsh.yaml index 3acfd3277..2ccef3d78 100644 --- a/src/test/resources/testnextflowvdsl3/src/test_wfs/filter_runif/config.vsh.yaml +++ b/src/test/resources/testnextflowvdsl3/src/test_wfs/filter_runif/config.vsh.yaml @@ -10,5 +10,7 @@ dependencies: - name: step1 - name: step2 - name: step3 -platforms: +engines: + - type: native +runners: - type: nextflow \ No newline at end of file diff --git a/src/test/resources/testnextflowvdsl3/src/test_wfs/fromstate_tostate/config.vsh.yaml b/src/test/resources/testnextflowvdsl3/src/test_wfs/fromstate_tostate/config.vsh.yaml index 62c9fe10f..8bc66ad60 100644 --- a/src/test/resources/testnextflowvdsl3/src/test_wfs/fromstate_tostate/config.vsh.yaml +++ b/src/test/resources/testnextflowvdsl3/src/test_wfs/fromstate_tostate/config.vsh.yaml @@ -10,5 +10,7 @@ dependencies: - name: step1 - name: step2 - name: step3 -platforms: +engines: + - type: native +runners: - type: nextflow \ No newline at end of file diff --git a/src/test/resources/testnextflowvdsl3/src/test_wfs/invalid_fromstate_argument/config.vsh.yaml b/src/test/resources/testnextflowvdsl3/src/test_wfs/invalid_fromstate_argument/config.vsh.yaml index 8d1f411a7..99536dc27 100644 --- a/src/test/resources/testnextflowvdsl3/src/test_wfs/invalid_fromstate_argument/config.vsh.yaml +++ b/src/test/resources/testnextflowvdsl3/src/test_wfs/invalid_fromstate_argument/config.vsh.yaml @@ -8,5 +8,7 @@ resources: - path: ../../../resources dependencies: - name: sub_workflow -platforms: +engines: + - type: native +runners: - type: nextflow \ No newline at end of file diff --git a/src/test/resources/testnextflowvdsl3/src/test_wfs/invalid_tostate_argument/config.vsh.yaml b/src/test/resources/testnextflowvdsl3/src/test_wfs/invalid_tostate_argument/config.vsh.yaml index 788b6a3e8..5b8e7d118 100644 --- a/src/test/resources/testnextflowvdsl3/src/test_wfs/invalid_tostate_argument/config.vsh.yaml +++ b/src/test/resources/testnextflowvdsl3/src/test_wfs/invalid_tostate_argument/config.vsh.yaml @@ -8,5 +8,7 @@ resources: - path: ../../../resources dependencies: - name: sub_workflow -platforms: +engines: + - type: native +runners: - type: nextflow \ No newline at end of file diff --git a/src/test/resources/testnextflowvdsl3/src/test_wfs/nested/config.vsh.yaml b/src/test/resources/testnextflowvdsl3/src/test_wfs/nested/config.vsh.yaml index 01b75a8c6..988f83cd0 100644 --- a/src/test/resources/testnextflowvdsl3/src/test_wfs/nested/config.vsh.yaml +++ b/src/test/resources/testnextflowvdsl3/src/test_wfs/nested/config.vsh.yaml @@ -8,5 +8,7 @@ resources: - path: ../../../resources dependencies: - name: sub_workflow -platforms: +engines: + - type: native +runners: - type: nextflow \ No newline at end of file diff --git a/src/test/resources/testnextflowvdsl3/src/test_wfs/runeach/config.vsh.yaml b/src/test/resources/testnextflowvdsl3/src/test_wfs/runeach/config.vsh.yaml index d784e9efe..76662068b 100644 --- a/src/test/resources/testnextflowvdsl3/src/test_wfs/runeach/config.vsh.yaml +++ b/src/test/resources/testnextflowvdsl3/src/test_wfs/runeach/config.vsh.yaml @@ -10,5 +10,7 @@ dependencies: - name: step1 - name: step2 - name: step3 -platforms: +engines: + - type: native +runners: - type: nextflow \ No newline at end of file diff --git a/src/test/resources/testnextflowvdsl3/src/wf/config.vsh.yaml b/src/test/resources/testnextflowvdsl3/src/wf/config.vsh.yaml index 6c7016e6d..542fe0448 100644 --- a/src/test/resources/testnextflowvdsl3/src/wf/config.vsh.yaml +++ b/src/test/resources/testnextflowvdsl3/src/wf/config.vsh.yaml @@ -35,5 +35,7 @@ dependencies: repositories: - name: mylocal type: local -platforms: +engines: + - type: native +runners: - type: nextflow \ No newline at end of file diff --git a/src/test/scala/io/viash/auxiliary/MainBuildAuxiliaryDockerChown.scala b/src/test/scala/io/viash/auxiliary/MainBuildAuxiliaryDockerChown.scala index a47b8a157..8b708c5e3 100644 --- a/src/test/scala/io/viash/auxiliary/MainBuildAuxiliaryDockerChown.scala +++ b/src/test/scala/io/viash/auxiliary/MainBuildAuxiliaryDockerChown.scala @@ -111,18 +111,6 @@ class MainBuildAuxiliaryDockerChown extends AnyFunSuite with BeforeAndAfterAll w }) } - test("Test with platform and chown is set to false", DockerTest) { - val newConfigFile = configDeriver.derive(""".platforms := [{type: "docker", chown: false }]""", "docker_chown_false") - // functionality not provided in runner, should throw exception - val output = TestHelper.testMainException[ConfigParserException]( - "build", - "--engine", "docker_chown", - "-o", tempFolStr, - newConfigFile - ) - assert(output.stderr.contains("Error: .chown was removed: Compability not provided with the Runners functionality.")) - } - override def afterAll(): Unit = { IO.deleteRecursively(temporaryFolder) IO.deleteRecursively(temporaryConfigFolder) diff --git a/src/test/scala/io/viash/e2e/build/DockerSetup.scala b/src/test/scala/io/viash/e2e/build/DockerSetup.scala index 8f39fb683..3303f55f5 100644 --- a/src/test/scala/io/viash/e2e/build/DockerSetup.scala +++ b/src/test/scala/io/viash/e2e/build/DockerSetup.scala @@ -148,7 +148,7 @@ class DockerSetup extends AnyFunSuite with BeforeAndAfterAll { // Run the code // prepare the environment - // override the functionality name & version so we don't have collisions with other docker images + // override the component name & version so we don't have collisions with other docker images val stdout = TestHelper.testMain( "build", "--engine", "docker", diff --git a/src/test/scala/io/viash/e2e/build/NativeSuite.scala b/src/test/scala/io/viash/e2e/build/NativeSuite.scala index b3a561379..f3eb24065 100644 --- a/src/test/scala/io/viash/e2e/build/NativeSuite.scala +++ b/src/test/scala/io/viash/e2e/build/NativeSuite.scala @@ -18,8 +18,6 @@ class NativeSuite extends AnyFunSuite with BeforeAndAfterAll { Logger.UseColorOverride.value = Some(false) // which configs to test private val configFile = getClass.getResource(s"/testbash/config.vsh.yaml").getPath - private val configDeprecatedArgumentGroups = getClass.getResource(s"/testbash/config_deprecated_argument_groups.vsh.yaml").getPath - private val configFunctionalityFile = getClass.getResource(s"/testbash/config_with_functionality.vsh.yaml").getPath private val temporaryFolder = IO.makeTemp("viash_tester") private val tempFolStr = temporaryFolder.toString @@ -217,29 +215,6 @@ class NativeSuite extends AnyFunSuite with BeforeAndAfterAll { ) } - test("Test whether a config with a platform specified gives a deprecation warning") { - val newConfigFilePath = configDeriver.derive(""".platforms := [{ type: "native" }]""", "deprecated_platform") - val testOutput = TestHelper.testMain( - "build", - "-o", tempFolStr, - newConfigFilePath - ) - - val testRegex = "Warning: .platforms is deprecated: Use 'engines' and 'runners' instead.".r - assert(testRegex.findFirstIn(testOutput.stderr).isDefined, testOutput) - } - - test("Test Viash still supports the deprecated functionality structure and gives a deprecated warning") { - val testOutput = TestHelper.testMain( - "build", - "-o", tempFolStr, - configFunctionalityFile - ) - - val testRegex = "Warning: Functionality is deprecated: Functionality level is deprecated, all functionality fields are now located on the top level of the config file.".r - assert(testRegex.findFirstIn(testOutput.stderr).isDefined, testOutput) - } - test("Test whether setting an internalFunctionality field throws an error") { val newConfigFilePath = configDeriver.derive(""".argument_groups[.name == "First group"].arguments[.name == "input"].dest := "foo"""", "set_internal_functionality") diff --git a/src/test/scala/io/viash/e2e/config_view/MainConfigViewSuite.scala b/src/test/scala/io/viash/e2e/config_view/MainConfigViewSuite.scala index af1e855b0..ab204755e 100644 --- a/src/test/scala/io/viash/e2e/config_view/MainConfigViewSuite.scala +++ b/src/test/scala/io/viash/e2e/config_view/MainConfigViewSuite.scala @@ -26,7 +26,7 @@ class MainConfigViewSuite extends AnyFunSuite{ test("viash config view remote") { val testOutput = TestHelper.testMain( "config", "view", - "https://raw.githubusercontent.com/viash-io/viash/develop_0_8/src/test/resources/testbash/config.vsh.yaml" + "https://raw.githubusercontent.com/viash-io/viash/main/src/test/resources/testbash/config.vsh.yaml" ) assert(testOutput.stdout.startsWith("name:")) diff --git a/src/test/scala/io/viash/e2e/export/MainExportSuite.scala b/src/test/scala/io/viash/e2e/export/MainExportSuite.scala index d697a3990..9b8d0345d 100644 --- a/src/test/scala/io/viash/e2e/export/MainExportSuite.scala +++ b/src/test/scala/io/viash/e2e/export/MainExportSuite.scala @@ -39,28 +39,6 @@ class MainExportSuite extends AnyFunSuite with BeforeAndAfter { val lines = helpers.IO.read(tempFile.toUri()) assert(lines.contains("def readConfig(")) } - - test("viash export resource legacy") { - val testOutput = TestHelper.testMain( - "export", "resource", "platforms/nextflow/WorkflowHelper.nf" - ) - - assert(testOutput.stderr.contains("WARNING: The 'platforms/' prefix is deprecated. Please use 'runners/' instead.")) - - assert(testOutput.stdout.contains("def readConfig(")) - } - - test("viash export resource to file legacy") { - val testOutput = TestHelper.testMain( - "export", "resource", "platforms/nextflow/WorkflowHelper.nf", - "--output", tempFile.toString - ) - - assert(testOutput.stderr.contains("WARNING: The 'platforms/' prefix is deprecated. Please use 'runners/' instead.")) - - val lines = helpers.IO.read(tempFile.toUri()) - assert(lines.contains("def readConfig(")) - } test("viash export cli_schema") { val testOutput = TestHelper.testMain( diff --git a/src/test/scala/io/viash/e2e/help/MainHelpSuite.scala b/src/test/scala/io/viash/e2e/help/MainHelpSuite.scala index 04760b81b..526be7781 100644 --- a/src/test/scala/io/viash/e2e/help/MainHelpSuite.scala +++ b/src/test/scala/io/viash/e2e/help/MainHelpSuite.scala @@ -41,7 +41,7 @@ class MainHelpSuite extends AnyFunSuite{ assert(!testOutput.stdout.contains("testbash")) } - test("viash config view with trailing help after platform argument") { + test("viash config view with trailing help after runner argument") { val testOutput = TestHelper.testMainException[ExitException]( "config", "view", configFile, @@ -53,7 +53,7 @@ class MainHelpSuite extends AnyFunSuite{ assert(!testOutput.stdout.contains("testbash")) } - test("viash config view with trailing help before platform argument") { + test("viash config view with trailing help before runner argument") { val testOutput = TestHelper.testMainException[ExitException]( "config", "view", configFile, diff --git a/src/test/scala/io/viash/e2e/ns_build/MainNSBuildNativeSuite.scala b/src/test/scala/io/viash/e2e/ns_build/MainNSBuildNativeSuite.scala index 4779023f2..f4e973fc1 100644 --- a/src/test/scala/io/viash/e2e/ns_build/MainNSBuildNativeSuite.scala +++ b/src/test/scala/io/viash/e2e/ns_build/MainNSBuildNativeSuite.scala @@ -118,9 +118,8 @@ class MainNSBuildNativeSuite extends AnyFunSuite with BeforeAndAfterAll{ test("Check uniqueness of component names, same name, different namespace") { val compStr = - """functionality: - | name: comp - | namespace: %s + """name: comp + |namespace: %s |""".stripMargin val tempSrcDir = IO.makeTemp("viash_ns_build_check_uniqueness_src") IO.write(compStr.format("ns1"), tempSrcDir.resolve("config1.vsh.yaml")) @@ -140,9 +139,8 @@ class MainNSBuildNativeSuite extends AnyFunSuite with BeforeAndAfterAll{ test("Check uniqueness of component names, different name, same namespace") { val compStr = - """functionality: - | name: %s - | namespace: ns + """name: %s + |namespace: ns |""".stripMargin val tempSrcDir = IO.makeTemp("viash_ns_build_check_uniqueness_src") IO.write(compStr.format("comp1"), tempSrcDir.resolve("config1.vsh.yaml")) @@ -162,9 +160,8 @@ class MainNSBuildNativeSuite extends AnyFunSuite with BeforeAndAfterAll{ test("Check uniqueness of component names, same name, same namespace") { val compStr = - """functionality: - | name: %s - | namespace: ns + """name: %s + |namespace: ns |""".stripMargin val tempSrcDir = IO.makeTemp("viash_ns_build_check_uniqueness_src") IO.write(compStr.format("comp"), tempSrcDir.resolve("config1.vsh.yaml")) @@ -184,9 +181,8 @@ class MainNSBuildNativeSuite extends AnyFunSuite with BeforeAndAfterAll{ test("Check uniqueness of component names, same name, same namespace - multiple duplicates") { val compStr = - """functionality: - | name: %s - | namespace: ns + """name: %s + |namespace: ns |""".stripMargin val tempSrcDir = IO.makeTemp("viash_ns_build_check_uniqueness_src") IO.write(compStr.format("comp1"), tempSrcDir.resolve("config1.vsh.yaml")) diff --git a/src/test/scala/io/viash/e2e/ns_exec/MainNSExecNativeSuite.scala b/src/test/scala/io/viash/e2e/ns_exec/MainNSExecNativeSuite.scala index c4959b3b0..02551a5d4 100644 --- a/src/test/scala/io/viash/e2e/ns_exec/MainNSExecNativeSuite.scala +++ b/src/test/scala/io/viash/e2e/ns_exec/MainNSExecNativeSuite.scala @@ -39,7 +39,7 @@ class MainNSExecNativeSuite extends AnyFunSuite { "ns", "exec", "--apply_runner", "--apply_engine", - "echo _{functionality-name}_ -{dir}- !{path}! ~{engine}~ ={namespace}=+\\;" + "echo _{name}_ -{dir}- !{path}! ~{engine}~ ={namespace}=+\\;" ) val stdout = testOutput.stdout.replaceAll(nsPath, "[nsPath]") val stderr = testOutput.stderr.replaceAll(nsPath, "[nsPath]") @@ -88,7 +88,7 @@ class MainNSExecNativeSuite extends AnyFunSuite { val testOutput = TestHelper.testMain( workingDir = Some(workingDir), "ns", "exec", - "echo {} {path} {abs-path} {dir} {abs-dir} {main-script} {abs-main-script} {functionality-name} {name} {namespace}" + "echo {} {path} {abs-path} {dir} {abs-dir} {main-script} {abs-main-script} {name} {namespace}" ) val stdout = testOutput.stdout.replaceAll(nsPath, "[nsPath]") @@ -99,7 +99,7 @@ class MainNSExecNativeSuite extends AnyFunSuite { s"""src/$component/$configYaml src/$component/$configYaml $nsPathRegex/src/$component/$configYaml |src/$component $nsPathRegex/src/$component |src/$component/code\\.py $nsPathRegex/src/$component/code\\.py - |$component $component testns + |$component testns |""".stripMargin.replace("\n", " ").strip() ) assert(stderrRegex.findFirstIn(stderr).isDefined, s"\nRegex: $stderrRegex; text: \n$stderr") diff --git a/src/test/scala/io/viash/e2e/test/MainTestNativeSuite.scala b/src/test/scala/io/viash/e2e/test/MainTestNativeSuite.scala index 771d5f4a5..ff8a0ca46 100644 --- a/src/test/scala/io/viash/e2e/test/MainTestNativeSuite.scala +++ b/src/test/scala/io/viash/e2e/test/MainTestNativeSuite.scala @@ -86,7 +86,7 @@ class MainTestNativeSuite extends AnyFunSuite with BeforeAndAfterAll { checkTempDirAndRemove(testOutput.stdout, false) } - test("Check test output when no tests are specified in the functionality file") { + test("Check test output when no tests are specified in the component config") { val newConfigFilePath = configDeriver.derive("del(.test_resources)", "no_tests") val testOutput = TestHelper.testMain( "test", @@ -201,23 +201,6 @@ class MainTestNativeSuite extends AnyFunSuite with BeforeAndAfterAll { assert(testOutput.stdout.isEmpty) } - test("Check invalid platform type") { - val newConfigFilePath = configDeriver.derive(""".platforms := [{ type: "foo" }]""", "invalid_platform_type") - val testOutput = TestHelper.testMainException[ConfigParserException]( - "test", - "--engine", "native", - "--runner", "executable", - newConfigFilePath - ) - - assert(testOutput.exceptionText.get.contains("Type 'foo' is not recognised. Valid types are 'docker', 'native', and 'nextflow'.")) - assert(testOutput.exceptionText.get.contains( - """{ - | "type" : "foo" - |}""".stripMargin)) - assert(testOutput.stdout.isEmpty) - } - test("Check invalid field in runner") { val newConfigFilePath = configDeriver.derive(""".runners += { type: "executable", foo: "bar" }""", "invalid_runner_field") val testOutput = TestHelper.testMainException[ConfigParserException]( @@ -254,24 +237,6 @@ class MainTestNativeSuite extends AnyFunSuite with BeforeAndAfterAll { assert(testOutput.stdout.isEmpty) } - test("Check invalid field in platform") { - val newConfigFilePath = configDeriver.derive(""".platforms := [{ type: "native", foo: "bar" }]""", "invalid_platform_field") - val testOutput = TestHelper.testMainException[ConfigParserException]( - "test", - "--engine", "native", - "--runner", "executable", - newConfigFilePath - ) - - assert(testOutput.exceptionText.get.contains("Invalid data fields for NativePlatform.")) - assert(testOutput.exceptionText.get.contains( - """{ - | "type" : "native", - | "foo" : "bar" - |}""".stripMargin)) - assert(testOutput.stdout.isEmpty) - } - test("Check valid viash config yaml but with wrong file extension") { val newConfigFilePath = Paths.get(tempFolStr, "config.txt") Files.copy(Paths.get(configFile), newConfigFilePath) diff --git a/src/test/scala/io/viash/helpers/GitTest.scala b/src/test/scala/io/viash/helpers/GitTest.scala index 5bf8902c3..71d878c78 100644 --- a/src/test/scala/io/viash/helpers/GitTest.scala +++ b/src/test/scala/io/viash/helpers/GitTest.scala @@ -191,7 +191,7 @@ class GitTest extends AnyFunSuite with BeforeAndAfterAll { val gitTagOut1 = Exec.runCatch(List("git", "tag", "-a", "0.1.1", "-m", "first tag"), cwd = Some(tempDir)) assert(gitTagOut1.exitValue == 0, s"git tag: ${gitTagOut1.output}") - val gitTagOut2 = Exec.runCatch(List("git", "tag", "0.1.2"), cwd = Some(tempDir)) + val gitTagOut2 = Exec.runCatch(List("git", "tag", "0.1.2", "-m", "second tag"), cwd = Some(tempDir)) assert(gitTagOut2.exitValue == 0, s"git tag: ${gitTagOut2.output}") val tag1 = Git.hasTag("0.1.1", tempDir) diff --git a/src/test/scala/io/viash/helpers/IOTest.scala b/src/test/scala/io/viash/helpers/IOTest.scala index 4a5957bd5..b8db69357 100644 --- a/src/test/scala/io/viash/helpers/IOTest.scala +++ b/src/test/scala/io/viash/helpers/IOTest.scala @@ -23,7 +23,7 @@ class IOTest extends AnyFunSuite with BeforeAndAfter { test("makeTemp and deleteRecursively") { val temp = IO.makeTemp("foo") assert(Files.exists(temp) && Files.isDirectory(temp)) - assert(temp.toString.matches(".*foo[\\w]+"), "Temporary directory name should be randomized, strategy can differ between platforms.") + assert(temp.toString.matches(".*foo[\\w]+"), "Temporary directory name should be randomized, strategy can differ between engines.") IO.deleteRecursively(temp) assert(!Files.exists(temp))