Skip to content

Commit

Permalink
#2: investigate general approach to define CI target platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
tlamonthezie committed Sep 18, 2024
1 parent 650146c commit 04a17c4
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
41 changes: 41 additions & 0 deletions ci/docker/generic-approach/configurations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# NOTE: This is an investigation about a more complex but more scalable way to difine th platforms to target in CI.
# This file might be used as an input to scripts to
# - generate dockerfile environment files (for nodes with type='docker-image') and being able to build and push images
# - generate Github workflows yaml files stub (for nodes with type='github-runner')*
# - generate Azure pipelines yaml files stub (for nodes with type='azure-runner')*
# *In VT we have some specific stuff. We might want to add some compose logic with some generated pipeline stub and complementary
# project-specific pipeline

# THIS IS A LOT OF WORK BUT MIGHT BE VERY USEFUL

globals:
AZURE_PIPELINES_DIR: ci/azure
GITHUB_PIPELINES_DIR: .github/workflows

parameters:
python-common-packages: [nanobind, yaml]
conda-python[3.8-3.12]:
py3.8: [ python: 3.8, packages: "@python-common-packages"]
py3.9: [ python: 3.9, packages: "@python-common-packages" ]
py3.10: [ python: 3.10, packages: "@python-common-packages" ]
py3.11: [ python: 3.11, packages: "@python-common-packages" ]
py3.12: [ python: 3.12, packages: "@python-common-packages" ]

configurations:
ubuntu-22.04-gcc-11-vtk-9.2.2-py-3x-mpi:
type: docker-image
arch: amd64
base: ubuntu:22.04
compiler: { type: gnu, cc: gcc-11, cxx: gcc-11++ }
conda: "@conda-python[3.8-3.12]"
vtk: { version: '9.2.2' }
mpi: { dir: v5.0, version: '5.0.4' }

macos-12-clang-14-vtk-9.3.1:
type: github-runner
runs-on: macos-12,
compiler: { type: gnu, cc: clang-14, cxx: clang-14++ }
gcov: llvm-gcov,
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
vtk: '9.3.1'
mpi: ~
12 changes: 12 additions & 0 deletions ci/docker/generic-approach/ubuntu/amd64-ubuntu-gcc11.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Note: could be generated and used by docker compose
# This file could be generated by a script reading configurations.yaml
DOCKERFILE=ubuntu-cpp-base.dockerfile
REPO=lifflander1/vt
ARCH=amd64
UBUNTU=22.04
ULIMIT_CORE=0
COMPILER=gcc-12
HOST_COMPILER=gcc-12
COMPILER_TYPE=gnu
PROXY=
TOKEN=
72 changes: 72 additions & 0 deletions ci/docker/generic-approach/ubuntu/ubuntu-cpp-base.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Docker instructions to build an image with some arguments to specify compilers, python and VTK versions.
# @see .github/workflows/pushbasedockerimage.yml

ARG BASE_IMAGE=ubuntu:22.04

# Base image & requirements
FROM ${BASE_IMAGE} AS base

# Arguments
ARG VTK_VERSION=9.2.2
ARG PYTHON_VERSIONS=3.8,3.9,3.10,3.11,3.12
ARG CC=gcc-11
ARG CXX=g++-11
ARG GCOV=gcov-11

ENV DEBIAN_FRONTEND=noninteractive

# Setup common tools and compiler
RUN apt-get update -y -q && \
apt-get install -y -q --no-install-recommends \
${CC} \
${CXX} \
git \
xz-utils \
bzip2 \
zip \
gpg \
wget \
gpgconf \
software-properties-common \
libsigsegv2 \
libsigsegv-dev \
pkg-config \
zlib1g \
zlib1g-dev \
m4 \
gfortran-11 \
make \
cmake-data \
cmake \
pkg-config \
libncurses5-dev \
m4 \
perl \
curl \
xvfb \
lcov

# Setup MESA (opengl)
RUN bash /opt/scripts/setup_mesa.sh
RUN xvfb-run bash -c "glxinfo | grep 'OpenGL version'"

# Environment variables (conda path, python environments, compiler path, vtk)
ENV CC=/usr/bin/$CC
ENV CXX=/usr/bin/$CXX
ENV GCOV=/usr/bin/$GCOV
ENV CONDA_PATH=/opt/conda
ENV VTK_DIR=/opt/build/vtk

# Setup conda with python environments
RUN bash /opt/scripts/setup_conda.sh ${PYTHON_VERSIONS}

# Setup VTK
RUN VTK_VERSION=${VTK_VERSION} \
VTK_DIR=${VTK_DIR} \
VTK_SRC_DIR=/opt/src/vtk \
bash /opt/scripts/setup_vtk.sh

# Clean apt
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

RUN echo "Base creation success"

0 comments on commit 04a17c4

Please sign in to comment.