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

cli: update nomad job init full examples #24232

Merged
merged 5 commits into from
Oct 17, 2024
Merged

cli: update nomad job init full examples #24232

merged 5 commits into from
Oct 17, 2024

Conversation

schmichael
Copy link
Member

@schmichael schmichael commented Oct 17, 2024

The full example jobspecs emitted by nomad job init and nomad job init -connect have not seen any improvement in over a year. I intended to just peek in, add a new ui{} block block, and be done. However, something about skimming over the phrase the online documentation a dozen times made me stop and do some spring cleaning.

The diff is an absolute nightmare even though I think my changes are fairly minor. Some highlights:

  1. Added a ui block because I think it should be a widely used feature!
  2. Removed tons of non-connect-related blocks from the connect example. I don't think the value of documenting blocks twice in the normal example and in connect is worth it. We could add some templating to keep those blocks in sync, but I just don't think repeating our examples is helpful. When people want a service mesh example, they probably want to see exactly what's relevant to the service mesh, not a bunch of unrelated topics like affinity{}.
  3. Removed the online documentation. It is 2024, not 1999. I think our users know what a URL implies.
  4. Cleaned up whitespace in a few places although I did remove some comments to do it. For example I couldn't figure out how best to indent affinity{} and all of its field comments, so I just removed the field comments. I think users are much better off visiting the online documentation for those details. The examples should demonstrate Nomad's featureset, not be a comprehensive guide to those features.

Pinging @philrenaud because I've been pestering Phil with ui{} things already, and @aimeeu because despite this being a part of the nomad binary, I think it's documentation, and I want to make sure my changes fit with the style of similar examples our docs are full of. Let me know if you want to hand it off.

Copy link
Contributor

@philrenaud philrenaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@aimeeu aimeeu added theme/docs Documentation issues and enhancements backport/website This will backport PR changes to `stable-website` && the latest release-branch backport/ent/1.9.x+ent Changes are backported to 1.9.x+ent backport/1.9.x backport to 1.9.x release line labels Oct 17, 2024
Copy link
Contributor

@aimeeu aimeeu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

schmichael - Thanks for including me! Some style guide suggestions:

  • changed "please see" to "refer to". We are not supposed to use "see"
  • changed future tense to present tense
  • changed passive voice to active voice where it made sense

I'll add a new page to the team-nomad wiki with the aforementioned style guidelines plus how to engage the docs team (which is currently in Confluence but the Eng team doesn't look there).

command/asset/connect.nomad.hcl Outdated Show resolved Hide resolved
command/asset/connect.nomad.hcl Outdated Show resolved Hide resolved
command/asset/connect.nomad.hcl Outdated Show resolved Hide resolved
command/asset/connect.nomad.hcl Outdated Show resolved Hide resolved
command/asset/connect.nomad.hcl Outdated Show resolved Hide resolved
command/asset/example.nomad.hcl Outdated Show resolved Hide resolved
#
# For more information and examples on the "template" block, please see
# the online documentation at:
# For more information and examples on the "template" block, please see:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# For more information and examples on the "template" block, please see:
# For more information and examples on the "template" block, refer to:

# and revocation of the Vault token.
# The "vault" block instructs the Nomad client to acquire a token from a
# HashiCorp Vault server. Nomad must be configured to communicate with
# Vault. By default, Nomad will inject the token into the task via an
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Vault. By default, Nomad will inject the token into the task via an
# Vault. By default, Nomad injects the token into the task via an

# The "vault" block instructs the Nomad client to acquire a token from a
# HashiCorp Vault server. Nomad must be configured to communicate with
# Vault. By default, Nomad will inject the token into the task via an
# environment variable and make the token available to the "template"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# environment variable and make the token available to the "template"
# environment variable and makes the token available to the "template"

#
# For more information and examples on the "vault" block, please see
# the online documentation at:
# For more information and examples on the "vault" block, please see:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# For more information and examples on the "vault" block, please see:
# For more information and examples on the "vault" block, refer to:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/ent/1.9.x+ent Changes are backported to 1.9.x+ent backport/website This will backport PR changes to `stable-website` && the latest release-branch backport/1.9.x backport to 1.9.x release line theme/docs Documentation issues and enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants