Skip to content

gitlab ci

Tyler McDaniel edited this page Oct 20, 2020 · 7 revisions

CI has been replaced with AWS CodeBuild - leaving this here for future reference.

!!! this page is just working scratch notes - not really useful to anyone !!!

CI is being handled manually by MR approvers/mergers. Gitlab will gain the capability to CI un-merged code from forks in Q1/Q2 of next year.

set up the LXC container to hold the runner

  1. update the packages: apt update
  2. install with apt install lxd lxd-client
  3. configure with sudo lxd init
  4. join the group: newgrp lxd
  5. create container with lxc launch ubuntu:18.04 asgard-ci
  6. confirm it is there lxc list

Reference: LXD getting started - CLI

install the gitlab runner

  1. enter the container: lxc exec asgard-ci -- sudo --login --user ubuntu
  2. update the container: apt update
  3. install the runner: apt install gitlab-runner
  4. install other needed components: apt install cmake clang-format gcc g++ gfortran clang-7

Reference: Install GitLab Runner

register the gitlab runner

  1. within the container: sudo gitlab-runner register
  2. follow the prompts
    • use "https://code.ornl.gov/" for the url
    • get the token from the gitlab web UI
    • make it specific to the project
    • shell executor type

Reference: Registering Runners

use the runner

References

working notes

can try a simpler LXC approach: http://slightlybetter.eu/category/devops/lxc/

install cuda inside lxc on fusiont5 (roughly following https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#ubuntu-installation)

from nvidia repo

  • wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_10.0.130-1_amd64.deb
  • dpkg -i cuda-repo-ubuntu1604_10.0.130-1_amd64.deb
  • apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
  • apt update
  • apt install cuda-demo-suite-10-0 --no-install-recommends
  • if dpkg errors about overwriting libs, answer with apt-get -o Dpkg::Options::="--force-overwrite" install --fix-broken

from ubuntu's graphics ppa

  • add-apt-repository ppa:graphics-drivers/ppa
  • apt update
  • apt install nvidia-headless-410

install cuda from runfile

  • wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_410.48_linux
  • ./cuda_10.0.130_410.48_linux
  • yes to everything except driver install
  • test with /usr/local/cuda/extras/demo_suite/bandwidthTest (will fail if no passthrough setup yet)

enable gpu passthrough for lxd (roughly following https://stgraber.org/2017/03/21/cuda-in-lxd/)

  • lxc config device add container-name gpu gpu for all gpus
  • lxc config device add container-name gpu gpu id=0 to pick the first gpu

jenkins

moving to github necessitated using jenkins, at least temporarily.

  1. create 'jenkins' lxc container on fusiont5 and expose a port for the web interface
  2. install openjdk-8-jdk
  3. follow the instructions at https://wiki.jenkins.io/display/JENKINS/Installing+Jenkins+on+Ubuntu