Commit Graph

156 Commits

Author SHA1 Message Date
Chelsea Holland Komlo
e5ccc551dc add detected to more drivers where the driver is found but unusable 2018-02-01 11:28:17 -05:00
Chelsea Holland Komlo
ba2ebbc7f9 code review fixup 2018-01-31 18:34:03 -05:00
Chelsea Holland Komlo
a9447addd3 add applicable boolean to fingerprint response
public fields and remove getter functions
2018-01-31 13:21:45 -05:00
Chelsea Holland Komlo
ae889b4fba remove attributes from periodic fingerprints when state changes
write test for client periodic fingerprinters
2018-01-29 13:48:54 -05:00
Chelsea Holland Komlo
f5fc20a564 create safe getters and setters for fingerprint response 2018-01-26 11:22:05 -05:00
Chelsea Holland Komlo
5e8151d700 refactor Fingerprint to request/response construct 2018-01-24 11:54:02 -05:00
Charlie Voiselle
45c3d8d5a1 Found more priviledge.
priviledge -> privilege
2018-01-12 09:44:53 -05:00
Chelsea Holland Komlo
27b666e935 extend configurable kill signal to java driver 2017-12-07 11:40:10 -05:00
Adam Stankiewicz
79eccb2b1e Remove AllocID from ExecutorContext 2017-10-13 17:07:49 +02:00
Alex Dadgar
a9e3a41407 Enable more linters 2017-09-26 15:26:33 -07:00
Alex Dadgar
c26ecb7092 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
3fddb05fc8 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
Michael Schurter
a96fb5dbb0 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
6db35013d2 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
ace00980a1 Refactor TaskEnvironment into Builder and TaskEnv 2017-05-23 13:53:33 -07:00
Michael Schurter
90f5e232a5 Switch java/exec to use Exec in Executor 2017-04-21 16:25:49 -07:00
Michael Schurter
0e0845e94b Use a DriverAbility to expose Exec functionality 2017-04-19 12:42:47 -07:00
Michael Schurter
10cb924b2c 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
564367fa71 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
Alex Dadgar
4ba4987625 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
Michael Schurter
269b3c7e14 Merge pull request #2186 from hashicorp/f-driver-cleanup
Add Cleanup method to Driver interface
2017-01-20 13:02:14 -08:00
Michael Schurter
db096b23b5 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
9206446a8d 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
1ec5c930a6 Return errors from cleanup and let TaskRunner retry 2017-01-12 17:21:54 -08:00
Diptanu Choudhury
a066d90313 Added executorconfig 2017-01-12 15:47:58 -08:00
Diptanu Choudhury
84137b02c5 Filter executor log messages 2017-01-12 11:54:19 -08:00
Michael Schurter
33c015bcc7 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
Michael Schurter
86db19407e Remove task name prefix from executor logs 2017-01-05 16:31:56 -08:00
Michael Schurter
de7351b959 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
Michael Schurter
904543ef1b Remove unneeded env building 2016-12-20 16:14:42 -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
12c033ab81 Move the wait result to bottom of methods 2016-11-04 14:58:55 -07:00
Alex Dadgar
008d91aa56 Advertise signalling abilities 2016-10-19 15:06:23 -07:00
Alex Dadgar
917c7e5085 Merge pull request #1801 from hashicorp/f-signals
Consul-template signal change mode
2016-10-18 11:23:47 -07:00
Alex Dadgar
358c43333d Send Executor Ctx separately 2016-10-12 11:35:29 -07:00
Alex Dadgar
0b65a5f95d Executor + Java/Raw Exec/Exec 2016-10-10 11:47:04 -07:00
Alex Dadgar
1a3585b572 Docker + Qemu 2016-10-10 11:47:04 -07:00
Jay Oster
593669ada2 Address review comments
- Simplify map length check in Linux Executor
- Added a `chroot_env` test for config parser
- Moved `ChrootEnv` field from ExecutorCommand to ExecutorContext
- Added a test for `chroot_env` functionality
2016-08-04 15:33:06 -07:00
Jay Oster
09f2fc9f8f Add chroot_env to Java driver (which uses the exec driver internally) 2016-08-04 11:15:35 -07:00
Sean Chittenden
71dddc7f05 Push the Client's cleanup of Cgroups down 2016-07-09 23:45:33 -07:00
Alex Dadgar
1a7df4e7d2 Allocation resources returned in a struct 2016-06-11 21:04:10 -07:00
Diptanu Choudhury
1cae57aee9 Add the Stats api to driverhandle 2016-05-28 19:42:34 -07:00
Alex Dadgar
7616be8094 Put the executor into the cgroup to avoid a fork race 2016-04-18 17:59:08 -07:00
Ivo Verberk
51755c513f Implement configuration validation for all task drivers 2016-04-10 00:42:57 +02:00
Ivo Verberk
92bf6f1ad0 Add helper to validate raw configuration data 2016-04-10 00:42:43 +02:00
Diptanu Choudhury
ced78c9457 Using the paths of cgroups to reconstruct the manager 2016-04-02 12:37:19 -07:00
Diptanu Choudhury
21a2914363 Merge pull request #1020 from hashicorp/f-capture-signals
Capturing signals from wait
2016-04-02 11:13:04 -07:00
Diptanu Choudhury
1a0c35a196 Capturing signals from wait 2016-04-01 14:31:19 -07:00
Diptanu Choudhury
d203d62684 Logging in fingerprinters only when state changes 2016-04-01 02:22:17 -07:00
Diptanu Choudhury
621ae065d9 Making driver fingerprinters run periodically and unblocking evals when node registration happens 2016-03-31 18:11:27 -07:00