> On May 25, 2016, 6:36 p.m., Joshua Cohen wrote:
> > src/main/python/apache/aurora/admin/admin.py, line 225
> > <https://reviews.apache.org/r/47809/diff/3/?file=1393623#file1393623line225>
> >
> >     We could have the same problem here (and in `get_quota_str` further 
> > down) as we have below in `render_task_pretty` if the display unit is not 
> > set. It'll just be some trailing whitespace, so probably not a big deal, 
> > but if it's worth fixing there, should it be fixed here as well? If not, 
> > what causes the inconsistency?
> >     
> >     Perhaps we should just make this entire logic a method of the 
> > ResourceType enum so that individual callers don't have to worry about it?

This particular case should never be a problem given that quota is fixed to 
only use cpu, ram and disk. I agree, however, this is not obvious from the 
looks of it. 

Given that `display_unit` is only used for output and always with a space 
separator, I think it's much simpler to just add that space into the 
`display_unit` itself. We can always add more complexity around it (e.g. 
`format_display_unit()` method) later if there is a need for a different 
separator. Thanks for the nudge!


- Maxim


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


On May 25, 2016, 3:58 p.m., Maxim Khutornenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/47809/
> -----------------------------------------------------------
> 
> (Updated May 25, 2016, 3:58 p.m.)
> 
> 
> Review request for Aurora, Joshua Cohen and Stephan Erb.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> This brings client in sync with scheduler wrt resource management approach. 
> 
> To make it more consistent with java `ResourceType` enum I am adding an 
> `enum34`, which is a backport of enum type from python 3.4.
> 
> There was a minor output change in `aurora quota get` command, which is now 
> printing true mem/disk values instead of rolling them up to `GB`. This makes 
> it more consistent with other places this data is surfaced (e.g. `aurora job 
> status` or `aurora_admin increase_quota`).
> 
> 
> Diffs
> -----
> 
>   3rdparty/python/requirements.txt eab0acc1881127b04e87de23069e7ef91fd47952 
>   src/main/python/apache/aurora/admin/admin.py 
> e309460b969f6e164ca59be9ec5584f934c24756 
>   src/main/python/apache/aurora/client/cli/jobs.py 
> e8bc38aaff42579419130b116389d9b9e09122a9 
>   src/main/python/apache/aurora/client/cli/quota.py 
> 43d98107da6d5f33e21392cff896a4aaac5d3703 
>   src/main/python/apache/aurora/config/BUILD 
> 8c763c39781fe0c33cf2c14af3485a5a71ab8577 
>   src/main/python/apache/aurora/config/resource.py PRE-CREATION 
>   src/test/python/apache/aurora/client/cli/test_quota.py 
> e2d7f42cd0063cd26f3df0e45e6b3f43a491fe63 
>   src/test/python/apache/aurora/client/cli/test_status.py 
> 7f36b4627bdbaaec4e6358500beeb143de4fcb7a 
>   src/test/python/apache/aurora/config/test_resources.py PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/47809/diff/
> 
> 
> Testing
> -------
> 
> unit and manual vagrant tests
> 
> ```
> vagrant@aurora:~$ aurora job status devcluster/www-data/prod/hello
>  INFO] Checking status of devcluster/www-data/prod/hello
> Active tasks (1):
>       Task role: www-data, env: prod, name: hello, instance: 0, status: 
> RUNNING on 192.168.33.7
>         CPUs: 1.0 core(s), RAM: 128 MB, Disk: 128 MB, Port: http
>         assigned ports: {'http': 31514}
>         failure count: 0 (max 1)
>         events:
>          2016-05-25 00:57:48 PENDING: None
>          2016-05-25 00:57:48 ASSIGNED: None
>          2016-05-25 00:57:48 STARTING: Initializing sandbox.
>          2016-05-25 00:57:49 RUNNING: None
> Inactive tasks (1):
>       Task role: www-data, env: prod, name: hello, instance: 0, status: 
> KILLED on 192.168.33.7
>         CPUs: 1.0 core(s), RAM: 128 MB, Disk: 128 MB
>         events:
>          2016-05-25 00:55:38 PENDING: None
>          2016-05-25 00:55:38 ASSIGNED: None
>          2016-05-25 00:55:39 STARTING: Initializing sandbox.
>          2016-05-25 00:55:40 RUNNING: None
>          2016-05-25 00:57:40 KILLING: Killed by aurora
>          2016-05-25 00:57:42 KILLED: Instructed to kill task.
> ```
> 
> ```
> vagrant@aurora:~$ aurora quota get devcluster/www-data
>  INFO] Getting quota for: www-data
> Allocated:
>   CPUs: 2.0 core(s)
>   RAM: 11 MB
>   Disk: 101 MB
> Production shared pool resources consumed:
>   CPUs: 0.0 core(s)
>   RAM: 0 MB
>   Disk: 0 MB
> Production dedicated pool resources consumed:
>   CPUs: 0.0 core(s)
>   RAM: 0 MB
>   Disk: 0 MB
> Non-production shared pool resources consumed:
>   CPUs: 1.0 core(s)
>   RAM: 128 MB
>   Disk: 128 MB
> Non-production dedicated pool resources consumed:
>   CPUs: 0.0 core(s)
>   RAM: 0 MB
>   Disk: 0 MB
> ```
> 
> ```
> vagrant@aurora:~$ aurora_admin increase_quota devcluster www-data 1.0 10MB 
> 100MB
>  INFO] Getting quota for: www-data
>  INFO] Current quota for www-data:
>       CPUs    2.0 core(s)
>       RAM         11 MB
>       Disk    101 MB
>  INFO] Attempting to update quota for www-data to
>       CPU         3.0
>       RAM         21 MB
>       Disk    201 MB
>  INFO] Setting quota for user:www-data cpu:3.000000 ram:21 disk: 201
>  INFO] Response from scheduler: OK (message: )
> ```
> 
> 
> Thanks,
> 
> Maxim Khutornenko
> 
>

Reply via email to