tunapanda / provision

System for provisioning a new virtual machine with Tunapanda Edubuntu
7 stars 12 forks source link

Integrate edX playbooks #29

Open usernamenumber opened 9 years ago

usernamenumber commented 9 years ago

This is worthwhile not only because it allows us to host edX courses, but because the edX configuration playbooks provide playbooks for several other important services, like mongodb nginx, etc.

...in fact, something to consider: at least in the short-term, maybe it would be worthwhile for deployments that include edX to just start with an edX install, and then run our playbooks afterward to build on that.

One way or another, the ability to host edX courses is part of the MVP for the initial test deployment.

devalih commented 9 years ago

Installing edX using the configuration repo should be fairly easy, I suggest we fork the configuration repo and do some customization to run edX for now ... Then I think integrating this repo into a configuration repo fork would be easier than going the other way around.

what do you think ?

usernamenumber commented 9 years ago

It may be possible to use the edX playbooks without forking them (and then having to maintain our fork), by running their roles and playbooks without modification other than maybe overriding some of their variables, which can be done without modifying the role/playbook files.

I've done some research on this, and I see a couple of ways this could (hopefully) work:

Integration by playbook

If we want to base our systems on a standard edX install, we can create a top-level playbook that just includes a mix of their playbooks and ours. For example, suppose we added the edX configuration repo as a subtree or submodule under /edx in our provisioning repo. Then, in the root of our repo, added playbook that looks like this:

---
# edX, which also includes, mongo, nginx, and other stuff we want
- include: edx/playbooks/vagrant-fullstack.yml
  vars:
    # Optionally, I think we could override vars in the edx playbook here,
    # but I'd have to experiment-- not certain that it gets precedence.

# Everything else we want that isn't included in the above
- include: ansible/main.yml

This wouldn't work on ARM, of course, but at least for now we can just use the image Arturo has made, which already includes edX, and use only our playbook when deploying to ARM.

Integration by role

If we need more flexibility, we can set a custom roles_path that includes the edx roles as well as our own, then pull in the individual roles that we want.

Thoughts on these?

usernamenumber commented 9 years ago

Some further notes on ways to approach this. I think our ideal implementation would...

  1. Clone edX's repo to /usr/local/tunapanda/provision/ext/edx/
    • roles_path in our ansible.cfg allows our playbooks and roles to use edX roles if it is checked out here.
  2. If running on ARM, apply fixes.
    • edX does not run on ARM without modifications. @iLearner has figured out all of the changes that need to be made to the stock edX for it to run on the cubietruck, and implemented them using his custom script. Ideally these should be "ported" to ansible instructions, so that everything is done using one set of tools.
    • Note that you can test for cubietruck architecture with when: ansible_architecture == "armv7l" (not all ARM architectures will be v7l, of course, but the cubietruck should be)
  3. Use edX's roles (probably by role, not playbook) to deploy it.
    • See the dependencies for the edX role in my edx_integration branch for an example.
    • Note that this is a work-in progress branch that currently does not work. However, others are encouraged to fork it and help fix that. :)
usernamenumber commented 9 years ago

Since for now we're focused on using edx pre-installed on the cubietruck, I've split this off into its own branch so we don't have a broken edX playbook lying around in master.

https://github.com/tunapanda/provision/tree/usernamenumber/edx_integration