-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Componentisation has gone too far. #19957
Comments
@jhowardmsft agreed - and mentioned it here: docker/engine-api#65 (comment) In addition to what you mentioned, the spit at the repo level forces a duplication of testing too - and a lot of work to "mock" things. This extra "mocking" effort ends up 1) being a lot of wasted effort when the real data is available to us if we just used docker itself, and 2) gives us a false sense of security because we only end up verifying the most basic cases and miss the unplanned interactions of a real live daemon. And if the answer there is "we'll catch those when we vendor it into the engine", then we should just move it back to the engine now because then its not really as independent as we claim since it can't be truly tested on its own. With go's import/pkg system there's really no reason (at this time) not to keep it with the engine and let people import it if they want just that bit. If at some point the engine-api (and the go-builder repo too) are really stand-alone and can be fully run/tested w/o the engine, then I think we can reconsider this but right now its just pain with no real gain. I don't see what we get by being in a different repo that we can't do in a pkg (aside from a different set of maintainers, which IMO isn't necessarily a good thing since the apis & builder are so related to the engine anyway). |
This is an important discussion to have, I'll share my current feelings.
Yes, that is absolutely true: it makes it harder on the Engine. But the reasoning behind this decision is that Engine is not alone anymore. Tons of projects out there use the Docker API, both outside (Rancher, CI systems, ...), and inside Docker (Swarm, Compose, ...). One of the most recurring criticism against the project is that the API changes too much, sometimes for no good reason. Having a reference API implementation that is upstream from all products seems like a sane thing to do: we can discuss changes to the API independently of any particular product, and when such changes are approved, all clients stand on equal ground and can manage their own related patches. What we are experiencing on Engine right now is what every other project out there has been experiencing forever. We made it worse on Engine, to make it better for everybody else.
I honestly wonder how much more stable would the API be if it hadn't been so trivial to change, including by mistake (!), through the Engine codebase. I think it's worth considering that maybe nothing is stable because there is no technical incentive for it to be.
This statement is Engine centric: what about all the other clients depending on the API today?
Do you think anybody is happy having those repositories untested? The only reason there are no tests is because nobody had time, and the fact that it's issue docker/engine-api#1 makes it pretty clear how much we think it matters. It's extremely ironic for a maintainer to complain that something is missing. I'm just going to conclude this way. Am I convinced that a separate repository is a better idea than a sub |
On Feb 3, 2016, at 12:07 PM, Arnaud Porterie notifications@github.com wrote:
See comment below about “API changes too much”.
|
Let's ask actual & potential users: ping @vieux @aluzzardi @ibuildthecloud @justincormack @ehazlett @donhcd @dnephin @vdemeester. |
I think the split into engine-api is actually working extremely well. It's forcing us to consider API changes in isolation, which leads to more consistent and well thought out API design. It allows other projects which depend on the API to watch for changes and contribute feedback without the torrent of implementation-related changes in the engine. We've just started this process, so I think it's normal there are some pain points. We should work on addressing them directly instead of abandoning the idea entirely.
+100 Most of the issues I see here I think can be fixed with some better tooling.
integration-cli tests are part of the problem. If you test from the client you completely miss any API regressions. The client can cover up unexpected api changes. The end-to-end tests for engine should really be using the API directly, not the cli. engine-api is a special case. You don't test an interface by testing its implementation. I think the relevant tests for an interface are:
The first two can be verified without any implementation, and the last can't be verified without every implementation, so can't be verified in engine either (each implementation is responsible for testing itself). Testing of packages like
I think it makes a big difference. When you look at API changes as a set of 20+ other file changes it's easy to miss problems. You're focused on too many things at once. If you look at API changes in the context of "the api repo" and there are only 2 or 3 file changes, it's much easier to focus on the API design, and not get lost in the implementation changes. It also makes it possible for other projects who depend on the API to be involved, because watching the
If we went with this approach it would never be extracted. In order to make any progress on this we need to pull it out and start severing the ties early. It's painful at first, but it gives us a chance to identify the pain points and create the right tooling to address it. Keeping it in the engine means the pain points are only felt by those outside the engine team, which aren't in a position to fix them. I personally think this split out is long overdue, not premature. |
Also I saw that @bobrik used engine-api for his project. |
Note too that once the server api is moved out things should be less painful since the API change happens in one place, vendor-in and update the implementation only. I agree it's certainly been more painful, however I think in the long run it's a huge benefit to all projects involved and will help interoperability. |
Swarm maintainer here, I am very happy about the When swarm-1.1.0-rc1 was released, it was incompatible with Hopefully we had time to fix during our "code freeze" period, but it's really not ideal.
|
Well almost everything I wanted to say has been said, either by @icecrime or @dnephin 😻.
+1000
I couldn't agree more. That's a thought that is turning and turning in my head (both for The
In short, I agree it appears a little bit more painful but in the long run, I really think it's gonna pay of ! |
@vdemeester in fact, we should probably use the engine-api client in our tests too unless necessary to use the binary client. The client itself has to be tested to make sure it does the right api calls. |
Coming from using a third party Go client I'm a huge +1 for this. It's very painful to try and keep up with the change (types and lack of support for X in the third party, etc). Having a single client that is always in step reduces a tremendous amount of maintenance burden. |
API testing and integration-cli testing are two different things. Before integration-cli, we only had API testing and testing done using internal APIs. Tests were passing and we still had lots of regressions between Docker versions. I don't see API based tests deprecating integration-cli. I think these separate repositories have been useful when some projects had to evolve rapidly (libnetwork and distribution), but it's also a problem for projects which use these. I don't think we should merge these back in to the main repository for now, but we need to make sure we don't cause problems for downstream users of these packages and that we avoid problems for those who use them. |
Definitely, I didn't mean to suggest that integration-cli was completely unnecessary. It's still important to have some tests that cover the client behaviour, I was just suggesting that engine behaviour should be tested at the API level. There have been major regressions because of a lack of API level testing. I was trying to suggest that having tests at different boundaries isn't test duplication, it's a necessity for complete test coverage. |
There are good use cases for engine-api, as outlined above. But please do file issues for enabling Windows CI where it is not being run, and for "testing X is too difficult", these are definitely issues that need fixing. |
Just random two cents. The engine-api project immensely helps us (Rancher). If it is a separate project as in Another thing about separating repos is that because you have to change in two places and coordinate it makes people think a lot more about the impact. This may have an advantage in that I feel like the API often changes too rapidly and people to easily break backwards compatibility. |
engine-api has been moved back in, so I'll close this issue, but as always, feel free to comment |
While I agree that making clearly delineated separation between components is good, the approach that has gone on in the past few months is severely hindering ongoing development and bug-fixing of the docker engine.
I concur that certain components make perfect sense to be in independent, such as libcontainer or libnetwork. But for other components,
engine-api
for example being the latest I hit today, IMO it simply makes it harder to develop changes/bug fixes to the engine for reasonably little gain. As it stands as I type, it is not even possible to build the docker engine with the latest engine api - it's not in a state that can be vendored in and compiled. That makes issues such as #18077 (comment) almost impossible to fix in the current code base.My suggestion is to keep separation at the pkg/ level, rather than fracturing out into so many distinct repos. The current design philosophy makes submitting changes incrementally hard and onerous, and I'm far from convinced that this level of componentisation is worth the advantages. It sets the the learning curve bar for new contributors at 'extreme'. And 'complicated++' for relatively seasoned ones.
It also (in the current CI world where Windows CI is only enabled on docker/docker) is prone to increased error possibilities. We should try to make this easy for everyone, not overly complicate things.
Componentisation to separate repos makes sense if the overall code base were stable. However, this remains far from the case with the level of changes going through daily and weekly.
Please discuss 😄
@shykes @docker-maintainers @thaJeztah @friizm @icecrime
The text was updated successfully, but these errors were encountered: