-
Notifications
You must be signed in to change notification settings - Fork 1
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
[FC-20956] batou_ext.fcio: Add components that set an RG in maintenance for the time of the deployment #213
base: master
Are you sure you want to change the base?
Conversation
…time of the deployment FC-20956
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 guess a bit more docs would be nice. But first we should discuss the things below.
) | ||
|
||
|
||
class MaintenanceEnd(batou.component.Component): |
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.
This has the downside that setting it up is a little verbose: you have to add three additional components.
We may be able to cut it down to two by removing the DirectoryXMLRPC
and setting up the client in each component.
Another idea I had was to use a decorator which injects Start
end End
into a component (and calls the component's configure
in between), but this has the downside that the maintenance is left when the component itself is updated. I.e.
@needs_maintenance
class Foobar(Component):
def configure(self):
# The RG is in maintenance when X & Y are deployed
self += X()
self += Y()
def update(self):
# when this is reached, we're not in maintenance anymore.
Thoughts?
def change_maintenance_state( | ||
xmlrpc, host_name, desired_state, predict_only=False | ||
): | ||
rg_name = host_name[:-2] |
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 effectively assume here that each host in a deployment is in the same RG.
Do we even have cases where this is not True?
self.xmlrpc = self.require_one("directory-xmlrpc") | ||
|
||
def verify(self): | ||
raise batou.UpdateNeeded() |
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 still have bad feelings about this: every deployment with no other change will set the RG to maintenance for a short time with this.
Unfortunately I don't have a better idea after reading through batou's sources: when MaintenanceStart
is deployed, we don't know yet if anything else will change later that needs maintenance. We could of course run all of the verify()
methods of these components in here, but this doesn't take their sub-components into account.
Ideas? Or is this good enough?
Given a
provision
section in the secret config likean environment config like this
and a component like this
then all subcomponents configured by `Demo will be deployed while the RG is in maintenance.