Skip to content

Conversation

@cclauss
Copy link
Contributor

@cclauss cclauss commented Oct 19, 2020

Closes #3880, #3901
Closes #3783

Allow us to convert ol-web1 with a fresh Ubuntu install into an Open Library web node running Python 3.8 on Docker.

The workflow will be:

  1. Log into ol-web1 that has a fresh Ubuntu install.
  2. Get nginx is running OUTSIDE of Docker
    1. Use github token to git clone github.com/internetarchive/olsystem into /olsystem
    2. Make symbolic links to /etc/nginx/nginx.conf and /etc/nginx/sites-available
    3. Copy ol-web3:/opt/.petabox/seed to ol-web1:/opt/.petabox/seed
    4. sudo systemctl start nginx
  3. systemctl status nginx # to ensure it is up-and-running
  4. Copy scripts/setup_web1.sh into your home directory.
  5. Set environment variables and run setup_web1.sh to and configure docker, openlibrary, olsystem
    • export GITHUB_USERNAME=myusername OL_DOMAIN=myusername OL_BRANCH=Setup-ol-web1-yet-again
    • export GITHUB_TOKEN=mytoken # This required to git clone olsystem
    • ./setup_web1.sh which will run docker-compose.production.yml
    • docker-compose.production.yml will run docker/ol-web-start.sh.
  6. BUG the last lines of scripts/setup_web1.sh need to be run manually...
    • systemctl status nginx && cd /opt/openlibrary
    • sudo docker-compose -f docker-compose.yml -f docker-compose.infogami-local.yml \
      -f docker-compose.production.yml up --no-deps -d web
    • sudo docker-compose logs --tail=100 -f web
    • OPTIONAL: bash in with sudo docker exec -it openlibrary_web_1 /bin/bash

Technical

Testing

This dangerous code should only be run in non-production environments. It restores ol-web1 to a clean state.

#!/bin/bash

cd /opt/openlibrary
sudo docker-compose down
sudo systemctl disable docker
sudo systemctl stop docker
sudo docker system prune -y
sudo apt-get --purge remove -y docker docker.io docker-compose
sudo rm -fr /opt/containerd /opt/openlibrary /opt/olsystem
ls -l /opt  # nothing

Screenshot

Stakeholders

@cclauss cclauss requested review from cdrini and mekarpeles October 19, 2020 18:56
@cclauss cclauss mentioned this pull request Oct 19, 2020
@mekarpeles mekarpeles added the Priority: 1 Do this week, receiving emails, time sensitive, . [managed] label Oct 19, 2020
Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! A few small changes. Also, are the symlinks working now?

@cdrini
Copy link
Collaborator

cdrini commented Oct 19, 2020

(I went through and "DONE"'d and resolved my comments; for future reference it would great if you could do that :) )

Comment on lines 18 to 19
&& ln -sfv /olsystem/etc/nginx/nginx.conf /etc/nginx/nginx.conf
&& ln -sfv /olsystem/etc/nginx/sites-available /etc/nginx/sites-available
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just spinning my wheels on this. I can not rm or chown or sudo the destination files so I can not create the symlinks. What else should I try?

Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We tested and it looks like nginx is no longer needed on webnodes \o/ So let's remove those sections.

@cclauss
Copy link
Contributor Author

cclauss commented Oct 30, 2020

Video https://archive.org/details/setup-of-ol-web-1 demonstrates this code in action.

Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm; removing the last reference to nginx. Note I haven't tested running this.

@cdrini cdrini merged commit de8e5a0 into internetarchive:master Oct 30, 2020
@cclauss cclauss deleted the Setup-ol-web1-yet-again branch October 30, 2020 23:46
@cclauss cclauss mentioned this pull request Nov 10, 2020
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: 1 Do this week, receiving emails, time sensitive, . [managed]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create ol-web1

3 participants