Commit Graph

307 Commits

Author SHA1 Message Date
Diptanu Choudhury
49e6735227 Merge pull request #2159 from hashicorp/b-consul-config
Fixed merging consul config
2017-01-18 16:14:54 -08:00
Diptanu Choudhury
6d669fb48e Moved functions to helper from structs 2017-01-18 15:55:14 -08:00
Alex Dadgar
23e84ecc12 Random wait 2017-01-11 13:24:23 -08:00
Alex Dadgar
925622a851 GetAllocs uses a blocking query
This PR makes GetAllocs use a blocking query as well as adding a sanity
check to the clients watchAllocation code to ensure it gets the correct
allocations.

This PR fixes https://github.com/hashicorp/nomad/issues/2119 and
https://github.com/hashicorp/nomad/issues/2153.

The issue was that the client was talking to two different servers, one
to check which allocations to pull and the other to pull those
allocations.  However the latter call was not with a blocking query and
thus the client would not retreive the allocations it requested.

The logging has been improved to make the problem more clear as well.
2017-01-10 13:30:35 -08:00
Michael Schurter
e25274b775 Put a logger in AllocDir/TaskDir 2017-01-05 16:31:56 -08:00
Diptanu Choudhury
5c6adce720 Unlocking if we return before adding a new alloc runner 2017-01-05 13:18:48 -08:00
Diptanu Choudhury
84bbd3de28 Fixed how alloc lock is held 2017-01-05 13:06:56 -08:00
Michael Schurter
09d4f0795a Fix race when shutting down in dev mode
Client.Shutdown holds the allocLock when destroying alloc runners in dev
mode.

Client.updateAllocStatus can be called during AllocRunner shutdown and
calls getAllocRunners which tries to acquire allocLock.RLock. This
deadlocks since Client.Shutdown already has the write lock.

Switching Client.Shutdown to use getAllocRunners and not hold a lock
during AllocRunner shutdown is the solution.
2017-01-03 17:21:50 -08:00
Michael Schurter
fccf115c56 Merge pull request #2054 from hashicorp/f-prestart
Add Driver.Prestart method
2016-12-20 16:18:56 -08:00
Diptanu Choudhury
6f978dd051 Removing the alloc runner from GC if it is destroyed by the server 2016-12-20 11:14:22 -08:00
Diptanu Choudhury
7ebe4a6972 Added comments 2016-12-20 10:49:48 -08:00
Diptanu Choudhury
61e534d684 Making the gc allocator understand real disk usage 2016-12-16 18:34:59 -08:00
Diptanu Choudhury
79fdad86c3 Added the stats collector to GC 2016-12-14 15:11:11 -08:00
Diptanu Choudhury
41d7ebc5c5 Refactored hoststats collector 2016-12-14 15:07:42 -08:00
Diptanu Choudhury
a38201a220 GC-ing before we start a new allocation 2016-12-14 15:04:06 -08:00
Diptanu Choudhury
615fbbe17a Added a garbage collector for allocations 2016-12-14 15:01:12 -08:00
Alex Dadgar
8b6fcd3483 Merge pull request #2096 from hashicorp/b-addAlloc
Fix race and remove panic
2016-12-13 13:50:17 -08:00
Diptanu Choudhury
76794f037f cancelling waiting for remote allocation if the alloc doesn't need migration 2016-12-13 13:06:33 -08:00
Alex Dadgar
da3e51a72c Fix race and remove panic 2016-12-13 12:34:23 -08:00
Christoffer Kylvåg
c3df9dd73f #1680: Continue after not being able to stat a mountpoint 2016-12-13 12:28:57 +01:00
Diptanu Choudhury
33e7d12d70 Setting the appropriate file permissions which un-archiving compressed alloc dir 2016-12-05 17:04:43 -08:00
Diptanu Choudhury
7c0978ea30 Merge pull request #2017 from hashicorp/b-sticky
Not moving alloc data when sticky is turned off
2016-12-05 14:11:45 -08:00
Diptanu Choudhury
0182b859e8 Not moving alloc data when sticky is turned off 2016-12-05 14:00:01 -08:00
Michael Schurter
ee17940dfe 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
4287706ce1 Disallow stale queries when deriving Vault tokens
This PR disallows stale queries when deriving a Vault token. Allowing
stale queries could result in the allocation not existing on the server
that is servicing the request.
2016-12-01 11:13:36 -08:00
Alex Dadgar
026802b7bc add debug panic 2016-11-29 15:57:40 -08:00
Diptanu Choudhury
910049740b Ensuring allocs are not added multiple times to blocking queue 2016-11-29 11:19:37 -08:00
Alex Dadgar
8b7647a34d Check for Ephemeral Disk being nil 2016-11-15 10:03:06 -08:00
Alex Dadgar
96b5840fc3 Merge pull request #1949 from carlpett/blacklist-fingerprints-and-drivers
Support blacklisting fingerprinters
2016-11-09 10:31:17 -08:00
Calle Pettersson
dd2c8531f1 Address comments from PR 2016-11-09 11:50:16 +01:00
Calle Pettersson
0be1a1fbf4 Add blacklisting of drivers 2016-11-08 18:30:07 +01:00
Calle Pettersson
2f2c5adb86 Add blacklisting of fingerprinters 2016-11-08 18:29:44 +01:00
Alex Dadgar
fc237fe4be Add compatibility code for secret ID while upgrading cluster in both server/client mode on single nodes 2016-11-07 16:52:08 -08:00
Diptanu Choudhury
7ee2a1515b Making Nomad TLS configs region aware 2016-11-01 11:55:29 -07:00
Diptanu Choudhury
afa7e5dca4 Making the client use tls if the node from which migration has to be made has enabled tls 2016-10-31 10:20:04 -07:00
Michael Schurter
c4c06d3fe2 Swap log line classifiers to be consistent 2016-10-28 14:59:48 -07:00
Diptanu Choudhury
c8afc418c9 Adding the alloc if we can't find the TG 2016-10-27 15:45:10 -07:00
Diptanu Choudhury
a9f5799f5a Not blocking for remote alloc if the alloc is not sticky 2016-10-27 12:04:55 -07:00
Alex Dadgar
a186f7a26d 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
Diptanu Choudhury
70ec22fadf Merge pull request #1853 from hashicorp/f-rpc-http-tls
TLS support for http and RPC
2016-10-25 16:14:43 -07:00
Diptanu Choudhury
f416ac7419 Moved tlsutil into helpers 2016-10-25 16:05:37 -07:00
Diptanu Choudhury
ac5f6fcbe1 Moving the certs into tlsutil package 2016-10-25 16:01:53 -07:00
Diptanu Choudhury
ecfb24d521 Moving the TLSConfig to structs 2016-10-25 15:57:38 -07:00
Alex Dadgar
7c3a2d08a3 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
a877e320c0 Merge pull request #1842 from hashicorp/f-version-and-id
Print the version and client node ID
2016-10-24 10:13:33 -07:00
Diptanu Choudhury
11c1583467 Implemented TLS support for http and rpc 2016-10-23 22:22:00 -07:00
Alex Dadgar
4d99c19428 Small fixes 2016-10-22 18:20:50 -07:00
Alex Dadgar
42f7bc8e81 Thread through whether DeriveToken error is recoverable or not 2016-10-22 18:08:30 -07:00
Michael Schurter
4d3187bc7e 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
902c3973db Print the version and client node ID 2016-10-20 17:46:04 -07:00