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

Set a name for the container #389

Merged
merged 1 commit into from
Nov 17, 2015
Merged

Set a name for the container #389

merged 1 commit into from
Nov 17, 2015

Conversation

achanda
Copy link
Contributor

@achanda achanda commented Nov 5, 2015

No description provided.

@achanda
Copy link
Contributor Author

achanda commented Nov 5, 2015

Fixes #387

@dimfeld
Copy link
Contributor

dimfeld commented Nov 5, 2015

Will this cause problems if two instances of a task get scheduled on the same host, since Docker container names must be unique?

@achanda
Copy link
Contributor Author

achanda commented Nov 5, 2015

I assumed that task names are unique, but looking at https://github.com/hashicorp/nomad/blob/master/jobspec/parse.go#L361 that does not seem to be the case. Will modify.

@dadgar
Copy link
Contributor

dadgar commented Nov 5, 2015

The name should include the alloc_id which would make the name unique. Currently the drivers do not have access to the alloc_id. We will submit a PR soon to update this and then this PR can be updated.

@diptanu
Copy link
Contributor

diptanu commented Nov 6, 2015

@achanda We just merged #395 which will allow you to reference the alloc id in the driver, so you could name your container after the alloc id. In the future, we should be able to pass in more information such as job name, task name, task index, etc to have more human readable container names.

@cbednarski
Copy link
Contributor

@achanda Why do we need to specify this at all?

@diptanu
Copy link
Contributor

diptanu commented Nov 6, 2015

@cbednarski This is useful when people use container names with metric dimensions, so a unique name which can be traced back to a Nomad object is easier to co-relate while debugging, etc.

@achanda
Copy link
Contributor Author

achanda commented Nov 6, 2015

@cbednarski the associated issue was asking for a name to track containers using a monitoring system. If we auto generate a name, an external agent might be able to query nomad API to get alloc id and task name and use those to monitor.

@cbednarski cbednarski mentioned this pull request Nov 6, 2015
@cbednarski
Copy link
Contributor

@diptanu @achanda Thanks for the background here. There is some discussion in #387 as to whether this change would achieve the desired effect.

@diptanu
Copy link
Contributor

diptanu commented Nov 16, 2015

I think we need to pass the name of the task to the driver since the name might have to include more information like restarts etc to keep the task name unique through restarts.

dadgar added a commit that referenced this pull request Nov 17, 2015
Set a name for the container
@dadgar dadgar merged commit dc0501e into hashicorp:master Nov 17, 2015
@dadgar
Copy link
Contributor

dadgar commented Nov 17, 2015

Thanks @achanda

@achanda achanda deleted the name branch November 19, 2015 10:37
@github-actions
Copy link

github-actions bot commented May 2, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants