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

Setup ol-web1 yet again #3938

Merged
merged 20 commits into from
Oct 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ services:
- GUNICORN_OPTS= --workers 50 --timeout 300 # 5 minutes before reload
- OL_CONFIG=/olsystem/etc/openlibrary.yml
- PYENV_VERSION=3.8.6
- USE_NGINX=true
volumes:
- ../olsystem:/olsystem
45 changes: 45 additions & 0 deletions scripts/setup_web1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash
# This script is used to provision an ol-webX node _before_ docker gets on it.

cdrini marked this conversation as resolved.
Show resolved Hide resolved
# CAUTION: To git clone olsystem, environment variables must be set...
# Set $GITHUB_USERNAME or $USER will be used.
# Set $GITHUB_TOKEN or this script will halt.
if [[ -z ${GITHUB_TOKEN} ]]; then
echo "FATAL: Can not git clone olsystem" ;
exit 1 ;
fi

# apt list --installed
sudo apt-get update
sudo apt-get install -y docker.io docker-compose
docker --version # 19.03.8
docker-compose version # 1.25.0
sudo systemctl start docker
sudo systemctl enable docker

sudo groupadd --system openlibrary
sudo useradd --no-log-init --system --gid openlibrary --create-home openlibrary

cd /opt
ls -Fla # nothing

sudo git clone https://${GITHUB_USERNAME:-$USER}:${GITHUB_TOKEN}@github.com/internetarchive/olsystem

OL_DOMAIN=${OL_DOMAIN:-internetarchive}
sudo git clone https://github.com/$OL_DOMAIN/openlibrary
ls -Fla # containerd, olsystem, openlibrary owned by openlibrary

cd /opt/openlibrary
OL_BRANCH=${OL_BRANCH:-master}
sudo git checkout $OL_BRANCH
sudo make git
cd /opt/openlibrary/vendor/infogami && sudo git pull origin master

cd /opt/openlibrary
sudo docker-compose down
sleep 2
export DOCKER_CLIENT_TIMEOUT=500
export COMPOSE_HTTP_TIMEOUT=500
# NOTE: `cd /opt/openlibrary` and the remaining lines must be repeated manually
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