viash-io / viash

script + metadata = standalone component
https://viash.io
GNU General Public License v3.0
39 stars 2 forks source link

[BUG] Setting Docker registry results in inconsistent docker names during tests #678

Closed Grifs closed 7 months ago

Grifs commented 7 months ago

What happened?

When setting the .links.docker_registry in viash [ns] test results in inconsistent docker image names. TBD if this is actually an issue but it feels like one.

Steps to reproduce

config.vsh.yaml

name: foo
resources:
- type: bash_script
  text: "echo foo"
links:
  docker_registry: "ghcr.io"
test_resources:
- type: bash_script
  text: |
    $meta_executable
    echo bar
engines:
- type: docker
  image: bash

viash test config.vsh.yaml

Running tests in temporary directory: '/tmp/viash_test_foo14269862776129916982'
====================================================================
+/tmp/viash_test_foo14269862776129916982/build_engine_environment/foo ---verbosity 6 ---setup cachedbuild ---engine docker
[notice] Building container 'ghcr.io/foo:test' with Dockerfile
[info] docker build -t 'ghcr.io/foo:test'  '/tmp/viash_test_foo14269862776129916982/build_engine_environment' -f '/tmp/viash_test_foo14269862776129916982/build_engine_environment/tmp/dockerbuild-foo-SiEMIC/Dockerfile'
#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 276B done
#1 DONE 0.0s

#2 [internal] load metadata for docker.io/library/bash:latest
#2 DONE 0.0s

#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s

#4 [1/1] FROM docker.io/library/bash:latest
#4 CACHED

#5 exporting to image
#5 exporting layers done
#5 writing image sha256:d07a18ab09dc1cf615f373868868a7192666a3948aadef4e93476449e965ce07 done
#5 naming to ghcr.io/foo:test 0.0s done
#5 DONE 0.0s

====================================================================
+/tmp/viash_test_foo14269862776129916982/test_script/test_executable
foo
bar
====================================================================
SUCCESS! All 1 out of 1 test scripts succeeded!
grep "VIASH_DOCKER_IMAGE_ID=" /tmp/viash_test_foo14269862776129916982/test_script/test_executable 
    VIASH_DOCKER_IMAGE_ID='foo:test'
grep "VIASH_DOCKER_IMAGE_ID=" /tmp/viash_test_foo14269862776129916982/build_engine_environment/foo 
    VIASH_DOCKER_IMAGE_ID='ghcr.io/foo:test'

Expected behavior

The docker image names in build_engine_environment and test_script are identical

Relevant log output

No response

Version

Viash 0.9.0-RC2

Possible solution

No response

Confirmation

Additional context

No response

Grifs commented 7 months ago

Fixed in Viash 0.9.0-RC3