-
Notifications
You must be signed in to change notification settings - Fork 72
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
Improve traffic handling #497
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
796b7c8
Add pipfile
jmcs f10b535
Change all stacks' traffic if all stacks have 0 traffic
jmcs 26720bd
Add tox to Pipfile
jmcs ce23d0d
Split traffic.get_weights function to enable code reuse
jmcs 3fc0df1
Check traffic on create
jmcs 91746ff
Test ensure-no-traffic flag
jmcs 846f44d
Test traffic switch with 0 weights
jmcs 2dc74b7
Add docstring
jmcs 7c01fed
Check if fatal_error was called
jmcs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[[source]] | ||
|
||
url = "https://pypi.python.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
|
||
[packages] | ||
|
||
arrow = "*" | ||
clickclick = ">=1.0" | ||
pystache = "*" | ||
pyyaml = "*" | ||
dnspython = ">=1.15.0" | ||
stups-pierone = ">=1.0.34" | ||
"boto3" = ">=1.3.0" | ||
botocore = ">=1.4.10" | ||
pytest = ">=2.7.3" | ||
raven = "*" | ||
typing = "*" | ||
|
||
|
||
[dev-packages] | ||
|
||
tox = "*" | ||
|
||
|
||
[requires] | ||
|
||
python_version = "3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this phrase fails to deliver the idea that it's happening because of 0 traffic weight - maybe something like "Don't create a stack if it has no traffic and would automatically receive it after the change". What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New stacks never have traffic so "if it has no traffic" is always true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to fail when you create the very first version of a stack?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@a1exsh good question..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but the flag is off by default, so you can just omit the flag the first time. I made the behaviour like this to prevent any unexcepted results, specially for Continuous Delivery pipelines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmcs I'm not sure if this buys us a lot if the flag is not enabled by default. It's easy to forget and if you don't already know about the issue, you have no chance.
Can we do this w/o a flag? Like always avoid creating a new stack version if there are some existing versions and all of them have "0%" traffic assigned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@a1exsh do you want to collect some other users upvoting your idea? It would definitely break compatibility, but maybe that's what most Senza users want, so I would be fine with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hjacobs @jmcs Well, I was reluctant to suggest this in the first place, but maybe the better response is to make sure
senza delete
doesn't mess up the traffic weights?Then you can keep semantics of
senza create
as they are currently and no incompatible change is needed.Of course one may intentionally set the traffic of the only stack version to 0 and then deploy a second stack, but there is no much sense trying to prevent that. This will then work as documented by AWS: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-weighted.html#rrsets-values-weighted-weight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the "safe by default" approach way better as well. Having an optional flag will require quite some knowledge.
From my experience so far, use cases where the current behavior is desired of the new behavior are rather few actually. Therefore I would be really in favor of a solution which optimises for the 80% even though it would break compatibility. Especially as the broken functionality should be quite obvious (compared to the "broken" behaviour)