...
- Checkout the edx configuration repository locally for hacking
- Create a local virtual environment on your host machine and install the configuration repository requirements that include edX fork of Ansible.
Create a new role using our template
Code Block cd edx/configuration/playbooks ansible-playbook -i 'localhost,' create_role.yml --connection=local --extra-vars "role_name=my_shiny_new_role"
- As you are developing your role, keep our, freshly minted, role lifecycle convention in mind: Role Life-cycle
Create a play for running your role and per-requisities in configuration/playbooks/edx-east
Code Block - name: Deploy my shiny new service hosts: all sudo: True gather_facts: True vars: serial_count: 1 serial: "{{ serial_count }}" roles: - common - my_shiny_new_role
- Install the latest binary build of docker, >= 1.9.0, so you can make use of productionalized Docker networking. You can find the details here http://docs.docker.com/engine/installation/binaries/
Start the Docker daemon
Code Block sudo /home/edward/bin/docker daemon --bip 172.17.42.1/16 --dns 8.8.8.8
Start up the precise-common container mounting your checked out code so it overlays the checkout in /edx/app/edx-ansible
Code Block docker run -ti -v /home/me/Documents/git/edx/configuration:/edx/app/edx_ansible/edx_ansible edxops/precise-common /bin/bash
Unpacking this command, it is saying
Run the docker container edxops/precise-common:latest which comes with our edx-ansible application installed
- Run with a pseudo TTY, -t
- Run in interactive mode, -i
- Overlay host directory /home/me/Documents/git/edx/configuration on top of the guest's directory /edx/app/edx_ansible/edx_ansible
- Run the command /bin/bash dropping you into an interactive shell
Activate the edx_ansible virtual environment
Code Block . /edx/app/edx_ansible/venvs/edx_ansible/bin/activate
Change to the edx_ansible/playbooks directory
Code Block cd /edx/app/edx_ansible/edx_ansible/playbooks/
Run your play
Code Block sudo ansible-playbook -vvv my_shiny_new_play.yml -c local -t 'install:base,install:configuration'
- Lather, rinse, repeat. Changes made on the host will immediately be available on the guest.
- We are actively working on formalizing and stabilizing Docker support, but for now you'll need to take care regarding the following:
Most of our applications rely on rsyslogd which won't be started as normal in Docker. You can hack around this by running
Code Block $ rsyslogd
Ultimately we need to figure out the process manager story in Docker. While we will push toward single services per container, I don't think we'll get there entirely. We're likely to want rsyslogd, splunk-forwarder, dogstatsd or some analog each running along side our applications.
Running supervisor is a little bit tricky, but doing so is not insurmountable. You'll need to connect to your running container and run supervisor
Code Block $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2b3ccb75c5f9 edxops/precise-common "/bin/bash" 46 minutes ago Up 46 minutes sleepy_perlman $ docker exec -ti 2b3ccb75c5f9 /bin/basbash
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...