Commit Graph

278 Commits

Author SHA1 Message Date
Alex Dadgar
22c5999c09 darwin test fixes 2017-07-22 19:48:47 -07:00
Alex Dadgar
d4e35815a1 executor and logging pkg 2017-07-21 12:14:54 -07:00
Hynek Schlawack
96c9f9dd02 Fix typos 2017-06-16 16:10:12 +02:00
Michael Schurter
52ffc01972 Log PID when sending signals 2017-06-12 11:11:36 -07:00
Michael Schurter
aa0e977f1c Fix executor tests 2017-05-26 16:46:03 -07:00
Michael Schurter
ace00980a1 Refactor TaskEnvironment into Builder and TaskEnv 2017-05-23 13:53:33 -07:00
Michael Schurter
426c696404 Reuse ExecScript implementation 2017-05-04 16:21:40 -07:00
Michael Schurter
90f5e232a5 Switch java/exec to use Exec in Executor 2017-04-21 16:25:49 -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
67c07c9932 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
Alex Dadgar
36dc330737 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
16fb45e4ba Fix tests broken by API change 2017-03-02 15:54:12 -08:00
Alex Dadgar
07f7e19578 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
0e8b43767b Fix import 2017-01-25 21:27:36 -08:00
Alex Dadgar
c920d3cbb0 Fix unreachable function in tests 2017-01-25 20:58:24 -08:00
Diptanu Choudhury
84137b02c5 Filter executor log messages 2017-01-12 11:54:19 -08:00
Michael Schurter
34cc7a70ad 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
Michael Schurter
ed8b3cd37d Fix executor tests 2017-01-06 11:39:18 -08:00
Michael Schurter
12915c30bf Remove debug logging 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
Alex Dadgar
3bf19b555e Interpolate all check related variables 2016-11-08 14:43:46 -08:00
Alex Dadgar
17cab6e932 Fix env vars relating to secretdir 2016-11-08 12:28:43 -08:00
Diptanu Choudhury
6acfa45f2a Making the executor lock the logger 2016-10-28 10:57:35 -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
Alex Dadgar
00ce1e50f5 Fix panic 2016-10-25 17:27:13 -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
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
42c4346dcf Constant time space tracking of pids 2016-09-27 16:57:26 -07:00
Diptanu Choudhury
47144fe5e9 Merge pull request #1683 from mwieczorek/enable-syslog-for-windows
Enable syslog for windows
2016-09-04 17:07:25 -07:00
Michal Wieczorek
78eaeafc15 Enable syslog server and universal collector for windows 2016-09-05 00:26:36 +02:00
Alex Dadgar
4bae54741e Secret dir materialized in alloc/task directory 2016-09-02 12:44:05 -07:00
Alex Dadgar
335cababe1 Revert "Introduce a Secret/ directory" 2016-09-01 17:23:15 -07:00
Alex Dadgar
0b07ef93c1 Address comments and reserve 2016-08-31 18:11:02 -07:00
Alex Dadgar
dfab22cd9f environment variables 2016-08-31 13:56:11 -07:00
Alex Dadgar
46ce8dd020 Interface + tests 2016-08-30 21:40:32 -07:00
Ivo Verberk
13071e9846 Disk resource monitoring and enforcement 2016-08-18 07:59:03 +02:00
Diptanu Choudhury
8174671c7c Fixed the docker script check 2016-08-17 13:23:48 -07:00
Diptanu Choudhury
6811e084f4 Merge pull request #1518 from pubnub/feature/chroot-map-rebase
Add config field to specify chroot mapping for exec driver
2016-08-10 17:00:03 -07:00
Jay Oster
bd0363b6a6 Fix Linux executor isolation test
- Properly expects the hard-coded mounts (alloc, dev, and proc) and hardcoded local directories (local and tmp)
- Also verifies that etc contains only the requested paths
2016-08-08 14:04:09 -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
vrenjith
b686be0c9b Update checks_test.go
Remove docker volumes while exiting container
2016-08-04 11:42:47 +05:30
Jay Oster
1876fc2b10 Add config field to specify chroot mapping for exec driver
- Same format as used by the internal chroot mapping
- Map: source_path -> dest_path
- Example HCL:

client {
  chroot_env {
    "/etc" = "/etc"
    "/lib" = "/lib"
    "/opt/projects/foo/bin" = "/usr/bin"
  }
}
2016-08-03 17:17:17 -07:00
Sean Chittenden
875c090ed9 Rename resourceContainer{,Context} and resCon{,Ctx}. 2016-07-11 00:02:55 -07:00
Sean Chittenden
5ede387a70 Update comments and pushdown a lock into the resource container 2016-07-10 00:12:59 -07:00
Sean Chittenden
1baa5de6af Push down the Linux-specific bits into resourceContainer 2016-07-10 00:06:53 -07:00
Sean Chittenden
beee613f13 Move unit tests around into per-platform where appropriate. 2016-07-09 23:56:31 -07:00
Sean Chittenden
71dddc7f05 Push the Client's cleanup of Cgroups down 2016-07-09 23:45:33 -07:00
Sean Chittenden
a15efc5796 Rename resourceContainer.cleanup() to executorCleanup()
Not to be confused with the imminent ClientCleanup().
2016-07-09 23:25:33 -07:00