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

DriverContext: Add the TaskGroup and the Job name #4196

Merged

Conversation

jvrplmlmn
Copy link

Adding this fields to the DriverContext object, will allow us to pass
them to the drivers.

An use case for this, will be to emit tagged metrics in the drivers,
which contain all relevant information:

  • Job
  • TaskGroup
  • Task
  • ...

For more context, see the following discussion: #4185 (comment)

Adding this fields to the DriverContext object, will allow us to pass
them to the drivers.

An use case for this, will be to emit tagged metrics in the drivers,
which contain all relevant information:
- Job
- TaskGroup
- Task
- ...

Ref: hashicorp#4185
@dadgar
Copy link
Contributor

dadgar commented Apr 23, 2018

@jvrplmlmn
Copy link
Author

Thanks for the review @dadgar, seems like I missed to push 92cbfd0

Travis keeps failing the build in TestAllocRunner_RetryArtifact, but if I run that test locally it passes:

GOROOT=/usr/local/Cellar/go/1.9.2/libexec #gosetup
GOPATH=/Users/javier/go #gosetup
/usr/local/Cellar/go/1.9.2/libexec/bin/go test -c -i -o /private/var/folders/zw/lqcz80hj51b5q8_y56kc_1jr0000gn/T/___TestAllocRunner_RetryArtifact_in_alloc_runner_test_go github.com/hashicorp/nomad/client #gosetup
/private/var/folders/zw/lqcz80hj51b5q8_y56kc_1jr0000gn/T/___TestAllocRunner_RetryArtifact_in_alloc_runner_test_go -test.v -test.run ^TestAllocRunner_RetryArtifact$ #gosetup
	testlog.go:30: 23:16:28.552258 [DEBUG] client: starting task runners for alloc '15fd8da5-87cb-3bdc-8196-2766ec5806db'
	testlog.go:30: 23:16:28.552539 [DEBUG] client: starting task context for 'web' (alloc '15fd8da5-87cb-3bdc-8196-2766ec5806db')
	testlog.go:30: 23:16:28.552584 [DEBUG] client: starting task context for 'bad' (alloc '15fd8da5-87cb-3bdc-8196-2766ec5806db')
	testlog.go:30: 23:16:28.566418 [DEBUG] driver.mock: starting task "web"
	testlog.go:30: 23:16:28.566435 [TRACE] client: alloc 15fd8da5-87cb-3bdc-8196-2766ec5806db task web could not detect a driver IP
	testlog.go:30: 23:16:28.566534 [TEST] mock_consul: RegisterTask("15fd8da5-87cb-3bdc-8196-2766ec5806db", "web", *driver.mockDriverHandle, 68934a3e9455fa72420237eb05902327)
	testlog.go:30: 23:16:28.578283 [DEBUG] client: failed to download artifact "http://127.0.0.1:0/foo/bar/baz": Get http://127.0.0.1:0/foo/bar/baz: dial tcp 127.0.0.1:0: connect: can't assign requested address
	testlog.go:30: 23:16:28.578348 [INFO] client: Restarting task "bad" for alloc "15fd8da5-87cb-3bdc-8196-2766ec5806db" in 4.690040753s
	testlog.go:30: 23:16:28.578478 [TEST] mock_consul: RemoveTask("15fd8da5-87cb-3bdc-8196-2766ec5806db", "bad")
	testlog.go:30: 23:16:29.567708 [DEBUG] driver.mock: finished running task "web"
	testlog.go:30: 23:16:29.567911 [INFO] client: task "web" for alloc "15fd8da5-87cb-3bdc-8196-2766ec5806db" completed successfully
	testlog.go:30: 23:16:29.567941 [INFO] client: Not restarting task: web for alloc: 15fd8da5-87cb-3bdc-8196-2766ec5806db 
	testlog.go:30: 23:16:29.568134 [TEST] mock_consul: RemoveTask("15fd8da5-87cb-3bdc-8196-2766ec5806db", "web")
	testlog.go:30: 23:16:33.271376 [DEBUG] client: failed to download artifact "http://127.0.0.1:0/foo/bar/baz": Get http://127.0.0.1:0/foo/bar/baz: dial tcp 127.0.0.1:0: connect: can't assign requested address
	testlog.go:30: 23:16:33.271440 [INFO] client: Not restarting task: bad for alloc: 15fd8da5-87cb-3bdc-8196-2766ec5806db 
	testlog.go:30: 23:16:33.271488 [DEBUG] client: task "bad" failed, destroying other tasks in task group: [web]
	testlog.go:30: 23:16:33.271601 [TEST] mock_consul: RemoveTask("15fd8da5-87cb-3bdc-8196-2766ec5806db", "bad")
	testlog.go:30: 23:16:33.271670 [DEBUG] client: task "bad" failed, destroying other tasks in task group: [web]

Process finished with exit code 0

@dadgar dadgar merged commit 639662d into hashicorp:master Apr 24, 2018
@jvrplmlmn jvrplmlmn deleted the driverContext/add-taskGroup-job-details branch April 25, 2018 09:25
@github-actions
Copy link

github-actions bot commented Mar 5, 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 Mar 5, 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.

None yet

2 participants