Commit Graph

70 Commits

Author SHA1 Message Date
Michael Schurter fb52bbfa45 Explain PortLabel handling in RegisterAgent 2017-04-19 12:42:47 -07:00
Michael Schurter 2728216f6f Plumb alloc id + task name into script check logs 2017-04-19 12:42:47 -07:00
Michael Schurter 01b20cbb59 Stop being lazy and just type out struct{}{} 2017-04-19 12:42:47 -07:00
Michael Schurter 5e908dbf38 Use nifty testtask sleep command for xplat compat 2017-04-19 12:42:47 -07:00
Michael Schurter 8c433cfba1 Add comments, clarify names, fix PR comments 2017-04-19 12:42:47 -07:00
Michael Schurter 40b3987e90 Explain cleanup defer in test 2017-04-19 12:42:47 -07:00
Michael Schurter 7c8ad71da5 Fix comment to reflect reality 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 926d141532 Fix shutdown when consul is down 2017-04-19 12:42:47 -07:00
Michael Schurter 87b28cfb75 Switch ServiceClient to synchronizing state
Previously it applied a stream of operations. Reconciling state is less
complex and error prone at the cost of slightly higher CPU/memory usage.
2017-04-19 12:42:47 -07:00
Michael Schurter 244251490a Add UpdateTask method instead of Remove/Add 2017-04-19 12:42:47 -07:00
Michael Schurter 8118c41931 Remove some lies 2017-04-19 12:42:47 -07:00
Michael Schurter 0143bef8c7 Remove unused syncInterval 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
Michael Schurter 9798e7c7c1 Add SyncNow test 2016-12-02 16:44:18 -08:00
Michael Schurter 92f579891c Remove lie from comment 2016-11-18 11:05:22 -08:00
Michael Schurter fc1f557a36 Fix incorrect lock usage around consul maps 2016-11-18 10:12:02 -08:00
Michael Schurter da9a8bbcef Fix SyncNow 2016-11-18 10:12:02 -08:00
Michael Schurter 57e5e03ccc New chaos test to exercise consul syncer 2016-11-18 10:12:02 -08:00
Michael Schurter 393efe2579 Switch syncer tests to use embedded consul 2016-11-15 10:22:25 -08:00
Diptanu Choudhury 7367d6adb4 Removing warn msg 2016-09-04 17:22:49 -07:00
Michael Schurter ec96e03563 Query consul without helpers in test to be safe 2016-08-31 14:14:17 -07:00
Michael Schurter aa8cbe777a Make comment more precise 2016-08-31 10:43:55 -07:00
Michael Schurter 7f6b5f4d2a Fix error message when querying consul fails 2016-08-31 10:42:51 -07:00
Michael Schurter db1cf6385e Assert syncer state is consistent with consul's state 2016-08-31 09:19:54 -07:00
Michael Schurter f6bf81270d Remove extra consul service tracking entirely
Instead just remove all associated services on shutdown.
2016-08-30 17:10:15 -07:00
Michael Schurter 27912a95d6 Fix old services not getting removed from consul on update
Fixes #1661
2016-08-30 16:36:42 -07:00
capone ce4d236a40 Fixed CR defects 2016-08-24 01:33:44 +03:00
capone 10cc50ad29 First attemt to fix issue #1636 2016-08-23 19:09:20 +03:00
Diptanu Choudhury 4683aa3dc6 Cleaning up some code 2016-08-16 15:22:26 -07:00
Marin 69bc3a8fc8 Add support for initial check status 2016-08-16 12:05:15 -07:00
David Bresson 7d0fb58f03 Add a test for query string support 2016-08-11 12:22:46 -07:00
David Bresson c651cbbfd6 Add error handling to check registration 2016-08-11 11:49:48 -07:00
David Bresson f47a543a4d Add support for query strings in check paths 2016-08-11 11:27:29 -07:00
Alex Dadgar c203885352 consul syncer uses multi-error 2016-08-09 12:24:50 -07:00
Diptanu Choudhury 48b9684b1e Using net.JoinHostPort instead of handcrafting addrs 2016-07-08 16:45:14 -07:00
Diptanu Choudhury b180223f4b Allowing ports to be overriden in check definitions 2016-07-08 14:14:25 -07:00
Sean Chittenden 871a31a8ec
Teach config.ConsulConfig how to construct a consulapi TLS client.
Said differently, centralize the creation of consul's client config
in one place and use it everywhere.
2016-06-16 22:51:06 -07:00
Sean Chittenden 59c54e9aeb
Fix tests, don't take the address of DefaultConsulCommand() 2016-06-16 21:21:39 -07:00
Sean Chittenden d17af396ca
Create config.DefaultConsulConfig() 2016-06-16 20:41:05 -07:00
Sean Chittenden 10ce8f27d4
Temporarily disable various syncer checks due to the API changes made earlier today. 2016-06-13 19:52:17 -07:00
Sean Chittenden a54b4e08f8
Drive-by comment correction 2016-06-13 18:14:50 -07:00
Alex Dadgar 4b04e503f3 address comments 2016-06-13 17:32:18 -07:00
Alex Dadgar 8bbf4a55e5 Fix IDs and domain scoping 2016-06-13 16:30:58 -07:00
Diptanu Choudhury 2e10458367 Removing unwated line of code 2016-06-13 15:37:55 +02:00
Diptanu Choudhury d019d8ef8e implemented reconciliation of unwanted services 2016-06-13 14:52:26 +02:00
Alex Dadgar 232654cdee register checks 2016-06-12 21:28:56 -07:00
Alex Dadgar a82c2bb058 Do not reconcile in client and cleanup executor a bit 2016-06-12 18:22:07 -07:00
Alex Dadgar c68d23b7d6 Merge pull request #1264 from hashicorp/b-rename-services
Rename ConsulService back to Service
2016-06-12 16:44:49 -07:00
Diptanu Choudhury 751b2e1bcb Remove initial delay of registering services with consul 2016-06-13 01:42:56 +02:00