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

DOCD-1685 Set resource requests/limits from fiaas.yml on bootstrapping pod #37

Merged
merged 12 commits into from Jun 15, 2018

Conversation

oyvindio
Copy link
Member

@oyvindio oyvindio commented Jun 14, 2018

We were relying on the default resource requests/limits enforced by the limitrange in most namespaces, which worked by coincidence untill we hit a namespace that didn't have defaults but did have a resourcequota denying pods with BestEffort QoS. This caused the bootstrapping pod to not be scheduled. Now skipper will use there resources specified in fiaas-deploy-daemon's fiaas.yml when creating the bootstrapping pod as well, unless there is a resourcequota enforcing BestEffort QoS pods only.

@oyvindio oyvindio added the WIP label Jun 14, 2018
@birgirst
Copy link
Contributor

lgtm remove the wip label unless there are additional things to be addressed?

@oyvindio
Copy link
Member Author

lgtm remove the wip label unless there are additional things to be addressed?

There are a few more testcases on the way

Copy link
Contributor

@birgirst birgirst left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -17,38 +18,40 @@


class BarePodBootstrapper(object):
def __init__(self, cmd_args=()):
def __init__(self, cmd_args=[]):
Copy link
Member

Choose a reason for hiding this comment

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

Using list here is a bad choice. Mutable objects should not be the default value in a parameter-list, it sets the stage for hard to understand bugs later. If this really needs to be a list, it should default to None, with initializing in the __init__-method.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, good catch! It is used in the command field of the bootstrapping pod/spec/container, which is a ListField, so it needs to be a list at that point. I'll set the argument default to None and initialize it in the init method.
This only worked because the production code paths that use this always set cmd_args (to a list), and it started breaking in the tests I wrote when I didn't.

setup.cfg Outdated
@@ -9,3 +9,8 @@ directory=build/reports/coverage

[coverage:xml]
output=build/reports/coverage.xml

[flake8]
Copy link
Member

Choose a reason for hiding this comment

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

This is already configured in .prospector.yaml, and you are setting a different max-line-length.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll remove this

@oyvindio
Copy link
Member Author

@mortenlj PTAL

Copy link
Member

@mortenlj mortenlj left a comment

Choose a reason for hiding this comment

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

LGTM

@oyvindio
Copy link
Member Author

Codacy issues seem to stem from the prospector version used not understanding Python 3 or something like that

@oyvindio oyvindio merged commit cdb8938 into master Jun 15, 2018
@oyvindio oyvindio deleted the DOCD-1685-set-resources branch June 15, 2018 08:49
@mortenlj
Copy link
Member

Codacy issues seem to stem from the prospector version used not understanding Python 3 or something like that

Supposed to support Python 3.3 and up. Might be worth a bug report to Prospector? PyPI says 3.3-3.5, but these features aren't new in 3.6 are they?

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.

None yet

3 participants