Re: [openstack-dev] [kolla] Obtaining version information for Docker container

2016-12-01 Thread hu . zhijiang
For #1, I think the requirement is that before pulling the image to local 
registry, one can get its metadata about the version info before hand, 
thus save time and space spend on pulling wrong images. I don't know if 
the info in docker label can be retrieved before before pulling the image 
to local registry. If not, holding such info in docker label may be not a 
good solution since we have to pull the image first. 

Another thought is how about let the kolla build command to generate a 
report about what component version it used to build for each image and 
just let it output this report to a file or stdout? Then this well 
formatted output can be published along with the images(docker save...) 
but not inside of images. 


B.R.,
Zhijiang




发件人: Pete Birley 
收件人: "OpenStack Development Mailing List (not for usage 
questions)" , Adrian Mouat 
, 
日期:   2016-11-19 02:17
主题:   Re: [openstack-dev] [kolla] Obtaining version information for 
Docker container



I've been thinking about this a bit as well, and think that we should 
consider using the docker label schema (http://label-schema.org/rc1/) as a 
solution for #1, it would be possible to add labeling to kolla-build to 
add these labels simply. This solution is gaining traction in the docker 
community, and integrates well with external tools e.g. 
https://microbadger.com. One of the maintainers of this project (Adrian 
Mouat) works in the same room as me and I've cc'd him in case he has any 
additional insight or perspective that may be useful.

Unfortunately this does not provide a solution to the 2nd problem, and 
currently it is not possible to query labels from within a container. I 
think Steve's suggestion of a simple shell tool to query the containers 
package manager(s) and produce a report is probably the right way to go: 
but we should draw up a specification that scoped what data we collected 
in such a manifest as if we simply do the equivalent of 'rpm -qa' then I 
think Paul's point is valid and we don't gain much from the exercise.

Cheers

Pete

On Fri, Nov 18, 2016 at 11:51 AM, Steven Dake (stdake)  
wrote:
Zhu,

This isn’t the first time this question has been asked :)

Since this is a technical matter, I’ve copied openstack-dev for a wider 
audience.  I don’t have a clear solution to obtaining version manifests 
for container content or the upstream container version.  Perhaps someone 
in our broader community may have an answer.

The best I’ve got is we could add a general shell command that can be run 
with docker exec to obtain a proper version manifest of both 1 and 2 
(formatted in YAML or plaintext).  This could be placed in the base 
container image to enable a general diagnostic and certificate of origin 
tool.

Perhaps someone has a better solution?

Regards
-steve


From: "zhu.z...@zte.com.cn" 
Date: Friday, November 18, 2016 at 1:56 AM
To: Steven Dake 
Subject: 

Hello,nice to meet you. I am a contributor of Kolla.
Excuse me, I have a question to bother you.
The question is that how to get openstack component version from a running 
container or image.
you know , the version info is wrapped by the container, it is not easy to 
get them 
there are two type of versions 
one: version in a image, two: version in a running container 
two is easy, for example , we can get it by calling docker exec... 
but how to get the one, Is there any way, Thanks.

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev




-- 

Pete Birley / Director 
pete@port.direct / +447446862551
PORT.DIRECT 
United Kingdom 
https://port.direct


This e-mail message may contain confidential or legally privileged 
information and is intended only for the use of the intended recipient(s). 
Any unauthorized disclosure, dissemination, distribution, copying or the 
taking of any action in reliance on the information herein is prohibited. 
E-mails are not secure and cannot be guaranteed to be error free as they 
can be intercepted, amended, or contain viruses. Anyone who communicates 
with us by e-mail is deemed to have accepted these risks. Port.direct is 
not responsible for errors or omissions in this message and denies any 
responsibility for any damage arising from the use of e-mail. Any opinion 
and other statement contained in this message and any attachment are 
solely those of the author and do not necessarily represent those of the 
company.
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


___

Re: [openstack-dev] [kolla] Obtaining version information for Docker container

2016-11-18 Thread Joshua Harlow
So just something that I can share about what we are putting in our 
images, since they are getting built from jenkins we shove in pretty 
much all the jenkins build information into it:


$ IMG=""
$ docker run $IMG cat /jenkins.json
{
"Project": "glance",
"Project git": "https://github.com/openstack/glance.git";,
"Project ref": "stable/liberty",
"Deploy git": 
"g...@github.secureserver.net:cloudplatform/openstack-deploy.git",

"Deploy ref": "master",
"Docker repo (for push)": "docker-cloud-ostack-local",
"Requirement git": "git://git.openstack.org/openstack/requirements",
"Requirement ref": "stable/liberty",
"Python venv": "python2.7",
"Unit test path": "./glance/tests/unit",
"Kolla git": "https://github.com/openstack/kolla.git";,
"Kolla ref": "stable/newton",
"Kolla image namespace": 
"docker-cloud-ostack-local.artifactory.secureserver.net",

"Maintainers": "Cloud Platform [ELS] (cl...@godaddy.com)",
"Job name": "glance",
"Job build id": "55",
"Job build number": "55",
"Job build url": 
"http://jenkins-master.cloud.dev.phx3.gdg:8080/job/glance/55/";,

"Job started at": "Tue Nov 15 16:45:40 MST 2016",
"Project details": {
"version": "11.0.2.dev18",
"name": "glance",
"author": "OpenStack",
"fullname": "glance-11.0.2.dev18",
"url": "http://www.openstack.org/";
}
}

That's what we are currently shoving in, which includes the project data 
also and various other useful goodies that help identify where the image 
came from and where it was built and when.


Steven Dake (stdake) wrote:

Zhu,

This isn’t the first time this question has been asked :)

Since this is a technical matter, I’ve copied openstack-dev for a wider
audience. I don’t have a clear solution to obtaining version manifests
for container content or the upstream container version. Perhaps someone
in our broader community may have an answer.

The best I’ve got is we could add a general shell command that can be
run with docker exec to obtain a proper version manifest of both 1 and 2
(formatted in YAML or plaintext). This could be placed in the base
container image to enable a general diagnostic and certificate of origin
tool.

Perhaps someone has a better solution?

Regards
-steve


From: "zhu.z...@zte.com.cn "
mailto:zhu.z...@zte.com.cn>>
Date: Friday, November 18, 2016 at 1:56 AM
To: Steven Dake mailto:std...@cisco.com>>
Subject: 

Hello,nice to meet you. I am a contributor of Kolla.
Excuse me, I have a question to bother you.
The question is that how to get openstack component version from a
running container or image.
you know , the version info is wrapped by the container, it is not easy
to get them
there are two type of versions
one: version in a image, two: version in a running container
two is easy, for example , we can get it by calling docker exec...
but how to get the one, Is there any way, Thanks.

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [kolla] Obtaining version information for Docker container

2016-11-18 Thread Pete Birley
I've been thinking about this a bit as well, and think that we should
consider using the docker label schema (http://label-schema.org/rc1/) as a
solution for #1, it would be possible to add labeling to kolla-build to add
these labels simply. This solution is gaining traction in the docker
community, and integrates well with external tools e.g.
https://microbadger.com. One of the maintainers of this project (Adrian
Mouat) works in the same room as me and I've cc'd him in case he has any
additional insight or perspective that may be useful.

Unfortunately this does not provide a solution to the 2nd problem, and
currently it is not possible to query labels from within a container. I
think Steve's suggestion of a simple shell tool to query the containers
package manager(s) and produce a report is probably the right way to go:
but we should draw up a specification that scoped what data we collected in
such a manifest as if we simply do the equivalent of 'rpm -qa' then I think
Paul's point is valid and we don't gain much from the exercise.

Cheers

Pete

On Fri, Nov 18, 2016 at 11:51 AM, Steven Dake (stdake) 
wrote:

> Zhu,
>
> This isn’t the first time this question has been asked :)
>
> Since this is a technical matter, I’ve copied openstack-dev for a wider
> audience.  I don’t have a clear solution to obtaining version manifests for
> container content or the upstream container version.  Perhaps someone in
> our broader community may have an answer.
>
> The best I’ve got is we could add a general shell command that can be run
> with docker exec to obtain a proper version manifest of both 1 and 2
> (formatted in YAML or plaintext).  This could be placed in the base
> container image to enable a general diagnostic and certificate of origin
> tool.
>
> Perhaps someone has a better solution?
>
> Regards
> -steve
>
>
> From: "zhu.z...@zte.com.cn" 
> Date: Friday, November 18, 2016 at 1:56 AM
> To: Steven Dake 
> Subject: 
>
> Hello,nice to meet you. I am a contributor of Kolla.
> Excuse me, I have a question to bother you.
> The question is that how to get openstack component version from a running
> container or image.
> you know , the version info is wrapped by the container, it is not easy to
> get them
> there are two type of versions
> one: version in a image, two: version in a running container
> two is easy, for example , we can get it by calling docker exec...
> but how to get the one, Is there any way, Thanks.
>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>


-- 

[image: Port.direct] 

Pete Birley / Director
pete@port.direct / +447446862551

*PORT.*DIRECT
United Kingdom
https://port.direct

This e-mail message may contain confidential or legally privileged
information and is intended only for the use of the intended recipient(s).
Any unauthorized disclosure, dissemination, distribution, copying or the
taking of any action in reliance on the information herein is prohibited.
E-mails are not secure and cannot be guaranteed to be error free as they
can be intercepted, amended, or contain viruses. Anyone who communicates
with us by e-mail is deemed to have accepted these risks. Port.direct is
not responsible for errors or omissions in this message and denies any
responsibility for any damage arising from the use of e-mail. Any opinion
and other statement contained in this message and any attachment are solely
those of the author and do not necessarily represent those of the company.
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [kolla] Obtaining version information for Docker container

2016-11-18 Thread Fox, Kevin M
Steve, (And the rest of kolla)

This raises a question I've had for a while and wanted to talk through.

Right now, kolla versions containers based on the kolla version (packaging 
version).

In most package managers dpkg/rpm/etc, the versioning is done in a very 
different way.

The software being shipped gets the version number, and a packaging version 
number is appended with a dash. so,
14.0.3-1
If the packaging is buggy but the software doesn't have a new release, it gives 
a nice place to fix that:
14.0.3-2

This lets the user very quickly see what the upstream software number is, which 
is what is most cared about.

Its flexible enough to use complicated packaging versions too .  For example, 
redhats kernel package:
kernel-3.10.0-327.13.3 (version 3.10.0 kernel, 327.13.3 version of the package)

I think containers are a slightly more unique case as not only the primary 
software release is in there, but also all its dependencies. so there is a case 
where the primary software doesn't change, the packaging stuff doesn't change, 
but the dependencies get updated.
So, I think my proposal is to tag on a build number at the end. so something 
like:
14.0.3-1-1
then a pure dependency security update (openssl upgraded for example) would 
produce
14.0.3-1-2

If we tag everything this way, it should be easy for someone to know, for 
example, what version of nova the package was, and if there is a more up to 
date version of the package then what is currently running on their system. It 
would allow folks to apply the common pattern for packaging that is already 
commonly understood. We might even might be able to automate the 
scanning/update process in kolla to assist with that at some point.

What do you think?

Thanks,
Kevin



From: Steven Dake (stdake) [std...@cisco.com]
Sent: Friday, November 18, 2016 3:51 AM
To: zhu.z...@zte.com.cn
Cc: OpenStack Development Mailing List (not for usage questions)
Subject: [openstack-dev] [kolla] Obtaining version information for Docker 
container

Zhu,

This isn’t the first time this question has been asked :)

Since this is a technical matter, I’ve copied openstack-dev for a wider 
audience.  I don’t have a clear solution to obtaining version manifests for 
container content or the upstream container version.  Perhaps someone in our 
broader community may have an answer.

The best I’ve got is we could add a general shell command that can be run with 
docker exec to obtain a proper version manifest of both 1 and 2 (formatted in 
YAML or plaintext).  This could be placed in the base container image to enable 
a general diagnostic and certificate of origin tool.

Perhaps someone has a better solution?

Regards
-steve


From: "zhu.z...@zte.com.cn<mailto:zhu.z...@zte.com.cn>" 
mailto:zhu.z...@zte.com.cn>>
Date: Friday, November 18, 2016 at 1:56 AM
To: Steven Dake mailto:std...@cisco.com>>
Subject: 

Hello,nice to meet you. I am a contributor of Kolla.
Excuse me, I have a question to bother you.
The question is that how to get openstack component version from a running 
container or image.
you know , the version info is wrapped by the container, it is not easy to get 
them
there are two type of versions
one: version in a image, two: version in a running container
two is easy, for example , we can get it by calling docker exec...
but how to get the one, Is there any way, Thanks.
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [kolla] Obtaining version information for Docker container

2016-11-18 Thread Paul Bourke
If I'm understanding the requirement correctly, we want to know which 
version of an OpenStack component is installed in an image? If so why 
not just run something like:


# docker run kolla/oraclelinux-source-keystone:3.0.0 pip show keystone
Name: keystone
Version: 10.0.0.0rc2.dev290
[...]

Or equivalent for yum/apt. I'm not sure there's a need to implement 
anything beyond what is offered by package management tools.


On 18/11/16 11:51, Steven Dake (stdake) wrote:

Zhu,

This isn’t the first time this question has been asked :)

Since this is a technical matter, I’ve copied openstack-dev for a wider
audience.  I don’t have a clear solution to obtaining version manifests
for container content or the upstream container version.  Perhaps
someone in our broader community may have an answer.

The best I’ve got is we could add a general shell command that can be
run with docker exec to obtain a proper version manifest of both 1 and 2
(formatted in YAML or plaintext).  This could be placed in the base
container image to enable a general diagnostic and certificate of origin
tool.

Perhaps someone has a better solution?

Regards
-steve


From: "zhu.z...@zte.com.cn "
mailto:zhu.z...@zte.com.cn>>
Date: Friday, November 18, 2016 at 1:56 AM
To: Steven Dake mailto:std...@cisco.com>>
Subject: 

Hello,nice to meet you. I am a contributor of Kolla.
Excuse me, I have a question to bother you.
The question is that how to get openstack component version from a
running container or image.
you know , the version info is wrapped by the container, it is not easy
to get them
there are two type of versions
one: version in a image, two: version in a running container
two is easy, for example , we can get it by calling docker exec...
but how to get the one, Is there any way, Thanks.


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [kolla] Obtaining version information for Docker container

2016-11-18 Thread Steven Dake (stdake)
Zhu,

This isn’t the first time this question has been asked :)

Since this is a technical matter, I’ve copied openstack-dev for a wider 
audience.  I don’t have a clear solution to obtaining version manifests for 
container content or the upstream container version.  Perhaps someone in our 
broader community may have an answer.

The best I’ve got is we could add a general shell command that can be run with 
docker exec to obtain a proper version manifest of both 1 and 2 (formatted in 
YAML or plaintext).  This could be placed in the base container image to enable 
a general diagnostic and certificate of origin tool.

Perhaps someone has a better solution?

Regards
-steve


From: "zhu.z...@zte.com.cn" 
mailto:zhu.z...@zte.com.cn>>
Date: Friday, November 18, 2016 at 1:56 AM
To: Steven Dake mailto:std...@cisco.com>>
Subject: 

Hello,nice to meet you. I am a contributor of Kolla.
Excuse me, I have a question to bother you.
The question is that how to get openstack component version from a running 
container or image.
you know , the version info is wrapped by the container, it is not easy to get 
them
there are two type of versions
one: version in a image, two: version in a running container
two is easy, for example , we can get it by calling docker exec...
but how to get the one, Is there any way, Thanks.
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev