Commit Graph

1544 Commits

Author SHA1 Message Date
Sean Chittenden
44487cc7f1 Build the Cgroup fingerprinter on only Linux.
Change the logic from `!linux` to an empty build tag so that *if*
another platform picks up Cgroups support they can add themselves to the
necessary build tags for this fingerprinter and be on their way.
Because this technology isn't inherently Linux-specific and isn't
mutually exclusive of other resource isolation containers, resist the
urge to rename the Cgroup fingerprinter to something generic like the
ResourceContainerFingerprinter.
2016-07-10 13:55:06 -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
Sean Chittenden
3f88f1a23d Begin cgroup pushdown into platform specific files 2016-07-09 23:01:14 -07:00
Sean Chittenden
962cf7b07d Initialize the list of available fingerprinters per platform. 2016-07-09 00:22:42 -07:00
Sean Chittenden
762973e15f Consolidate fingerprinters into a single map. 2016-07-08 23:37:14 -07:00
Sean Chittenden
a320883d7e Move all non-Linux Fingerprinter items to the default exec driver 2016-07-08 18:35:46 -07:00
Alex Dadgar
ab7a3b29bb Set running when restoring 2016-06-28 13:47:59 -07:00
Wojciech Bederski
e922200b34 Fix docker driver lockup during nomad boot
Unit mismatch caused docker driver to wait almost indefinitely during boot 
(when one or more containers were a bit uncooperative during StopContainer())
This should fix problems described in  #1202
2016-06-28 14:26:47 +02:00
Cameron Davison
aad6203b6d write state to temp file and then rename 2016-06-27 12:29:33 -05:00
Jake Champlin
b5b7b7d16e Update failing tests 2016-06-23 11:28:17 -04:00
Alex Dadgar
f2e28735a5 Treat float as int 2016-06-22 15:09:39 -07:00
Alex Dadgar
d87d988491 Floor CPU MHz and total compute and mark hostname as unique 2016-06-22 15:01:36 -07:00
Diptanu Choudhury
964e133c9e Merge pull request #1335 from hashicorp/f-set-docker-timeout
Setting a timeout in the docker client
2016-06-21 17:00:14 -07:00
Diptanu Choudhury
f385e33181 Setting a timeout in the docker client 2016-06-21 16:58:21 -07:00
Diptanu Choudhury
0b608e23ea Making SSL default 2016-06-21 16:41:14 -07:00
Sean Chittenden
7f33b7d417 Code golf
Pointed out by: @dadgar
2016-06-21 14:26:01 -07:00
Sean Chittenden
cc1c73fd51 Fix the shuffling of remote datacenters.
Pointed out by: @ryanuber
2016-06-21 13:37:22 -07:00
Diptanu Choudhury
7ee0dc95f9 Not emitting per-pid stats and added the total ticks consumed by a Task 2016-06-20 17:30:25 -07:00
Alex Dadgar
fc4d489d7e Merge pull request #1322 from hashicorp/b-docker-logs-splicing
Make line copy to avoid being overriden by subsequent scans
2016-06-20 13:17:49 -07:00
Alex Dadgar
7cd4866c89 Make line copy to avoid being overriden by subsequent scans 2016-06-20 13:14:43 -07:00
Alex Dadgar
0b3a39b47f guard against NaN 2016-06-20 10:29:46 -07:00
Alex Dadgar
144f277226 finer grain locking 2016-06-20 10:19:06 -07:00
Alex Dadgar
80edb57a6f Guard against bad restore 2016-06-17 14:58:53 -07:00
Alex Dadgar
8cdb590298 Driver tests use client default config 2016-06-17 14:24:49 -07:00
Sean Chittenden
9656a2045c Initialize the stats helpers before accessing them for the first time 2016-06-17 13:23:30 -07:00
Sean Chittenden
554ad594f6 Merge pull request #1307 from hashicorp/f-fingerprint-cpus
F fingerprint cpus
2016-06-17 12:23:40 -07:00
Sean Chittenden
cb792ea036 Merge pull request #1310 from hashicorp/b-logger
Create and pass only one `logger` object around per Agent
2016-06-17 12:16:35 -07:00
Sean Chittenden
e26606acfd Memoize the CPU stats. Error if CPU fingerprinting fails. 2016-06-17 12:13:53 -07:00
Alex Dadgar
30edb676fa debug message when stopping container 2016-06-17 11:52:44 -07:00
Sean Chittenden
e42f7d5c23 Record and use only the first Mhz from the CPU fingerprinter.
Assume all cores are the same speed.
2016-06-17 11:06:57 -07:00
Sean Chittenden
451c685f1c Provide nomad.Config with a default LogOutput of os.StdErr 2016-06-17 06:44:10 -07:00
Sean Chittenden
bcf0929c95 Pass a logger arg to NewClient and NewServer 2016-06-16 23:29:23 -07:00
Sean Chittenden
b0490efb38 In the debug log, split the unit from the measurement
awk(1) friendly is UNIX(tm) friendly.
2016-06-16 23:07:13 -07:00
Sean Chittenden
e0b4f7a080 Warn when we're unable to fingerprint the CPU Mhz 2016-06-16 23:07:13 -07:00
Sean Chittenden
a6dc002415 Explicitly call cpu.Counts() to determine the CPU core count
Much safer than counting the number of InfoStat structs returned.
2016-06-16 23:07:13 -07:00
Sean Chittenden
7dc7fcf052 Create config.DefaultConsulConfig() 2016-06-16 20:41:05 -07:00
Sean Chittenden
53ffd40bef Only register the Client services reaper when consul.auto_advertise is enabled 2016-06-16 18:24:58 -07:00
Sean Chittenden
277592dd88 conf -> config 2016-06-16 17:05:29 -07:00
Sean Chittenden
3d32d20af8 Fix tests for NewServer() in client mode.
Pointy-hat: sean-

I'm positive I've done this before.
2016-06-16 16:34:22 -07:00
Sean Chittenden
5559e013bf Only auto-join clients if client_auto_join is true 2016-06-16 14:47:21 -07:00
Sean Chittenden
8e1777ae3a Test for errors 2016-06-16 14:43:46 -07:00
Sean Chittenden
5708560527 Merge pull request #1276 from hashicorp/f-consul-server-autojoin
Teach Nomad servers how to fall back to Consul.
2016-06-16 14:40:45 -07:00
Diptanu Choudhury
69adab51d9 Merge pull request #1285 from hashicorp/fix-selinux-options
Added a client options for setting selinux options
2016-06-16 22:45:24 +02:00
Diptanu Choudhury
4ecba7c7c2 Changed the client options for docker volume selinux labels 2016-06-16 21:41:02 +01:00
Alex Dadgar
041e6eb5f3 Guard against restoring a nil task in task_runner 2016-06-16 11:55:40 -07:00
Sean Chittenden
a915cdc337 Use the %+q verb in log messages (vs %q). 2016-06-16 11:03:51 -07:00