Skip to content

Setup CI

Mu Li edited this page Apr 28, 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. Configure -> Configure Global Security: check "Allow anonymous read access"
  4. Install the following plugins: Blue Ocean, Embeddable Build Status, Environment Injector
  5. Install Miniconda3 for user jenkins, you can switch user by sudo su - jenkins
  6. Add environment in Jenkins -> configure system -> Environment variables, with Name BASH_ENV and value /var/lib/jenkins/miniconda3/etc/profile.d/conda.sh, and Name PAHT with value /var/lib/jenkins/miniconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin
  7. Configure -> Shell executable: /bin/bash
  8. 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. or simply create a job under the blue ocean interface.

Clone this wiki locally