Commit graph

1950 commits

Author SHA1 Message Date
Clint Shryock a9cf7381ca Refactor the Network Fingerprinters 2015-09-22 15:59:00 -05:00
Clint Shryock f048326300 Rework client/fingerprint/fingerprint.go to use a slice and enforce ordering 2015-09-22 14:23:48 -05:00
Armon Dadgar ed2fc3a69f client: persist the node ID 2015-09-22 10:31:47 -07:00
Clint Shryock d11bd582f7 Basic network fingerprinting for Unix type, AWS systems 2015-09-22 11:44:53 -05:00
Alex Dadgar 1b46cbff83 Fixed function comment 2015-09-21 09:08:57 -07:00
Alex Dadgar 8d24e5e532 Tests skip based on cgroups, not root 2015-09-21 09:08:57 -07:00
Alex Dadgar e694688527 Update UniversalExecutor to have string identifiers 2015-09-21 09:08:57 -07:00
Alex Dadgar 0e3f21b34f Linux executor with cgroup isolation support 2015-09-21 09:08:57 -07:00
Clint Shryock 61948802a8 executor/linux: Add UUID for the name, return error on failure to apply 2015-09-21 09:08:57 -07:00
Clint Shryock 067e65bf12 exec/linux: move Limit to after Start 2015-09-21 09:08:57 -07:00
Clint Shryock 0c526ddb8e spike on adding cgroups 2015-09-21 09:08:57 -07:00
Armon Dadgar 807edc194d Merge branch 'f-docs' 2015-09-20 19:25:25 -07:00
Armon Dadgar 67fc3c9b87 client: optimize initial heartbeat time 2015-09-20 17:02:12 -07:00
Chris Bednarski d4948e2935 Windows does not support exec.Cmd.SysProcAttr.Credential call; this causes cross-compiltion to fail so it's behind a build flag now 2015-09-18 18:59:42 -07:00
Chris Bednarski c99e368461 Support running Linux exec as a non-root user 2015-09-15 20:17:23 -07:00
Chris Bednarski 57e4f7c44f Merge branch 'master' into f-executor 2015-09-15 19:03:52 -07:00
Chris Bednarski e5cb8852af Overhaul the executor code so we use build flags instead of dynamic loading 2015-09-15 18:54:55 -07:00
Chris Bednarski d1c4abef33 Changed Default executor to use a factory 2015-09-15 16:40:40 -07:00
Chris Bednarski 4cefbc3c22 Rename exec package to executor so it works better with goimports; fixes for Java driver 2015-09-15 14:03:03 -07:00
Chris Bednarski 6a7b82f7ba Update Java driver to use Executor 2015-09-15 13:45:48 -07:00
Chris Bednarski 9db88f6013 Updated exec driver to use nomad/client/exec 2015-09-15 13:11:56 -07:00
Chris Bednarski 06073b171d Use Linux on Linux 2015-09-14 19:38:21 -07:00
Chris Bednarski 6eb3d86528 Run as nobody if no user is specified 2015-09-14 19:04:29 -07:00
Chris Bednarski e4d3aad44e Send signal 0 to check whether the process is alive 2015-09-14 16:16:56 -07:00
Chris Bednarski 0425ae941c Implemented Linux driver with RunAs functionality -- added errors to RunAs and Limit 2015-09-14 15:57:21 -07:00
Armon Dadgar 2ff133c0e6 nomad: rename region1 to global. Fixes #41 2015-09-13 18:18:40 -07:00
Armon Dadgar d1f829e502 client: Use Alloc.TaskResouces to override Task.Resources 2015-09-13 17:35:56 -07:00
Ryan Uber 3d31230ac1 client: always create alloc dir if it is non-empty 2015-09-13 12:14:12 -07:00
Ryan Uber 58216245ac client: skip init in dev mode 2015-09-12 13:16:27 -07:00
Ryan Uber 823276993c client: init the alloc dir 2015-09-12 11:47:44 -07:00
Ryan Uber 1ff724ab25 client: alloc dirs tolerate missing directories 2015-09-11 20:32:55 -07:00
Chris Bednarski 91194d9337 Update the interface, add UniversalExecutor, add stub for LinuxExecutor 2015-09-11 17:12:48 -07:00
Chris Bednarski f511eeac0e Added stub / spec for executor interface 2015-09-11 12:35:03 -07:00
Chris Bednarski da93d4a30f Change error to err to be consistent with other usage 2015-09-11 10:26:33 -07:00
Chris Bednarski 4f83bc7090 Fix typos 2015-09-10 11:35:03 -07:00
Chris Bednarski 2ccad3d6e8 Change panic to a more helpful message 2015-09-09 19:04:06 -07:00
Chris Bednarski 237bf5f68e Merge branch 'f-driver-config' into f-docker-resource-constraints 2015-09-09 18:47:35 -07:00
Chris Bednarski 2a40673a3a Relax Qemu version regexp to accomodate build identifier in the version command 2015-09-09 18:39:40 -07:00
Chris Bednarski cc4d361ee9 Updated Qemu and tests to use DriverContext 2015-09-09 18:38:52 -07:00
Chris Bednarski 0281debee4 Merge branch 'master' into f-driver-config
Conflicts:
	client/driver/driver.go
2015-09-09 18:19:19 -07:00
Chris Bednarski a695e311dc Replace logging and config with DriverContext, which allows us to expand the dependency injection without changing the interface 2015-09-09 18:06:23 -07:00
Chris Bednarski 1ff755f31a Merge pull request #24 from hashicorp/qemu-driver
Basic Qemu driver implementation
2015-09-09 17:43:13 -07:00
Chris Bednarski 9965d28a22 Add logger to the dockerHandle created by Open() 2015-09-09 13:43:28 -07:00
Chris Bednarski a731a84136 Cleanup based on PR feedback
- Add validation that Resources.MemoryMB and Resources.CPU have non-zero values
- Change log calls to use logger whenever possible
- Change log format to add colon after driver.docker
2015-09-09 13:35:10 -07:00
Clint Shryock 037ae6d6eb driver/qemu+java: Code cleanups 2015-09-09 14:38:42 -05:00
Clint Shryock bd0f92f977 driver/qemu: Actually use the requred Memory from the Task 2015-09-09 14:30:35 -05:00
Clint Shryock 2611523b3b driver/qemu: Require a memory resource on the task 2015-09-09 14:28:16 -05:00
Chris Bednarski ac277c5765 Change SIGINT to SIGTERM 2015-09-09 01:52:58 -07:00
Chris Bednarski b70b852662 Added preliminary resource constraints for docker; CPU and Memory 2015-09-09 01:08:31 -07:00
Clint Shryock 98c53162d2 driver/qemu: add to builtin drivers 2015-09-08 16:25:36 -05:00
Clint Shryock d2822a435d driver/qemu: Basic lifecycle management of Qemu images 2015-09-08 16:08:49 -05:00
Chris Bednarski 4eb8fc5188 Added config to drivers; needed for docker driver to get the socket endpoint 2015-09-08 12:43:02 -07:00
Clint Shryock c1f982a1d0 Merge branch 'master' into qemu-driver
* master: (66 commits)
  Use a single implementation of GenerateUUID
  scheduler: use update strategy for rolling updates
  nomad: adding helper structs
  scheduler: Adding CreateEval to Planner
  nomad: worker supports create eval
  nomad: guard eval creation based on parent eval
  nomad: adding Eval.Create endpoint
  nomad: support time wait for evaluations
  nomad: adding fields to cause an evaluation to 'wait'
  scheduler: support in-place allocation updates
  scheduler: util method to diff task groups
  nomad: helper struct func
  nomad: PopUpdate should minimize plan size
  nomad: adding helper to manipulate plans
  scheduler: share context and stack
  scheduler: allow updating the base nodes
  scheduler: allow StaticIterator to update base set
  scheduler: pull node shuffle into util
  nomad: adding node GC
  nomad: using Raft StartAsLeader to make tests faster
  ...
2015-09-08 09:52:40 -05:00
Chris Bednarski bd06e4bad2 Merge pull request #19 from hashicorp/test-resources
Added example python and java apps for testing
2015-09-07 17:03:09 -07:00
Armon Dadgar ea0795995d Use a single implementation of GenerateUUID 2015-09-07 15:23:03 -07:00
Armon Dadgar 7d69aa78c1 nomad: using Raft StartAsLeader to make tests faster 2015-09-07 10:46:41 -07:00
Armon Dadgar 8bedd3769c nomad: unifying the state store API 2015-09-06 20:56:38 -07:00
Armon Dadgar 1a5579384a nomad: cleanup API descrepencies 2015-09-06 20:47:42 -07:00
Armon Dadgar 0702f17989 Rename client endpoint to node endpoint 2015-09-06 20:31:32 -07:00
Armon Dadgar c7773feced nomad: improve error messages at start for dev mode 2015-09-06 20:18:47 -07:00
Armon Dadgar f1da1226c1 driver/java: Add to builtin list 2015-09-04 13:09:11 -07:00
Clint Shryock 60ad3b7517 Merge remote-tracking branch 'upstream/master' into qemu-driver
* upstream/master:
  Removed debug logging
  Added tests for docker, improved logging, and fixed a few bugs
  Added initial implementation for the docker driver; tests pending
2015-09-04 14:50:47 -05:00
Chris Bednarski aa3937f248 Added example python and java apps for testing
- Java example from @catsby
2015-09-04 11:13:24 -07:00
Chris Bednarski 813f905a1c Removed debug logging 2015-09-03 21:08:14 -07:00
Chris Bednarski c483036e16 Added tests for docker, improved logging, and fixed a few bugs 2015-09-03 21:00:16 -07:00
Clint Shryock 9cb1dc95a0 driver: Add README.md for docs 2015-09-03 17:01:43 -05:00
Chris Bednarski b9ceb69683 Added initial implementation for the docker driver; tests pending 2015-09-03 12:35:22 -07:00
Clint 2000d3657f Merge pull request #15 from hashicorp/b-java-driver
Rough spike at adding Java driver
2015-09-03 14:31:49 -05:00
Clint Shryock 8c6128503f driver/java: use filepath.Join instead of simple + 2015-09-03 10:25:09 -05:00
Clint Shryock 256d5c1286 driver/java: Don't error if Java isn't found; log if error parsing 2015-09-03 10:02:48 -05:00
Clint Shryock 1dd0b63cb4 clean up orphaned java processes 2015-09-03 09:49:39 -05:00
Clint Shryock c774c67b6b driver/java: update Fingerprint for Java driver 2015-09-02 11:41:25 -05:00
Clint Shryock 9d5c04ddbb Spike at a Java driver, runs Java jars 2015-09-01 17:07:41 -05:00
Clint Shryock 9e79a15789 move test logger to shared file 2015-09-01 16:56:42 -05:00
Chris Bednarski 7070b80167 Added test for config.Read and config.ReadDefault 2015-08-31 20:11:01 -07:00
Chris Bednarski 2e5a080354 Delete unused NewConfig function 2015-08-31 20:01:04 -07:00
Chris Bednarski d9d78d6b2c Add working test for consul fingerprinter 2015-08-31 19:56:38 -07:00
Chris Bednarski ab0deab3e5 Made consul fingerprinter configurable 2015-08-31 19:56:25 -07:00
Chris Bednarski ecfeba3ce6 Added ReadDefault for supreme laziness 2015-08-31 19:54:49 -07:00
Chris Bednarski 1936932406 Added Config.Options so we can support arbitrary key-value configuration 2015-08-31 19:48:59 -07:00
Chris Bednarski ff5266ad8f Add consul data to node.Links 2015-08-31 16:04:48 -07:00
Chris Bednarski a033bedbaf Added basic consul functionality; currently hard-coded to a test instance 2015-08-31 16:04:48 -07:00
Clint 05682391b9 Merge pull request #14 from hashicorp/aws-env
Spike on AWS ENV fingerprint
2015-08-31 15:10:33 -05:00
Clint Shryock 1e652cc4e9 fingerprint/env_aws: Rename ec2-instance link to aws.ec2, drop ami link 2015-08-31 15:02:31 -05:00
Clint Shryock 416e7de06d fingerprint/aws: Add 2 basic links, rename 'env' to 'platform' 2015-08-31 14:18:40 -05:00
Armon Dadgar 0527529f88 client: allocate alloc dir and cleanup 2015-08-30 17:35:58 -07:00
Armon Dadgar ab069de9b9 client: more stats 2015-08-30 17:24:12 -07:00
Armon Dadgar 5549a82f9f client: testing state restore 2015-08-30 17:19:20 -07:00
Armon Dadgar 43471d023e client: test alloc runner 2015-08-30 17:10:17 -07:00
Armon Dadgar 7b3adc6cc4 client: refactor AllocRunner for testing 2015-08-30 16:35:04 -07:00
Armon Dadgar 8c25d1fca1 client: testing task runner 2015-08-29 20:07:24 -07:00
Armon Dadgar db33f76a61 client: remove TaskRunner dependence on AllocRunner 2015-08-29 19:42:35 -07:00
Armon Dadgar a2d8c6c3fe client: working on state restore 2015-08-29 19:14:47 -07:00
Armon Dadgar b6332b435d client: first pass at save/restore of state 2015-08-29 18:16:49 -07:00
Armon Dadgar 50c677a9bb client: adding state save helpers 2015-08-29 18:03:00 -07:00
Armon Dadgar c99fe72f54 driver/exec: basic implementation 2015-08-29 16:20:07 -07:00
Armon Dadgar 83dd313b5c client: working on runners 2015-08-29 15:46:10 -07:00
Armon Dadgar e57ee3fbfe client: test watching allocations 2015-08-29 14:33:30 -07:00
Armon Dadgar 4d6238ebb8 client: test updating alloc status 2015-08-29 14:22:24 -07:00
Armon Dadgar 2e4809d2fc client: test heartbeats 2015-08-29 14:15:34 -07:00
Clint Shryock ae1142ad33 cleanups 2015-08-28 13:09:21 -05:00
Clint Shryock dc217da84a spike on AWS ENV fingerprint 2015-08-28 11:33:41 -05:00
Chris Bednarski 96cb220ff4 Update references to "os" to use "kernel.name"
This brings test code and mocks up to date with the fingerprinter. This was a slightly larger change than I anticipated, but I think it's good for two reasons:

1. More semanitcally correct. `os.name` is something like "Windows 10 Pro" or "Ubuntu", while `kernel.name` is "windows" or "linux". `os.version` and `kernel.version` match these semantics.
2. `kernel.name` is much easier to grep for than `os`, which is helpful because oracle can't help us with strings.
2015-08-28 01:30:47 -07:00
Chris Bednarski 9b8fc07bbe Drop os fingerprint since this is redundant with host 2015-08-27 17:37:56 -07:00
Chris Bednarski 94235e3448 Change 'os' to 'kernel.name'; add 'kernel.version' for *nix* 2015-08-27 17:37:37 -07:00
Chris Bednarski ced2f647c6 Add guard to storage fingerprint so CWD will be used if AllocDir is not specified -- fixes windows tests 2015-08-27 16:03:09 -07:00
Chris Bednarski d0a091c952 Add the storage fingerprinter to the list of built-ins 2015-08-27 14:30:41 -07:00
Chris Bednarski 0437a02fd7 Change column constraint so this is compatible with darwin and linux 2015-08-27 14:30:20 -07:00
Clint c6cdf014fd Merge pull request #7 from hashicorp/memory-fingerprint
Add a memory fingerprint
2015-08-27 16:11:44 -05:00
Clint Shryock b223278b6f convert to MB for MemoryMB, and update test 2015-08-27 16:01:47 -05:00
Chris Bednarski 6123ba8b83 Get average frequency of all CPUs so we can do average frequency * cores for total compute 2015-08-27 13:35:54 -07:00
Clint Shryock 759d3131f2 Merge remote-tracking branch 'upstream/master' into memory-fingerprint
* upstream/master:
  Prevent a panic if the df tool output is not in the expected format
  Change 'available' to 'free' because it's shorter; also initialize node.Resources.DiskMB as total disk instead of available disk
  Changed logs to errors; added data to node.Resources.DiskMB
  populate CPU in Node Resources
  Fix arity in log call for TCP resolution failure
  Add storage fingerprinter
2015-08-27 15:30:00 -05:00
Clint e3348ad809 Merge pull request #6 from hashicorp/cpu-resources
populate CPU in Node Resources
2015-08-27 15:26:00 -05:00
Clint Shryock 83a792593e Add a memory fingerprint, just grabs memory 2015-08-27 15:19:19 -05:00
Chris Bednarski 78767f0ff4 Merge pull request #4 from hashicorp/f-storage-fingerprint
Add storage fingerprinter
2015-08-27 12:43:18 -07:00
Chris Bednarski 8e544e0969 Prevent a panic if the df tool output is not in the expected format 2015-08-27 12:42:58 -07:00
Chris Bednarski 66b518cd6c Change 'available' to 'free' because it's shorter; also initialize node.Resources.DiskMB as total disk instead of available disk 2015-08-27 12:37:05 -07:00
Chris Bednarski d17c6128c8 Changed logs to errors; added data to node.Resources.DiskMB 2015-08-27 12:23:17 -07:00
Clint Shryock 58be8ba139 populate CPU in Node Resources 2015-08-27 14:15:56 -05:00
Clint Shryock cacb8074d3 Add cpu.frequency, cpu.totalcompute 2015-08-27 09:19:53 -05:00
Chris Bednarski cd5cd7efc2 Fix arity in log call for TCP resolution failure 2015-08-26 17:17:08 -07:00
Chris Bednarski edea3700a4 Add storage fingerprinter
Breaking change: Added ID() to Fingerprint interface. This allows us to assign
each fingerprint implementation a unique ID, identify which fingerprinters have
been run, and also self-identify in log messages.

- Added storage fingerprinter for Windows and *nix
- Added storage tests under storage_test.go
- Added test helper functions under fingerprint/fingerprint_test.go
- Added ID() to existing finterprinters and drivers
- Added Fingerprint.ID() to log messages via log.SetPrefix()
2015-08-26 17:17:08 -07:00
Clint Shryock 9a92383b69 refactor into multiple fingerprints 2015-08-26 16:29:18 -05:00
Clint Shryock 8ab31da8b0 update fingerprint with more cpu, some host info 2015-08-26 15:20:07 -05:00
Clint Shryock d2318f71f1 Fingerprint CPU model name, count of cores 2015-08-26 11:32:30 -05:00
Chris Bednarski 0b255c6af6 Pass config to fingerprints; update tests 2015-08-25 16:21:29 -07:00
Chris Bednarski 98331bbf87 We need a new package for this or we get a circular import between client and client/fingerprint 2015-08-25 16:13:33 -07:00
Armon Dadgar 265da591ae client: faster retries in dev mode 2015-08-23 17:40:14 -07:00
Armon Dadgar 07b832c588 agent: use the client 2015-08-23 16:53:15 -07:00
Armon Dadgar 8e32075210 client: making progress 2015-08-23 16:49:48 -07:00
Armon Dadgar 3663c44dee client: standardize naming 2015-08-23 15:36:06 -07:00
Armon Dadgar d7c785aad4 client: rename Alloc/TaskContext to Runner 2015-08-23 15:32:46 -07:00
Armon Dadgar 7cd52e10bc client: alloc/task context 2015-08-23 15:30:16 -07:00
Armon Dadgar c57821877b client: working on alloc context 2015-08-23 15:15:48 -07:00
Armon Dadgar 0f3ef2a48a client: working on alloc handling 2015-08-23 15:06:47 -07:00
Armon Dadgar c71c9bec1a client: working with alloc diffs 2015-08-23 14:54:52 -07:00
Armon Dadgar 1dfa7296c1 client: alloc diffing 2015-08-23 14:47:51 -07:00
Armon Dadgar 811d6d85e1 client: state stubs 2015-08-23 14:12:26 -07:00
Armon Dadgar 5705dc6398 client: watch for allocations 2015-08-22 19:31:22 -07:00
Armon Dadgar 6c8791ccf8 nomad: client does periodic heartbeat 2015-08-22 18:16:05 -07:00
Armon Dadgar 2b2e4c2256 client: register on start 2015-08-20 17:49:04 -07:00
Armon Dadgar c5553017be client: scan for drivers 2015-08-20 16:53:43 -07:00
Armon Dadgar a561fbb9a9 driver: skeleton package 2015-08-20 16:50:28 -07:00
Armon Dadgar d44bf839ef client: attempt fingerprint of host 2015-08-20 16:41:29 -07:00
Armon Dadgar 88438619c8 fingerprint: adding arch fingerprint 2015-08-20 16:29:19 -07:00
Armon Dadgar f20b361d89 fingerprint: adding simple package 2015-08-20 16:26:32 -07:00
Armon Dadgar a6c4d2a63f client: testing RPC 2015-08-20 16:13:05 -07:00
Armon Dadgar 0f2fe6a425 client: testing RPC 2015-08-20 16:12:28 -07:00
Armon Dadgar 7c3e987617 client: skeleton package 2015-08-20 16:07:26 -07:00
Armon Dadgar 0383bf3c14 client: adding skeleton 2015-08-20 15:25:09 -07:00