Alex Dadgar
e509661cf9
executor and logging pkg
2017-07-21 12:14:54 -07:00
Alex Dadgar
7c433a1767
Parallel
2017-07-21 12:06:39 -07:00
Karel Malec
4b98f94a88
Allow rkt driver to mount volumes read-only
2017-07-21 13:05:15 +02:00
Karel Malec
cf985f011c
Pass task group name as NOMAD_GROUP_NAME environment variable
2017-07-21 01:22:54 +02:00
Michael Schurter
0a6bf87365
Fix nil panic in Docker error condition
...
Fixes #2835
Yet another bug caused by overwriting container and then trying to
reference container.ID in the err handling block. Did a quick audit of
docker.go and it seems to be the last offender. See #2804 for previous
bug.
2017-07-14 10:48:19 -07:00
Michael Schurter
95a9a5da71
Merge pull request #2787 from hashicorp/f-docker-test-mac
...
Test #2652 - Docker MAC Address option
2017-07-07 16:22:10 -07:00
Michael Schurter
4be4df21c9
Merge pull request #2797 from hashicorp/f-2785-docker-bridge-ip
...
Add driver.docker.bridge_ip node attribute
2017-07-07 16:20:20 -07:00
Michael Schurter
94389c3ecc
Remove debug logging
2017-07-07 16:19:42 -07:00
Michael Schurter
5e3e3818db
Merge pull request #2804 from hashicorp/b-2802-docker-panic
...
Don't panic in container list/remove/inspect race
2017-07-07 15:35:51 -07:00
Michael Schurter
67a7b0eac9
Don't panic in container list/remove/inspect race
...
Fixes #2802
While it's hard to reproduce the theoretical race is:
1. This goroutine calls ListContainers()
2. Another goroutine removes a container X
3. This goroutine attempts to InspectContainer(X)
However, this bug could be hit in the much simpler case of
InspectContainer() timing out.
In those cases an error is returned and the old code attempted to wrap
the error with the now-nil container.ID. Storing the container ID fixes
that panic.
2017-07-07 15:10:59 -07:00
Alex Dadgar
45712c6ca3
test fixes
2017-07-07 14:11:27 -07:00
Alex Dadgar
067ed86a47
Client watches for allocation health using task state and Consul checks
...
This PR adds watching of allocation health at the client. The client can
watch for health based on the tasks running on time and also based on
the consul checks passing.
2017-07-07 12:10:04 -07:00
Alex Dadgar
c77944ed29
assign names
2017-07-07 12:03:11 -07:00
Michael Schurter
084dd384c1
Add driver.docker.bridge_ip node attribute
...
Fixes #2785
2017-07-07 10:14:10 -07:00
Michael Schurter
39edf23fd5
Merge pull request #2786 from hashicorp/f-docker-auth-soft-fail
...
Default to auth hard fail but optionally soft fail
2017-07-06 13:25:56 -07:00
Michael Schurter
bae1b7db2d
Test #2652
...
Also cleanup docker config opts docs
2017-07-06 12:46:25 -07:00
Michael Schurter
8f4353779a
Merge branch 'master' into master
2017-07-06 12:09:36 -07:00
Michael Schurter
2900f941b5
Default to auth hard fail but optionally soft fail
2017-07-06 11:35:34 -07:00
Michael Schurter
b000bb8598
Merge pull request #2744 from aep/master
...
Do not fail when no docker registry auth is available
2017-07-06 11:04:11 -07:00
Michael Schurter
8e2e26c607
rkt: use %s instead of %q when interpolating env
...
Fixes #2686
2017-07-05 09:36:17 -07:00
Arvid E. Picciani
aa4f029f10
Do not fail when no docker registry auth is available
...
this amends the behaviour introduced with #2651
and allows pulling public images when docker.auth.helper is set
2017-06-27 11:11:18 +02:00
Michael Schurter
8fcf866a7d
Fix some tests still expecting reverted behavior
2017-06-23 16:51:38 -07:00
Michael Schurter
5a274e6683
Style and comments
2017-06-23 15:20:04 -07:00
Michael Schurter
f3a6ddc57d
Remove DRIVER env vars
...
Also make NOMAD_ADDR_* use host ip:port for consistency. NOMAD_PORT_*
varies based on port map and the driver IP isn't exposed as an env var
as the only place it can be used is in script checks anyway.
2017-06-21 17:19:08 -07:00
Michael Schurter
0633d0c286
Have Qemu return PortMap
2017-06-21 17:19:08 -07:00
Michael Schurter
38a0695687
Simplify Docker Networks processing
2017-06-21 17:19:08 -07:00
Michael Schurter
fec83b271a
Bump error log level
2017-06-21 17:19:08 -07:00
Michael Schurter
8d677bc6b9
Fix lxc tests
2017-06-21 17:19:08 -07:00
Michael Schurter
8d440b1675
Skip DRIVER env vars for labels without a port mapping
2017-06-21 17:19:08 -07:00
Michael Schurter
c0eff81383
Fix Service.AddressMode changes during task updates
2017-06-21 17:19:08 -07:00
Michael Schurter
67d154a274
Test driver network advertisement and checks
2017-06-21 17:19:08 -07:00
Michael Schurter
b9bfb84b53
Implement DriverNetwork and Service.AddressMode
...
Ideally DriverNetwork would be fully populated in Driver.Prestart, but
Docker doesn't assign the container's IP until you start the container.
However, it's important to setup the port env vars before calling
Driver.Start, so Prestart should populate that.
2017-06-21 17:19:08 -07:00
Hynek Schlawack
59ab34c264
Fix typos
2017-06-16 16:10:12 +02:00
Michael Schurter
b69e060071
Log PID when sending signals
2017-06-12 11:11:36 -07:00
Michael Schurter
ffb417a300
Merge pull request #2697 from hashicorp/b-port-map
...
Fix port map interpolation for docker
2017-06-09 13:29:36 -07:00
Michael Schurter
a3827d2cc6
Fix bad merge conflict resolution
2017-06-09 10:40:47 -07:00
Michael Schurter
784d69789e
Merge branch 'master' into add-no-overlay-option
2017-06-08 13:15:56 -07:00
Alex Dadgar
7695e636d5
Fix port map interpolation for docker
...
This PR fixes an issue in which the value of the portmap could not be
interpolated.
Fixes https://github.com/hashicorp/nomad/issues/2680
2017-06-08 13:12:32 -07:00
Karel Malec
b55f4bf601
Fix backticks in docs; refine --debug comment
2017-06-07 21:11:22 +02:00
Karel Malec
a258a803f2
Added insecure_options config list
2017-06-07 09:58:42 +02:00
Karel Malec
1957e9dfa6
Add a no_overlay option for the rkt task config.
2017-06-07 00:17:33 +02:00
Alex Dadgar
3b46fe136f
small cleanup
2017-05-31 15:56:54 -07:00
Alex Dadgar
8d6e28ace8
Merge branch 'master' into feature/2334
2017-05-31 14:27:07 -07:00
Alex Dadgar
ec9cb2c751
Merge pull request #2672 from eyberg/master
...
dont throw away errors in log rotation
2017-05-31 14:14:22 -07:00
Ulrik Mikaelsson
6138564f00
Implement support for docker-credential-helpers
...
Solves: #2334
2017-05-31 12:45:02 +02:00
Michael Schurter
51d8231911
Fix executor tests
2017-05-26 16:46:03 -07:00
Michael Schurter
3184616936
Always use PATH-only env for rkt commands
2017-05-26 15:41:26 -07:00
Michael Schurter
83543b1d80
Use custom TaskEnv to provide PATH for rkt
2017-05-26 15:24:14 -07:00
Michael Schurter
3afade9675
Let's pretend I never committed this
2017-05-26 15:06:59 -07:00
Ian Eyberg
3fbc58997b
dont throw away errors in log rotation
2017-05-25 11:49:33 -07:00
Michael Schurter
a233b0401d
Add env testing
2017-05-23 16:46:29 -07:00
Michael Schurter
15ef740ab6
Add env.Builder.UpdateTask for alloc updates
2017-05-23 16:00:57 -07:00
Michael Schurter
fd9bef768f
Move task env into execcontext
...
Also inject PATH into rkt commands since we're no longer appending host
env vars for it.
2017-05-23 13:53:34 -07:00
Michael Schurter
59ad200d1a
Fix env var interpolation and env tests
2017-05-23 13:53:34 -07:00
Michael Schurter
37b148fb60
Add PortMap to struct returned by Driver.Prestart
...
Moves env.Builder out of drivers entirely so one less thing to worry
about when implementing driver plugins.
2017-05-23 13:53:34 -07:00
Michael Schurter
a2eb7d17c9
Improve PortMap handling and simplify Builder creation
2017-05-23 13:53:34 -07:00
Michael Schurter
d2c08ff24b
Refactor TaskEnvironment into Builder and TaskEnv
2017-05-23 13:53:33 -07:00
Michael Schurter
10b6610e56
Functional consul template env file support
2017-05-23 13:45:14 -07:00
Brandon Fulljames
6d7caa5f6b
Fix for test
2017-05-19 16:59:07 -07:00
Brandon Fulljames
6b2d5bd4fd
Add SecurityOpt as a config field in Docker driver
2017-05-19 16:18:49 -07:00
johannesa
323a0a78f3
Fixed wrong newline
2017-05-17 16:51:22 +02:00
johannesa
ea644237cf
mac address pinning in docker driver
...
This commit adds mac address pining to the docker driver.
2017-05-17 16:41:00 +02:00
Alex Dadgar
68c3a2bd98
Fix vet errors
2017-05-11 13:08:08 -07:00
Alex Dadgar
23685d65d0
Merge pull request #2610 from hashicorp/f-bolt-db
...
Client persist state using bolt-db and more efficient write patterns
2017-05-09 13:01:36 -07:00
Michael Schurter
3b15db1ac4
Ignore Consul deregister errors on executors
...
Errors here only occur if Consul is not running when Nomad is restarted.
Errors here are only an issue if:
* Consul is being used but is down or misbehaving
* The executor is old (<0.6)
* The task has services
* The services hit a pre-0.6 consul.Syncer bug
If all of those conditions are met the pre-0.6 bugs will persist for
this task until Nomad is restarted.
2017-05-09 11:28:27 -07:00
Alex Dadgar
ba70cc4f01
Merge branch 'master' into f-bolt-db
2017-05-09 11:11:55 -07:00
Michael Schurter
5b8415df2c
Merge pull request #2585 from hashicorp/b-2554-container-exec
...
Execute exec/java script checks in containers
2017-05-05 10:31:18 -07:00
Michael Schurter
897b516117
Reuse ExecScript implementation
2017-05-04 16:21:40 -07:00
Alex Dadgar
2d54ee2925
Fix tests
2017-05-03 15:14:19 -07:00
Kate Taggart
706e09748b
fix test.
2017-05-03 12:45:59 -07:00
Kate Taggart
2fb6301b37
responding to feedback on PR: remove Region from Node struct, some grammatical niceties.
2017-05-03 12:45:59 -07:00
Kate Taggart
af22cb722e
I think I did it.
2017-05-03 12:45:59 -07:00
Kate Taggart
277d5ddb36
allow region to also be interpolated, like datacenter.
2017-05-03 12:45:59 -07:00
Kate Taggart
9fa97c38a0
just found out dc and region are going to be a bit different, as Region didn't previously exist in the Node struct.
2017-05-03 12:45:59 -07:00
Kate Taggart
1a5ebace03
add helper functions to set and clear dc, region names.
2017-05-03 12:45:59 -07:00
Kate Taggart
2062d5d1dc
add dc and region to task env building function. flipped order of a couple functions to be consistent with the ordering of the rest of that section.
2017-05-03 12:45:59 -07:00
Kate Taggart
e572ec8997
starting the jelly bean trail for two new env vars
2017-05-03 12:45:59 -07:00
Alex Dadgar
b94f855326
boltDB database for client state
2017-05-01 14:50:34 -07:00
Michael Schurter
b965708c51
Test env+cgroups for exec driver checks
2017-04-25 11:13:06 -07:00
Michael Schurter
c069ca0bfe
Change raw_exec to use simplified exec wrapper
2017-04-21 16:50:20 -07:00
Michael Schurter
095d2ee340
Switch java/exec to use Exec in Executor
2017-04-21 16:25:49 -07:00
Michael Schurter
a63162c7ff
Fix Windows build.
2017-04-19 13:16:48 -07:00
Michael Schurter
a3fc157233
Fix circular test imports
2017-04-19 12:42:47 -07:00
Michael Schurter
caf317e3f2
Use a DriverAbility to expose Exec functionality
2017-04-19 12:42:47 -07:00
Michael Schurter
745ad9521f
Move ScriptExecutor to driver
2017-04-19 12:42:47 -07:00
Michael Schurter
e204a287ed
Refactor Consul Syncer into new ServiceClient
...
Fixes #2478 #2474 #1995 #2294
The new client only handles agent and task service advertisement. Server
discovery is mostly unchanged.
The Nomad client agent now handles all Consul operations instead of the
executor handling task related operations. When upgrading from an
earlier version of Nomad existing executors will be told to deregister
from Consul so that the Nomad agent can re-register the task's services
and checks.
Drivers - other than qemu - now support an Exec method for executing
abritrary commands in a task's environment. This is used to implement
script checks.
Interfaces are used extensively to avoid interacting with Consul in
tests that don't assert any Consul related behavior.
2017-04-19 12:42:47 -07:00
Alex Dadgar
cdd624ff5b
Add ExtraHosts to Docker driver
...
This PR allows job submitters to add extra hosts to the containers
/etc/hosts file.
Fixes https://github.com/hashicorp/nomad/issues/2546
2017-04-11 10:52:41 -07:00
Clint Armstrong
d71ddcb756
Allow specifying container IP with docker driver
2017-04-07 11:56:07 -04:00
Alex Dadgar
d0da30324e
Split driver tests
2017-04-04 15:12:14 -07:00
Robert Neumayer
804f83f1fb
Fix typo and be consistent in naming
2017-03-29 09:33:54 +02:00
Michael Schurter
ae3810052d
Merge pull request #2482 from hashicorp/f-2289-better-artifact-err
...
Improve artifact download error message
2017-03-28 12:48:22 -07:00
Michael Schurter
2d07b75308
Recoverable struct field must be exported
2017-03-28 12:18:57 -07:00
Michael Schurter
1653b42400
Merge branch 'master' into b-2491-task-env
2017-03-28 11:28:00 -07:00
Alex Dadgar
5e7e19de4b
Merge pull request #2461 from hashicorp/b-groups
...
Various fixes for setting user/group of task
2017-03-28 11:13:27 -07:00
Alex Dadgar
3b493b29b0
Merge pull request #2488 from hashicorp/f-node-values-template
...
Access Node Meta and Attrs in template
2017-03-28 11:10:29 -07:00
Alex Dadgar
5b36a90723
feedback
2017-03-28 11:10:11 -07:00
Michael Schurter
d58bcde183
Make test more accurate and add changelog entry
2017-03-28 10:53:26 -07:00
Michael Schurter
9a0c66b55b
Don't take a reference a var in a loop
...
Fixes #2491
2017-03-28 10:16:27 -07:00
Michael Schurter
41dcc72033
Recoverable is a method now, not a field
2017-03-27 15:41:35 -07:00
Michael Schurter
507862ade3
Add WrapRecoverable helper
2017-03-27 15:37:15 -07:00
Alex Dadgar
23562d77c9
Access Node Meta and Attrs in template
...
This PR allows accessing the Node's attributes and metadata as in a
template.
```
template {
data = "{{ env \"attr.unique.network.ip-address\" }}"
destination = "local/out"
}
```
2017-03-27 15:15:33 -07:00
Alex Dadgar
4ecebe7d8c
Proper reference counting through task restarts
...
This PR fixes an issue in which the reference count on a Docker image
would become inflated through task restarts.
2017-03-25 17:05:53 -07:00
Michael Schurter
0e6c564406
Improve artifact download error message
...
Fixes #2289
Unfortunately took more RecoverableError hijinx than I would have liked.
There might be a better way.
2017-03-24 15:26:05 -07:00
Alex Dadgar
a171a014b3
Various fixes for setting user/group of task
...
This PR fixes two issues:
* Folder permissions in -dev mode were incorrect and not suitable for
running as a particular user.
* Was not setting the group membership properly for the launched
process.
Fixes https://github.com/hashicorp/nomad/issues/2160
2017-03-20 14:21:13 -07:00
Michael Schurter
9f8067e340
Fix test by adding new env vars
2017-03-14 17:15:12 -07:00
Alex Dadgar
d220d9405b
return the recoverable err
2017-03-14 16:33:36 -07:00
Alex Dadgar
5f7bf577cd
Docker doesn't need to init the stats helper
2017-03-14 13:41:57 -07:00
Alex Dadgar
a1a7941dec
Various fixes
...
This PR:
* Uses Go 1.8 executable lookup
* Stores any err message from stats init method
* Allows overriding of Cpu Compute for hosts where it can't be detected
2017-03-14 12:56:31 -07:00
Michael Schurter
047b41f469
Merge pull request #2408 from hashicorp/b-2358-rkt-volume-name
...
Replace `_` with `-` in task names for rkt volumes
2017-03-14 10:10:00 -07:00
Michael Schurter
71783e8e41
Add NOMAD_{IP,PORT}_<task>_<label> env vars
2017-03-10 12:17:43 -08:00
Michael Schurter
16adc44358
Round two of env var cleaning
...
Should bring us into conformance with IEEE Std 1003.1, 2004 Edition:
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html
1 alloc/op and ~80ns/op on my machine.
2017-03-08 16:46:13 -08:00
Michael Schurter
a724779720
Replace `_` with `-` in task names for rkt volumes
...
Fixes #2358
2017-03-07 14:34:57 -08:00
Michael Schurter
518e4f75a6
Replace "-" in env var keys with "_"
...
Fixes #2405
2017-03-06 19:57:44 -08:00
Alex Dadgar
5cd43e837a
Merge branch 'master' into b-remount
2017-03-02 19:23:13 -08:00
Michael Schurter
200d31e2e6
Fix tests broken by API change
2017-03-02 15:54:12 -08:00
Michael Schurter
8ac632c3ff
Fix API breaks in tests
2017-03-02 15:50:18 -08:00
Tom Michaud
b4db9d33f9
Fixes docker-driver docker.auth.config processing
2017-03-01 16:16:11 -07:00
Alex Dadgar
d2193048ce
Fix caching of pull future
2017-02-28 18:19:13 -08:00
Alex Dadgar
48ab2a6c6a
Delete on increment and add a safety guard
2017-02-27 20:23:21 -08:00
Alex Dadgar
3dc0e38feb
Merge branch 'master' of github.com:hashicorp/nomad
2017-02-27 19:09:50 -08:00
Alex Dadgar
254b0e4ca6
Fix delete future
2017-02-27 19:09:13 -08:00
Alex Dadgar
5be806a3df
Fix vet script and fix vet problems
...
This PR fixes our vet script and fixes all the missed vet changes.
It also fixes pointers being printed in `nomad stop <job>` and `nomad
node-status <node>`.
2017-02-27 16:00:19 -08:00
Alex Dadgar
c423626484
Docker open stores image/image ID for next ID
2017-02-27 13:49:54 -08:00
Alex Dadgar
aa05ecc37c
Merge pull request #2361 from hashicorp/f-docker-coordination
...
Docker Image Coordinator and caching
2017-02-24 14:18:21 -08:00
Alex Dadgar
b5d4f39734
Docker Image Coordinator
...
This PR introduces a coordinator for doing CRUD on a Docker image. It
should fix racy deletion of images. The issue before was images would be
deleted between prestart and start causing an error.
2017-02-24 13:20:40 -08:00
Michael Schurter
f61b7975a3
Put access to Docker volume drivers behind flag
2017-02-23 15:47:36 -08:00
Alex Dadgar
2239503e6e
Fix noisy log
2017-02-23 14:40:24 -08:00
Pietro Menna
2f88d6cb68
Docker Volume Drivers
...
This commit adds the functionality to use Docker Volume Drivers.
2017-02-23 14:36:32 -03:00
Alex Dadgar
d2cbbac76e
Merge pull request #2347 from hashicorp/b-parse
...
Remove defaulting from parse and fix tests
2017-02-22 18:42:43 -08:00
Alex Dadgar
b5995c6cd7
Vendor + test fixes
2017-02-22 15:55:33 -08:00
Michael Schurter
12c549d6a0
Skip setting MemorySwap on Windows
...
Windows doesn't support this Docker setting.
Fixes #2193
2017-02-21 13:21:42 -08:00
Alex Dadgar
d0fd0e277a
Don't force uppercase meta keys in env vars
2017-02-20 19:51:24 -08:00
Alex Dadgar
f9323f03df
Drivers log during fingerprinting
...
This PR fixes a regression in which some drivers did not log during
fingerprinting.
2017-02-20 19:35:51 -08:00
Alex Dadgar
c62cd5cc55
Revendor docker client
2017-02-14 17:34:05 -08:00
Michael Schurter
aef3c2e380
Handle createdResourcs=nil
...
Combined with b522c472fdf this fixes #2256
Without these two commits in place upgrades to 0.5.3 panics.
2017-01-31 10:51:32 -08:00
Alex Dadgar
44d63318a4
Add nil guard
2017-01-31 09:19:59 -08:00
Alex Dadgar
0933bcadf9
Fix import
2017-01-25 21:27:36 -08:00
Alex Dadgar
b7e8bae128
Fix unreachable function in tests
2017-01-25 20:58:24 -08:00
Alex Dadgar
68fd18f5cf
small env fix
2017-01-25 10:42:11 -08:00
Alex Dadgar
75e3f2c996
Fix fsm/env test
2017-01-24 09:36:22 -08:00
Alex Dadgar
985598d4b5
Fix test
2017-01-23 16:33:35 -08:00
Diptanu Choudhury
264a0c46cf
Merge pull request #2223 from hashicorp/f-env-addr
...
Setting the Addrs of sibling tasks in the env
2017-01-23 15:05:48 -08:00
Diptanu Choudhury
fda3a5250c
Merge pull request #2222 from hashicorp/b-docker-image-not-found
...
Making the docker driver retry when an image is not found
2017-01-23 14:58:00 -08:00
Diptanu Choudhury
dfd1f03ec8
Added a comment
2017-01-23 14:57:30 -08:00
Alex Dadgar
e160b2b38f
Add test and better logs
...
This commit adds a test to retrieving auth configurations, use either
the auth block in the config or specified via the agent config and adds
a log if lookup fails.
2017-01-23 14:48:02 -08:00
Alex Dadgar
43a17b7d74
Close file
2017-01-23 11:37:45 -08:00
Alex Dadgar
ee5296ba70
Deprecation notice
2017-01-23 11:32:51 -08:00
Alex Dadgar
3365688571
Remove SSL
2017-01-23 11:32:51 -08:00
Alex Dadgar
4a627b02ca
undo
2017-01-23 11:32:51 -08:00
Alex Dadgar
08733b68d2
vendor
2017-01-23 11:32:51 -08:00
Alex Dadgar
b1823a5fdb
Better auth lookup
2017-01-23 11:32:51 -08:00
Alex Dadgar
3d5b31fc96
WIP
2017-01-23 11:32:51 -08:00
Alex Dadgar
ec6b6e69d4
remove reference to entrypoint
2017-01-22 14:04:41 -08:00
Diptanu Choudhury
fe4ae25eea
Setting the Addrs of sibling tasks in the env
2017-01-20 14:15:53 -08:00
Michael Schurter
de7dbf5ff9
Fix java tests
2017-01-20 14:12:30 -08:00
Michael Schurter
a28fc4798a
Merge pull request #2215 from hashicorp/b-2211-host-env
...
Fix image based drivers having host env vars set
2017-01-20 13:16:44 -08:00
Michael Schurter
295c2bf74a
Merge pull request #2186 from hashicorp/f-driver-cleanup
...
Add Cleanup method to Driver interface
2017-01-20 13:02:14 -08:00
Diptanu Choudhury
be7081568c
Making the docker driver retry when an image is not found
2017-01-20 12:38:04 -08:00
Michael Schurter
010a7709f1
Bump unknown resource to ERR
2017-01-19 09:48:07 -08:00
Michael Schurter
f94210b4bc
Fix image based drivers having host env vars set
...
Add detailed tests for GetTaskEnv to avoid this issue happening again!
Fixes #2211
2017-01-18 10:27:03 -08:00
Michael Schurter
578272b7f2
Add CreatedResources.Remove and use it
2017-01-17 16:41:59 -08:00
Michael Schurter
1bcf7cdbfe
Remove outdated comment
2017-01-17 16:23:29 -08:00
Michael Schurter
82b49d4547
Updated CreatedResources as images are cleaned
2017-01-17 16:13:40 -08:00
Michael Schurter
beed31ff6f
Remove outdated comment
2017-01-17 16:05:21 -08:00
Michael Schurter
b9d6d2c8d6
Return error from Prestart
2017-01-17 16:04:09 -08:00
Michael Schurter
15952e5d17
Try to get test passing in Travis
2017-01-17 12:51:19 -08:00
Michael Schurter
255698e8af
Use Image ID instead of Image Name
2017-01-13 16:53:58 -08:00
Michael Schurter
a3a3656dbb
Switch to use recoverable errors from Cleanup
...
TaskRunner handles retrying but Cleanup handles all of CreatedResources.
2017-01-13 16:46:08 -08:00
Alex Dadgar
78deb8b292
Support setting class_path and class name.
...
This PR enhances the java driver to allow setting the class path and
class name to run. It also fixes an issue that would make the Java
driver attempt to chroot regardless of operating system (this never
effected a released version of Nomad).
2017-01-13 16:03:11 -08:00
Michael Schurter
25bf266606
Add ID to output
2017-01-13 12:46:55 -08:00
Michael Schurter
dc68aa1a5a
Return errors from cleanup and let TaskRunner retry
2017-01-12 17:21:54 -08:00
Diptanu Choudhury
6809a4b104
Added executorconfig
2017-01-12 15:47:58 -08:00
Diptanu Choudhury
b1d0078db5
Filter executor log messages
2017-01-12 11:54:19 -08:00
Michael Schurter
ec81325ddc
Stop being so confusing
2017-01-12 11:17:35 -08:00
Michael Schurter
4d081490e6
Add Cleanup method to Driver interface
...
Cleanup can be used for cleaning up resources created by drivers to run
a task. Initially the Docker driver is the only user (to remove
downloaded images).
2017-01-11 17:23:33 -08:00
Cameron Davison
c910f9b304
using new ctx instead of getting both params back
2017-01-10 16:54:01 -06:00
Cameron Davison
7ccbd8a000
fixing typo in comment
2017-01-10 16:54:01 -06:00
Cameron Davison
88a462d5b9
add force_pull to docker driver
2017-01-10 16:54:01 -06:00
Michael Schurter
0b7f8163d2
Merge pull request #2174 from hashicorp/b-fix-executor-test
...
Switch to a less timing dependent test command
2017-01-10 13:45:12 -08:00
Michael Schurter
1347a941b0
Fix missing value in test failure message
2017-01-10 13:39:05 -08:00
Michael Schurter
7462379086
Switch to a less timing dependent test command
...
`/usr/bin/yes` could produce output very quickly (100s of MBps on my
laptop) and therefore could cause log files to roll over.
A bash loop with a sleep avoids that issue. The test is slower but
should be much more resilient to the massive timing differences between
workstations and Travis.
2017-01-09 15:40:53 -08:00
Alex Dadgar
2be221d664
Don't retrieve Driver Stats if unsupported
...
This PR makes us only try to collect stats once if the Driver doesn't
support collecting stats.
Fixes https://github.com/hashicorp/nomad/issues/1986
2017-01-09 13:47:06 -08:00
Michael Schurter
65fb580216
Fix inconsistent task env setting
...
Consolidate task environment building in GetTaskEnv since it can
determine what kind of filesystem isolation is used.
This means drivers no longer have to manipulate task environment paths.
2017-01-06 12:19:32 -08:00
Michael Schurter
d3270799f0
Fix executor tests
2017-01-06 11:39:18 -08:00
Michael Schurter
e203928d64
Driver is now required in test tasks
2017-01-06 11:39:17 -08:00
Michael Schurter
579f378bee
Remove debug logging
2017-01-05 16:31:56 -08:00
Michael Schurter
baf6f078d6
Remove task name prefix from executor logs
2017-01-05 16:31:56 -08:00
Michael Schurter
86fcf96f72
Put a logger in AllocDir/TaskDir
2017-01-05 16:31:56 -08:00
Michael Schurter
7260d0bca3
Test tasks now require driver name
2017-01-05 16:31:55 -08:00
Michael Schurter
3ea09ba16a
Move chroot building into TaskRunner
...
* Refactor AllocDir to have a TaskDir struct per task.
* Drivers expose filesystem isolation preference
* Fix lxc mounting of `secrets/`
2017-01-05 16:31:49 -08:00
Alex Dadgar
8d5f0fea69
Merge pull request #2128 from hashicorp/f-dispatch
...
Nomad Constructor Jobs and Dispatch
2017-01-06 05:22:49 +08:00
Michael Schurter
4a9a574d9d
Merge pull request #2054 from hashicorp/f-prestart
...
Add Driver.Prestart method
2016-12-20 16:18:56 -08:00
Michael Schurter
8e1ae14feb
Remove unneeded env building
2016-12-20 16:14:42 -08:00
Michael Schurter
39f587a2af
Fix tests broken by TaskEnv change
2016-12-20 14:37:35 -08:00
Michael Schurter
0d90e96925
lxc: Set image local env vars
2016-12-20 14:37:18 -08:00
Michael Schurter
05b49008eb
Remove unneeded waitClient field
2016-12-20 14:29:57 -08:00
Michael Schurter
ea92cd102a
Append host env vars on every task env
2016-12-20 12:24:24 -08:00
Michael Schurter
458c2ed5f1
Fix formatting of downloading image message
2016-12-20 11:57:26 -08:00
Michael Schurter
e34d1e5d23
Use startContainer wrapper
2016-12-20 11:55:40 -08:00
Michael Schurter
85b0cecff2
Emit "Downloading image" event
2016-12-20 11:40:34 -08:00
Alex Dadgar
746d4c7ee3
Small cleanups
2016-12-19 14:22:08 -08:00
Alex Dadgar
18739a4433
Merge pull request #1980 from dmexe/network-aliases
...
Add network_aliases for docker driver
2016-12-19 14:17:48 -08:00
Alex Dadgar
7cdf24f05f
Fix Docker Logging Type interpolation
...
This PR fixes an issue that made Logging.Type un-interpretable in the
docker driver.
2016-12-19 13:42:58 -08:00
Alex Dadgar
2f3aeed2f8
Merge pull request #2063 from tmichaud314/fix-docker-driver-auth-interpolation
...
Fixes docker-driver Auth-config interpolation
2016-12-19 13:41:27 -08:00
Alex Dadgar
4e8035756b
Fix test and prevent job with payload from being submitted
2016-12-18 16:32:14 -08:00
Alex Dadgar
b1883daae8
Use new combined meta data function in env
2016-12-16 10:45:09 -08:00
Alex Dadgar
7778339f03
Fix mapstructure tag formatting for lxc driver
2016-12-16 10:24:17 -08:00
Tom Michaud
d0c01c8816
Fixes docker-driver Auth-config interpolation
2016-12-06 13:30:23 -07:00
Michael Schurter
770ed703d0
Add Driver.Prestart method
...
The Driver.Prestart method currently does very little but lays the
foundation for where lifecycle plugins can interleave execution _after_
task environment setup but _before_ the task starts.
Currently Prestart does two things:
* Any driver specific task environment building
* Download Docker images
This change also attaches a TaskEvent emitter to Drivers, so they can
emit events during task initialization.
2016-12-02 11:03:48 -08:00
Alex Dadgar
70396c464b
Make errors starting a container recoverable
...
This PR makes errors starting a container recoverable and tries to
optimistically handle 500 errors.
2016-11-30 15:59:47 -08:00
Diptanu Choudhury
6c179d1695
Merge pull request #2045 from hashicorp/b-docker-create-container
...
Returning a container if it exists instead of creating a new one
2016-11-29 17:55:33 -08:00
Diptanu Choudhury
50452520bf
Returning a container if it exists instead of creating a new one
2016-11-29 17:52:19 -08:00
Alex Dadgar
712e18707b
add debugging
2016-11-29 14:29:37 -08:00
Diptanu Choudhury
bff172939b
Fixes an issue with purging containers with the same name Nomad is trying to start
2016-11-28 17:37:22 -08:00
Michael Schurter
1f0bfa00aa
rkt: Support host and none dns options
...
Fixes #2025
2016-11-28 13:13:40 -08:00
Michael Schurter
44e4414490
Fix rkt volumes
...
I forgot to validate the volumes field!
2016-11-28 13:13:40 -08:00
Alex Dadgar
4f2a6eae8b
Merge pull request #2029 from gliptak/dockerauth1
...
Log when lookup in docker.auth.config fails
2016-11-28 12:45:19 -08:00
Alex Dadgar
d8048ad75d
Merge pull request #2033 from hashicorp/b-docker-container-exists
...
Make container exist errors non-retriable
2016-11-28 12:38:52 -08:00
Michael Schurter
b3ede6a5b7
Use net.JoinHostPort instead of fmt.Sprintf
...
Using fmt.Sprintf breaks IPv6 addresses.
2016-11-28 10:38:54 -08:00
Alex Dadgar
8a641a8672
Make container exist errors non-retriable
...
This change makes it so that the task runner does not retry container
exists errors and also a sleep is added on the local retry.
2016-11-25 19:22:58 -08:00
Gábor Lipták
6268112e86
Log when lookup in docker.auth.config fails
2016-11-23 18:43:58 -05:00
Ranjib Dey
0b29ad8787
Fix error message. Pass on template args
2016-11-21 20:12:59 -08:00
Dmitry Galinsky
3ec7ebac9c
Add network_aliases for docker driver
2016-11-16 11:16:07 +03:00
Alex Dadgar
3e5bfcdbc4
respond to comment
2016-11-15 16:27:07 -08:00
Alex Dadgar
cb187ffce6
Fix TestRktDriver_PortsMapping and TestAgent_LoadKeyrings
2016-11-15 15:49:05 -08:00
Alex Dadgar
a11d66f639
Remove todo
2016-11-10 15:20:19 -08:00
Alex Dadgar
eea35626b7
Changes the relative path from joining against the alloc dir to the
...
task's directory.
This PR changes the behavior when given a relative host path when
mounting docker containers. Prior to this, the behavior was to mount by
joining against the alloc/ directory. This PR changes it to be against
the task/ directory.
2016-11-10 14:47:54 -08:00
Alex Dadgar
e8d6227b20
Do not validate the command does not contain spaces.
...
This PR removes validation that the command string does not contain
spaces. This can cause issues where the path contains a folder that
includes a space ("C:\Program Files\Python35\python.exe").
Fixes #1737
2016-11-10 10:22:17 -08:00
Alex Dadgar
20a5b6fa6b
Merge pull request #1965 from hashicorp/b-docker-interpolate
...
Interpolate all docker driver configs that are strings
2016-11-08 15:35:27 -08:00
Alex Dadgar
3b33f49cde
Merge pull request #1966 from hashicorp/b-service-interpolate
...
Interpolate all service/check fields
2016-11-08 15:35:19 -08:00
Alex Dadgar
f1689bc7f9
Rkt env var
2016-11-08 15:14:04 -08:00
Alex Dadgar
ddf101d7a2
Interpolate all check related variables
2016-11-08 14:43:46 -08:00
Alex Dadgar
691e09f863
remove debug
2016-11-08 14:21:37 -08:00
Alex Dadgar
9f2c0cb0c2
Interpolate everything that is a string
2016-11-08 14:20:51 -08:00
Alex Dadgar
742e11ddb4
Fix env vars relating to secretdir
2016-11-08 12:28:43 -08:00
Alex Dadgar
a9e9b61216
Merge pull request #1938 from hashicorp/b-docker-reattach
...
Fix Docker container creation and task runner updating
2016-11-04 17:14:40 -07:00
Michael Schurter
b1a01a9a0f
Add userns_mode docker config option
...
Fixes #1904
2016-11-04 16:53:56 -07:00
Alex Dadgar
0cbd0188b1
Move the wait result to bottom of methods
2016-11-04 14:58:55 -07:00
Alex Dadgar
4741a4b129
Create container much more robust
2016-11-04 14:39:56 -07:00
Alex Dadgar
b08f4e0b97
More recoverable errors
2016-11-02 10:36:04 -07:00
Michael Schurter
a0340532cb
Forgot to flip a bit
2016-11-01 14:35:22 -07:00
Alex Dadgar
478eebb19b
Merge pull request #1908 from hashicorp/f-vault-docs
...
Vault docs
2016-11-01 12:39:14 -07:00
Alex Dadgar
747c3e7e68
Agent
2016-11-01 10:39:15 -07:00
Michael Schurter
b84d8212ff
Add LXC docs and enable by default for lxc builds
2016-11-01 10:18:16 -07:00
Alex Dadgar
62f1b98954
Add docker test
2016-10-28 17:53:25 -07:00
Alex Dadgar
6618f7a03d
Fix passing of recoverable error from docker pull
2016-10-28 17:49:46 -07:00
Diptanu Choudhury
f0e2178790
Making the executor lock the logger
2016-10-28 10:57:35 -07:00
Alex Dadgar
5ddf646615
Don't delete docker images in test
2016-10-27 12:31:53 -07:00
Michael Schurter
43a670d442
Merge pull request #1877 from hashicorp/b-expand-docker-vols
...
Expand env vars in docker volume paths
2016-10-27 11:32:45 -07:00
Michael Schurter
b5df74e92e
Merge pull request #1862 from hashicorp/f-rkt-portmap
...
driver.rkt: support network configuration [waiting]
2016-10-27 11:05:55 -07:00
Michael Schurter
d3835283ca
Expand env vars in docker volume paths
...
Fixes #1876
2016-10-27 11:02:38 -07:00
Alex Dadgar
150b678a6b
Merge pull request #1806 from hashicorp/f-docker4mac-fixes
...
A couple fixes to make Docker For Mac work
2016-10-27 09:29:40 -07:00
Michael Schurter
f430203505
Put lxc support behind a flag
...
Since lxc support requires linking to a C lib at compile and runtime
I'm putting it behind a build flag to avoid forcing all nomad users to
install liblxc (lxc-dev for development).
2016-10-26 14:55:54 -07:00
Diptanu Choudhury
067fcda3fe
Making the cli use TLS if the client has enabled TLS
2016-10-26 11:13:53 -07:00
Michael Schurter
98600b5943
Fix LXC driver interface impls
2016-10-26 10:06:03 -07:00
Alex Dadgar
3c4a27e72b
Fix panic
2016-10-25 17:27:13 -07:00
Michael Schurter
21b8030ded
Fix tests for rkt port map
2016-10-25 17:06:41 -07:00
Kenjiro Nakayama
18bbfe8325
driver.rkt: add rkt drriver port mapping test
2016-10-25 15:41:49 -07:00
Kenjiro Nakayama
56d91632ca
driver.rkt: support port mapping with net and port options
2016-10-25 15:41:49 -07:00
Diptanu Choudhury
9d3cdded9a
Merge pull request #1699 from hashicorp/f-lxc-driver
...
LXC Support
2016-10-25 15:17:44 -07:00
Diptanu Choudhury
b5cc153d54
Added lxc related dependencies
2016-10-25 15:17:02 -07:00
Alex Dadgar
8e07c2750e
Merge pull request #1839 from hashicorp/f-signal-constraints
...
Signal creates an auto-constraints
2016-10-25 11:09:33 -07:00
Michael Schurter
4f45aece4b
Fingerprint rkt volume support and make periodic
...
Fix rkt docs and custom volume mounting
2016-10-25 09:46:49 -07:00
Michael Schurter
5d358c7eba
Allow mounting alloc-dir-relative paths in docker
2016-10-25 09:46:49 -07:00
Michael Schurter
49ed6da0ad
Enable rkt and docker volume mounting by default
2016-10-25 09:46:49 -07:00
Michael Schurter
f075bda9b9
Make volume name unique
2016-10-25 09:46:49 -07:00
Michael Schurter
83a11fc93b
Bump minimum required rkt version; update docs
...
Make section names match between docker and rkt
2016-10-25 09:46:49 -07:00
Michael Schurter
edf657b58a
Fix docker reference in rkt test
2016-10-25 09:46:49 -07:00
Michael Schurter
02ed35bd1c
Add arbitrary volume support to rkt
2016-10-25 09:46:49 -07:00
Michael Schurter
473c28824c
Fix standard mounts in rkt and tests
2016-10-25 09:46:49 -07:00
Alex Dadgar
03eba049ed
Merge pull request #1848 from hashicorp/f-vault-error
...
Thread through whether DeriveToken error is recoverable or not
2016-10-24 15:01:18 -07:00
Alex Dadgar
5577e53b20
Merge pull request #1845 from hashicorp/f-remove-disk-usage-acct
...
Remove disk usage enforcement
2016-10-22 19:01:51 -07:00
Alex Dadgar
e85a67a49a
Fix signal test for docker
2016-10-22 18:32:48 -07:00
Alex Dadgar
0070178741
Thread through whether DeriveToken error is recoverable or not
2016-10-22 18:08:30 -07:00
Michael Schurter
d937d3aede
Fix comment form
2016-10-21 16:56:33 -07:00
Michael Schurter
285e80ac0f
Remove disk usage enforcement
...
Many thanks to @iverberk for the original PR (#1609 ), but we ended up
not wanting to ship this implementation with 0.5.
We'll come back to it after 0.5 and hopefully find a way to leverage
filesystem accounting and quotas, so we can skip the expensive polling.
2016-10-21 13:55:51 -07:00
Alex Dadgar
41b5679015
Advertise signalling abilities
2016-10-19 15:06:23 -07:00
Alex Dadgar
ae1ea0e5ba
Actually mount the local directory
2016-10-18 15:57:12 -07:00
Alex Dadgar
36cfe6e89e
Large refactor of task runner and Vault token rehandling
2016-10-18 11:24:20 -07:00
Alex Dadgar
53eeec9bc1
Merge pull request #1801 from hashicorp/f-signals
...
Consul-template signal change mode
2016-10-18 11:23:47 -07:00
Michael Schurter
34f7cbd10f
Disable lxc by default
2016-10-13 13:22:12 -07:00
Michael Schurter
1dbb2b7164
Cleanup comments/whitespace
2016-10-13 13:05:55 -07:00
Michael Schurter
38b2020291
Mount secret dir
2016-10-13 12:45:33 -07:00
Diptanu Choudhury
4e86a5f906
throwing an error if stats line can't be converted to k/v pair
2016-10-12 17:18:58 -07:00
Diptanu Choudhury
ea5d9d959a
Bind mounting alloc dir into container
2016-10-12 17:18:58 -07:00
Diptanu Choudhury
6312ea3f8f
Setting the network type
2016-10-12 17:18:58 -07:00
Diptanu Choudhury
ce334e0e04
Adding cpu resource limits
2016-10-12 17:18:58 -07:00
Diptanu Choudhury
bb2a580ef1
Implemented an LXC Driver
2016-10-12 17:18:58 -07:00
Evan Phoenix
8864a506aa
Disable the syslog logging system on Docker For Mac
...
The syslog logging system depends on the ability for a unix socket to be
accessed by the docker daemon in the $TMPDIR of the host. This doesn't
work on Docker For Mac because the docker daemon is running inside a VM,
and while /tmp is accessible, the filesystem used to share them doesn't
support unix socket files, and thus it doesn't work.
2016-10-12 17:07:21 -07:00
Alex Dadgar
eec1a154ec
add plugin kill
2016-10-12 13:24:22 -07:00
Alex Dadgar
86238387e7
Send Executor Ctx separately
2016-10-12 11:35:29 -07:00
Michael Schurter
ca5439eca1
Add NOMAD_JOB_NAME to environment
2016-10-11 11:20:42 -07:00
Alex Dadgar
bc35eaee21
Task runner sends signals
2016-10-10 15:09:00 -07:00
Alex Dadgar
00a1234c55
Executor + Java/Raw Exec/Exec
2016-10-10 11:47:04 -07:00
Alex Dadgar
5b01b1be1b
Rkt
2016-10-10 11:47:04 -07:00
Alex Dadgar
280af8f4d1
Docker + Qemu
2016-10-10 11:47:04 -07:00
Michael Schurter
f0d04bd798
Add comment and fix log line code style
2016-10-07 11:58:21 -07:00
Michael Schurter
523dbfcc81
Remove VolumesFrom feature
...
Since containers are named with alloc ids it's difficult to use safely.
Not to mention task scheduling ordering issues could break it as well.
2016-10-07 11:58:13 -07:00
Michael Schurter
f777faba00
Add comments to config key constants
2016-10-03 16:04:33 -07:00
Michael Schurter
0d66b8aef0
Only launch syslog server if container uses syslog
2016-10-03 15:22:10 -07:00