Skip to content

Commit

Permalink
Revert "Add support for Pip packages (experimental)"
Browse files Browse the repository at this point in the history
This reverts commit 3bced2f.
  • Loading branch information
pditommaso committed Feb 4, 2024
1 parent 8875dd9 commit 97f58f5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 212 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ that it can be used in your Docker (replace-with-your-own-fav-container-engine)

* Build container images on-demand for a given container file (aka Dockerfile);
* Build container images on-demand based on one or more [Conda](https://conda.io/) packages;
* Build container images on-demand based on one or more [Spack](https://spack.io/) packages (experimental);
* Build container images on-demand based on one or more Pip packages (experimental);
* Build container images on-demand based on one or more [Spack](https://spack.io/) packages;
* Build container images for a specified target platform (currently linux/amd64 and linux/arm64);
* Push and cache built containers to a user-provided container repository;
* Build Singularity native containers both using a Singularity spec file, Conda package(s) and Spack package(s);
* Push Singularity native container images to OCI-compliant registries;

### Installation


#### Binary download

Download the Wave pre-compiled binary for your operating system from the
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repositories {

dependencies {
implementation 'io.seqera:wave-api:0.6.0'
implementation 'io.seqera:wave-utils:0.10.0'
implementation 'io.seqera:wave-utils:0.9.0'
implementation 'info.picocli:picocli:4.6.1'
implementation 'com.squareup.moshi:moshi:1.15.0'
implementation 'com.squareup.moshi:moshi-adapters:1.14.0'
Expand Down
36 changes: 4 additions & 32 deletions app/src/main/java/io/seqera/wave/cli/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
import static io.seqera.wave.util.DockerHelper.addPackagesToSpackFile;
import static io.seqera.wave.util.DockerHelper.condaFileFromPackages;
import static io.seqera.wave.util.DockerHelper.condaFileFromPath;
import static io.seqera.wave.util.DockerHelper.condaFileFromPipPackages;
import static io.seqera.wave.util.DockerHelper.condaFileToDockerFile;
import static io.seqera.wave.util.DockerHelper.condaFileToSingularityFile;
import static io.seqera.wave.util.DockerHelper.condaPackagesToDockerFile;
Expand Down Expand Up @@ -149,12 +148,9 @@ public class App implements Runnable {
@Option(names = {"--conda-file"}, paramLabel = "''", description = "A Conda file used to build the container e.g. /some/path/conda.yaml.")
private String condaFile;

@Option(names = {"--conda-package", "--conda"}, paramLabel = "''", description = "One or more Conda packages used to build the container e.g. bioconda::samtools=1.17.")
@Option(names = {"--conda-package"}, paramLabel = "''", description = "One or more Conda packages used to build the container e.g. bioconda::samtools=1.17.")
private List<String> condaPackages;

@Option(names = {"--pip-package", "--pip"}, paramLabel = "''", description = "One or more Pip packages used to build the container e.g. numpy.")
private List<String> pipPackages;

@Option(names = {"--conda-base-image"}, paramLabel = "''", description = "Conda base image used to to build the container (default: ${DEFAULT-VALUE}).")
private String condaBaseImage = CondaOpts.DEFAULT_MAMBA_IMAGE;

Expand All @@ -167,7 +163,7 @@ public class App implements Runnable {
@Option(names = {"--spack-file"}, paramLabel = "''", description = "A Spack file used to build the container e.g. /some/path/spack.yaml.")
private String spackFile;

@Option(names = {"--spack-package", "--spack"}, paramLabel = "''", description = "One or more Spack packages used to build the container e.g. cowsay.")
@Option(names = {"--spack-package"}, paramLabel = "''", description = "One or more Spack packages used to build the container e.g. cowsay.")
private List<String> spackPackages;

@Option(names = {"--spack-run-command"}, paramLabel = "''", description = "Dockerfile RUN commands used to build the container.")
Expand Down Expand Up @@ -284,7 +280,7 @@ protected void validateArgs() {
if( !isEmpty(image) && !isEmpty(containerFile) )
throw new IllegalCliArgumentException("Argument --image and --containerfile conflict each other - Specify an image name or a container file for the container to be provisioned");

if( isEmpty(image) && isEmpty(containerFile) && isEmpty(condaFile) && isEmpty(condaPackages) && isEmpty(spackFile) && isEmpty(spackPackages) && isEmpty(pipPackages) )
if( isEmpty(image) && isEmpty(containerFile) && isEmpty(condaFile) && condaPackages==null && isEmpty(spackFile) && spackPackages ==null )
throw new IllegalCliArgumentException("Provide either a image name or a container file for the Wave container to be provisioned");

if( freeze && isEmpty(buildRepository) )
Expand All @@ -309,25 +305,6 @@ protected void validateArgs() {
if( condaPackages!=null && !isEmpty(containerFile) )
throw new IllegalCliArgumentException("Option --conda-package and --containerfile conflict each other");

// -- check pip options
if( pipPackages!=null && !isEmpty(image) )
throw new IllegalCliArgumentException("Option --pip-package and --image conflict each other");

if( pipPackages!=null && !isEmpty(containerFile) )
throw new IllegalCliArgumentException("Option --pip-package and --containerfile conflict each other");

if( pipPackages!=null && condaPackages!=null )
throw new IllegalCliArgumentException("Option --pip-package and --conda-package conflict each other");

if( pipPackages!=null && spackPackages!=null )
throw new IllegalCliArgumentException("Option --pip-package and --spack-package conflict each other");

if( pipPackages!=null && !isEmpty(condaFile) )
throw new IllegalCliArgumentException("Option --pip-package and --conda-file conflict each other");

if( pipPackages!=null && !isEmpty(spackFile) )
throw new IllegalCliArgumentException("Option --pip-package and --spack-file conflict each other");

// -- check spack options
if( !isEmpty(spackFile) && spackPackages!=null )
throw new IllegalCliArgumentException("Option --spack-file and --spack-package conflict each other");
Expand Down Expand Up @@ -571,7 +548,7 @@ protected String containerFileBase64() {
return encodePathBase64(containerFile);
}

if (!isEmpty(condaFile) || !isEmpty(condaPackages) || !isEmpty(pipPackages) ) {
if (!isEmpty(condaFile) || !isEmpty(condaPackages)) {
String result;
final String lock = condaLock();
if (!isEmpty(lock)) {
Expand Down Expand Up @@ -610,11 +587,6 @@ else if (!isEmpty(condaPackages) && isEmpty(condaLock())) {
final Path path = condaFileFromPackages(packages, condaChannels());
return path != null ? encodePathBase64(path.toString()) : null;
}
else if( !isEmpty(pipPackages) ) {
final String packages = pipPackages.stream().collect(Collectors.joining(" "));
final Path path = condaFileFromPipPackages(packages);
return path != null ? encodePathBase64(path.toString()) : null;
}
else
return null;
}
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/resources/io/seqera/wave/cli/usage-examples.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ Examples:
# Build a container based on Conda lock file served via prefix.dev service
wave --conda-package https://prefix.dev/envs/pditommaso/wave/conda-lock.yml

# Build a container based on Conda packages
wave --pip-package numpy --pip-package pandas

# Build a container based on Spack packages
wave --spack-package cowsay

Expand Down
174 changes: 0 additions & 174 deletions app/src/test/groovy/io/seqera/wave/cli/AppPipOptsTest.groovy

This file was deleted.

0 comments on commit 97f58f5

Please sign in to comment.