Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Docker setup is not failing when a package can not be found #770

Open
2 tasks done
DriesSchaumont opened this issue Sep 24, 2024 · 2 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@DriesSchaumont
Copy link
Contributor

DriesSchaumont commented Sep 24, 2024

What happened?

During installation R package that does not exist, I encountered an issue where this error was not reported during build.

Steps to reproduce

mkdir -p /tmp/test_bug
cd /tmp/test_bug
cat > _viash.yaml << 'HERE'
viash_version: 0.9.0

source: src
target: target
HERE

mkdir -p src/dummycomponent

cat > src/dummycomponent/config.vsh.yaml << 'HERE'

name: myscript
namespace: "dummycomponent"
resources:
  - type: r_script
    path: script.r
    text: |
      print("OK!")
engines:
  - type: docker
    image: bioconductor/bioconductor_docker:latest
    setup:
      - type: r
        cran:
          - thisisarandompackagethatdoesnotexist
runners:
  - type: executable
HERE

viash ns build --setup cb
./target/executable/dummycomponent/myscript/myscript ---setup build ---verbose

Expected behavior

Because thisisarandompackagethatdoesnotexist is not a cran package, the installation should report a failure.

Relevant log output

viash ns build --setup cb
./target/executable/dummycomponent/myscript/myscript ---setup build ---verbose
Exporting myscript (dummycomponent) =executable=> /tmp/test_bug/target/executable/dummycomponent/myscript
[notice] Building container 'dummycomponent/myscript:latest' with Dockerfile
All 1 configs built successfully
[notice] Building container 'dummycomponent/myscript:latest' with Dockerfile
[info] docker build -t 'dummycomponent/myscript:latest' --no-cache '/tmp/test_bug/target/executable/dummycomponent/myscript' -f '/tmp/dockerbuild-myscript-t8y0CU/Dockerfile'
[+] Building 1.2s (6/6) FINISHED                                                                                                                                                                                 docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                       0.0s
 => => transferring dockerfile: 489B                                                                                                                                                                                       0.0s
 => [internal] load metadata for docker.io/bioconductor/bioconductor_docker:latest                                                                                                                                         0.2s
 => [internal] load .dockerignore                                                                                                                                                                                          0.0s
 => => transferring context: 2B                                                                                                                                                                                            0.0s
 => CACHED [1/2] FROM docker.io/bioconductor/bioconductor_docker:latest@sha256:ad30b4df65b18a98dc04a234e270ac0f55c1c72a8feac6f2d8e72973a44b5bd6                                                                            0.0s
 => [2/2] RUN Rscript -e 'if (!requireNamespace("remotes", quietly = TRUE)) install.packages("remotes")' &&   Rscript -e 'remotes::install_cran(c("thisisarandompackagethatdoesnotexist"), repos = "https://cran.rstudio.  0.8s
 => exporting to image                                                                                                                                                                                                     0.1s
 => => exporting layers                                                                                                                                                                                                    0.0s
 => => writing image sha256:127ba9e52bae6895ff3d4a98df7de95c669cadf1e436d874e638d122f4f51782                                                                                                                               0.0s
 => => naming to docker.io/dummycomponent/myscript:latest

Version

  • viash 0.9.
  • OS: Ubuntu 24.04

Possible solution

I think the exit code from the build is not propagated.

Confirmation

  • I have searched the existing issues to make sure this is not a duplicate.
  • I have provided clear and concise information about the bug.

Additional context

No response

@DriesSchaumont DriesSchaumont added the bug Something isn't working label Sep 24, 2024
@Grifs
Copy link
Collaborator

Grifs commented Sep 24, 2024

Seems like a duplicate of #629

@DriesSchaumont
Copy link
Contributor Author

Seems like a duplicate of #629

It is I think! I looked through the items listed as bugs, but #629 seems to be labeled as a feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants