Re: Review Request 29873: Fixing batched kill task filtering.

2015-01-17 Thread Maxim Khutornenko


 On Jan. 15, 2015, 10:07 p.m., Bill Farner wrote:
  src/main/python/apache/aurora/client/cli/context.py, line 218
  https://reviews.apache.org/r/29873/diff/2/?file=822909#file822909line218
 
  why convert an empty list to `None`?

Blind following to the above pattern. No reason, dropped.


 On Jan. 15, 2015, 10:07 p.m., Bill Farner wrote:
  src/test/python/apache/aurora/client/cli/util.py, line 200
  https://reviews.apache.org/r/29873/diff/2/?file=822920#file822920line200
 
  Your call, but i'd prefer this be a single statement, `return 
  ScheduledTask(...)`.

Sure, converted.


- Maxim


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29873/#review68329
---


On Jan. 15, 2015, 7:44 p.m., Maxim Khutornenko wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/29873/
 ---
 
 (Updated Jan. 15, 2015, 7:44 p.m.)
 
 
 Review request for Aurora and Bill Farner.
 
 
 Bugs: AURORA-996
 https://issues.apache.org/jira/browse/AURORA-996
 
 
 Repository: aurora
 
 
 Description
 ---
 
 Fixed job status quering in client context to return active tasks where 
 needed.
 
 Also, dropped active instance validation from both updater calls as it was 
 hiding a legitimate feature: add new job instances with instance_spec.
 
 
 Diffs
 -
 
   src/main/python/apache/aurora/client/api/__init__.py 
 64f08046f6aca112a9f51c3f250ba6102d297216 
   src/main/python/apache/aurora/client/cli/context.py 
 93587c616afb0b7493a509197361cd76af2e2c97 
   src/main/python/apache/aurora/client/cli/jobs.py 
 508c9be556998e47bddcec8dee43f1595497b354 
   src/main/python/apache/aurora/client/cli/task.py 
 21548984f6f5cd894733220c6508458cc1318391 
   src/main/python/apache/aurora/client/cli/update.py 
 a1617325f08ca252bdba38618aef141504ba7272 
   src/test/python/apache/aurora/client/cli/test_command_hooks.py 
 e8432a1f3475e7e48a092526998d15cbf7e92e10 
   src/test/python/apache/aurora/client/cli/test_create.py 
 18b58383d209a50bd09fbdfa5a600e49d1d848f7 
   src/test/python/apache/aurora/client/cli/test_kill.py 
 b475d737ede8ff0a669a9a9229196a76b43b46b6 
   src/test/python/apache/aurora/client/cli/test_plugins.py 
 aa45851bd26f78583e0c16d0c3699c12f8a58697 
   src/test/python/apache/aurora/client/cli/test_restart.py 
 a532ead256869c620e6bd96886ce9681b3423d0c 
   src/test/python/apache/aurora/client/cli/test_supdate.py 
 9378b49ec5e4bb8189b00d9fd1d80558a731d668 
   src/test/python/apache/aurora/client/cli/test_update.py 
 c12b32e3327af8c014fdad72d63ab4e68dc541c8 
   src/test/python/apache/aurora/client/cli/util.py 
 147d418ea1de679674dd93eaf648d84686b95d37 
 
 Diff: https://reviews.apache.org/r/29873/diff/
 
 
 Testing
 ---
 
 ./pants src/test/python:all
 
 vagrant@vagrant-ubuntu-trusty-64:~$ aurora job killall 
 devcluster/www-data/prod/hello 
  INFO] Checking status of devcluster/www-data/prod/hello
  INFO] 
 No tasks to kill found for job devcluster/www-data/prod/hello
 Job killall succeeded
 
 
 Thanks,
 
 Maxim Khutornenko
 




Re: Review Request 29873: Fixing batched kill task filtering.

2015-01-15 Thread Maxim Khutornenko

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29873/
---

(Updated Jan. 15, 2015, 7:44 p.m.)


Review request for Aurora and Bill Farner.


Changes
---

Bill's comments.


Bugs: AURORA-996
https://issues.apache.org/jira/browse/AURORA-996


Repository: aurora


Description
---

Fixed job status quering in client context to return active tasks where needed.

Also, dropped active instance validation from both updater calls as it was 
hiding a legitimate feature: add new job instances with instance_spec.


Diffs (updated)
-

  src/main/python/apache/aurora/client/api/__init__.py 
64f08046f6aca112a9f51c3f250ba6102d297216 
  src/main/python/apache/aurora/client/cli/context.py 
93587c616afb0b7493a509197361cd76af2e2c97 
  src/main/python/apache/aurora/client/cli/jobs.py 
508c9be556998e47bddcec8dee43f1595497b354 
  src/main/python/apache/aurora/client/cli/task.py 
21548984f6f5cd894733220c6508458cc1318391 
  src/main/python/apache/aurora/client/cli/update.py 
a1617325f08ca252bdba38618aef141504ba7272 
  src/test/python/apache/aurora/client/cli/test_command_hooks.py 
e8432a1f3475e7e48a092526998d15cbf7e92e10 
  src/test/python/apache/aurora/client/cli/test_create.py 
18b58383d209a50bd09fbdfa5a600e49d1d848f7 
  src/test/python/apache/aurora/client/cli/test_kill.py 
b475d737ede8ff0a669a9a9229196a76b43b46b6 
  src/test/python/apache/aurora/client/cli/test_plugins.py 
aa45851bd26f78583e0c16d0c3699c12f8a58697 
  src/test/python/apache/aurora/client/cli/test_restart.py 
a532ead256869c620e6bd96886ce9681b3423d0c 
  src/test/python/apache/aurora/client/cli/test_supdate.py 
9378b49ec5e4bb8189b00d9fd1d80558a731d668 
  src/test/python/apache/aurora/client/cli/test_update.py 
c12b32e3327af8c014fdad72d63ab4e68dc541c8 
  src/test/python/apache/aurora/client/cli/util.py 
147d418ea1de679674dd93eaf648d84686b95d37 

Diff: https://reviews.apache.org/r/29873/diff/


Testing
---

./pants src/test/python:all

vagrant@vagrant-ubuntu-trusty-64:~$ aurora job killall 
devcluster/www-data/prod/hello 
 INFO] Checking status of devcluster/www-data/prod/hello
 INFO] 
No tasks to kill found for job devcluster/www-data/prod/hello
Job killall succeeded


Thanks,

Maxim Khutornenko



Re: Review Request 29873: Fixing batched kill task filtering.

2015-01-15 Thread Maxim Khutornenko


 On Jan. 14, 2015, 7:27 p.m., Bill Farner wrote:
  src/test/python/apache/aurora/client/cli/test_kill.py, line 146
  https://reviews.apache.org/r/29873/diff/1/?file=820323#file820323line146
 
  While you're in here, can you take a stab at renaming 
  `create_mock_task` to `create_task`, and not using mocks (ditto for 
  `create_scheduled_tasks`)?  This aligns with the desired pattern of 
  avoiding unnecessary use of mocks.
  
  You can borrow from `test_inspect.py` for an example: 
  https://reviews.apache.org/r/29696
 
 Maxim Khutornenko wrote:
 Sure, will do.

Refactored as much as I could find. There is still plenty of refactoring left 
but I have to stop here to avoid a larger yak shave.


- Maxim


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29873/#review68083
---


On Jan. 14, 2015, 1:16 a.m., Maxim Khutornenko wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/29873/
 ---
 
 (Updated Jan. 14, 2015, 1:16 a.m.)
 
 
 Review request for Aurora and Bill Farner.
 
 
 Bugs: AURORA-996
 https://issues.apache.org/jira/browse/AURORA-996
 
 
 Repository: aurora
 
 
 Description
 ---
 
 Fixed job status quering in client context to return active tasks where 
 needed.
 
 Also, dropped active instance validation from both updater calls as it was 
 hiding a legitimate feature: add new job instances with instance_spec.
 
 
 Diffs
 -
 
   src/main/python/apache/aurora/client/cli/context.py 
 93587c616afb0b7493a509197361cd76af2e2c97 
   src/main/python/apache/aurora/client/cli/jobs.py 
 508c9be556998e47bddcec8dee43f1595497b354 
   src/main/python/apache/aurora/client/cli/update.py 
 a1617325f08ca252bdba38618aef141504ba7272 
   src/test/python/apache/aurora/client/cli/test_kill.py 
 b475d737ede8ff0a669a9a9229196a76b43b46b6 
   src/test/python/apache/aurora/client/cli/test_restart.py 
 a532ead256869c620e6bd96886ce9681b3423d0c 
 
 Diff: https://reviews.apache.org/r/29873/diff/
 
 
 Testing
 ---
 
 ./pants src/test/python:all
 
 vagrant@vagrant-ubuntu-trusty-64:~$ aurora job killall 
 devcluster/www-data/prod/hello 
  INFO] Checking status of devcluster/www-data/prod/hello
  INFO] 
 No tasks to kill found for job devcluster/www-data/prod/hello
 Job killall succeeded
 
 
 Thanks,
 
 Maxim Khutornenko
 




Re: Review Request 29873: Fixing batched kill task filtering.

2015-01-15 Thread Aurora ReviewBot

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29873/#review68344
---

Ship it!


Master (1acb428) is green with this patch.
  ./build-support/jenkins/build.sh

I will refresh this build result if you post a review containing @ReviewBot 
retry

- Aurora ReviewBot


On Jan. 15, 2015, 7:44 p.m., Maxim Khutornenko wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/29873/
 ---
 
 (Updated Jan. 15, 2015, 7:44 p.m.)
 
 
 Review request for Aurora and Bill Farner.
 
 
 Bugs: AURORA-996
 https://issues.apache.org/jira/browse/AURORA-996
 
 
 Repository: aurora
 
 
 Description
 ---
 
 Fixed job status quering in client context to return active tasks where 
 needed.
 
 Also, dropped active instance validation from both updater calls as it was 
 hiding a legitimate feature: add new job instances with instance_spec.
 
 
 Diffs
 -
 
   src/main/python/apache/aurora/client/api/__init__.py 
 64f08046f6aca112a9f51c3f250ba6102d297216 
   src/main/python/apache/aurora/client/cli/context.py 
 93587c616afb0b7493a509197361cd76af2e2c97 
   src/main/python/apache/aurora/client/cli/jobs.py 
 508c9be556998e47bddcec8dee43f1595497b354 
   src/main/python/apache/aurora/client/cli/task.py 
 21548984f6f5cd894733220c6508458cc1318391 
   src/main/python/apache/aurora/client/cli/update.py 
 a1617325f08ca252bdba38618aef141504ba7272 
   src/test/python/apache/aurora/client/cli/test_command_hooks.py 
 e8432a1f3475e7e48a092526998d15cbf7e92e10 
   src/test/python/apache/aurora/client/cli/test_create.py 
 18b58383d209a50bd09fbdfa5a600e49d1d848f7 
   src/test/python/apache/aurora/client/cli/test_kill.py 
 b475d737ede8ff0a669a9a9229196a76b43b46b6 
   src/test/python/apache/aurora/client/cli/test_plugins.py 
 aa45851bd26f78583e0c16d0c3699c12f8a58697 
   src/test/python/apache/aurora/client/cli/test_restart.py 
 a532ead256869c620e6bd96886ce9681b3423d0c 
   src/test/python/apache/aurora/client/cli/test_supdate.py 
 9378b49ec5e4bb8189b00d9fd1d80558a731d668 
   src/test/python/apache/aurora/client/cli/test_update.py 
 c12b32e3327af8c014fdad72d63ab4e68dc541c8 
   src/test/python/apache/aurora/client/cli/util.py 
 147d418ea1de679674dd93eaf648d84686b95d37 
 
 Diff: https://reviews.apache.org/r/29873/diff/
 
 
 Testing
 ---
 
 ./pants src/test/python:all
 
 vagrant@vagrant-ubuntu-trusty-64:~$ aurora job killall 
 devcluster/www-data/prod/hello 
  INFO] Checking status of devcluster/www-data/prod/hello
  INFO] 
 No tasks to kill found for job devcluster/www-data/prod/hello
 Job killall succeeded
 
 
 Thanks,
 
 Maxim Khutornenko
 




Re: Review Request 29873: Fixing batched kill task filtering.

2015-01-15 Thread Bill Farner

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29873/#review68329
---

Ship it!



src/main/python/apache/aurora/client/cli/context.py
https://reviews.apache.org/r/29873/#comment112506

why convert an empty list to `None`?



src/test/python/apache/aurora/client/cli/util.py
https://reviews.apache.org/r/29873/#comment112507

Your call, but i'd prefer this be a single statement, `return 
ScheduledTask(...)`.


- Bill Farner


On Jan. 15, 2015, 7:44 p.m., Maxim Khutornenko wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/29873/
 ---
 
 (Updated Jan. 15, 2015, 7:44 p.m.)
 
 
 Review request for Aurora and Bill Farner.
 
 
 Bugs: AURORA-996
 https://issues.apache.org/jira/browse/AURORA-996
 
 
 Repository: aurora
 
 
 Description
 ---
 
 Fixed job status quering in client context to return active tasks where 
 needed.
 
 Also, dropped active instance validation from both updater calls as it was 
 hiding a legitimate feature: add new job instances with instance_spec.
 
 
 Diffs
 -
 
   src/main/python/apache/aurora/client/api/__init__.py 
 64f08046f6aca112a9f51c3f250ba6102d297216 
   src/main/python/apache/aurora/client/cli/context.py 
 93587c616afb0b7493a509197361cd76af2e2c97 
   src/main/python/apache/aurora/client/cli/jobs.py 
 508c9be556998e47bddcec8dee43f1595497b354 
   src/main/python/apache/aurora/client/cli/task.py 
 21548984f6f5cd894733220c6508458cc1318391 
   src/main/python/apache/aurora/client/cli/update.py 
 a1617325f08ca252bdba38618aef141504ba7272 
   src/test/python/apache/aurora/client/cli/test_command_hooks.py 
 e8432a1f3475e7e48a092526998d15cbf7e92e10 
   src/test/python/apache/aurora/client/cli/test_create.py 
 18b58383d209a50bd09fbdfa5a600e49d1d848f7 
   src/test/python/apache/aurora/client/cli/test_kill.py 
 b475d737ede8ff0a669a9a9229196a76b43b46b6 
   src/test/python/apache/aurora/client/cli/test_plugins.py 
 aa45851bd26f78583e0c16d0c3699c12f8a58697 
   src/test/python/apache/aurora/client/cli/test_restart.py 
 a532ead256869c620e6bd96886ce9681b3423d0c 
   src/test/python/apache/aurora/client/cli/test_supdate.py 
 9378b49ec5e4bb8189b00d9fd1d80558a731d668 
   src/test/python/apache/aurora/client/cli/test_update.py 
 c12b32e3327af8c014fdad72d63ab4e68dc541c8 
   src/test/python/apache/aurora/client/cli/util.py 
 147d418ea1de679674dd93eaf648d84686b95d37 
 
 Diff: https://reviews.apache.org/r/29873/diff/
 
 
 Testing
 ---
 
 ./pants src/test/python:all
 
 vagrant@vagrant-ubuntu-trusty-64:~$ aurora job killall 
 devcluster/www-data/prod/hello 
  INFO] Checking status of devcluster/www-data/prod/hello
  INFO] 
 No tasks to kill found for job devcluster/www-data/prod/hello
 Job killall succeeded
 
 
 Thanks,
 
 Maxim Khutornenko
 




Re: Review Request 29873: Fixing batched kill task filtering.

2015-01-14 Thread Maxim Khutornenko


 On Jan. 14, 2015, 7:26 p.m., Bill Farner wrote:
   Also, dropped active instance validation from both updater calls as it 
   was hiding a legitimate feature: add new job instances with instance_spec.
  
  I may have missed it - do unit tests verify this new behavior?

The updater.py tests do. Since the functionality of validating instance spec is 
effectively removed, I don't see much benefit adding tests to validate the 
absent feature.


- Maxim


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29873/#review68082
---


On Jan. 14, 2015, 1:16 a.m., Maxim Khutornenko wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/29873/
 ---
 
 (Updated Jan. 14, 2015, 1:16 a.m.)
 
 
 Review request for Aurora and Bill Farner.
 
 
 Bugs: AURORA-996
 https://issues.apache.org/jira/browse/AURORA-996
 
 
 Repository: aurora
 
 
 Description
 ---
 
 Fixed job status quering in client context to return active tasks where 
 needed.
 
 Also, dropped active instance validation from both updater calls as it was 
 hiding a legitimate feature: add new job instances with instance_spec.
 
 
 Diffs
 -
 
   src/main/python/apache/aurora/client/cli/context.py 
 93587c616afb0b7493a509197361cd76af2e2c97 
   src/main/python/apache/aurora/client/cli/jobs.py 
 508c9be556998e47bddcec8dee43f1595497b354 
   src/main/python/apache/aurora/client/cli/update.py 
 a1617325f08ca252bdba38618aef141504ba7272 
   src/test/python/apache/aurora/client/cli/test_kill.py 
 b475d737ede8ff0a669a9a9229196a76b43b46b6 
   src/test/python/apache/aurora/client/cli/test_restart.py 
 a532ead256869c620e6bd96886ce9681b3423d0c 
 
 Diff: https://reviews.apache.org/r/29873/diff/
 
 
 Testing
 ---
 
 ./pants src/test/python:all
 
 vagrant@vagrant-ubuntu-trusty-64:~$ aurora job killall 
 devcluster/www-data/prod/hello 
  INFO] Checking status of devcluster/www-data/prod/hello
  INFO] 
 No tasks to kill found for job devcluster/www-data/prod/hello
 Job killall succeeded
 
 
 Thanks,
 
 Maxim Khutornenko
 




Re: Review Request 29873: Fixing batched kill task filtering.

2015-01-14 Thread Maxim Khutornenko


 On Jan. 14, 2015, 7:27 p.m., Bill Farner wrote:
  src/test/python/apache/aurora/client/cli/test_kill.py, line 146
  https://reviews.apache.org/r/29873/diff/1/?file=820323#file820323line146
 
  While you're in here, can you take a stab at renaming 
  `create_mock_task` to `create_task`, and not using mocks (ditto for 
  `create_scheduled_tasks`)?  This aligns with the desired pattern of 
  avoiding unnecessary use of mocks.
  
  You can borrow from `test_inspect.py` for an example: 
  https://reviews.apache.org/r/29696

Sure, will do.


- Maxim


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29873/#review68083
---


On Jan. 14, 2015, 1:16 a.m., Maxim Khutornenko wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/29873/
 ---
 
 (Updated Jan. 14, 2015, 1:16 a.m.)
 
 
 Review request for Aurora and Bill Farner.
 
 
 Bugs: AURORA-996
 https://issues.apache.org/jira/browse/AURORA-996
 
 
 Repository: aurora
 
 
 Description
 ---
 
 Fixed job status quering in client context to return active tasks where 
 needed.
 
 Also, dropped active instance validation from both updater calls as it was 
 hiding a legitimate feature: add new job instances with instance_spec.
 
 
 Diffs
 -
 
   src/main/python/apache/aurora/client/cli/context.py 
 93587c616afb0b7493a509197361cd76af2e2c97 
   src/main/python/apache/aurora/client/cli/jobs.py 
 508c9be556998e47bddcec8dee43f1595497b354 
   src/main/python/apache/aurora/client/cli/update.py 
 a1617325f08ca252bdba38618aef141504ba7272 
   src/test/python/apache/aurora/client/cli/test_kill.py 
 b475d737ede8ff0a669a9a9229196a76b43b46b6 
   src/test/python/apache/aurora/client/cli/test_restart.py 
 a532ead256869c620e6bd96886ce9681b3423d0c 
 
 Diff: https://reviews.apache.org/r/29873/diff/
 
 
 Testing
 ---
 
 ./pants src/test/python:all
 
 vagrant@vagrant-ubuntu-trusty-64:~$ aurora job killall 
 devcluster/www-data/prod/hello 
  INFO] Checking status of devcluster/www-data/prod/hello
  INFO] 
 No tasks to kill found for job devcluster/www-data/prod/hello
 Job killall succeeded
 
 
 Thanks,
 
 Maxim Khutornenko
 




Re: Review Request 29873: Fixing batched kill task filtering.

2015-01-14 Thread Maxim Khutornenko


 On Jan. 14, 2015, 7:21 p.m., Bill Farner wrote:
  src/main/python/apache/aurora/client/cli/context.py, line 214
  https://reviews.apache.org/r/29873/diff/1/?file=820320#file820320line214
 
  Seems like it would make sense for this to be the default behavior of 
  `get_job_status`.  I can't imagine why the default should be to fetch the 
  active tasks plus some arbitrary history (since history is pruned) of dead 
  instances.
  
  Meta: we should ~always do filtering like this server-side if possible. 
   In this case, you should pass ACTIVE_STATES as a query parameter.  
  `get_status_for_jobs` is also guilty of this, but would benefit from the 
  proposd default behavior of `get_job_status` as well.

The get_job_status is used by aurora job status to pull all available 
instances (including terminal ones).

I was split between using a pre- and post- query filters and decided for the 
latter as a simpler one. The perf gain is quite neglible given the limited 
history we persist but I am happy to reconsider if you think it's worth it.


- Maxim


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29873/#review68078
---


On Jan. 14, 2015, 1:16 a.m., Maxim Khutornenko wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/29873/
 ---
 
 (Updated Jan. 14, 2015, 1:16 a.m.)
 
 
 Review request for Aurora and Bill Farner.
 
 
 Bugs: AURORA-996
 https://issues.apache.org/jira/browse/AURORA-996
 
 
 Repository: aurora
 
 
 Description
 ---
 
 Fixed job status quering in client context to return active tasks where 
 needed.
 
 Also, dropped active instance validation from both updater calls as it was 
 hiding a legitimate feature: add new job instances with instance_spec.
 
 
 Diffs
 -
 
   src/main/python/apache/aurora/client/cli/context.py 
 93587c616afb0b7493a509197361cd76af2e2c97 
   src/main/python/apache/aurora/client/cli/jobs.py 
 508c9be556998e47bddcec8dee43f1595497b354 
   src/main/python/apache/aurora/client/cli/update.py 
 a1617325f08ca252bdba38618aef141504ba7272 
   src/test/python/apache/aurora/client/cli/test_kill.py 
 b475d737ede8ff0a669a9a9229196a76b43b46b6 
   src/test/python/apache/aurora/client/cli/test_restart.py 
 a532ead256869c620e6bd96886ce9681b3423d0c 
 
 Diff: https://reviews.apache.org/r/29873/diff/
 
 
 Testing
 ---
 
 ./pants src/test/python:all
 
 vagrant@vagrant-ubuntu-trusty-64:~$ aurora job killall 
 devcluster/www-data/prod/hello 
  INFO] Checking status of devcluster/www-data/prod/hello
  INFO] 
 No tasks to kill found for job devcluster/www-data/prod/hello
 Job killall succeeded
 
 
 Thanks,
 
 Maxim Khutornenko
 




Re: Review Request 29873: Fixing batched kill task filtering.

2015-01-14 Thread Bill Farner


 On Jan. 14, 2015, 7:21 p.m., Bill Farner wrote:
  src/main/python/apache/aurora/client/cli/context.py, line 214
  https://reviews.apache.org/r/29873/diff/1/?file=820320#file820320line214
 
  Seems like it would make sense for this to be the default behavior of 
  `get_job_status`.  I can't imagine why the default should be to fetch the 
  active tasks plus some arbitrary history (since history is pruned) of dead 
  instances.
  
  Meta: we should ~always do filtering like this server-side if possible. 
   In this case, you should pass ACTIVE_STATES as a query parameter.  
  `get_status_for_jobs` is also guilty of this, but would benefit from the 
  proposd default behavior of `get_job_status` as well.
 
 Maxim Khutornenko wrote:
 The get_job_status is used by aurora job status to pull all available 
 instances (including terminal ones).
 
 I was split between using a pre- and post- query filters and decided for 
 the latter as a simpler one. The perf gain is quite neglible given the 
 limited history we persist but I am happy to reconsider if you think it's 
 worth it.

I'm pretty strongly in favor of filtering with the query.


- Bill


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29873/#review68078
---


On Jan. 14, 2015, 1:16 a.m., Maxim Khutornenko wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/29873/
 ---
 
 (Updated Jan. 14, 2015, 1:16 a.m.)
 
 
 Review request for Aurora and Bill Farner.
 
 
 Bugs: AURORA-996
 https://issues.apache.org/jira/browse/AURORA-996
 
 
 Repository: aurora
 
 
 Description
 ---
 
 Fixed job status quering in client context to return active tasks where 
 needed.
 
 Also, dropped active instance validation from both updater calls as it was 
 hiding a legitimate feature: add new job instances with instance_spec.
 
 
 Diffs
 -
 
   src/main/python/apache/aurora/client/cli/context.py 
 93587c616afb0b7493a509197361cd76af2e2c97 
   src/main/python/apache/aurora/client/cli/jobs.py 
 508c9be556998e47bddcec8dee43f1595497b354 
   src/main/python/apache/aurora/client/cli/update.py 
 a1617325f08ca252bdba38618aef141504ba7272 
   src/test/python/apache/aurora/client/cli/test_kill.py 
 b475d737ede8ff0a669a9a9229196a76b43b46b6 
   src/test/python/apache/aurora/client/cli/test_restart.py 
 a532ead256869c620e6bd96886ce9681b3423d0c 
 
 Diff: https://reviews.apache.org/r/29873/diff/
 
 
 Testing
 ---
 
 ./pants src/test/python:all
 
 vagrant@vagrant-ubuntu-trusty-64:~$ aurora job killall 
 devcluster/www-data/prod/hello 
  INFO] Checking status of devcluster/www-data/prod/hello
  INFO] 
 No tasks to kill found for job devcluster/www-data/prod/hello
 Job killall succeeded
 
 
 Thanks,
 
 Maxim Khutornenko
 




Re: Review Request 29873: Fixing batched kill task filtering.

2015-01-14 Thread Bill Farner


 On Jan. 14, 2015, 7:26 p.m., Bill Farner wrote:
   Also, dropped active instance validation from both updater calls as it 
   was hiding a legitimate feature: add new job instances with instance_spec.
  
  I may have missed it - do unit tests verify this new behavior?
 
 Maxim Khutornenko wrote:
 The updater.py tests do. Since the functionality of validating instance 
 spec is effectively removed, I don't see much benefit adding tests to 
 validate the absent feature.

I was probably too terse - you point out that you removed code because a 
legitimate use case was heretofore impossible.  If that's the case, i'd like to 
make sure we have a test that prevents me from dropping those lines back in and 
regressing behavior.


- Bill


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29873/#review68082
---


On Jan. 14, 2015, 1:16 a.m., Maxim Khutornenko wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/29873/
 ---
 
 (Updated Jan. 14, 2015, 1:16 a.m.)
 
 
 Review request for Aurora and Bill Farner.
 
 
 Bugs: AURORA-996
 https://issues.apache.org/jira/browse/AURORA-996
 
 
 Repository: aurora
 
 
 Description
 ---
 
 Fixed job status quering in client context to return active tasks where 
 needed.
 
 Also, dropped active instance validation from both updater calls as it was 
 hiding a legitimate feature: add new job instances with instance_spec.
 
 
 Diffs
 -
 
   src/main/python/apache/aurora/client/cli/context.py 
 93587c616afb0b7493a509197361cd76af2e2c97 
   src/main/python/apache/aurora/client/cli/jobs.py 
 508c9be556998e47bddcec8dee43f1595497b354 
   src/main/python/apache/aurora/client/cli/update.py 
 a1617325f08ca252bdba38618aef141504ba7272 
   src/test/python/apache/aurora/client/cli/test_kill.py 
 b475d737ede8ff0a669a9a9229196a76b43b46b6 
   src/test/python/apache/aurora/client/cli/test_restart.py 
 a532ead256869c620e6bd96886ce9681b3423d0c 
 
 Diff: https://reviews.apache.org/r/29873/diff/
 
 
 Testing
 ---
 
 ./pants src/test/python:all
 
 vagrant@vagrant-ubuntu-trusty-64:~$ aurora job killall 
 devcluster/www-data/prod/hello 
  INFO] Checking status of devcluster/www-data/prod/hello
  INFO] 
 No tasks to kill found for job devcluster/www-data/prod/hello
 Job killall succeeded
 
 
 Thanks,
 
 Maxim Khutornenko
 




Review Request 29873: Fixing batched kill task filtering.

2015-01-13 Thread Maxim Khutornenko

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29873/
---

Review request for Aurora and Bill Farner.


Bugs: AURORA-996
https://issues.apache.org/jira/browse/AURORA-996


Repository: aurora


Description
---

Fixed job status quering in client context to return active tasks where needed.

Also, dropped active instance validation from both updater calls as it was 
hiding a legitimate feature: add new job instances with instance_spec.


Diffs
-

  src/main/python/apache/aurora/client/cli/context.py 
93587c616afb0b7493a509197361cd76af2e2c97 
  src/main/python/apache/aurora/client/cli/jobs.py 
508c9be556998e47bddcec8dee43f1595497b354 
  src/main/python/apache/aurora/client/cli/update.py 
a1617325f08ca252bdba38618aef141504ba7272 
  src/test/python/apache/aurora/client/cli/test_kill.py 
b475d737ede8ff0a669a9a9229196a76b43b46b6 
  src/test/python/apache/aurora/client/cli/test_restart.py 
a532ead256869c620e6bd96886ce9681b3423d0c 

Diff: https://reviews.apache.org/r/29873/diff/


Testing
---

./pants src/test/python:all

vagrant@vagrant-ubuntu-trusty-64:~$ aurora job killall 
devcluster/www-data/prod/hello 
 INFO] Checking status of devcluster/www-data/prod/hello
 INFO] 
No tasks to kill found for job devcluster/www-data/prod/hello
Job killall succeeded


Thanks,

Maxim Khutornenko



Re: Review Request 29873: Fixing batched kill task filtering.

2015-01-13 Thread Aurora ReviewBot

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29873/#review68008
---


Master (a350982) is red with this patch.
  ./build-support/jenkins/build.sh

:licenseTest UP-TO-DATE
:license UP-TO-DATE
:pmdMain
:test
:jacocoTestReport
Coverage report generated: 
file:///x1/jenkins/jenkins-slave/workspace/AuroraBot/dist/reports/jacoco/test/html/index.html
:analyzeReport
Instruction coverage of 0.8929194773338365 exceeds minimum coverage of 0.89.
Branch coverage of 0.8393782383419689 exceeds minimum coverage of 0.835.
:check
:build
:api:assemble
:api:compileTestJava UP-TO-DATE
:api:processTestResources UP-TO-DATE
:api:testClasses UP-TO-DATE
:api:test UP-TO-DATE
:api:check UP-TO-DATE
:api:build
:buildSrc:compileJava UP-TO-DATE
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar
:buildSrc:assemble
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build

BUILD SUCCESSFUL

Total time: 2 mins 53.927 secs
+ export PIP_DEFAULT_TIMEOUT=60
+ PIP_DEFAULT_TIMEOUT=60
+ mkdir -p third_party
+ pip install -d third_party -r /dev/fd/63
++ grep -v mesos.native 3rdparty/python/requirements.txt
./build-support/jenkins/build.sh: line 28: pip: command not found
grep: write error: Broken pipe


I will refresh this build result if you post a review containing @ReviewBot 
retry

- Aurora ReviewBot


On Jan. 14, 2015, 1:16 a.m., Maxim Khutornenko wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/29873/
 ---
 
 (Updated Jan. 14, 2015, 1:16 a.m.)
 
 
 Review request for Aurora and Bill Farner.
 
 
 Bugs: AURORA-996
 https://issues.apache.org/jira/browse/AURORA-996
 
 
 Repository: aurora
 
 
 Description
 ---
 
 Fixed job status quering in client context to return active tasks where 
 needed.
 
 Also, dropped active instance validation from both updater calls as it was 
 hiding a legitimate feature: add new job instances with instance_spec.
 
 
 Diffs
 -
 
   src/main/python/apache/aurora/client/cli/context.py 
 93587c616afb0b7493a509197361cd76af2e2c97 
   src/main/python/apache/aurora/client/cli/jobs.py 
 508c9be556998e47bddcec8dee43f1595497b354 
   src/main/python/apache/aurora/client/cli/update.py 
 a1617325f08ca252bdba38618aef141504ba7272 
   src/test/python/apache/aurora/client/cli/test_kill.py 
 b475d737ede8ff0a669a9a9229196a76b43b46b6 
   src/test/python/apache/aurora/client/cli/test_restart.py 
 a532ead256869c620e6bd96886ce9681b3423d0c 
 
 Diff: https://reviews.apache.org/r/29873/diff/
 
 
 Testing
 ---
 
 ./pants src/test/python:all
 
 vagrant@vagrant-ubuntu-trusty-64:~$ aurora job killall 
 devcluster/www-data/prod/hello 
  INFO] Checking status of devcluster/www-data/prod/hello
  INFO] 
 No tasks to kill found for job devcluster/www-data/prod/hello
 Job killall succeeded
 
 
 Thanks,
 
 Maxim Khutornenko