Commit Graph

317 Commits

Author SHA1 Message Date
Alex Dadgar 828c4abc44 Fix upgrading from 0.6.x to 0.7.0 2017-09-19 10:28:14 -05:00
Alex Dadgar e5ec915ac3 sync 2017-09-19 10:08:23 -05:00
Armon Dadgar 20a8e590a0 nomad: support ACL bootstrap reset 2017-09-10 16:03:30 -07:00
Alex Dadgar 84d06f6abe Sync namespace changes 2017-09-07 17:04:21 -07:00
Armon Dadgar 10500c39e5 nomad: fixing test 2017-09-04 13:21:01 -07:00
Armon Dadgar 97404e3f8c nomad: compute hash for ACL policies and tokens 2017-09-04 13:09:34 -07:00
Armon Dadgar 1ace912341 nomad: adding bootstrapping checks 2017-09-04 13:05:53 -07:00
Armon Dadgar 06a7f12fad nomad: adding bootstrap state store method 2017-09-04 13:05:53 -07:00
Armon Dadgar 583a11cebd nomad: Adding ability to filter list of tokens to global only 2017-09-04 13:04:45 -07:00
Armon Dadgar bc697dc50e Address @dadgar feedback 2017-09-04 13:04:45 -07:00
Armon Dadgar f91d2608cb nomad: renambe PublicID to AccessorID for consistency 2017-09-04 13:04:45 -07:00
Armon Dadgar a17991e907 nomad: CRUD methods for ACLTokens 2017-09-04 13:04:45 -07:00
Armon Dadgar 8623bf9a5b nomad: adding ACLToken table 2017-09-04 13:04:45 -07:00
Armon Dadgar cde8e9301b nomad: fixing state store tests due to signature mismatch 2017-09-04 13:04:44 -07:00
Armon Dadgar 351afa0069 nomad: Upsert and Delete ACL policies can take a list 2017-09-04 13:03:14 -07:00
Armon Dadgar 4cb544e8f3 nomad: Adding CRUD to state store for ACL Policies 2017-09-04 13:03:14 -07:00
Armon Dadgar 85cad11885 nomad: adding policy table to state store 2017-09-04 13:03:14 -07:00
Alex Dadgar 4cc8bac48d fix blocking query due to ctx change 2017-08-31 15:34:55 -07:00
Alex Dadgar 590ff91bf3 Deployment watcher takes state store 2017-08-30 18:51:59 -07:00
Alex Dadgar dfcb73c896 Fix purging job versions
This PR fixes an issue in which the job versions weren't properly
cleaned when removing a job.

Fixes https://github.com/hashicorp/nomad/issues/3052
2017-08-18 15:46:03 -07:00
Luke Farnell f0ced87b95 fixed all spelling mistakes for goreport 2017-08-07 17:13:05 -04:00
Alex Dadgar 5e98c3ce95 Expose FSM errors into deployment watcher and API
This PR exposes errors returned by the FSM to the deployment watcher and
thus the API. It also adds an error to handle the case of promoting a
deployment that has no eligible canaries.
2017-07-25 16:23:22 -07:00
Alex Dadgar 311084c724 Allow the deployment to not exist and just no-op 2017-07-17 14:09:59 -07:00
Alex Dadgar 3a29b38108 Status description shows requiring promotion 2017-07-07 12:12:48 -07:00
Alex Dadgar 08bf34f9a3 Fix JobModifyIndex changing when job is marked stable 2017-07-07 12:12:48 -07:00
Alex Dadgar de54ffd1f6 Deployment from inplace updates tracks placed properly. 2017-07-07 12:10:04 -07:00
Alex Dadgar a7fdc74bd4 feedback 2017-07-07 12:10:04 -07:00
Alex Dadgar 5457bb7962 Job stability 2017-07-07 12:10:04 -07:00
Alex Dadgar d07a5a2008 Complete deployments mark jobs as stable
This PR allows jobs to be marked as stable automatically by a successful
deployment.
2017-07-07 12:10:04 -07:00
Alex Dadgar 454083ba1b Remove canary 2017-07-07 12:10:04 -07:00
Alex Dadgar c10d7ab871 Remove promoted bit from allocation 2017-07-07 12:10:04 -07:00
Alex Dadgar 09dfa2fc10 Rename CreateDeployments and remove cancelling behavior in state_store 2017-07-07 12:10:04 -07:00
Alex Dadgar 2e2fd26bed Update index 2017-07-07 12:07:08 -07:00
Alex Dadgar ecee5e370e initial watcher 2017-07-07 12:07:08 -07:00
Alex Dadgar e7034691ea deployment status 2017-07-07 12:07:07 -07:00
Alex Dadgar b64185a3f1 Deployment GC
This PR implements the garbage collector for deployments. Deployments
will by default be garbage collected after 1 hour.
2017-07-07 12:05:57 -07:00
Alex Dadgar 73325f888f deployment api 2017-07-07 12:03:11 -07:00
Alex Dadgar dad9e69822 more comment fixes 2017-07-07 12:03:11 -07:00
Alex Dadgar c189948ad2 comments on watcher 2017-07-07 12:03:11 -07:00
Alex Dadgar 87d187d777 Tests 2017-07-07 12:03:11 -07:00
Alex Dadgar 6f821beec4 fix integration slightly 2017-07-07 12:03:11 -07:00
Alex Dadgar b4c8f56570 Deployment watcher tests 2017-07-07 12:03:11 -07:00
Alex Dadgar 80dc4d66d8 Deployments list 2017-07-07 12:03:11 -07:00
Alex Dadgar eec3cefee4 state store tests 2017-07-07 12:03:11 -07:00
Alex Dadgar d04877d23c initial impl 2017-07-07 12:03:11 -07:00
Alex Dadgar 0d42b5d421 initial reconciler 2017-07-07 12:01:17 -07:00
Michael Schurter 8d3e13ab8a System jobs without evals are running too 2017-07-03 13:48:51 -07:00
Michael Schurter f7d2a74ddf System jobs should be running until stopped
Prior to this commit they would be marked as dead if they had no
currently running allocations -- even though they would spring back to
life (running) if the cluster state changed such that a new eval+alloc
was created.
2017-06-28 11:39:24 -07:00
Alex Dadgar 83f5e65aae Plan allows updating the status of deployments 2017-05-11 12:49:04 -07:00
Alex Dadgar 9a576bafd1 Use a detected struct to hold deployment status for an allocation 2017-05-11 11:09:29 -07:00
Alex Dadgar 71788faacd Easy feedback fixes 2017-05-10 15:26:00 -07:00
Alex Dadgar 7078d563cb Create Deployments through plan application 2017-05-05 15:33:19 -07:00
Alex Dadgar 343ff03f02 Deployment struct, state store, fsm persist/restore 2017-05-04 13:37:18 -07:00
Alex Dadgar aed852782f Merge pull request #2592 from hashicorp/b-gc-race
Protect against nil job in new allocation
2017-05-01 13:54:43 -07:00
Alex Dadgar efa91c3d89 Protect against nil job in new allocation 2017-04-26 18:27:27 -07:00
Alex Dadgar 367f4b592f docs 2017-04-20 11:14:06 -07:00
Alex Dadgar 1b97c9abdd Revert server endpoint 2017-04-20 11:14:06 -07:00
Alex Dadgar 5a2449d236 Respond to review comments 2017-04-19 10:54:03 -07:00
Alex Dadgar 1769fe468a Fix some tests 2017-04-17 19:39:20 -07:00
Alex Dadgar 34332af70e GC and some fixes 2017-04-15 17:08:05 -07:00
Alex Dadgar 3145086a42 non-purge deregisters 2017-04-15 17:08:05 -07:00
Alex Dadgar fda44689b7 Histories -> Versions 2017-04-15 17:08:05 -07:00
Alex Dadgar f97664512b Upsert Job Histories 2017-04-15 17:08:05 -07:00
Alex Dadgar d489ed3c7d Job History schema 2017-04-15 17:08:05 -07:00
Alex Dadgar 787be30f13 Fix periodic job state
This PR fixes an issue in which a periodic job would incorrectly
transistion to status dead.

Fixes https://github.com/hashicorp/nomad/issues/2268
2017-03-27 10:35:36 -07:00
Alex Dadgar 5be806a3df 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 21ef1ce685 Add guard 2017-02-10 16:29:28 -08:00
Alex Dadgar 5d293c0f1e Add abandon tests and use snapshot for blocking queries 2017-02-08 11:18:03 -08:00
Alex Dadgar 36d018514b Fix test 2017-02-07 11:35:38 -08:00
Alex Dadgar bc2e6b0cc2 Fix state store tests 2017-02-06 16:46:23 -08:00
Alex Dadgar c026a97ce7 Use watchset on getter methods 2017-02-05 12:45:57 -08:00
Alex Dadgar 570efcaebd Update state store and blocking query helper 2017-02-05 12:03:11 -08:00
Alex Dadgar 7f9c6466d4 Disallow GC of parameterized jobs
This PR makes it so parameterized jobs do not get garbage collected and
adds a test.
2017-01-26 11:57:32 -08:00
Michael Schurter 1f7b5b4b47 Rename Constructor -> Parameterized Job 2017-01-20 12:43:10 -08:00
Alex Dadgar a616e9d970 Merge pull request #2163 from hashicorp/b-summary
Job Summary: Fix queued accounting and remove in-place state store updates
2017-01-11 13:36:36 -08:00
Alex Dadgar efbb2894c7 Review fixes 2017-01-11 13:18:36 -08:00
Alex Dadgar 0f046b179a Merge pull request #2155 from hashicorp/f-cancel
Cancel blocked evals upon successful one for job
2017-01-11 13:10:35 -08:00
Alex Dadgar d0f918495b Store pointer of JobSummary in state store and remove in-place modifications of the object and replace with Copy-Update-Insert operations 2017-01-08 13:55:03 -08:00
Alex Dadgar 8d5f0fea69 Merge pull request #2128 from hashicorp/f-dispatch
Nomad Constructor Jobs and Dispatch
2017-01-06 05:22:49 +08:00
Alex Dadgar 86980e08f0 Cancel blocked evals upon successful one for job
This PR causes blocked evaluations to be cancelled if there is a
subsequent successful evaluation for the job. This fixes UX problems
showing failed placements when there are not any in reality and makes GC
possible for these jobs in certain cases.

Fixes https://github.com/hashicorp/nomad/issues/2124
2017-01-04 16:16:04 -08:00
Diptanu Choudhury 9786708526 Added comments 2016-12-19 18:10:02 -08:00
Alex Dadgar 2761e1d8ea fix tests 2016-12-16 10:21:56 -08:00
Alex Dadgar bf1e157bd8 Children fixes + nomad status outputs summaries
Children object is always initialized instead of lazily.
`nomad status` outputs children summaries and has specialized view for
constructor jobs.
2016-12-14 16:58:54 -08:00
Alex Dadgar 4a5c3c8db0 Rename structs 2016-12-14 14:28:43 -08:00
Alex Dadgar 1235fc6581 summary tests 2016-12-13 16:15:40 -08:00
Alex Dadgar af2865ea48 Don't modify jobs status inplace 2016-12-12 11:42:47 -08:00
Alex Dadgar 8885ab70a6 Handle the delete case 2016-12-06 20:15:10 -08:00
Alex Dadgar ef79e77e52 Children summary 2016-12-06 17:06:57 -08:00
Alex Dadgar c005fcb973 Add structs 2016-12-05 17:24:37 -08:00
Diptanu Choudhury 5191b4d33a Making the status command return the allocs of currently registered job 2016-11-24 16:31:30 +01:00
Diptanu Choudhury 56ed1d3cd8 Fixing the upgrade path for ephemeral disk 2016-11-08 15:24:51 -08:00
Alex Dadgar df4398beac Implement blocking queries for /v1/job/evaluations 2016-10-29 17:30:34 -07:00
Diptanu Choudhury 1b3c5e98c8 Renaming LocalDisk to EphemeralDisk (#1710)
Renaming LocalDisk to EphemeralDisk
2016-09-14 15:43:42 -07:00
Diptanu Choudhury 6028682ad2 Adding LocalDisk to alloc.Job 2016-09-01 17:41:50 -07:00
Alex Dadgar 3c9936ae4a Merge pull request #1659 from hashicorp/f-revoke-accessors
Token revocation and keeping only a single Vault client active among servers
2016-08-31 14:10:46 -07:00
Diptanu Choudhury bfee7b30a3 Introducing shared resources in alloc 2016-08-29 13:49:25 -07:00
Alex Dadgar 48696ba0cc Use tomb to shutdown
Token revocation

Remove from the statestore

Revoke tokens

Don't error when Vault is disabled as this could cause issue if the operator ever goes from enabled to disabled

update server interface to allow enable/disable and config loading

test the new functions

Leader revoke

Use active
2016-08-28 14:06:25 -07:00
Diptanu Choudhury 13497913f9 Ensuring resources are re-calculated properly in fsm 2016-08-26 20:13:11 -07:00
Diptanu Choudhury 2f681b6415 Added copy method to LocalDisk 2016-08-26 14:24:47 -05:00
Diptanu Choudhury 3447658bba Added scheduler tests to ensure disk constraints are honored 2016-08-25 15:31:56 -05:00
Diptanu Choudhury ffaf6c6299 Fixed some tests 2016-08-25 13:56:39 -05:00
Diptanu Choudhury 8105613c25 Added an upgrade path for existing jobs with no local disk 2016-08-25 13:00:20 -05:00
Alex Dadgar 901000f789 Raft message, fsm and state store table 2016-08-19 16:40:37 -07:00
Diptanu Choudhury 6dc5b1972c Setting job's create index as summary create index during reconciliation 2016-08-04 15:14:01 -07:00
Alex Dadgar 2fb67fefb5 Merge pull request #1516 from hashicorp/f-lost-state-sched
Make scheduler mark allocations as lost
2016-08-04 11:36:02 -07:00
Diptanu Choudhury 88d383c47f Updated tests and comments 2016-08-04 11:29:36 -07:00
Diptanu Choudhury c24e8ba7d8 Not updating summary if job is de-registered 2016-08-03 17:00:08 -07:00
Diptanu Choudhury 74caed0c7a Added an endpoint for users to reconcile job summaries 2016-08-03 16:12:47 -07:00
Alex Dadgar ac3328e812 Make scheduler mark allocations as lost 2016-08-03 15:57:46 -07:00
Diptanu Choudhury 1b60e0823a Added a test for restoring the summaries in fsm 2016-08-03 11:58:36 -07:00
Alex Dadgar 4197e62e78 Remove old way of marking lost 2016-08-03 11:20:56 -07:00
Diptanu Choudhury b95cf91ee3 using the job associated with the alloc to determine if job is present 2016-08-02 19:14:05 -07:00
Diptanu Choudhury 6f8c40fca7 Not updating summary if create index of summary not same as job's create index 2016-08-02 18:59:45 -07:00
Diptanu Choudhury b2d388bcba Merge pull request #1508 from hashicorp/b-dont-update-job
Do not update the job of allocations that are being stopped
2016-08-02 18:58:39 -07:00
Alex Dadgar 2332a58944 Do not update the job of allocations that are being stopped 2016-08-02 17:53:31 -07:00
Diptanu Choudhury 87fdeb5393 Updated the logic to update job summary 2016-08-02 16:08:20 -07:00
Diptanu Choudhury 3966a46996 Updating the summary after we have updated the current allocation when client updates the alloc 2016-08-02 15:06:39 -07:00
Diptanu Choudhury 92e32e46f1 Updating the summary after we have updated the current allocation 2016-08-02 14:59:41 -07:00
Diptanu Choudhury 3aa4f39094 Checking if a job is nil before updating the allocation 2016-08-01 17:05:48 -07:00
Diptanu Choudhury b69b7129a6 Using the parnet transaction to query the allocation while updating summary 2016-08-01 16:46:05 -07:00
Diptanu Choudhury b0e1f02e26 Not updating job summaries if jobs are not present 2016-07-28 15:24:27 -07:00
Diptanu Choudhury 0dd8a84de0 Marking the desired state of an allocation as stop if the node on which it runs disconnects 2016-07-27 17:07:08 -07:00
Diptanu Choudhury b857d7c6c1 Copying job summary before mutating it 2016-07-27 14:46:46 -07:00
Diptanu Choudhury 1bab053490 Updated some tests 2016-07-26 15:11:48 -07:00
Diptanu Choudhury 5bded8d54d Setting the right indexes while creating Job Summary 2016-07-25 17:51:20 -07:00
Diptanu Choudhury 3089833397 Reconciling the queued allocations during restore 2016-07-25 17:31:40 -07:00
Diptanu Choudhury 6193529040 Fixed more tests 2016-07-25 17:31:40 -07:00
Diptanu Choudhury f1c9427c37 Added code to create missing job summaries 2016-07-25 17:26:38 -07:00
Diptanu Choudhury dabb83063b Review comments 2016-07-25 17:26:38 -07:00
Diptanu Choudhury 50842b88c7 Fixed some bugs 2016-07-25 17:26:38 -07:00
Diptanu Choudhury 1405687a88 Fixed some error messages and conditions 2016-07-25 17:26:38 -07:00
Diptanu Choudhury 7bafb7c675 Updating the job summary while mutating jobs and allocation objects 2016-07-25 17:26:38 -07:00
Diptanu Choudhury 109b05cb29 Applying changes to job updates via FSM 2016-07-25 17:26:38 -07:00
Diptanu Choudhury affbf5b6e4 Updating the job summary table only if an evaluation has any Queued Allocations 2016-07-25 17:26:38 -07:00
Diptanu Choudhury 2ff2acbfc0 Added the job summary related endpoints 2016-07-25 17:26:38 -07:00
Diptanu Choudhury 1cc0bc392b Setting the number of queued allocations per task group 2016-07-25 17:26:38 -07:00
Alex Dadgar e0114fee05 InitFields to Canonicalize 2016-07-20 16:08:52 -07:00
Diptanu Choudhury e35369ec83 Fixed typos in comments 2016-07-13 13:25:07 -06:00
Diptanu Choudhury 487c66b84d Removing the queued state of Job Summary and alloc desired status false 2016-07-13 13:20:46 -06:00
Diptanu Choudhury daa83a4f3e Renamed jobsummary to job_summary 2016-07-12 16:00:35 -06:00
Diptanu Choudhury 5d782abd50 Refactored the test 2016-07-12 14:37:51 -06:00
Diptanu Choudhury 00b9b4c6e8 Accounting lost state of allocations 2016-07-12 14:27:45 -06:00
Diptanu Choudhury e8d1aee3f4 Added a method for listing jobs whose id matches a prefix 2016-07-12 11:41:13 -06:00
Diptanu Choudhury 313d7aa7f5 Added a test to ensure client alloc updates are happening properly 2016-07-12 11:41:13 -06:00
Diptanu Choudhury 91b828d299 Updated logic to handle change in desired status of allocation when client status is still pending 2016-07-12 11:41:13 -06:00
Diptanu Choudhury 6937c0f7f3 Added test for job summary restore 2016-07-12 11:41:13 -06:00
Diptanu Choudhury 5e6f9ef69e Added methods to save and restore job summary snapshots 2016-07-12 11:41:13 -06:00
Diptanu Choudhury ba71757dfb handled the logic of task group count going up 2016-07-12 11:41:13 -06:00
Diptanu Choudhury 67953b1583 Added a test to ensure correctness of job summary when client updates alloc 2016-07-12 11:41:13 -06:00
Diptanu Choudhury 837b70f285 Added test to make sure summary gets deleted when job gets deleted 2016-07-12 11:41:13 -06:00