Repository navigation
Name containers created by s2i explicitly - #496
openshift-bot merged 1 commit into
Conversation
|
s2i prefix seems reasonable to me.. maybe s2i__randomuid ? |
I thought maybe we could include the same info that openshift uses (build name, namespace, ...), this would allow for better debugging and perhaps more directed cleanup. But that would require openshift to pass in that information to s2i. |
|
when running from openshift i agree it would be good to include that info, i thought we were just discussing the non-openshift scenario here. |
|
@rhcarvalho any chance of moving forward w/ this? (trying to clear tech debt) |
| hostConfig := rco.asDockerHostConfig() | ||
| return docker.CreateContainerOptions{ | ||
| Name: "", | ||
| Name: containerName("", ""), |
There was a problem hiding this comment.
BTW, why we're generating names? Could we specify names explicitly? For example, "Builder container", "Runtime image container" etc.
There was a problem hiding this comment.
We cannot have name collisions. Keep in mind there can be several concurrent builds.
I scheduled some time towards the end half of this sprint to catch up on old PRs. |
|
thanks @rhcarvalho! On Wed, Jun 15, 2016 at 8:53 AM, Rodolfo Carvalho [email protected]
Ben Parees | OpenShift |
@bparees we cannot use the image spec as is, because it may not always lead to a valid container name. E.g.: $ docker run --name 's2i_centos:latest_f4f4f4' centos:latest
Error response from daemon: Invalid container name (s2i_centos:latest_f4f4f4), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowedNeither Since I like the idea of using the image name, we could replace slashes and colons with underscores, wdyt? |
447773f to
ac883cd
Compare
|
Updated description to reflect the current state. [test] |
|
|
||
| // RunContainerOptions are options passed in to the RunContainer method | ||
| type RunContainerOptions struct { | ||
| Name string |
There was a problem hiding this comment.
Looked at how we'd leverage this from Origin, doesn't seem useful.
We never set RunContainerOptions directly, instead we call the Save and Execute methods defined in pkg/build/strategies/sti/sti.go, and they call RunContainer with options based on yet another Config struct.
If we don't care to correlate BuildConfigs and S2I containers, then the name generated by containerName should be enough. Otherwise we'd need to make changes to the Config struct. In that case, probably instead of providing a container name we should provide just metadata because S2I might create multiple containers and I guess we don't want to use a single name (for a given build).
There was a problem hiding this comment.
i'm fine with not introducing it at this point.
There was a problem hiding this comment.
Will drop the second commit and we're ready to go then.
ac883cd to
d003c98
Compare
|
substituting w/ underscores works for me. |
Instead of leaving the name blank and letting the Docker daemon name
containers with random strings like 'lonely_thompson', we give proper
names so that we can identify and filter containers created by S2I
later.
Names take a fixed prefix, 's2i_', and a random suffix. The builder
image is also used to compose the container name, replacing with
underscores characters that would be invalid for a container name.
Example:
$ s2i build \
git://github.com/openshift/ruby-hello-world \
centos/ruby-22-centos7 \
hello-world-app
The above creates a temporary container named
's2i_centos_ruby_22_centos7_397cfecd'.
d003c98 to
5ed269f
Compare
|
Evaluated for source to image test up to 5ed269f |
|
@bparees ready to go. |
|
lgtm [merge] |
|
Source To Image Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_sti/121/) |
|
Evaluated for source to image merge up to 5ed269f |
I ❤️ it too, let's kill some more bugs this week. |
|
Source To Image Test Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_sti/120/) |
Instead of leaving the name blank and letting the Docker daemon name
containers with random strings like 'lonely_thompson', we give proper
names so that we can identify and filter containers created by S2I
later.
Names take a fixed prefix, 's2i_', and a random suffix. The builder
image is also used to compose the container name, replacing with
underscores characters that would be invalid for a container name.
Example:
The above creates a temporary container named
's2i_centos_ruby_22_centos7_397cfecd'.
Fixes #395.