hashicorp / hashicorp/nomad

Allow Drivers to Attach information to an allocation

Open
#5,863 3 comments 3 reactions 0 assignees View on GitHub
stage/needs-discussion theme/allocation API theme/api type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

Currently, I don’t believe Drivers can return or attach any arbitrary data onto an allocation that is gotten after a successful provision. At least I don’t see any place on the Allocation struct. We’d like to inform the user about where on Triton their allocation is running, their current package size, just some Metadata about their Task Allocation. Currently a user must hit nomad, find the alloc id, and then query triton to get the desired information. They’d much rather run “nomad status ” and get back some info that our driver has attached to the allocation / task.

Is there any way to do this today?

// Allocation is used for serialization of allocations.
type Allocation struct {
ID string
Namespace string
EvalID string
Name string
NodeID string
NodeName string
JobID string
Job *Job
TaskGroup string
Resources *Resources
TaskResources map[string]*Resources
AllocatedResources *AllocatedResources
Services map[string]string
Metrics *AllocationMetric
DesiredStatus string
DesiredDescription string
DesiredTransition DesiredTransition
ClientStatus string
ClientDescription string
TaskStates map[string]*TaskState
DeploymentID string
DeploymentStatus *AllocDeploymentStatus
FollowupEvalID string
PreviousAllocation string
NextAllocation string
RescheduleTracker *RescheduleTracker
PreemptedAllocations []string
PreemptedByAllocation string
CreateIndex uint64
ModifyIndex uint64
AllocModifyIndex uint64
CreateTime int64
ModifyTime int64
}

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Allocation struct shown in the issue and trace how allocations are serialized and displayed by `nomad status `. Follow the driver-to-allocation data path, then establish how driver-provided metadata would be exposed and verified; done means a successful provision can surface that metadata through allocation status.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend-api-design, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.