-
Notifications
You must be signed in to change notification settings - Fork 9
Added validation and docs for commands in container API#961
Open
munishchouhan wants to merge 6 commits intomaster from
Open
Added validation and docs for commands in container API #961munishchouhan wants to merge 6 commits intomaster from
munishchouhan wants to merge 6 commits intomaster from
Conversation
Signed-off-by: munishchouhan <hrma017@gmail.com>
...ing-commands-in-cran-builds
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
@munishchouhan
munishchouhan
changed the title
(削除) Added docs for commands in container API (削除ここまで)
(追記) Added validation and docs for commands in container API (追記ここまで)
Jan 13, 2026
Signed-off-by: munishchouhan <hrma017@gmail.com>
Member
Author
munishchouhan
commented
Jan 13, 2026
tested locally:
- CONDA
wave % curl --location 'http://localhost:9090/v1alpha2/container' \
--header 'Content-Type: application/json' \
--data '{
"packages": {
"type": "CONDA",
"entries": [
"dplyr",
"ggplot2",
"bioc::GenomicRanges"
],
"channels": [
"cran",
"bioconductor"
],
"condaOpts": {
"rImage": "rocker/r-ver:4.4.1",
"basePackages": "littler r-cran-docopt",
"commands": [
"apt-get update",
"apt-get install -y libcurl4-openssl-dev"
]
}
},
"format": "d",
"containerPlatform": "linux/amd64"
}'
{"message":"Invalid Docker command at index 0: 'apt-get update'. Commands must start with a valid Dockerfile instruction keyword (e.g., RUN, CMD, ENV, COPY, etc.) - Error ID: 93147f3266bc"}
- CRAN
curl --location 'http://localhost:9090/v1alpha2/container' \
--header 'Content-Type: application/json' \
--data '{
"packages": {
"type": "CRAN",
"entries": [
"dplyr",
"ggplot2",
"bioc::GenomicRanges"
],
"channels": [
"cran",
"bioconductor"
],
"cranOpts": {
"rImage": "rocker/r-ver:4.4.1",
"basePackages": "littler r-cran-docopt",
"commands": [
"apt-get update",
"apt-get install -y libcurl4-openssl-dev"
]
}
},
"format": "d",
"containerPlatform": "linux/amd64"
}'
{"message":"Invalid Docker command at index 0: 'apt-get update'. Commands must start with a valid Dockerfile instruction keyword (e.g., RUN, CMD, ENV, COPY, etc.) - Error ID: 26fba02a4f2e"}
ewels
ewels
approved these changes
Jan 13, 2026
Member
@ewels
ewels
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Updated TypeSpec API definitions and documentation to clarify that the commands field in CranOpts, CondaOpts, and PixiOpts requires valid Dockerfile instruction keywords
(e.g., RUN, CMD, ENTRYPOINT, USER).
Changes
wave-utils/src/main/java/io/seqera/wave/util/DockerHelper.java):validateCommands(List<String>)method to validate command listsisValidDockerCommand(String)method to check individual commandsgetValidKeywords()method to expose the set of valid keywordsFROM,RUN,CMD,LABEL,EXPOSE,ENV,ADD,COPYENTRYPOINT,VOLUME,USER,WORKDIR,ARG,ONBUILDSTOPSIGNAL,HEALTHCHECK,SHELL^\\s*([A-Z]+)\\b) to extract and validate keywordsIllegalArgumentExceptionwith detailed error message including command indexIntegration Points
CranHelper (
src/main/groovy/io/seqera/wave/util/CranHelper.groovy):addCommandsmethod to callDockerHelper.validateCommands()TemplateUtils (
src/main/java/io/seqera/wave/util/TemplateUtils.java):addCommandsmethod to callDockerHelper.validateCommands()Test Coverage
DockerHelperTest (
wave-utils/src/test/groovy/io/seqera/wave/util/DockerHelperTest.groovy):CranHelperTest (
src/test/groovy/io/seqera/wave/util/CranHelperTest.groovy):TemplateUtilsTest (
src/test/groovy/io/seqera/wave/util/TemplateUtilsTest.groovy):Examples Updated
Before (would cause Docker build error)
{ "cranOpts": { "commands": ["apt-get update"] } }After (valid)
{ "cranOpts": { "commands": [ "RUN apt-get update", "ENV MY_VAR=value", "USER root", "WORKDIR /app" ] } }