hashicorp / hashicorp/nomad

Change jobspec for `job init` command

Open
#12,928 0 comments 1 reaction 0 assignees View on GitHub
theme/cli type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Proposal

The jobspec returned by `nomad job init` should be updated.

Currently it returns a Redis job. This is confusing in that Redis is a stateful job, but the init job doesn't have any volume support.

### Use-cases

* Show off interesting Nomad features
* Provide a better "Aha moment" to new Nomad users
* Avoid confusing the user with stateful job immediately.

### A proposed Jobspec

This could go in a lot of different directions, but here is a proposal to get the ball rolling.

* Job has two tasks. - Demonstrates task hierarchy.
* One task is running Docker, the other is running exec. - Demonstrates driver flexibility.
* One job is making a request to the other using Nomad Service Discovery - Demonstrates simple service discovery for new users.
* The "inner" task is using the template stanza - Demonstrates templating well. We could inject a Secure Variable here when we ship these.
* The "inner" task has a count of more than 1. This would help show off load balancing within Nomad and multiple allocs would help people understand Nomad's model better.
* The outer task could be Nginx running docker potentially? Or maybe just something that makes a request to the inner task and wraps it in a pretty UI.
* Ideally the UI that is returned has an explanation of what is happening (so they user can hit a URL and get more info), and links to next steps, such as the Nomad learn guides.
* Neither task should be stateful, as this is confusing for new users. Perhaps volume docs can be linked to from the UI.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the `nomad job init` command and inspect how its current Redis jobspec is assembled. The issue proposes several possible demonstrations, so completion would require settling the example's scope and replacing the stateful jobspec with a clear, non-stateful one.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.