-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add fallback ref & preference rules for duplicate deployment targets #333
Conversation
be4e444
to
6311aed
Compare
aa6e75e
to
b5d3a49
Compare
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.
LGTM! I was expecting this patch to be more intense but it was really less invasive than I pictured. I guess in the end this was just taking what was already there and just adding a new way to narrow down the querying. So, LGTM!
Tested this to ensure there's no impact to the backend configs. Here's a little script I'm using to ensure that every resource between 2 # compare.py <old file> <new file>
import json
import sys
with open(sys.argv[1]) as fp:
old = json.loads(fp.read())
with open(sys.argv[2]) as fp:
new = json.loads(fp.read())
for old_item in old["items"]:
kind = old_item["kind"]
name = old_item["metadata"]["name"]
for new_item in new["items"]:
if new_item["kind"] == kind and new_item["metadata"]["name"] == name:
if old_item != new_item:
print(f"diff found: {kind} {name}") I am switching between bonfire's 'master' branch, for ex:
Here are results for
(the secret is different every time because the template is generating a random pre-shared key) For patchman:
(the frontends are all different because now we're selecting the stage-stable frontends) When using
(the patch frontend is different because we're falling back to select the stage-stable frontend... previously bonfire would have selected the stage-beta frontend) |
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.
LGTM - I don't see any problems or anything that should change. All makes sense.
91e6157
to
09e0ef1
Compare
The new containerized frontend apps have two deployment targets configured in the same environment -- a 'stable' target and a 'beta' target. Because of this, bonfire doesn't know which one to select when a user indicates something like
--ref-env=insights-stage
-- the deployment config frominsights-stage
that it selects to use for the git ref/image tag to deploy can be unpredictable.Also, when bonfire is run with no
--ref-env
, it defaults to pulling from 'main/master' for all components. This isn't ideal for the frontend deployments which are pushing their betas into the main/master branch.This PR:
--ref-env
to be 'insights-stage' (can be changed with an env var). For backends, this should have basically no impact, because nearly every stage deployment target is usingmaster/main
already anyways.bonfire deploy host-inventory --frontends=true --ref-env=insights-stage --prefer ENV_NAME=frontends-beta
to prefer beta deployment targets. You can use--prefer
multiple times if for some reason you wish to specify multiple parameters._check_replace_other
to use a number weighted system, and takes the--prefer
input into account. Also, I noticed the 'replicas' logic needed a tweak, went ahead and updated it here.--prefer
to beENV_NAME=frontends
-- which would prefer consoledot stable frontend deployments.