Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

Add supprt for iops #241

Merged
merged 2 commits into from
Jun 10, 2016
Merged

Add supprt for iops #241

merged 2 commits into from
Jun 10, 2016

Conversation

cjellick
Copy link
Contributor

@cjellick cjellick commented Jun 9, 2016

  • Upgrade ci image to 1.10.3 as it is needed to test the blkio fields. This resulted in updating a few tests.
  • Add blkio fieds for limiting iops, bps, and weight
  • Add an Iops stats collector that will send iops stats up to cattle like we do for disk/memory/cpu/etc
  • Add logic to handle a disk of "DEFAULT_DISK" specially. If we see that key, we should attempt to lookup the disk from our iops stats.

@cjellick cjellick force-pushed the blkio branch 2 times, most recently from 3f9eb4e to 76a24d8 Compare June 9, 2016 16:31
@cjellick cjellick changed the title Add supprt for blkio fields Add supprt for iops Jun 9, 2016
if len(dev_list):
config[docker_field] = dev_list
except (KeyError, AttributeError):
pass
Copy link
Contributor

Choose a reason for hiding this comment

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

do you think we should log the exception here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These blocks that catch and silently swallow KeyError and AttributeErrors are the established pattern for handling backwards compatibility with cattle. The idea is that if this runs against a version of cattle that doesn't have the deviceOptions field, it will just silently move on.

But looking at this code, the try/except block has too much code in it. I could potentially mask legit errors.

What if I refactor so that it was basically this?

try:
    device_options = instance.data['fields']['deviceOptions']
except (KeyError, AttributeError):
    return
# continue with logic and let any exceptions just bubble up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made that chagne @alena1108. Let me know if you're cool with it.

Copy link
Contributor

Choose a reason for hiding this comment

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

@cjellick the change looks good

@alena1108
Copy link
Contributor

LGTM

- Implement blkio fields in container create
- Implement an iops collector for stats info
@cjellick cjellick merged commit 54146ea into rancher:master Jun 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants