#API inconsistency with AsService using
1 messages Β· Page 1 of 1 (latest)
I was discussing with @manic mist and it would makes sense to tie this one to the 0.14 release. Would anyone have room for the implementation? @radiant dune @echo summit @thin yarrow @night stratus ?
specifically the "part 1" described in this comment: https://github.com/dagger/dagger/issues/8140#issuecomment-2450747681
I can take on the first part π
When are we targeting 0.14 release
Friday
Hi Sam/Solomon, I am still verifying the test cases (a few are hanging) but I wanted to share the changes so far to ensure that I am moving in the right direction and that changes are not very different from what you were expecting:
https://github.com/dagger/dagger/compare/main...rajatjindal:dagger:service-entrypoint?expand=1
opened a draft PR, its only brute force changes so far. https://github.com/dagger/dagger/pull/8865
cc @echo summit @radiant dune (won't ping Erik and Justin since they are on vacation)
Are all the options from withExec necessary?
@echo summit see the discussion about that in the issue: https://github.com/dagger/dagger/issues/8140#issuecomment-2460258842
same problem we had with Terminal.
it would be a subset of args from withExec. e.g. I am thinking we may not need ExperimentalPrivilegedNesting and NestedExecMetadata but most others seems reasonable to add to the new api.
We definitely do need those
Oh sorry the first one we need
the second, I don't even know what that is
// (Internal-only) If this is a nested exec, exec metadata to use for it
NestedExecMetadata *buildkit.ExecutionMetadata name:"-"
that is the comment from code ^^
It doesn't seem to be visible to regular clients. I have no idea what it is or how it works, so I'll just ignore it π
Yes, you only need those exposed to the client so you can pass them to withExec.
π okay, sounds good. so I will add these changes and try running integration tests. I am hoping those will help us identify other scenarios that we might not have considered yet.
I'm starting to feel like we have an API mess to cleanup... Lots of duplication between "execute a command and return"; "execute an interactive shell and return"; "execute a long-running service";
@manic mist, without a lot of background (and experience) on why some decisions were made in dagger, I would expect a lot of these to work like how they work in Docker (while I understand its a different frontend for buildkit). is that expectation not correct?
Buildkit doesn't have an API for interactive terminals or long-running services, so that part of the Dagger API is a superset of the buildkit API)
right but coming from an enduser perspective (who has past experience using Docker), the long-running service in dagger should behave similar to docker run.... and interactive terminal should behave similar to docker exec/run -it...... - right?
For API or CLI?
The problem with Docker is that those two experiences are nothing alike..
Because Dagger promises an API-first design, with the CLI being just another API client, we have an additional constraint. With Docker we didn't have this constraint. We made it a CLI tool only in the beginning. Then later added a very basic REST API that is not powerful enough for our use cases.
I agree it would be nice to have a more direct equivalent from the most familiar Docker commands, to the equivalent Dagger commands.
thank you for the additional context.
I'll continue on these changes and will try to make PR reviewable by tomorrow.
@night stratus do you have a specific idea in mind for making Dagger more familiar to Docker users? If so I'm interested in hearing it!
(one thing that might help indirectly, is making our core types interfaces, which we talked about doing. This would create more flexibility. For example the same object could "be" a container and "be" a service)
I really love the idea of writing reusable code for managing docker images and local setups. As someone who has written a lot of dockerfiles and docker-compose files, i want to explore how i can use dagger for local env setup without a lot of hacky scripts etc.
I recently migrated one of my project to start using dagger for local dev env, (ui, db and backend components), i do miss the βwatchβ functionality
Next i want to try dagger for a complex env setup. Eg in my last job i was managing a docker compose setup that used services from 10-12 different services. (And have seen multiple such projects in past) I want to see if dagger can help with that kind of usecase.
But having the ability to rebuild and restart just one service is imp for that kind of setup and i am not entirely sure if that kind of usecase is a good use of dagger but i do want to try it out π
cc @runic gust π
I have seen a project as Cisco (via a friend) that uses golang + templating to generate dynamic docker compose files for local env spin up
Yeah that is very common, and definitely a problem Dagger can solve (or should be able to solve)
@night stratus do you think of Dagger as a replacement, or possible replacement, for Docker itself? That topic keeps coming up.
I mostly run my personal services on Kubernetes, and use docker for building and pushing images, so yes i think dagger can replace docker for my limited usecase.
One other thing i really miss (probably due to my lack of understanding of some parts of dagger api) is that i can check what containers are currently running and exec into a running container. A βdagger psβ and βdagger execβ command could be useful for debugging usecases
Also helps bridge the gap for someone coming from docker background
I was thinking to do something hacky with dagger + nsenter
cc @runic gust @tawdry saffron π π
I have another question regarding these changes. When starting service, why are we keeping default value of UseEntrypoint as false. I would think we should keep it as true (the same default as Docker and our earlier AsService implementation).
I am asking this question as I am adjusting some tests in our integration suite to add UseEntrypoint: true to make them work
Short answer: we want to discourage people on using entrypoints.
The reason it's unwanted is because it's a legacy Dockerfile thing that stuck, and doesn't make sense in Dagger. So we only support it for compatibility reasons but we'd prefer if people move off of it, especially if building containers via Dagger instead of a Dockerfile. By defaulting to false we make it more explicit when the entrypoint is required.
ππ» got it, thnx
to update on progress here: The changes are done, but there are existing test cases which are failing. I am chasing down the failures and fixing them.
@fleet dome
relaying this from @lapis goblet as a wrap up comment from yesterday's exchage:
to really get this working in 0.14, I'd either use-entrypoint or I'd add stuff to make up for some of the things in the docker-entrypoint.sh. Maybe some with-execs ...not sure how many needed. Would def make it more explicit.
just had a quick sync with @night stratus and he'll try to squeeze this in (get the PR in a green state) for today's 0.14 release with the modification of UseEntrypoint being default true for the case of services.
cc @magic pasture. @manic mist @echo summit @lapis goblet. So we can have one last ack before merging.
no ack... we spent an hour discussing this to get consensus, no last minute changes on the side please.
I wasn't there for the whole thing, so I missed quite a bit. What's the reason for flipping the entrypoint default? I know it's related to docker images like databases using it, but not entirely clear why the need to not make it explicit.
also there is no rush on merging for the release
ok, we're holding this one off then
the only "rush" would be getting the services API in a good state while taking advantage of an API breaking release
but if we're ok with postponing to 0.15 then SGTM!
happy to keep discussing about this after out last exchange in yesterday's team meeting cc @lapis goblet as you were leading that discussion π
well I would prefer to get the change in 0.14 if we can. But not with a last minute change without discussion
π. A misundertanding from my end then. I had the impression that after our exchange yesterday and Jeremy's comments that in order to avoid friction with the default docker ecosystem behavior we wanted to have the UseEntrypoint flag turned to true for services. So I told rajat that we could leave the PR in a ready state in case this was the final decision. π
Let's try to discuss it today with some of the people from the original decision? Ideally @fleet dome @lapis goblet we would have asked you from the beginning.
Yeah, ping me.
i just want to avoid "split brain" in the design
@echo summit @radiant dune do you mind if we take a few minutes to discuss this with @lapis goblet and @fleet dome ? I just freed up
π
Yep
OK cool, joining dev-audio then
@dense flame @night stratus feel free to join if you're around and interested (since I see you on the thread)
will join in a sec, in another call