Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2709)

Issue 7324049: state: trivial Constraints

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 2 months ago by fwereade
Modified:
11 years, 2 months ago
Reviewers:
dimitern, mp+148248, dave, jameinel, TheMue
Visibility:
Public.

Description

state: trivial Constraints This does not necessarily reflect the current consensus re what we should provide, but at least it's something concrete to argue about. https://code.launchpad.net/~fwereade/juju-core/trivial-initial-constraints/+merge/148248 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 25

Patch Set 2 : state: trivial Constraints #

Total comments: 12

Patch Set 3 : state: trivial Constraints #

Unified diffs Side-by-side diffs Delta from patch set Stats (+388 lines, -0 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
A cmd/juju/constraints.go View 1 2 1 chunk +104 lines, -0 lines 0 comments Download
A cmd/juju/constraints_test.go View 1 2 1 chunk +176 lines, -0 lines 0 comments Download
A state/constraints.go View 1 1 chunk +52 lines, -0 lines 0 comments Download
A state/constraints_test.go View 1 1 chunk +54 lines, -0 lines 0 comments Download

Messages

Total messages: 10
fwereade
Please take a look.
11 years, 2 months ago (2013-02-13 17:35:25 UTC) #1
dave_cheney.net
On 2013/02/13 17:35:25, fwereade wrote: > Please take a look. To the best of my ...
11 years, 2 months ago (2013-02-14 00:21:05 UTC) #2
dave_cheney.net
LGTM. I have some concerns about the choice pointer values for the Constraint struct. https://codereview.appspot.com/7324049/diff/1/state/constraints.go ...
11 years, 2 months ago (2013-02-14 00:25:23 UTC) #3
TheMue
LGTM, only one question. https://codereview.appspot.com/7324049/diff/1/cmd/juju/constraints.go File cmd/juju/constraints.go (right): https://codereview.appspot.com/7324049/diff/1/cmd/juju/constraints.go#newcode45 cmd/juju/constraints.go:45: func (v *constraintsValue) setCpuCores(str string) ...
11 years, 2 months ago (2013-02-14 07:32:04 UTC) #4
rog
a good start! a few minor suggestions below. https://codereview.appspot.com/7324049/diff/1/cmd/juju/constraints.go File cmd/juju/constraints.go (right): https://codereview.appspot.com/7324049/diff/1/cmd/juju/constraints.go#newcode20 cmd/juju/constraints.go:20: args ...
11 years, 2 months ago (2013-02-14 07:40:09 UTC) #5
dave_cheney.net
https://codereview.appspot.com/7324049/diff/1/state/constraints.go File state/constraints.go (right): https://codereview.appspot.com/7324049/diff/1/state/constraints.go#newcode23 state/constraints.go:23: strs = append(strs, "cpu-cores="+intStr(*c.CpuCores)) My apologies, I must not ...
11 years, 2 months ago (2013-02-14 08:13:29 UTC) #6
fwereade
Please take a look. https://codereview.appspot.com/7324049/diff/1/cmd/juju/constraints.go File cmd/juju/constraints.go (right): https://codereview.appspot.com/7324049/diff/1/cmd/juju/constraints.go#newcode20 cmd/juju/constraints.go:20: args := strings.Split(raw, " ") ...
11 years, 2 months ago (2013-02-15 10:51:20 UTC) #7
jameinel
LGTM
11 years, 2 months ago (2013-02-15 12:59:10 UTC) #8
dimitern
LGTM, with a few comments. https://codereview.appspot.com/7324049/diff/9001/cmd/juju/constraints.go File cmd/juju/constraints.go (right): https://codereview.appspot.com/7324049/diff/9001/cmd/juju/constraints.go#newcode21 cmd/juju/constraints.go:21: args := strings.Split(raw, " ...
11 years, 2 months ago (2013-02-15 16:30:37 UTC) #9
fwereade
11 years, 2 months ago (2013-02-17 09:31:44 UTC) #10
*** Submitted:

state: trivial Constraints

This does not necessarily reflect the current consensus re what we should
provide, but at least it's something concrete to argue about.

R=dfc, TheMue, rog, jameinel, dimitern
CC=
https://codereview.appspot.com/7324049

https://codereview.appspot.com/7324049/diff/9001/cmd/juju/constraints.go
File cmd/juju/constraints.go (right):

https://codereview.appspot.com/7324049/diff/9001/cmd/juju/constraints.go#newc...
cmd/juju/constraints.go:21: args := strings.Split(raw, " ")
On 2013/02/15 16:30:37, dimitern wrote:
> How about stripping all spaces except the ones between constrains, including
> possible spaces around "=". Then the parsing can be simplified and a little
> laxer on there user?
> We can have "  something  =  val   thing= val2 ", and end up with
"something=val
> thing=val2" and then parse it.

Feels like it makes it harder to me (especially considering "mem=" to clear
constraints).

https://codereview.appspot.com/7324049/diff/9001/cmd/juju/constraints.go#newc...
cmd/juju/constraints.go:96: var mbSuffixes = map[string]float64{
On 2013/02/15 16:30:37, dimitern wrote:
> Aliasing M to MB, etc. ?

That's what we did in python, and nobody has yet complained. Shouldn't be hard
to add them later if it turns out somebody's really bothered by this ;p.

https://codereview.appspot.com/7324049/diff/9001/cmd/juju/constraints_test.go
File cmd/juju/constraints_test.go (right):

https://codereview.appspot.com/7324049/diff/9001/cmd/juju/constraints_test.go...
cmd/juju/constraints_test.go:12: var constraintsValueTests = []struct {
On 2013/02/15 16:30:37, dimitern wrote:
> Nice tests!

Thanks :D

https://codereview.appspot.com/7324049/diff/9001/cmd/juju/constraints_test.go...
cmd/juju/constraints_test.go:104: summary: "set mem without suffix",
On 2013/02/15 16:30:37, dimitern wrote:
> Is this "bytes"?

It's always measured in MB.

https://codereview.appspot.com/7324049/diff/9001/cmd/juju/constraints_test.go...
cmd/juju/constraints_test.go:128: args:    []string{"mem=32Y"},
On 2013/02/15 16:30:37, dimitern wrote:
> Arguably, yoctobytes are a valid figure, so maybe test 32X or something?

Heh, I thought it was "yotta". Anyway, it's intended as an explicit check that
I'm not *that* crazy... petabytes is bad enough ;p.

https://codereview.appspot.com/7324049/diff/9001/state/constraints.go
File state/constraints.go (right):

https://codereview.appspot.com/7324049/diff/9001/state/constraints.go#newcode20
state/constraints.go:20: // equivalent to 1 Amazon ECU (or, roughly, a single
2007-era Xeon).
On 2013/02/15 16:30:37, dimitern wrote:
> Will there be a formula in juju to convert cpu-power to cpu-cores?

I don't think there's any intrinsic correlation. Openstack will be free to
ignore cpu-power constraints (but may want to handle them for certain
clouds...).
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b