Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix blkio related validation #545

Merged

Conversation

Mashimiao
Copy link

Signed-off-by: Ma Shimiao mashimiao.fnst@cn.fujitsu.com

@vbatts
Copy link
Member

vbatts commented Aug 29, 2016

@cyphar are these values that you say needed to stay as pointers?

@cyphar
Copy link
Member

cyphar commented Aug 29, 2016

I'm fairly sure they do need to remain as pointers. Though, IIRC @wking mentioned something about this a few days ago (saying that there are some open issues about the pointer as dont-touch-this semantics).

@wking
Copy link
Contributor

wking commented Aug 29, 2016

On Mon, Aug 29, 2016 at 08:01:27AM -0700, Aleksa Sarai wrote:

I'm fairly sure they do need to remain as pointers. Though, IIRC
@wking mentioned something about this a few days ago (saying that
there are some open issues about the pointer as dont-touch-this
semantics).

Pointers make it easy to say “leave it alone”, but they don't give you
a clear way to say “explicitly set this to unlimited” 1.

But in this case, blkioThrottleReadBpsDevice and friends are “array or
null”, and the array entries are not pointers. So I'm fine with
that part of 5d47014.

The uint16 → int16 change for major/minor matches the spec in
config-linux.md and blockIODevice in the Go types. But I don't see a
reason to allow negative values there, so we may want to consolidate
around uints instead.

And the Major/Minor touched by 5d47014 are not pointers, but the
versions used in the spec's cgroup entries are optional 2. So we'll
probably need majorPointer and minorPointer (although currently
linux.resources.devices isn't represented in the JSON Schema at all).

@Mashimiao
Copy link
Author

ping @vbatts any comments?
This is based on the current specs-go. I think we can pass this if there is no plan to modify specs-go recently.
We need to validate based on the latest specs-go.

@Mashimiao Mashimiao force-pushed the fix-blockio-related-validation branch from 5d47014 to bd8e3a5 Compare December 19, 2016 03:04
@Mashimiao
Copy link
Author

@opencontainers/runtime-spec-maintainers PTAL

@@ -97,11 +97,11 @@
"properties": {
"blkioWeight": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/blkioWeight",
"$ref": "defs-linux.json#/definitions/blkioWeightPointer"
"$ref": "defs-linux.json#/definitions/blkioWeight"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see blkioWeight is still pointer in specs-go.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have modified blkioWeight to uint16Pointer as it is typed in spec-go, so blkioWeightPointer is not needed any more

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I see, thanks.

@hqhq
Copy link
Contributor

hqhq commented Dec 19, 2016

LGTM

Approved with PullApprove

@Mashimiao
Copy link
Author

@vbatts @mrunalp PTAL

@mrunalp
Copy link
Contributor

mrunalp commented Jan 11, 2017

@hqhq does this still make sense after your recent PR about negative values?

}
},
{
"type": "null"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably don't want the null alternative since null alternatives for arrays were just rejected in #555.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks.

@wking
Copy link
Contributor

wking commented Jan 12, 2017 via email

@Mashimiao Mashimiao force-pushed the fix-blockio-related-validation branch from bd8e3a5 to 055f3fa Compare January 12, 2017 01:37
@Mashimiao
Copy link
Author

@hqhq @wking @mrunalp @vbatts PTAL

@hqhq
Copy link
Contributor

hqhq commented Jan 12, 2017

@mrunalp #648 didn't affect blkio fields, this PR looks more like cleanup with a minor fix, so it still looks good to me.

LGTM

Approved with PullApprove

@@ -140,19 +140,7 @@
}
},
"blkioWeight": {
"type": "integer",
"minimum": 10,
"maximum": 1000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to keep this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it seems keep this is better, updated.

@Mashimiao Mashimiao force-pushed the fix-blockio-related-validation branch from 055f3fa to 61e0da0 Compare January 12, 2017 06:20
@Mashimiao
Copy link
Author

According to #555 remove null option for array.
@hqhq @wking @mrunalp @vbatts PTAL

]
"type": "array",
"items": {
"$ref": "defs-linux.json#/definitions/Device"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indent (try cd schema && make fmt).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks

},
"blkioWeightDevice": {
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/blkioWeightDevice",
"type": "array",
"items": {
"$ref": "defs-linux.json#/definitions/blockIODeviceWeightPointer"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of 61e0da0, you still need to remove the definition for this from defs-linux.json.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
@Mashimiao Mashimiao force-pushed the fix-blockio-related-validation branch from 61e0da0 to 58832f9 Compare January 12, 2017 06:59
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
@wking
Copy link
Contributor

wking commented Jan 12, 2017 via email

@Mashimiao
Copy link
Author

@hqhq @wking @mrunalp @vbatts PTAL

@wking
Copy link
Contributor

wking commented Jan 23, 2017 via email

@hqhq
Copy link
Contributor

hqhq commented Jan 23, 2017

LGTM

Approved with PullApprove

1 similar comment
@crosbymichael
Copy link
Member

crosbymichael commented Jan 23, 2017

LGTM

Approved with PullApprove

@crosbymichael crosbymichael merged commit d5a1269 into opencontainers:master Jan 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants