marathon icon indicating copy to clipboard operation
marathon copied to clipboard

Expose docker identifier/name

Open xmwang76 opened this issue 12 years ago • 20 comments

After marathon starts a docker task, there is no information from marathon that can be used to identify the corresponding docker container started by the task. It'd be useful if marathon can expose that information.

xmwang76 avatar Oct 19 '14 01:10 xmwang76

Would it help if Marathon set the hostname by default to the Mesos Task ID?

ConnorDoyle avatar Oct 20 '14 23:10 ConnorDoyle

I'm afraid not much unless you know there is a way for marathon users to translate Mesos Task ID into docker id/name. Is there?

xmwang76 avatar Oct 21 '14 04:10 xmwang76

If you provide a hostname yourself, then you can look at task id yourself which then translates into the hostname you provided.

tnachen avatar Oct 21 '14 06:10 tnachen

@tnachen I'm confused - I need a way to map Mesos Task ID into docker container ID or container name. The use case of this is to allow me to collect metrics/logs for the containers created for a Marathon app. The metrics/logs collection currently are only supported at docker container level, that's why I need to know the IDs of docker containers created from a Marathon app.

xmwang76 avatar Oct 21 '14 20:10 xmwang76

Why can't you use taskID as container name? Why do you need to create some other ID for docker container? hostname will not help at all, because if you have 250 containers on the host, and you need to go through all of them just to get a match with one, I doubt it's a proper way to do this. The best option would be to have direct match between TaskID from marathon and container name. No over engineering with some extra IDs, no headache of matching containers to tasks, plain and simple.

onorua avatar Mar 05 '15 06:03 onorua

Unfortunately Mesos uses the docker name for its own accounting purpose as there is no way to tag or add metadata to a particular container in Docker. Which means Mesos needs to control the docker container name, and it's not the task id. We're thinking about providing these information back as TaskStatus in the future.

tnachen avatar Mar 05 '15 08:03 tnachen

Out of curiosity, what is the use case to control the container name by Mesos? what is the difference between task id and mesos container name if both values are unique?

onorua avatar Mar 05 '15 10:03 onorua

+1; some way to correlate container name and mesos task ID would help correlate log sources e.g. using docker with syslog log-driver, the docker id is emitted along with each log statement. A way to correlate that with the mesos task would be helpful.

pmbauer avatar May 23 '15 04:05 pmbauer

+1 would be useful

pnedelko avatar Jun 07 '15 19:06 pnedelko

@onorua I think one challenge is that in mesos it's possible to run many task in a container (mesos native or docker) which means that a single taskid can't be used for the docker name.

I can't remember off the top of my head whether mesos sets the docker name to the executor id or whether it sets it to some other container id. If it's set to the executor id, that information can be used to correlate the container with the task.

BenWhitehead avatar Jun 08 '15 03:06 BenWhitehead

For cluster type deployments, when multiple containers need to talk to each other, each container should have easy name tag and other containers should be able to identify and connect using the name of the container.

ajaybhatnagar avatar Jul 28 '15 18:07 ajaybhatnagar

@ajaybhatnagar That's probably a larger story that exceeds the scope of this issue ;) If you do make feature suggestions, it would also help if you were more specific, elaborated on use cases, possible syntax etc. But please in a separate issue.

kolloch avatar Jul 29 '15 09:07 kolloch

+1

kopax avatar Dec 07 '15 14:12 kopax

+1 Such feature is very important for container monitoring

yingfeng avatar Feb 25 '16 03:02 yingfeng

+1

shizhz avatar Mar 07 '16 07:03 shizhz

+1

Salaander avatar May 12 '16 11:05 Salaander

Could also add mesos/marathon labels to docker labels.

jeacott avatar Jul 07 '16 21:07 jeacott

+1

raghu999 avatar Sep 29 '16 01:09 raghu999

+1

alexisCata avatar Jan 24 '17 12:01 alexisCata

Note: This issue has been migrated to https://jira.mesosphere.com/browse/MARATHON-4031. For more information see https://groups.google.com/forum/#!topic/marathon-framework/khtvf-ifnp8.

meichstedt avatar Mar 07 '17 13:03 meichstedt