Skip to content

Latest commit

 

History

History
148 lines (103 loc) · 6.64 KB

README.md

File metadata and controls

148 lines (103 loc) · 6.64 KB

Nomad Pack Registry

This repository manages Nomad Packs for @workloads.

Table of Contents

Available Packs

Pack Name Description Task Driver(s)
boundary_worker HCP Boundary Workers exec1, raw_exec2
datadog_agent Datadog Agents raw_exec2
flagd OpenFeature flagd (Docker, Podman) docker3, podman4
hello_world Nomad feature-testing exec1, raw_exec2
minecraft_bedrock_edition Minecraft (Bedrock Edition) docker3, podman4
minecraft_java_edition Minecraft (Java Edition) docker3, podman4
rcon_web RCON Web (for Minecraft etc.) docker3, podman4

Requirements

Development

For development and testing of this repository:

  • terraform-docs 0.17.0 or newer
  • newman 5.3.0 or newer

Usage

This repository provides a Makefile-based workflow.

Running make without commands will print out the following help information:

env             create Nomad environment for testing            `make env pack=<pack>`
render          render a Nomad Pack                             `make render pack=<pack>`
run             run a Nomad Pack                                `make run pack=<pack>`
rerun           destroy and run a Nomad Pack                    `make rerun pack=<pack>`
stop            stop a running Nomad Pack                       `make stop pack=<pack>`
test            test a running Nomad Pack                       `make test pack=<pack>`
restart         restart a Task                                  `make restart task=<task>`
format          format HCL files for all Nomad Packs            `make format`
docs            generate documentation for all Nomad Packs      `make docs`
registry        add Nomad Pack Registry to local environment    `make registry`
help            display a list of Make Targets                  `make help`
_listincludes   list all included Makefiles and *.mk files      `make _listincludes`
_selfcheck      lint Makefile                                   `make _selfcheck`

Adding the Nomad Pack Registry

This Nomad Pack Registry may be added to an environment like so:

make registry

For more information see developer.hashicorp.com.

Running a Nomad Pack

Nomad Packs are stored in the ./packs directory and feature detailed documentation and accompanying files.

A Nomad Pack may be run like so:

make run pack=<pack>

Testing a Nomad Pack

The Nomad Packs in this Registry provide a test harness that may be used to verify the functionality of the Pack.

The harness is exposed through the make env and make test targets:

  • make env starts a Nomad environment, using the configuration stored inside the Pack's ./tests/nomad_config.hcl file.
  • make test runs a Postman Collection, using the requests stored inside the Pack's ./tests/newman.json file.

The make env command automatically creates any directories and variables that are set in ./tests/test.mk.

Additionally, ./tests/gitignored_config.mk may be used to set sensitive variables, such as API tokens, that should not be committed to version control.

Notes

  • Colorized CLI output may be disabled by setting the NO_COLOR environment variable to any non-empty value.
export NO_COLOR=1 && make
  • For nomad-pack arguments that are not supported by the Makefile, the ARGS variable may be used like so:
 make render pack=<pack> ARGS="--render-output-template"
  • The binaries for nomad and nomad-pack may be overridden by setting the BINARY_NOMAD and BINARY_NOMAD_PACK arguments when running the Makefile:
# override `nomad` binary
make render pack=<pack> BINARY_NOMAD=/tmp/nomad

# override `nomad-pack` binary
make render pack=<pack> BINARY_NOMAD_PACK=/tmp/nomad-pack
  • The reporter for newman may be overridden by setting the NEWMAN_REPORTERS argument when running the Makefile:
# override `newman` reporter
make render pack=<pack> NEWMAN_REPORTERS="progress"

Contributors

For a list of current (and past) contributors to this repository, see GitHub.

License

Licensed under the Apache License, Version 2.0 (the "License").

You may download a copy of the License at apache.org/licenses/LICENSE-2.0.

See the License for the specific language governing permissions and limitations under the License.

Footnotes

  1. exec 2

  2. raw_exec 2 3

  3. docker 2 3 4

  4. podman 2 3 4