public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Oleg Vasilev <oleg.vasilev@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH v2 3/3] gitlab-ci: introduce final containers
Date: Tue, 20 Aug 2019 16:19:36 +0300	[thread overview]
Message-ID: <20190820131936.25640-4-oleg.vasilev@intel.com> (raw)
In-Reply-To: <20190820131936.25640-1-oleg.vasilev@intel.com>

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: Oleg Vasilev <oleg.vasilev@intel.com>
---
 .gitlab-ci.yml         | 25 ++++++++++++++++++++++++-
 Dockerfile.final       | 16 ++++++++++++++++
 scripts/docker-help.sh | 34 ++++++++++++++++++++++++++++++++++
 3 files changed, 74 insertions(+), 1 deletion(-)
 create mode 100644 Dockerfile.final
 create mode 100755 scripts/docker-help.sh

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c9f8ca35..109ad7d0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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
+    FORCE_REBUILD: 1
+  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
diff --git a/Dockerfile.final b/Dockerfile.final
new file mode 100644
index 00000000..214a5c20
--- /dev/null
+++ b/Dockerfile.final
@@ -0,0 +1,16 @@
+# 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
diff --git a/scripts/docker-help.sh b/scripts/docker-help.sh
new file mode 100755
index 00000000..671da137
--- /dev/null
+++ b/scripts/docker-help.sh
@@ -0,0 +1,34 @@
+#!/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
-- 
2.22.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-08-20 13:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 13:19 [igt-dev] Add containers with IGT inside Oleg Vasilev
2019-08-20 13:19 ` [igt-dev] [PATCH v2 1/3] gitlab-ci: move containers section to the up Oleg Vasilev
2019-08-22  8:45   ` Arkadiusz Hiler
2019-08-20 13:19 ` [igt-dev] [PATCH v2 2/3] gitlab-ci: rebuild images only on Dockerfile changes Oleg Vasilev
2019-08-22  8:26   ` Arkadiusz Hiler
2019-08-20 13:19 ` Oleg Vasilev [this message]
2019-08-22  8:45   ` [igt-dev] [PATCH v2 3/3] gitlab-ci: introduce final containers Arkadiusz Hiler
2019-08-23 12:41     ` Vasilev, Oleg
2019-08-23 12:50       ` Arkadiusz Hiler
2019-08-23 12:56       ` Arkadiusz Hiler
2019-08-20 16:08 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [v2,1/3] gitlab-ci: move containers section to the up Patchwork
2019-08-20 23:48 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190820131936.25640-4-oleg.vasilev@intel.com \
    --to=oleg.vasilev@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox