Skip to content

Instantly share code, notes, and snippets.

@dk0r
Created August 25, 2020 13:02
Show Gist options
  • Save dk0r/e803ba28d0c80dfb651f7c5af6fc1446 to your computer and use it in GitHub Desktop.
Save dk0r/e803ba28d0c80dfb651f7c5af6fc1446 to your computer and use it in GitHub Desktop.
## Make Oncall v.1.2.3 on Ubuntu 18.04LTS
0. [Docker Image Preparation](#docker-image-preparation)
1. [Source Modifications](#source-modifications)
2. [Database Preparation](#hdatabase-preparation)
3. [Install Oncall](#install-oncall)
4. [Manually Start Oncall](#manually-start-oncall)
---
### Docker Image Preparation
Start an ubuntu v18.04 docker container
> docker run -itd -p 8080:8080 ubuntu:bionic
TTY into Container
> docker exec -it \<containerID\> /bin/bash
Prepare system for `Oncall`
> apt update && apt -y upgrade && \
> apt install -y git
Clone `Oncall v1.2.3`
> cd /home && \
> git clone --branch v1.2.3 https://github.com/linkedin/oncall.git && \
> cd /home/oncall && git checkout -b v1.2.3-modification
Install oncall dependencies
> apt install -y libssl-dev libxml2-dev libxslt1-dev libsasl2-dev \
> python3-dev libldap2-dev python3-pip python3-setuptools mysql-client mysql-server
Upgrade pip
> python3 -m pip install --upgrade pip
Install pip pkg dependencies to avoid errors whe upgrading packages in next step
> apt install -y libcairo2-dev libgirepository1.0-dev
Upgrade all outdated pip packages
> python3 -m pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 python3 -m pip install -U
<br><br>⚠️ Received and Ignored the following errors:<br>
`ERROR: Cannot uninstall 'pygobject'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall`<br><br>
`ERROR: Cannot uninstall 'pyxdg'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall`
Install pip pkgs utilized by .github/workflows/create-release-and-publish.yml (may be unnecessary for making from source)
> python3 -m pip install setuptools wheel twine
Install following to resolve PyYaml errors incurred when making onCall
> apt install -y libyaml-dev libpython2.7-dev
---
### Source Modifications
Commit history is **presently** available only in the `early-notification/Docker/images/oncall:dev.tar.gz` docker image. Until the original modifications are pushed to `aoc-pathfinder`, commit history may be viewed vis the following:
1. `load` the aforementioned image
2. `run` it as a container
3. `exec` into that container
4. `git log --reflog`
Pull down image, load, exec and see following commits in branch `v1.2.3-modification`
**Commit History** (`v1.2.3-modification`):
* *d344b2c*: Modified interpreters from python to python3
* *6277930*: Converted all 'python' and 'pip install' calls to their python3 equivalents
---
### Database Preparation
Set `mysql_native_password` as auth plugin so passwords may be utilized<br>
Note: By default, `mysql` on `ubuntu:bionic` utilizes the '**auth**_**socket**' auth plugin causing `mysql+pymysql` to fail to auth w/ a password; additional details [here](https://dev.mysql.com/doc/refman/5.7/en/socket-pluggable-authentication.html). Note: You may verify the current plugin by doing `mysql> SELECT plugin from mysql.user where User="root";`
> service mysql start && \
> mysql mysql -e "UPDATE user SET plugin='mysql_native_password' WHERE User='root';FLUSH PRIVILEGES;" && \
> service mysql restart
Set mysql root password
> mysql_secure_installation && service mysql restart
> Responses: [No, 1234, 1234, Yes. Yes, Yes, Yes]
Disable ONLY_FULL_GROUP_BY mysql mode as described [here](https://github.com/linkedin/iris#setup-database)
Note: these commands need to be run @ each mysql restart
> mysql -u root -p1234 -e "
> SET SESSION sql_mode = sys.list_drop(@@SESSION.sql_mode, 'ONLY_FULL_GROUP_BY');
> SET GLOBAL sql_mode = sys.list_drop(@@GLOBAL.sql_mode, 'ONLY_FULL_GROUP_BY');
> CREATE DATABASE oncall;
> "
Load Schema
> mysql -u root -p1234 < /home/oncall/db/schema.v0.sql
Load Mock Data
> mysql -u root -p1234 -o oncall < /home/oncall/db/dummy_data.sql
---
### Install Oncall
> python3 setup.py develop && \
> python3 -m pip install -e '.[dev]'
⚠️ **14**-**Aug**: When testing this ReadMe using only python2, we had to run the following commands in the following order and separately (i.e. don't use &&):<br>
> python -m pip install -e '.[dev]'<br>
> python3 setup.py develop &&
<br><br>
---
### Make Oncall
> oncall-dev ./configs/config.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment