#with_exec broken after update to v0.18.16

1 messages · Page 1 of 1 (latest)

languid tangle
#

Hello, we have updated our system to v.0.18.16 and we started to notice that with_exec function is acting in a different way then before, we were running on v.0.13.x before but I didn't see any breaking changes on the changelogs.
This is a code example to reproduce the error:

@function
async def helm(self) -> Container:
result = dag.container().from_(f"alpine/helm:3.15.3")
result = result.with_exec(["apk", "update"])
return result

When it gets to execute the "apk update" now the "helm" command is prepend to it becoming "helm apk update" making the call invalid and throwing an error, I tried to execute it as a shell command using ["sh", "-c", "apk", "update"] as arguments but I get the same result.
Any help?

Thanks!

median whale
languid tangle
#

It worked! Thanks.
@median whale So now if we modify the container running some command that are not entrypoint related we have to pass that paramenter to every with_exec function? Is there a way to set it by default on a Container?

median whale
#

Not that I'm aware of. The intention is that there's no hidden prepending/omitting entrypoints, they're present by default unless you specify otherwise.

thick mirage
hexed trellis
#

This doesn't make sense to me. Currently entrypoint is skipped by default unless you are running a container with an entrypoint with no modifications as a service (convenience for webservers, DBs, etc)

#

For example:

▶ container | from nginx | entrypoint
/docker-entrypoint.sh

▶ container | from nginx | default-args
nginx
-g
daemon off;

▼ container | from nginx | with-exposed-port 80 | as-service | up 8.2s
╰─▼ Service.up: Void 8.2s
  ┃ 14:49:02 INF tunnel started port=80 protocol=tcp http_url=http://localhost:80 description="tun
  ┃ 0.0.0.0:80 -> f0hct3vcgk0su.c21dk5re33gvu.dagger.local:80"
#

so, in your case:

▶ container | from "alpine/helm:3.15.3" | entrypoint
helm

▶ container | from "alpine/helm:3.15.3" | default-args
--help

▶ container | from "alpine/helm:3.15.3" | with-exec "apk","update" | stdout
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/aarch64/APKINDEX.tar.gz
v3.20.7-46-g4cba8526e90 [https://dl-cdn.alpinelinux.org/alpine/v3.20/main]
v3.20.7-40-g98a72a54737 [https://dl-cdn.alpinelinux.org/alpine/v3.20/community]
OK: 24067 distinct packages available
#

Here 👆 helm is skipped by default and NOT prepended to the with_exec.

▶ version
v0.18.16
hexed trellis
median whale
#

Huh, odd. Seemed like Dagger was prepending the entrypoint and it just needed to be told not to in this case. Potential bug?

hexed trellis
#

I'm wondering if @languid tangle had an old engine or old CLI going...NO, I can't get the 0.13.7 CLI working with 0.18.16 Engine or vice versa (that's by design), so unsure what's going on.

Maybe a Dagger package/lib version?

@languid tangle maybe you're not using Dagger Modules?

or maybe you eventually run the container as a service ? In that case, the last with_exec used to be run, but that changed. 👈 ⭐

Otherwise, 0.13.7, works that same as 0.18.16 if it's just a with_exec:

./bin/dagger core container from --address "alpine/helm:3.15.3" with-exec --args "apk","update" stdout
curl -fsSL https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.13.7 sh

./bin/dagger version
dagger v0.13.7 (registry.dagger.io/engine:v0.13.7) darwin/arm64

docker ps
CONTAINER ID   IMAGE                               COMMAND                  CREATED         STATUS         PORTS     NAMES
f5e368127904   registry.dagger.io/engine:v0.13.7   "dagger-entrypoint.s…"   3 minutes ago   Up 3 minutes             dagger-engine-v0.13.7
median whale