These steps should only need to be taken once when setting up a new development machine:
Install basic build dependencies:
sudo apt-get install git build-essential automake
$PATH
.Check out the Monorail source code repository:
mkdir ~/src/
cd ~/src/
fetch infra
(Googlers may alternatively fetch infra_internal
, but note that gclient sync
will then always sync based on the current infra_internal
branch instead of the current infra
branch.)cd infra/appengine/monorail
Install and configure the gcloud CLI:
fetch infra
above under ~/src/gcloud/bin
. Add it to your PATH
in .bashrc
.sudo apt-get install -y google-cloud-sdk
)Configure gcloud:
gcloud auth login
gcloud config set project monorail-dev
Install and configure Docker:
sudo apt install docker-ce
(Googlers will need to follow instructions at go/docker)sudo systemctl start docker
sudo adduser $USER docker
docker run hello-world
to verify installation.gcloud auth configure-docker
Configure the MySQL database:
sudo apt install libmariadb-dev
docker cp schema/. mysql:/schema
docker exec -it mysql -- mysql --user=root monorail < schema/framework.sql
docker exec -it mysql -- mysql --user=root monorail < schema/project.sql
docker exec -it mysql -- mysql --user=root monorail < schema/tracker.sql
docker exec -it mysql -- mysql --user=root monorail -e "UPDATE User SET is_site_admin = TRUE WHERE email LIKE '%@example.com';"
Install Monorail backend (python) prerequisites:
sudo apt install python2.7 python2.7-dev python-is-python2
(Googlers will need to run sudo apt-mark hold python2 python-is-python2 python2-dev
to prevent these from being uninstalled.)curl -o /tmp/get-pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py
sudo python2.7 /tmp/get-pip.py
pip install virtualenv
python2.7 -m virtualenv venv
Install Monorail frontend (node) prerequisites:
curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source "$HOME/.nvm/nvm.sh"
nvm install 12.13.1
These steps will need to be repeated regularly when developing Monorail:
Enter the virtual environment (in every new terminal you create):
eval $(../../go/env.py)
source ./venv/bin/activate
Install per-language dependencies (every few days to ensure you're up to date):
make dev_deps
make js_deps
npm install
Launch the Monorail server (once per machine/per reboot):
make serve
Login with test user (once per machine or when starting with a fresh database): 1. Sign in using test@example.com
1. Log back out and log in again as example@example.com
1. Log out and finally log in again as test@example.com
.