#Yes, you should be able to do something
1 messages ยท Page 1 of 1 (latest)
@quartz pulsar let me know if you'd like to sync up and try that at some point ๐ I'd love to document it. We've had users doing just that.
How does one configure dagger engine to listen on a specific port so I can connect to it via TCP?
@atomic frigate I'm guessing it would be something like this but I don't know what port Dagger exposes for TCP connectivity, I assume I would also need to enable that by providing a custom engine.json to the service.
.dagger:
services:
- name: registry.dagger.io/engine:v0.18.16
alias: dagger-engine
image: alpine:latest
variables:
_EXPERIMENTAL_DAGGER_RUNNER_HOST: tcp://dagger-engine:<port>
_EXPERIMENTAL_DAGGER_CACHE_CONFIG: type=registry,mode=max,ref=${CI_REGISTRY_IMAGE}/dagger/cache:latest
before_script:
- apk add curl
- curl -fsSL https://dl.dagger.io/dagger/install.sh | BIN_DIR=/usr/local/bin sh
stages:
- test
test:
extends:
- .dagger
stage: test
script:
- dagger -m github.com/kpenfound/dagger-modules/golang@v0.2.0 call test --source=.
With the engine launch arguments, you can use --addr 0.0.0.0:1234, however the more common way to connect to an engine in kubernetes is to share the socket with the client using a shared anonymous volume. More on that here https://docs.dagger.io/ci/integrations/kubernetes and also in #kubernetes
Is there a way to use the cache locally but not have dagger export the cache?
Using _EXPERIMENTAL_DAGGER_CACHE_CONFIG="type=registry,mode=max,ref=registry.gitlab.com/jshbrntt/pipelines/dagger/cache:latest" appears to do both --cache-from and --cache-to, when I just want --cache-from locally.
yeah, basically don't set that variable and use a host cache volume for /var/lib/dagger. I think a good reference config is this argo workflows one https://docs.dagger.io/ci/integrations/argo-workflows#example
ah but for specifically registry caching, I don't think so. TBH I wouldn't rely on that because it doesn't include all of daggers cache and its flaky at best
There are the follow env vars in the dagger source so maybe just set the import one? 
_EXPERIMENTAL_DAGGER_CACHE_EXPORT_CONFIG_EXPERIMENTAL_DAGGER_CACHE_IMPORT_CONFIG_EXPERIMENTAL_DAGGER_CACHE_CONFIG
worth a shot!
Yeah it didn't appear to like that sadly. ๐
$ dagger call grep-dir --directory-arg . --pattern pipelines
โถ connect 0.4s
โผ load module: . 2.5s ERROR
โฐโโ Container.withExec(
โ args: ["codegen", "generate-module", "--output", "/src", "--module-source-path", "/src", "--module-name", "python-sdk", "--introspection-json-path", "/schema.json"]
): Container! 0.5s ERROR
! process "codegen generate-module --output /src --module-source-path /src --module-name python-sdk --introspection-json-path /schema.json" did not complete successfully: open /runtime: no such file or directory
Should work though, I'll try re-creating the engine container.
It worked. ๐