Skip to content
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

Switch Provisioning to use Ansible w/ a Production & Developer playbook #680

Closed
mekarpeles opened this issue Dec 18, 2017 · 12 comments
Closed
Labels
Affects: Configuration Related to the configuration of the dev/staging/prod environments, CI, docker, etc. [managed] Affects: Operations Affects the IA DevOps folks Lead: @cclauss Issues overseen by Chris (Python3 & Dev-ops lead 2019-2021) [managed] Priority: 2 Important, as time permits. [managed] State: Work In Progress This issue is being actively worked on. [managed] Theme: Development Issues related to the developer experience and the dev environment. [managed] Theme: Provisioning Type: Refactor/Clean-up Issues related to reorganization/clean-up of data or code (e.g. for maintainability). [managed]

Comments

@mekarpeles
Copy link
Member

In 2018 we intend to migrate from trusy to xenial -- our internal provisioning isn't as automatic as our vagrant setup and we'd like to get to a position where we only have one canonical build process which adjusts based on tags like production, staging and developer

@mekarpeles mekarpeles changed the title Automated Provisioning for Open Library Automate provisioning (Ansible, Docker, etc.) Mar 13, 2018
@mekarpeles mekarpeles added this to the 2018 Q2 milestone Mar 21, 2018
@mekarpeles
Copy link
Member Author

We currently use Vagrant to run a script called bootstrap.sh: https://github.com/internetarchive/openlibrary/blob/master/scripts/bootstrap.sh

There's a start to an ansible playbook in the provisioning/ directory:
https://github.com/internetarchive/openlibrary/blob/master/provisioning/playbook.yml

The goal of this issue is to change our existing vagrant setup to use ansible exclusively (instead of scripts/bootstrap.sh), to do all provisioning, and to have a different playbook for development and production (we have a playbook started).

@mekarpeles mekarpeles changed the title Automate provisioning (Ansible, Docker, etc.) Move to Ansible w/ a Production & Developer playbook Mar 27, 2018
@mekarpeles mekarpeles changed the title Move to Ansible w/ a Production & Developer playbook Switch Provisioning to use Ansible w/ a Production & Developer playbook Mar 27, 2018
@sbshah97
Copy link
Contributor

I can take this up!

@rohitjain00
Copy link
Contributor

@salman-bhai any followup on this?

@mekarpeles
Copy link
Member Author

This is a subtask of #2036

@mekarpeles mekarpeles assigned mekarpeles and abezella and unassigned sbshah97 and mekarpeles Apr 10, 2019
@mekarpeles
Copy link
Member Author

@abezellathis old ansible playbook that @anandology had in olsystem back in 2014 (which has since been overwritten of some unknown reason?) seems to have useful ansible logic for setting more appropriate memory limits than the 64mb default. It also replaced 127.0.0.1 with a 0.0.0.0 broadcast which is still probably what we want to do.

Is this logic something we can/should add (back) to your new ansible playbook in olsystem?

We ideally want this number to be variable based on the vm’s capacity https://github.com/internetarchive/olsystem/commit/982aeb76e9aa8d7ad20b57c856aa2c9c9b002829

@mekarpeles
Copy link
Member Author

@hornc and I finally got our 1st VM provisioned as xenial with @abezella's help -- ol-mem4 -- and added to our memcached pool

  1. Andy provisioned the machine w/ a new ansible playbook in olsystem
  2. We manually (for now) updated /etc/memcached.conf to change the local address to 0.0.0.0 instead of 127.0.0.1 so that it broadcasts to all machines in our cluster and also the memory from 64mb to 9500mb. @abezella, this should be incorporated into the ansible playbook, along with step 4 (which is the ferm rules)
  3. @hornc and I made modifications to olsystem in order to include ol-mem4 in the pool -- see: https://github.com/internetarchive/olsystem/pull/62
  4. We added a xenial firewall rule to /etc/ferm/input -- we added a file to this directory called ol with the values proto tcp dport 11211 ACCEPT; and then ran sudo service ferm reload -- documented in https://wiki.archive.org/twiki/bin/view/PetaBox/XenialChangelog?twiki_redirect_cache=c076e607304d8b906c9211bb24eda746

@abezella
Copy link
Collaborator

@mekarpeles - i've redeployed ol-mem4 using the geerlingguy.memcached role from ansible galaxy (https://galaxy.ansible.com/geerlingguy/memcached). this allows easy changes to the memory based on host (although currently set for one-size-fits-all in the memcached group) and also the listening addr change. so that addresses 1) and 2). for 4) i added a ferm template.

/opt/openlibrary has not been copied over but otherwise should be ready. please take a look at the result.

@mekarpeles
Copy link
Member Author

mekarpeles commented Apr 17, 2019

@abezella I think I see this here? https://github.com/internetarchive/olsystem/blob/master/playbooks/site.yml

For the memcached servers, I don't believe /opt/openlibrary is necessary

@abezella
Copy link
Collaborator

yep! also some other supplemental files dropped in:
https://github.com/internetarchive/olsystem/commit/dde66442de0064ca85cf3826daf4689167f34449#diff-7a2684d343bed66d1c59ec37a49e55c6
ol-mem4 should be ready to go, then...

@xayhewalo xayhewalo added Affects: Configuration Related to the configuration of the dev/staging/prod environments, CI, docker, etc. [managed] Priority: 2 Important, as time permits. [managed] labels Nov 5, 2019
@mekarpeles mekarpeles added Theme: Development Issues related to the developer experience and the dev environment. [managed] Affects: Operations Affects the IA DevOps folks labels Jan 23, 2021
@mekarpeles mekarpeles added Lead: @cclauss Issues overseen by Chris (Python3 & Dev-ops lead 2019-2021) [managed] and removed Needs: Lead labels Feb 7, 2021
@mekarpeles mekarpeles modified the milestones: 2018 Q2, Active Sprint Feb 7, 2021
@cdrini cdrini removed this from the Icebox milestone Feb 2, 2022
@mekarpeles
Copy link
Member Author

mekarpeles commented Sep 14, 2023

@cclauss where I would love to get is a provisioning/ directory that (similar to deployment) has all the scripts needed to build Open Library for various servers. I don't care about ansible, however, I happen to think that (as a tool) it's built to give us some recipe that literally goes start to finish on a server and irrespective of what tool we use, we're not there. This issue may be closed when we get there (whether ansible or otherwise).

I should be able to run a script called ./provisioning/setup.sh ol-mem from a new ol-mem and have it call other necessary scripts like:

https://github.com/internetarchive/openlibrary/pull/3938/files#diff-3b30bef8970e22874431ef6aa3d67073bddc40ba78dc7e5a6c86e549a15b5706

We should also update the provisioning docs so people know where to find this and add a README.md to that provisioning directory.

Copy link

Assignees removed automatically after 14 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Affects: Configuration Related to the configuration of the dev/staging/prod environments, CI, docker, etc. [managed] Affects: Operations Affects the IA DevOps folks Lead: @cclauss Issues overseen by Chris (Python3 & Dev-ops lead 2019-2021) [managed] Priority: 2 Important, as time permits. [managed] State: Work In Progress This issue is being actively worked on. [managed] Theme: Development Issues related to the developer experience and the dev environment. [managed] Theme: Provisioning Type: Refactor/Clean-up Issues related to reorganization/clean-up of data or code (e.g. for maintainability). [managed]
Projects
None yet
Development

No branches or pull requests

7 participants