From 70a56a355f0d56e474629f089d5d55ff451a04c8 Mon Sep 17 00:00:00 2001 From: Florent Pruvost <florent.pruvost@inria.fr> Date: Thu, 28 Nov 2024 15:39:05 +0100 Subject: [PATCH] pages.sh: use pages docker image to run on gitlab instance runners --- .gitlab/Dockerfile-pages | 35 +++++++++++++++++++++++++++++++++++ .gitlab/docker.yml | 18 +++++++++++++++--- .gitlab/pages.yml | 9 +++++---- doc/user/homepage.org | 2 +- doc/user/publish.el | 2 ++ tools/pages.sh | 33 +++++++++++++++++++++------------ 6 files changed, 79 insertions(+), 20 deletions(-) create mode 100644 .gitlab/Dockerfile-pages diff --git a/.gitlab/Dockerfile-pages b/.gitlab/Dockerfile-pages new file mode 100644 index 000000000..df216af38 --- /dev/null +++ b/.gitlab/Dockerfile-pages @@ -0,0 +1,35 @@ +# +# @file Dockerfile-pages +# +# @copyright 2024-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, +# Univ. Bordeaux. All rights reserved. +# +# @version 1.3.0 +# @author Florent Pruvost +# @date 2024-12-02 +# +# This docker image is used to test the package during gitlab-ci pipelines. +# It should be stored in the gitlab's project container registry: +# https://gitlab.inria.fr/solverstack/chameleon/container_registry +# +FROM registry.gitlab.inria.fr/solverstack/chameleon + +USER root + +# Chameleon tools/pages.sh script additional dependencies +RUN apt-get -y upgrade --no-install-recommends \ + emacs \ + emacs-goodies-el \ + elpa-htmlize \ + python3-click \ + python3-elasticsearch \ + python3-pandas \ + r-cran-ggplot2 \ + r-cran-plyr \ + r-cran-reshape2 + +RUN apt-get autoremove -y +RUN apt-get autoclean -y +RUN apt-get purge -y + +USER gitlab diff --git a/.gitlab/docker.yml b/.gitlab/docker.yml index c47d8fc25..f2510aee3 100644 --- a/.gitlab/docker.yml +++ b/.gitlab/docker.yml @@ -1,10 +1,22 @@ --- -docker: +.docker_script_common: stage: docker image: docker when: manual before_script: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY script: - - docker build -f .gitlab/Dockerfile -t $CI_REGISTRY_IMAGE $PWD - - docker push $CI_REGISTRY_IMAGE + - docker build -f $IMAGE_FILE -t $IMAGE_NAME $PWD + - docker push $IMAGE_NAME + +docker-tests: + extends: .docker_script_common + variables: + IMAGE_FILE: .gitlab/Dockerfile + IMAGE_NAME: $CI_REGISTRY_IMAGE + +docker-pages: + extends: .docker_script_common + variables: + IMAGE_FILE: .gitlab/Dockerfile-pages + IMAGE_NAME: $CI_REGISTRY_IMAGE/pages diff --git a/.gitlab/pages.yml b/.gitlab/pages.yml index 5299509e3..3e533f379 100644 --- a/.gitlab/pages.yml +++ b/.gitlab/pages.yml @@ -1,14 +1,15 @@ --- pages: stage: deploy + image: $CI_REGISTRY_IMAGE/pages extends: .only-master needs: [coverage_master] + variables: + VERSION: pages + script: + - ./tools/pages.sh artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" expire_in: 1 week paths: - public - variables: - VERSION: pages - script: - - ./tools/pages.sh diff --git a/doc/user/homepage.org b/doc/user/homepage.org index 19c8ce6fd..2bf41a44e 100644 --- a/doc/user/homepage.org +++ b/doc/user/homepage.org @@ -6,7 +6,7 @@ #+OPTIONS: H:3 num:t \n:nil @:t ::t |:t _:nil ^:nil -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:t skip:nil d:nil pri:nil tags:not-in-toc html-style:nil # #+HTML_LINK_HOME: https://solverstack.gitlabpages.inria.fr/chameleon/ -#+SETUPFILE: https://mfelsoci.gitlabpages.inria.fr/inria-org-html-themes/online-theme-readtheorginria.setup +#+SETUPFILE: https://solverstack.gitlabpages.inria.fr/inria-org-html-themes/online-theme-readtheorginria.setup * Overview :PROPERTIES: diff --git a/doc/user/publish.el b/doc/user/publish.el index 7a2325217..2ecd431c0 100644 --- a/doc/user/publish.el +++ b/doc/user/publish.el @@ -9,6 +9,8 @@ (require 'org) (require 'htmlize) +(setq org-safe-remote-resources '("https://solverstack.gitlabpages.inria.fr/inria-org-html-themes/online-theme-readtheorginria.setup")) + (setq org-html-htmlize-output-type 'css) (setq org-src-fontify-natively t) (org-babel-do-load-languages diff --git a/tools/pages.sh b/tools/pages.sh index df0023083..7d03463d3 100755 --- a/tools/pages.sh +++ b/tools/pages.sh @@ -5,13 +5,21 @@ # @copyright 2020-2024 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, # Univ. Bordeaux. All rights reserved. # -# @version 1.2.0 +# @version 1.3.0 # @author Florent Pruvost # @date 2022-02-22 # +set -e +set -x CHAMELEON_SRC_DIR=${CHAMELEON_SRC_DIR:-$PWD} -mkdir tmp_fig +# where is installed starpu in the docker image +CURRENTUSER=`whoami` +if [[ -f /.dockerenv && $CURRENTUSER == "gitlab" ]]; then + export PKG_CONFIG_PATH=/home/gitlab/install/starpu/lib/pkgconfig:$PKG_CONFIG_PATH +fi + +mkdir -p tmp_fig cd tmp_fig ## need to generate figures from last benchmarks @@ -49,22 +57,23 @@ cd .. ## Build the doc VERSION=${VERSION:-pages} -mkdir -p build-$VERSION -cd build-$VERSION - -cmake $CHAMELEON_SRC_DIR -DCHAMELEON_ENABLE_DOC=ON -make doc -j5 +cmake -S ${CHAMELEON_SRC_DIR} -B build-$VERSION -DCHAMELEON_ENABLE_DOC=ON +cmake --build build-$VERSION --target doc --verbose -j5 ## Copy files in public/ used as an artefact (zip archive) to upload on gitlab pages, see -## Homepage: https://solverstack.gitlabpages.inria.fr/chameleon/index.html -## API: https://solverstack.gitlabpages.inria.fr/chameleon/dev/index.html -cd .. -mkdir public/ -mkdir public/dev/ +mkdir -p public/dev/ + +## Homepage (user's guide): https://solverstack.gitlabpages.inria.fr/chameleon/index.html cp build-$VERSION/doc/user/*.html public/ cp build-$VERSION/doc/user/*.png public/ cp build-$VERSION/doc/user/*.jpg public/ cp build-$VERSION/doc/user/*.svg public/ + +## API (doxygen): https://solverstack.gitlabpages.inria.fr/chameleon/dev/index.html cp -r build-$VERSION/doc/dev/html/* public/dev/ + +## Images such as last performances on plafrim cp tmp_fig/* public/ + +## lcov code coverage: https://solverstack.gitlabpages.inria.fr/chameleon/coverage/ cp -r coverage public/ -- GitLab