-
Notifications
You must be signed in to change notification settings - Fork 22
OC-1541: Keep the old instance running while deploying a new one #63
Conversation
d8f3d83
to
975e092
Compare
975e092
to
5f60fc4
Compare
|
||
|
||
# pylint: disable=too-many-instance-attributes | ||
class OpenEdXDatabasesMixin(MySQLInstanceMixin, MongoDBInstanceMixin, SwiftContainerInstanceMixin): |
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.
Why does the databases mixin contain Swift and S3?
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.
SwiftContainerInstanceMixin
was already in a module called database.py
. I could rename this to "PersistenceMixin" and then it would make more sense. (Or I could split it up into DatabaseMixin / StorageMixin but I don't think that that would improve anything)
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.
@bradenmacdonald I would be in favor of splitting up, the two are handled differently, even if they both persist data. It would also help to remove the pylint warning here, too.
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.
@antoviaque Ok, split up in f2eb2fd
@bradenmacdonald Cool set of changes : ) I had a quick read through the diff and really liked what I saw. Much cleaner approach overall. |
else: | ||
return msg, kwargs | ||
|
||
app_server = self.extra['obj'] |
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.
@bradenmacdonald Looks like this portion of the code is not reachable.
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.
@itsjeyd Whoops, thanks. I will fix. A lot of this code isn't actually running yet, so I haven't caught little things like that, but I would have :)
Now you can create an instance from the CLI using inst = OpenEdXInstance.objects.create(name="New Instance name", sub_domain="test1.blah")
03b4b22
to
5e1b8dc
Compare
it should be a git branch or tag that exists in all of those repositories. | ||
* `DEFAULT_CONFIGURATION_REPO_URL` The repository containing the Open edX | ||
ansible scripts to use. Defaults to | ||
`'https://github.com/edx/configuration.git'` |
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.
@bradenmacdonald No need for the single quotes here. Also (nit): "ansible" ⟶ "Ansible". Sentence is missing a full stop.
@bradenmacdonald Thanks for updating the README! The changes look good, I only found one piece of info to be missing (as mentioned in this comment). Otherwise this is ready to go! 👍 🎆 |
54f4873
to
b7e860e
Compare
@itsjeyd Ok, I addressed your nits. Doing manual testing now, and then I'll merge. |
b7e860e
to
28e2752
Compare
🎉 |
I have deployed this to our stage server, and it seems to be working. Note that for any migrated instances (created before this PR was deployed), all the ansible logs will appear at the Instance level, in the log tab. But going forward, for new instances, ansible logs will be separated by AppServer and appear in each AppServer's "Log" section. |
Changes:
[OpenEdX]Instance
intoInstance
(long-lived, mutable, creates AppServers and marks one as active), andAppServer
(immutable, owns one VM)OpenEdXInstance
andOpenEdXAppServer
respectivelyinstance.last_provisioning_started
since you can compute that from the most recentAppServer.created
fieldforum_version
,notifier_version
,xqueue_version
, andcerts_version
into a singleopenedx_release
setting, since these were always set to the same value, and if one needs to be set differently it can be done using ansible_extra_settings anyways.OpenEdXInstance
should not need to know about pull requests)TODO:
Deployment notes:
Suggestions for future work:
select_related()
calls where needed to optimizeWatchedPullRequest
TODO
items listed in the code