Skip to content
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

Fix for using the official mysql image in composite stacks #3049

Merged
merged 3 commits into from
Dec 20, 2016

Conversation

kaloyan-raev
Copy link
Contributor

What does this PR do?

As discussed in #2991 Che has a problem running the official mysql docker image and works the issue around by crafting a custom codenvy/mysql.

I investigated the issue and found that Che is passing empty arrays for the command and the entrypoint parameters of the /containers/create Docker API method. This overrides the default entrypoint and command of the mysql docker image, which leads to failure during the container startup. Instead of passing empty arrays for these parameters, Che should leave them as null in the Java config object. This way the command and the entrypoint properties won't be included in the serialized JSON object passed to the Docker API, and the mysql container will be started with the correct entrypoint and command.

In the second commit I modify the Java-MySQL stack to use the original mysql docker image.

What issues does this PR fix or reference?

Dockerfile for the codenvy/mysql image? #2991

Previous behavior

Stacks had to use the custom codenvy/mysql image in the Docker Compose definition.

New behavior

Stacks can use the official mysql image in the Docker Compose definition.

Signed-off-by: Kaloyan Raev kaloyan.r@zend.com

@codenvy-ci
Copy link

Can one of the admins verify this patch?

@benoitf
Copy link
Contributor

benoitf commented Nov 14, 2016

ci-build

@benoitf benoitf added the kind/bug Outline of a bug - must adhere to the bug report template. label Nov 14, 2016
@codenvy-ci
Copy link

@kaloyan-raev kaloyan-raev mentioned this pull request Nov 15, 2016
34 tasks
@bmicklea bmicklea added this to the 5.0.0-M8 milestone Dec 6, 2016
@bmicklea bmicklea added the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Dec 6, 2016
@bmicklea
Copy link

bmicklea commented Dec 6, 2016

@kaloyan-raev - we'd like to get this merged for M8 but there are conflicts, can you do a quick rebase?

@kaloyan-raev
Copy link
Contributor Author

@bmicklea give me a few minutes.

Copy link

@garagatyi garagatyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 on current approach. Null value should not be returned as collection.

Conflicts:
	wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/environment/server/compose/ComposeServiceImpl.java
@garagatyi
Copy link

I believe it is responsibility of MachineProviderImpl of DockerConnector to workaround situation with empty collections.

@kaloyan-raev
Copy link
Contributor Author

@garagatyi

-1 on current approach. Null value should not be returned as collection.

Why?
null and an empty collection are semantically different and masking null as an empty collection should be done only with a clear purpose. And it looks wrong at this particular place.

@benoitf
Copy link
Contributor

benoitf commented Dec 6, 2016

I agree with @kaloyan-raev that if user has not set anything it should be null, while an empty value is empty collection

to workaround situation with empty collections.

There is no workaround, it's how it should work. Nothing entered, then it's null.

@kaloyan-raev
Copy link
Contributor Author

Conflict resolved.

@JamesDrummond
Copy link
Contributor

For crosslink: This PR effects #3204 .

@garagatyi
Copy link

Because we use that convention in our code. It makes methods that return collections free from NPE problems. It is very widespread in our code. Changed code was using that approach and personally I -1 on changing it to achieve what can be achieved in a different way.

@riuvshin riuvshin modified the milestones: 5.0.0-M9, 5.0.0-M8 Dec 7, 2016
@riuvshin
Copy link
Contributor

riuvshin commented Dec 7, 2016

Moved to M9

@bmicklea
Copy link

@kaloyan-raev - are you able to update this PR based on the feedback?

@kaloyan-raev
Copy link
Contributor Author

@bmicklea No. The feedback by @garagatyi raises a code styling complain, but does not suggest a working alternative.

The MachineProviderImpl class is mentioned, but as far as I can see it actually assumes that the CheServiceImpl can return null. See: https://github.com/eclipse/che/blob/42272e4bd95c5b9b3c4fc20df5ef60685cac189f/plugins/plugin-docker/che-plugin-docker-machine/src/main/java/org/eclipse/che/plugin/docker/machine/MachineProviderImpl.java#L526-L527

@TylerJewell
Copy link

@garagatyi - there is no mention of such Collections best practices in the wiki: https://github.com/eclipse/che/wiki/Coding-Guidelines.

As such, @kaloyan-raev - +1 for merge. If we need to revisit our coding guidelines, we'll do so in the wiki, but not in this PR.

We are in ramp down for 5.0 and want to GA this month. This issue is a pre-req for this, so will you be able to rebase and merge? This issue is also a blocker for other issues that we have for 5.0 GA.

@kaloyan-raev
Copy link
Contributor Author

Github does not show any conflicts for this PR, so I don't think it needs another rebase.

@TylerJewell
Copy link

You are a committer now, so the PR owner is responsible for merging, updating any docs, and cleaning up the branches. cough cough.

@kaloyan-raev kaloyan-raev merged commit 5bb51e0 into eclipse-che:master Dec 20, 2016
@kaloyan-raev kaloyan-raev deleted the mysql-fix branch December 20, 2016 14:17
@kaloyan-raev
Copy link
Contributor Author

OK :-)

I have to admit that I am not really sure when are the good days to merge things to master and when not. I am also not sure how it is decided for milestone assignments.

@TylerJewell
Copy link

The general rules for milestone assignments has been:

  1. Product managers are able to designate groups of feature improvements for a particular milestone. We typically only track 1-2 milestones at a time. When a feature is designated for a milestone, then all associated bugs & tasks for that feature are included.

  2. All severity/blocker issues are immediately placed into the current milestone, as they are considred blockers.

  3. All regressions are labeled as severity/blocker until they are reviewed by PM to either keep that designation or moved to a different designation.

  4. When we make a release, then technical leads can take any merge-ready PRs and add the next milestone to it, and merge at the beginning of the milestone.

And then along the way, when we do our reviews a couple times a week, if we identify other items that we think are good for the release, then a PM adds them in.

@kaloyan-raev
Copy link
Contributor Author

Thanks!
It would be nice to have some "org chart" of the Che committers and mark those with the special roles and responsibilities. I already recognize some people, but I am still missing the overall picture.

@TylerJewell
Copy link

Yes, this would be good to add. I think we have product managers, maintainers, and committers. I'll work on something over the holidays.

JPinkney pushed a commit to JPinkney/che that referenced this pull request Aug 17, 2017
…he#3049)

* Avoid passing empty array for command and entrypoint to Docker API
* Use official mysql docker image in the java-mysql stack

Signed-off-by: Kaloyan Raev <kaloyan.r@zend.com>
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants