hashicorp / hashicorp/nomad

resource allocation for non-sidecar prestart tasks

Open
#9,725 6 comments 1 reaction 0 assignees View on GitHub
stage/accepted theme/docs theme/task lifecycle type/bug
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

Over on [Discuss](https://discuss.hashicorp.com/t/prestart-tasks-resource-allocation/19299/8?u=tgross) we noted that we're missing documentation around how the scheduler allocates resources when there are `prestart` tasks in play:

> The scheduler should be “doing the right thing” inasmuch as it should be allocating the minimum amount of resources required for the entire allocation, taking into account what tasks are running concurrently due to lifecycle. So for an example using RAM resources:

Prestart Task | Main Task | Allocated
-- | -- | --
100MB (sidecar) | 200MB | 300MB
100MB (no sidecar) | 200MB | 200MB
200MB (sidecar) | 100MB | 300MB
200MB (no sidecar) | 100MB | 200MB

> It looks like the last line in that table is the unfortunate case you’re running into?
>
> I suspect that when we were designing that there was an assumption that in the common case the main task would require more resources. And it seems that we’re accounting for the entire allocation restarting, even though the only way that typically happens is if a user does a nomad alloc restart – the restart block of the jobspec controls the restart of tasks, not the whole alloc.

We should have documentation in the [`lifecycle`](https://www.nomadproject.io/docs/job-specification/lifecycle) docs about how resources are scheduled, probably cross-linked with the [`resources`](https://www.nomadproject.io/docs/job-specification/resources) docs.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the lifecycle documentation and cross-reference the resources documentation. Document how resource allocation accounts for prestart tasks with and without sidecars, including the four RAM examples from the issue, and make the relationship between the two pages clear.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.