Commit 9458b5c2 authored by SIMONIN Matthieu's avatar SIMONIN Matthieu
Browse files

Docker image

parent 5ccca53f
---
variables:
GIT_SUBMODULE_STRATEGY: recursive
# https://docs.gitlab.com/ee/ci/runners/README.html#git-submodule-strategy
# normal -> only top level are fetched before the job starts
GIT_SUBMODULE_STRATEGY: normal
LD_PRELOAD: ""
RUST_VERSION: 1.46.0
......@@ -12,113 +14,62 @@ workflow:
when: never
- when: always
# unstable, yeah !
image: simgrid/unstable:latest
stages:
- build1
- build2
- test
###############################################################################
#
# Build Qemu patched for Tansiv
# -- test locally:
# $) gitlab-runner exec docker qemu
#
###############################################################################
qemu:
stage: build1
script:
#
# Some missing build tools
#
- apt-get update
- apt-get install -y build-essential git pkg-config libglib2.0-dev libpixman-1-dev
#
- git clone --depth 1 https://gitlab.inria.fr/msimonin/qemu.git -b tantap src/qemu
- cd src/qemu
- ./configure && make config-host.h
artifacts:
paths:
- src/qemu
###############################################################################
#
# Build tansiv and some cppunit stuffs
# -- test locally:
# $) gitlab-runner exec docker tansiv
#
###############################################################################
tansiv:
stage: build2
script:
#
# Some missing build tools
#
- apt-get update
- apt-get install -y curl git build-essential pkg-config libboost-dev cmake libcppunit-dev libglib2.0-dev clang libclang-dev
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init
- sh rustup-init -y --profile minimal --default-toolchain $RUST_VERSION
- export PATH=$HOME/.cargo/bin:$PATH
#
# Build tests
# TODO(msimonin): make all (but we'll need to adapt all vsg clients ...)
#
- mkdir -p build
- cd build
- cmake .. && make
# unittests
# NOTE(msimonin): as long as https://gitlab.inria.fr/quinson/2018-vsg/-/issues/5 is around
# we run our tests isolated in different process.
# This is far from ideal since reports will be spread in the output of each process
# But at least catch2 lets use specify this easily...
# But ...
# for some reason this fails: ./tests --list-test-names-only | xargs -d "\n" -n 1 ./tests
# grrr!
- ./tests "VSG receive one message"
- ./tests "VSG deliver one message"
- ./tests "VSG send piggyback port"
- ./tests "piggyback port"
artifacts:
paths:
- build
# expected /opt structure:
# /opt
# examples/ -> compiled examples
# platform/ -> some simgrid plaform files
# tansiv/ -> result of tansiv make install (include + lib + bin)
# qemu/ -> result of qemu make install (include + lib + bin)
- build
- publish
# unstable, yeah !
image: simgrid/unstable:latest
###############################################################################
#
# Build fake-vm
# -- test locally:
# $) gitlab-runner exec docker fake-vm --docker-volumes $(pwd)/opt:/opt
#
###############################################################################
fake-vm:
stage: build2
image: rust:${RUST_VERSION}-slim-buster
build:
stage: build
script:
#
# Some missing build tools
#
- export PROJECT_DIR=$(pwd)
- apt-get update
- apt-get install -y build-essential pkg-config libglib2.0-dev clang
- cd src/fake-vm
- apt-get install -y curl git build-essential pkg-config libboost-dev cmake libcppunit-dev libglib2.0-dev clang libclang-dev libpixman-1-dev flex bison
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init
- sh rustup-init -y --profile minimal --default-toolchain $RUST_VERSION
- export PATH=$HOME/.cargo/bin:$PATH
- mkdir -p build
# build test
- cd build
- cmake .. && make config-host.h
# fake-vm tests
- cd ${PROJECT_DIR}/src/fake-vm
- make build
- make test
- cd ${PROJECT_DIR}/build
- make
# NOTE(msimonin): as long as https://gitlab.inria.fr/quinson/2018-vsg/-/issues/5 is around
# we run our tests isolated in different process.
# This is far from ideal since reports will be spread in the output of each process
# But at least catch2 lets use specify this easily...
# But ...
# for some reason this fails: ./tests --list-test-names-only | xargs -d "\n" -n 1 ./tests
# grrr!
- ./tests "VSG receive one message"
- ./tests "VSG deliver one message"
- ./tests "VSG send piggyback port"
- ./tests "piggyback port"
###############################################################################
#
# Dummy ping/pong example
# inputs:
# opt/ -> artifact of the build phase
#
###############################################################################
send:
stage: test
docker:
image: docker:latest
stage: publish
tags:
- large
script:
- cd build
- ./tansiv examples/send/nova_cluster.xml examples/send/deployment.xml
# login iff we're on gitlab ci
- |
if [[ -n "${CI_JOB_TOKEN}" ]]
then
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
export DOCKER_IMAGE=${CI_REGISTRY_IMAGE}/tansiv:${CI_COMMIT_SHORT_SHA}
docker build -t ${DOCKER_IMAGE} .
docker push ${DOCKER_IMAGE}
else
export DOCKER_IMAGE=tansiv:latest
docker build -t ${DOCKER_IMAGE} .
fi
\ No newline at end of file
......@@ -4,4 +4,4 @@
branch = dev/waitfree
[submodule "src/qemu"]
path = src/qemu
url = git@gitlab.inria.fr:msimonin/qemu.git
url = https://gitlab.inria.fr/msimonin/qemu
# tansiv in docker :)
FROM simgrid/unstable:latest
WORKDIR /app
COPY . /app
RUN apt-get update
RUN apt-get install -y build-essential \
libboost-dev \
cmake \
libcppunit-dev \
libglib2.0-dev \
clang \
libclang-dev \
curl \
git \
pkg-config \
libglib2.0-dev \
libpixman-1-dev \
flex \
bison \
genisoimage
# a cup of rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init
RUN sh rustup-init -y --profile minimal --default-toolchain 1.46.0
ENV PATH=/root/.cargo/bin:$PATH
RUN cargo --help
WORKDIR /app/build
RUN cmake .. && make && make DESTDIR=/opt/tansiv install
# run some tests about the rust part
# WORKDIR /app/src/fake-vm
# RUN make && make test
# run some tests about the c/c++ part
WORKDIR /app/build
RUN ./tests --list-test-names-only | xargs -d "\n" -n1 ./tests
# build qemu with the new network backend (tantap)
WORKDIR /app/src/qemu
RUN make -j && make install
# make some room
RUN rm -rf /app
ENV PATH=/opt/tansiv/usr/local/bin:$PATH
WORKDIR /opt
ENTRYPOINT ["tansiv"]
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment