Skip to content
Snippets Groups Projects
Commit e28f0e57 authored by Oleg Vasilev's avatar Oleg Vasilev
Browse files

gitlab-ci: introduce final containers


Currently, the containers are used only to build IGT. We also want to
have an option to run IGT inside a container. For this, new build stage
is added.

Signed-off-by: default avatarOleg Vasilev <oleg.vasilev@intel.com>
parent 4ec2757a
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
......@@ -16,6 +16,7 @@ stages:
- build
- test
- deploy
- final-containers
################# CONTAINERS #######################
......@@ -85,12 +86,15 @@ containers:igt-fedora:
build:tests-fedora:
stage: build
script:
- meson $MESON_OPTIONS build
- meson --prefix=`pwd`/opt-igt $MESON_OPTIONS build
- ninja -C build
- ninja -C build install
- ninja -C build igt-gpu-tools-doc
- ls opt-igt
artifacts:
paths:
- build
- opt-igt
build:tests-fedora-no-libunwind:
stage: build
......@@ -273,3 +277,22 @@ pages:
only:
- master
############## FINAL CONTAINERS ####################
final-containers:igt-final:
stage: final-containers
image: docker:stable
services:
- docker:dind
dependencies:
- build:tests-fedora
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $CI_REGISTRY/$CI_PROJECT_PATH/igt-fedora
- docker tag $CI_REGISTRY/$CI_PROJECT_PATH/igt-fedora igt-fedora
- scripts/pull-or-rebuild.sh Dockerfile.final igt-final
# Version number to bump for force image rebuild: 0
FROM igt-fedora
RUN dnf install -y findutils && \
dnf clean all
COPY opt-igt /opt/igt
COPY scripts/docker-help.sh /usr/local/bin/docker-help.sh
ENV PATH="/opt/igt/bin:${PATH}"
ENV LD_LIBRARY_PATH="/opt/igt/lib:/opt/igt/lib64:${LD_LIBRARY_PATH}"
ENV IGT_TEST_ROOT="/opt/igt/libexec/igt-gpu-tools"
COPY scripts/docker-help.sh /usr/local/bin/docker-help.sh
CMD docker-help.sh
#!/bin/sh
#
# Copyright © 2019 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
TEST_LIST=$(find /opt/igt/libexec -type f -printf "%f ")
cat << END
This is a docker container, packaged with intel-gpu-tools.
- IGT runner is available in PATH. In order for results to be available on a
host system, the directory has to be mounted inside, e.g.
docker run -v results:/tmp/results igt-final igt_runner /tmp/results
- Test lists are available in /opt/igt/share/igt-gpu-tools
- Test binaries are available in IGT_TEST_ROOT=/opt/igt/libexec.
Contents of /opt/igt/libexec: $TEST_LIST
END
......@@ -25,7 +25,7 @@ DOCKERFILE=$1
NAME=$2
TAG=${3:-${CI_COMMIT_REF_NAME:-latest}}
if [ $TAG == "master" ]; then
if [ $TAG = "master" ]; then
TAG=latest
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment