Skip to content

Setup CI

Mu Li edited this page Apr 13, 2019 · 13 revisions

A quick note to install CI.

Package to build a CI server from scratch

  1. Ubuntu 16.04, sudo apt-get update && sudo apt-get install build-enssential
  2. CUDA 10.0 (if upgrade the cuda version, need to update build/env.yml in every d2l-* project
  3. add export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64 into /etc/profile.d/cuda.sh to enable cuda for all accounts
  4. Miniconda 3
  5. Latex for PDF sudo apt-get install texlive-full librsvg2-bin
  6. Fonts for PDF
    wget https://raw.githubusercontent.com/d2l-ai/utils/master/install_fonts.sh
    sudo bash install_fonts.sh
    

Install Jenkins

  1. Install JRE sudo apt-get install default-jre, check jenkins's requirement (https://jenkins.io/doc/administration/requirements/java/)

  2. Install and Start Jenkins by following https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-16-04

  3. Use forward 80 port to 8080 (jenkins in default use 8080)

    sudo iptables -A PREROUTING -t nat -i ens3 -p tcp --dport 80 -j REDIRECT --to-port 8080
    sudo sh -c "iptables-save > /etc/iptables.rules"
    sudo apt-get install iptables-persistent
    

Configure Jenkins

  1. Install suggested plugins, create an admin account
  2. You may need to restart jenkins to make it work (sudo systemctl status jenkins)
  3. Install the following plugins: Blue Ocean, Environment Injector
  4. Install Miniconda3 for user jenkins, you can switch user by sudo su - jenkins
  5. Add environment in Jenkins -> configure system -> Environment variables, with Name BASH_ENV and /var/lib/jenkins/miniconda3/etc/profile.d/conda.sh
  6. pip install awscli to setup credential by aws configure for user jenkins

Create a project

  1. use multi-branch pipeline, add your github username/password in the credential

Clone this wiki locally