#run engine locally

1 messages ยท Page 1 of 1 (latest)

arctic dew
#

You can find it here:

docker ps -a
CONTAINER ID   IMAGE                          COMMAND               CREATED        STATUS        PORTS     NAMES
189724a917eb   moby/buildkit:v0.10.5          "buildkitd --debug"   2 hours ago    Up 2 hours              dagger-buildkitd
aa4975eea72e   ghcr.io/dagger/engine:v0.3.4   "buildkitd --debug"   15 hours ago   Up 15 hours             dagger-engine-666b958a2f716c0d
#

So, if I understand properly, you want to tweak it for a PR ?

median obsidian
#

Nothing set yet, I'm just trying to run the engine locally with Go but without documentation for running things locally it's tricky to know what to do.

Can I do a docker build -t <WHATEVER> . && docker run -t <WHATEVER> in the root of the project?

Or how would I run this for example? What's the expected flow for the command line arguments it's asking for https://github.com/dagger/dagger/blob/2126901e1ea76a6d861b62a9ef5ab09a4cc66eb7/cmd/dagger/main.go#L42

I also tried to do mage engine:dev in the root of the project but that fails:

Error: buildkit failed to respond
Error: EOF
Please visit https://dagger.io/help#go for troubleshooting guidance.
GitHub

A programmable CI/CD engine that runs your pipelines in containers - dagger/main.go at 2126901e1ea76a6d861b62a9ef5ab09a4cc66eb7 ยท dagger/dagger

arctic dew
#

Actually, the engine architecture has been changing a lot lately: https://github.com/dagger/dagger/pull/3913. It's a part that is not documented for the moment, as, even though the API is quite stable, this part might change a lot.

From our cloned repo, do

  1. ./hack/make engine:dev
  2. That should give you a export DAGGER_HOST=โ€ฆ command to run in order to use the dev engine

Now, to use a different version of the Go SDK, against this engine

  1. to use the updated Go SDK in your project, add to your go.mod: replace dagger.io/dagger => <path to dagger repo>/sdk/go

Link: #1031785076029128784 message

median obsidian
#

Oh I see if I do this I can get the playground to start ๐Ÿ‘€

arctic dew
median obsidian
#

Doesn't work, it times out saying buildkit failed to respond

#

Can I run the engine without an SDK? I'm focusing on modifying the internals initially

#

My docker run command seems to work, but if there's a better option let me know as I'm no Go expert

arctic dew
arctic dew
#

Do you have ideas on contributions ? Internal changes need close sync-up with maintainers. Do not hesitate to make issues / draft PRs prior going into work that might become hardly mergeable if not in context with long-term vision on engine architecture

median obsidian
#

Private registry support. I had a convo with Solomon about it a couple of days ago.

Yeah It'll just be a draft PR/hack if I'm lucky ๐Ÿ˜„

#

Out of interest, how is this different to the docker run command I posted?

arctic dew
#

It wouldn't have taken all the changes into account ๐Ÿ˜‡

median obsidian
#

thinkies I will try and update the Dockerfile then

arctic dew
median obsidian
#

Unfortunately the engine:dev step fails the second time around

: exit status 1```
#

Ah I know what it is, if the DAGGER_HOST is set but there's no image it borks.

median obsidian
#

~~I'm getting strange results when running the engine locally and pointing my go.mod file at a local copy of the Go SDK.

  • If I use the publish v0.4.0 of the dagger go sdk, it complains with x509 certificate signed by unknown authority
  • If I point it at the local SDK, it does not complain at all. Initially I assumed someone had just beaten me to a fix, but it's because it fails silently i.e. the image is not exported to the private registry

Is the engine:dev command going down a different code path to the published version or am I doing something dumb here?~~

Nvm fixed