Giter Site home page Giter Site logo

base_ci's Introduction

How to deploy the CI

This CI is based on a Jenkins server capable of running a pipeline to fetch code, build it and test it on a real embedded board. It also provides a TFTP and an NFS server for booting the target machine from network.

The Jenkins, TFTP and NFS servers are all simultaneously set up using our docker-compose file.

Note: You may selectively disable one of the containers to run the corresponding server on the host machine. It is important to make sure a server is not running both on the docker container and the host machine at the same time.

Ansible is used to deploy and launch the tests on the target board and retrieve the result in the CI.

The folder cukinia contains template tests for validating the correct operation of the target board. You may find more information about this tool at https://github.com/savoirfairelinux/cukinia.

Environment requirements

Please make sure that docker and docker-compose packages are installed on the host machine.

The instructions to install Ansible on your machine are described at https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html

Create docker-compose environment file

A docker-compose environment file is used to configure all the environment-specific settings. This file can be generated by using the script generate_env.sh. It also generates and gives user permissions to the folders required by the CI, located inside /var/jenkins_home.

./generate_env.sh

Note: If you want to use a TFTP or an NFS server installed on your host machine, you need to specify their shared dir path with the --tftp-dir and --nfs-dir parameters:

./generate_env.sh --tftp-dir <tftp-on-host> --nfs-dir <nfs-on-host>

Deploying the Docker servers

Docker images can be built by using docker-compose. All docker-compose commands must be run at the directory level of the docker-compose.yaml file.

To build the Docker images for the three servers:

docker-compose build

Note: Docker images to be built can also be specified separately:

docker-compose build jenkins <other-docker-imgs>

Once the Docker images have been generated you can deploy and start them:

docker-compose up

Note: You can as well specify which servers to launch:

docker-compose up jenkins <other-docker-imgs>

You can later stop and restart the CI with docker-compose stop <imgs> and docker-compose start <imgs>.

For more informations about the docker-compose command see the official documentation at https://docs.docker.com/compose/.

Jenkins configuration

The Jenkins UI can be accessed from a navigator at localhost:8080. The initial password for the admin user can be found inside /var/jenkins_home/secrets/initialAdminPassword.

We recommend installing the following plugins for a user-friendly visualization of the pipeline and the tests run by cukinia: Pipeline: Stage View Plugin, JUnit and Blue Ocean.

Board configuration

The target board must be configured to:

  • Boot from network: The bootloader must be configured to take the dtb and kernel from the TFTP server. The kernel must be configured to use the rootfs from the NFS.

  • Ansible: An SSH server and Python3 must be installed in order to handle Ansible commands.

Test TFTP server

You can test the transfer of a file with the TFTP server with:

$ echo hello > <tftp-dir>/hello
$ tftp localhost
tftp> get hello
tftp> quit

Where is the shared directory by the server, /var/jenkins_home/tftp by default.

Test NFS server

You can test the NFS server by mounting its shared dir:

sudo mount -v -o vers=4,tcp localhost:/ /dir/to/mount

base_ci's People

Contributors

ebail avatar kevlhop avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.