Commit graph

8517 commits

Author SHA1 Message Date
Alex Dadgar dfcb73c896 Fix purging job versions
This PR fixes an issue in which the job versions weren't properly
cleaned when removing a job.

Fixes https://github.com/hashicorp/nomad/issues/3052
2017-08-18 15:46:03 -07:00
Michael Schurter 51a27cc83d Merge pull request #3031 from hashicorp/f-2924-consul-headers
Add Header and Method support for HTTP checks
2017-08-18 13:35:08 -07:00
Michael Schurter 7ebd429a86 Merge mistake made go fmt fail 2017-08-18 13:19:44 -07:00
James Nugent 196cdf4e64 build: Replace shell scripts with GNUmakefile
This commit replaces the shell script-driven build process for Nomad
with one based around GNU Make (note we _do_ use GNU-specific
constructs), requiring no additional scripts for common cases of
development. The following targets are implemented:

Per-OS/arch combinations:

    Binaries (Host - Mac OS X):
	pkg/darwin_amd64/nomad

    Binaries (Host - Linux):
	pkg/linux_386/nomad
	pkg/linux_amd64/nomad
	pkg/linux_amd64-lxc/nomad
	pkg/linux_arm/nomad
	pkg/linux_arm64/nomad
	pkg/windows_386/nomad
	pkg/windows_amd64/nomad

    Packages (Host - Mac OS X):
	pkg/darwin_amd64.zip

    Packages (Host - Linux):
	pkg/linux_386.zip
	pkg/linux_amd64.zip
	pkg/linux_amd64-lxc.zip
	pkg/linux_arm.zip
	pkg/linux_arm64.zip
	pkg/windows_386.zip
	pkg/windows_amd64.zip

Phony targets:

	dev - Builds for the current host GOOS/GOARCH (unless overriden
	      in the environment)

	release - Builds all appropriate release packages for the
	          current host GOOS/GOARCH (i.e. Windows and Linux
		  packages on a Linux host, Darwin packages on an OSX
		  host)

	generate - Generate code for the current host architecture using
	           `go generate`.

	test - Runs the Nomad test suite

	clean - Removes build artifacts

	travis - Runs `make test` with the wrapper script to prevent
	         Travis CI from timing out.

	help - Displays usage information about commonly used targets.

Note that there are some semantic differences from the previous version.

1. `generate` is no longer a dependency of `dev` builds. This is because
   it causes a rebuild every time, even when no code has changed, since
   `go generate` does not appear to leave file timestamps alone.
   Regardless, it is insufficient to generate on one host OS - it needs
   to be run on each target to ensure everything is generated correctly.

2. `gofmt` is no longer checked. This should be enabled as a linter once
   the `gofmt -s` refactoring will pass on the whole code base, in order
   to avoid special cased checks versus using go-metalinter.

Example Usages:

Make a development build for the current GOOS/GOARCH:

	make dev

Make release build packages appropriate for the host OS:

	make release

Update generated code for the host OS:

	make generate

Run linting checks:

	make check

Build a specific alternative GOOS/GOARCH/tags combination:

	make pkg/linux_amd64-pkg/nomad
	make pkg/linux_amd64-pkg.zip
2017-08-18 06:29:26 +01:00
Alex Dadgar 92b1cf8188 build acl branch 2017-08-17 17:29:33 -07:00
Michael Schurter 5c015da3cb Merge pull request #3021 from clinta/docker-mount2
Expose docker mount options
2017-08-17 16:57:09 -07:00
Michael Schurter 6b8bac4929 Update to latest upstream gopsutil 2017-08-17 16:52:53 -07:00
Michael Schurter b1fa005656 Document check header and method 2017-08-17 16:49:14 -07:00
Michael Schurter 4590b81a0a Add check header and method changelog entry 2017-08-17 16:49:14 -07:00
Michael Schurter c5529bdd16 Put header diff in its own function 2017-08-17 16:49:14 -07:00
Michael Schurter e65fe686ed Test check header error conditions 2017-08-17 16:49:14 -07:00
Michael Schurter fd0e6b092b Error should tell user exactly what type to use 2017-08-17 16:49:14 -07:00
Michael Schurter 7f6e1f3a9c Initializing embedded structs is weird 2017-08-17 16:49:14 -07:00
Michael Schurter 9a466bcf5e Add diff support for ServiceCheck.Header 2017-08-17 16:49:14 -07:00
Michael Schurter 0634eef12a Test createCheckReg 2017-08-17 16:49:14 -07:00
Michael Schurter ff3944a981 Update and test service/check interpolation 2017-08-17 16:49:14 -07:00
Michael Schurter b16304416e Add missing consul/testutil/retry pkg 2017-08-17 16:44:21 -07:00
Michael Schurter a4029a7948 Add jobspec test for check method/header 2017-08-17 16:44:21 -07:00
Michael Schurter 4e72a8dedf Update Consul to v0.9.2 for Header and Method 2017-08-17 16:44:21 -07:00
Michael Schurter bb8d5689d8 Add Header and Method support for HTTP checks 2017-08-17 16:44:21 -07:00
Michael Schurter 8b0fe6b2fd Fix broken link 2017-08-17 16:39:19 -07:00
Michael Schurter 93800d51b3 Add shutdown delay changelog entry 2017-08-17 14:39:42 -07:00
Michael Schurter b4813747d0 Merge pull request #3043 from hashicorp/f-2441-shutdown-delay
Add optional shutdown delay to tasks
2017-08-17 14:37:48 -07:00
Michael Schurter c709251ed6 Lower ShutdownDelay for non-Travis testing 2017-08-17 14:23:42 -07:00
Alex Dadgar 6669cf3c59 changelog 2017-08-17 14:13:25 -07:00
Alex Dadgar 3f5b7204dc Merge pull request #3051 from hashicorp/b-batcher
Fix race creating EvalFuture
2017-08-17 14:12:51 -07:00
Michael Schurter 8fdd58f55e Fix ShutdownDelay diff test 2017-08-17 14:05:51 -07:00
Michael Schurter b33b2fb4c0 Lower shutdown delay in test 2017-08-17 13:57:22 -07:00
Alex Dadgar 782abf4098 Fix race creating EvalFuture
This PR fixes https://github.com/hashicorp/nomad/issues/3044
2017-08-17 13:23:58 -07:00
Michael Schurter 188e89c77f Add ShutdownDelay to JSON Job docs 2017-08-17 11:30:29 -07:00
Michael Schurter 0726ca75e3 Make shutdown delay log DEBUG, not INFO 2017-08-17 11:28:33 -07:00
Alex Dadgar 83900faf79 Merge pull request #3048 from hashicorp/f-pre-push
Add a shared git hooks directory
2017-08-17 11:02:35 -07:00
Alex Dadgar 38f986ca7e Add a shared git hooks directory
This PR adds a place to share git hooks.
2017-08-17 10:55:53 -07:00
Michael Schurter dcc25db4a4 Merge pull request #3045 from slobo/patch-1
Spelling fix: stana -> stanza
2017-08-17 09:24:11 -07:00
Clint Armstrong f0460156ae restrict mount to volume type 2017-08-17 09:52:13 -04:00
Slobodan Mišković 7b5e5d695b Spelling fix: stana -> stanza 2017-08-16 23:32:41 -07:00
Michael Schurter d529b422b2 Add optional shutdown delay to tasks
Fixes #2441

Defaults to 0 (no delay) for backward compat and because this feature
should be opt-in.
2017-08-16 17:59:46 -07:00
Alex Dadgar ec10e07f61 bump version 2017-08-16 16:45:54 -07:00
Alex Dadgar 895c87252c Merge pull request #3042 from hashicorp/f-version
Add version package
2017-08-16 16:32:31 -07:00
Michael Schurter e569763196 Add #3041 to changelog 2017-08-16 16:27:32 -07:00
Alex Dadgar d6187cd3e8 Fix tests 2017-08-16 16:26:52 -07:00
Alex Dadgar 1a86aecf55 Add version package
This PR adds a version package and consolidates version strings into a
Version struct.
2017-08-16 15:44:21 -07:00
Michael Schurter 192db801d1 Update gopsutil to stop calling SetEnv
Fixes #3036
2017-08-16 15:05:24 -07:00
James Rasell 0d120228ea Updates based on feedback provided by dadgar. 2017-08-16 22:19:31 +01:00
Chelsea Komlo 755cc33f13 Merge pull request #3037 from hashicorp/b-limit-tab-autocomplete
Tab completion should only happen once
2017-08-16 14:25:14 -04:00
Alex Dadgar 828b9bfae4 fix http test 2017-08-16 11:01:12 -07:00
Alex Dadgar 3d69961c3a Must be root for TestAllocDir_CreateDir 2017-08-16 10:46:14 -07:00
Chelsea Holland Komlo c083af1e7c tab completion should only happen once 2017-08-16 17:04:47 +00:00
Chelsea Komlo 1ff04de2a7 Merge pull request #3026 from hashicorp/f-autocomplete-job-eval-node
Add autocomplete for nodes, evals, and jobs
2017-08-15 17:12:17 -04:00
Chelsea Holland Komlo 68679ee265 tests for autocomplete functions 2017-08-15 20:21:50 +00:00