Find a file
Mahmood Ali 067fd86a8c
drivers: Capture exit code when task is killed (#10494)
This commit ensures Nomad captures the task code more reliably even when the task is killed. This issue affect to `raw_exec` driver, as noted in https://github.com/hashicorp/nomad/issues/10430 .

We fix this issue by ensuring that the TaskRunner only calls `driver.WaitTask` once. The TaskRunner monitors the completion of the task by calling `driver.WaitTask` which should return the task exit code on completion. However, it also could return a "context canceled" error if the agent/executor is shutdown.

Previously, when a task is to be stopped, the killTask path makes two WaitTask calls, and the second returns "context canceled" occasionally because of a "race" in task shutting down and depending on driver, and how fast it shuts down after task completes.

By having a single WaitTask call and consistently waiting for the task, we ensure we capture the exit code reliably before the executor is shutdown or the contexts expired.

I opted to change the TaskRunner implementation to avoid changing the driver interface or requiring 3rd party drivers to update.

Additionally, the PR ensures that attempts to kill the task terminate when the task "naturally" dies. Without this change, if the task dies at the right moment, the `killTask` call may retry to kill an already-dead task for up to 5 minutes before giving up.
2021-05-04 10:54:00 -04:00
.circleci update golang to 1.16.3 (#10484) 2021-04-30 13:52:05 -04:00
.github website: add check for unlinked content (#10425) 2021-04-23 11:11:09 -04:00
acl added new policy capabilities for recommendations API 2020-10-28 14:32:16 +00:00
api api: actually set MemoryOversubscriptionEnabled (#10493) 2021-05-02 22:53:53 -04:00
client drivers: Capture exit code when task is killed (#10494) 2021-05-04 10:54:00 -04:00
command api: actually set MemoryOversubscriptionEnabled (#10493) 2021-05-02 22:53:53 -04:00
contributing update golang to 1.16.3 (#10484) 2021-04-30 13:52:05 -04:00
demo demo: apply hclfmt to ceph files 2021-05-03 09:27:26 -06:00
dev docs: swap master for main in Nomad repo 2021-03-08 14:26:31 -05:00
devices/gpu/nvidia Add gocritic to golangci-lint config (#9556) 2020-12-08 12:47:04 -08:00
dist dist: clarify minimum systemd version for example service file 2021-02-23 09:06:27 -06:00
drivers docker: improve error message for auth helper 2021-05-03 11:30:12 -04:00
e2e Merge pull request #10248 from hashicorp/f-remotetask-2021 2021-04-30 08:57:26 -07:00
helper connect: use exp backoff when waiting on consul envoy bootstrap 2021-04-27 09:21:50 -06:00
integrations spelling: registrations 2018-03-11 18:40:53 +00:00
internal/testing/apitests tests: non-CAS should be updated 2020-06-26 10:48:33 -04:00
jobspec oversubscription: add memory_max to hclv1 2021-03-30 16:55:58 -04:00
jobspec2 hcl2: handle unquoted undefined variables (#10419) 2021-04-21 13:24:22 -04:00
lib lib/cpuset: add String and ContainsAny helpers 2021-04-13 13:28:36 -04:00
nomad connect: use deterministic injected dynamic exposed port 2021-04-30 15:18:22 -06:00
plugins core: propagate remote task handles 2021-04-27 15:07:03 -07:00
scheduler Merge pull request #10248 from hashicorp/f-remotetask-2021 2021-04-30 08:57:26 -07:00
scripts update golang to 1.16.3 (#10484) 2021-04-30 13:52:05 -04:00
terraform docs: swap master for main in Nomad repo 2021-03-08 14:26:31 -05:00
testutil Fixup uses of sanity (#10187) 2021-03-16 18:05:08 -04:00
tools build: install buf during bootstrap 2021-04-06 09:42:44 -06:00
ui ui: Fix bug where switching topo viz allocation highlights doesn’t update charts (#10490) 2021-05-03 10:36:18 -05:00
vendor api: actually set MemoryOversubscriptionEnabled (#10493) 2021-05-02 22:53:53 -04:00
version post-1.0.4 release prep 2021-02-24 09:56:53 -05:00
website remove license put command references (#10501) 2021-05-04 08:39:56 -04:00
.gitattributes Remove invalid gitattributes 2018-02-14 14:47:43 -08:00
.gitignore ignore local e2e files 2021-04-27 15:07:03 -07:00
.golangci.yml fix: golangci-lint with -mod=vendor 2021-04-03 10:25:06 +02:00
build_linux_arm.go Fix 32bit arm build 2017-02-09 11:22:17 -08:00
CHANGELOG.md Merge pull request #10492 from hashicorp/b-expose-diff 2021-05-03 09:00:34 -06:00
GNUmakefile Merge pull request #10296 from hashicorp/c-script-tweaks-20210402 2021-04-07 16:54:43 -04:00
go.mod update golang to 1.16.3 (#10484) 2021-04-30 13:52:05 -04:00
go.sum vendor: update aws-sdk-go and deps 2021-04-27 15:07:03 -07:00
LICENSE Initial commit 2015-06-01 12:21:00 +02:00
main.go add helper commands for debugging state 2020-08-31 08:45:59 -04:00
main_test.go Adding initial skeleton 2015-06-01 13:46:21 +02:00
README.md README: Align with Consul README (#9681) 2020-12-18 09:38:34 -08:00
Vagrantfile proto: Switch to using buf (#9308) 2020-11-17 07:01:48 -08:00

Nomad Build Status Discuss

HashiCorp Nomad logo

Nomad is a simple and flexible workload orchestrator to deploy and manage containers (docker, podman), non-containerized applications (executable, Java), and virtual machines (qemu) across on-prem and clouds at scale.

Nomad is supported on Linux, Windows, and macOS. A commercial version of Nomad, Nomad Enterprise, is also available.

Nomad provides several key features:

  • Deploy Containers and Legacy Applications: Nomads flexibility as an orchestrator enables an organization to run containers, legacy, and batch applications together on the same infrastructure. Nomad brings core orchestration benefits to legacy applications without needing to containerize via pluggable task drivers.

  • Simple & Reliable: Nomad runs as a single binary and is entirely self contained - combining resource management and scheduling into a single system. Nomad does not require any external services for storage or coordination. Nomad automatically handles application, node, and driver failures. Nomad is distributed and resilient, using leader election and state replication to provide high availability in the event of failures.

  • Device Plugins & GPU Support: Nomad offers built-in support for GPU workloads such as machine learning (ML) and artificial intelligence (AI). Nomad uses device plugins to automatically detect and utilize resources from hardware devices such as GPU, FPGAs, and TPUs.

  • Federation for Multi-Region, Multi-Cloud: Nomad was designed to support infrastructure at a global scale. Nomad supports federation out-of-the-box and can deploy applications across multiple regions and clouds.

  • Proven Scalability: Nomad is optimistically concurrent, which increases throughput and reduces latency for workloads. Nomad has been proven to scale to clusters of 10K+ nodes in real-world production environments.

  • HashiCorp Ecosystem: Nomad integrates seamlessly with Terraform, Consul, Vault for provisioning, service discovery, and secrets management.

Quick Start

Testing

See Learn: Getting Started for instructions on setting up a local Nomad cluster for non-production use.

Optionally, find Terraform manifests for bringing up a development Nomad cluster on a public cloud in the terraform directory.

Production

See Learn: Nomad Reference Architecture for recommended practices and a reference architecture for production deployments.

Documentation

Full, comprehensive documentation is available on the Nomad website: https://www.nomadproject.io/docs

Guides are available on HashiCorp Learn.

Contributing

See the contributing directory for more developer documentation.