Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2: implement common docker containers #3

Merged
merged 162 commits into from
Dec 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
eeb3c22
#2: add deps scripts
tlamonthezie Sep 18, 2024
501afb7
#2: add generic dockerfiles
tlamonthezie Sep 18, 2024
650146c
#2: add dockerfiles adapted from vt
tlamonthezie Sep 18, 2024
04a17c4
#2: investigate general approach to define CI target platforms
tlamonthezie Sep 18, 2024
784e627
#2: work on analysis of a more generic way to support both github and…
tlamonthezie Sep 19, 2024
339b8f5
#2: generate docker files from configuration file with standardized p…
tlamonthezie Sep 19, 2024
94b0193
#2: make some ci depndencies setup working for docker
tlamonthezie Sep 19, 2024
d272f39
#2: improve dependencies integration support WIP
tlamonthezie Sep 20, 2024
ed853c9
#2: update ci config tree and docker build logic
tlamonthezie Sep 20, 2024
c9221cb
#2: introduce pipeline matrix generator and shared pipeline matrices …
tlamonthezie Sep 20, 2024
39f1c69
#2: update template Github workflow to run all test pipelines with ba…
tlamonthezie Sep 20, 2024
53a6b56
#2: update pipeline matrix json files and template ghworkflow
tlamonthezie Sep 20, 2024
baf2811
#2: name the build and test workflow template
tlamonthezie Sep 20, 2024
8c5a789
#2: add packages config to deps in config file and generate setup scr…
tlamonthezie Sep 23, 2024
acd5bfc
#2: update ci matrix
tlamonthezie Sep 23, 2024
415ad19
#2: update template workflow to retrieve scripts
tlamonthezie Sep 23, 2024
d9942c6
#2: update global ci config file
tlamonthezie Sep 24, 2024
315557f
#2: fix ci shell statement compatibility for zsh
tlamonthezie Sep 24, 2024
529e84b
#2: rename a configuration key
tlamonthezie Sep 24, 2024
f3db604
#2: fix ci shell error
tlamonthezie Sep 24, 2024
8c6ba1e
#2: refactor setup logic
tlamonthezie Sep 24, 2024
bbc25ee
#2: fix permission in ci
tlamonthezie Sep 24, 2024
03ca1e5
#2: try fix ci permissions
tlamonthezie Sep 24, 2024
c3c8fd3
#2: fix zsh error
tlamonthezie Sep 24, 2024
373ae72
#2: add conda environments to macos ci environment
tlamonthezie Sep 24, 2024
7f6ec40
#2: limit dependencies downloads to only required ones
tlamonthezie Sep 24, 2024
588e0bb
#2: move vt files to some unused folder
tlamonthezie Sep 24, 2024
3cf132f
#2: fix docker environment variables and refactor build script
tlamonthezie Sep 25, 2024
627ed2d
#2: add python3 to default apt packages for docker
tlamonthezie Sep 25, 2024
849601d
#2: update dependencies scripts
tlamonthezie Sep 25, 2024
cdddec5
#2: start integrating configuration for vt docker images
tlamonthezie Sep 25, 2024
25bde09
#2: configuration format changes and refactoring
tlamonthezie Sep 25, 2024
43fe3b1
#2: add sample docker run in ci
tlamonthezie Sep 25, 2024
6332e7c
#2: validate build of all docker images in CI
tlamonthezie Sep 25, 2024
7086ddf
#2: refactor rename files
tlamonthezie Sep 25, 2024
a4f44a8
#2: add TODO file for current work
tlamonthezie Sep 25, 2024
48dbcf0
#2: update ci build and test template
tlamonthezie Sep 26, 2024
18a6775
#2: fix extra space in dependency install instruction and simplify co…
tlamonthezie Sep 26, 2024
54c3164
#2: add macos demo and remove old dev config
tlamonthezie Sep 26, 2024
6381689
#2: add support of specifying compiler packages or turn off
tlamonthezie Sep 26, 2024
5d0c246
#2: enable dual run in runner and in docker
tlamonthezie Sep 26, 2024
7438ddf
#2: add post setup script for docker build
tlamonthezie Sep 26, 2024
f930262
#2: add pre-setup script for docker image build
tlamonthezie Sep 26, 2024
e167a8e
#2: fix alpine docker image build problems
tlamonthezie Sep 26, 2024
56765f3
#2: integrate pre setup and post setup into the setup script and add …
tlamonthezie Sep 26, 2024
120bd20
#2: update python
tlamonthezie Sep 27, 2024
e29c6ce
#2: rename ci python scripts
tlamonthezie Sep 27, 2024
bacbd6f
#2: fix macos setup
tlamonthezie Sep 27, 2024
184a527
#2: remove docker debug output
tlamonthezie Sep 27, 2024
9284151
#2: introduce !extend yaml tag to extend lists in config
tlamonthezie Sep 30, 2024
258ff33
#2: add documentation
tlamonthezie Sep 30, 2024
7f9646c
#2: start integration of 2 cuda docker images
tlamonthezie Sep 30, 2024
0b373f2
#2: fix setup script
tlamonthezie Sep 30, 2024
db62189
#2: add support of env in deps scripts call
tlamonthezie Sep 30, 2024
24d13e3
#2: update setup script output
tlamonthezie Sep 30, 2024
b513fd4
#2: add vt build and test CI example
tlamonthezie Sep 30, 2024
dfb248f
#2: fix errors in config and regenerate github matrix
tlamonthezie Sep 30, 2024
c83950f
#2: try fix CI command
tlamonthezie Oct 14, 2024
5e63eeb
#2: forward docker run status code to ci
tlamonthezie Oct 14, 2024
a27409e
#2: update matrix and ci pipeline example
tlamonthezie Oct 14, 2024
b64b468
#2: update ci config
tlamonthezie Oct 14, 2024
e5d16a4
#2: update macos 14 mpich version
tlamonthezie Oct 14, 2024
6763c5b
#2: build timestamp for caching host independent
tlamonthezie Oct 14, 2024
4e9f30d
#2: add config for intel oneapi cpp
tlamonthezie Oct 15, 2024
7ddbdd5
#2: add VT test in build docker to validate docker image
tlamonthezie Oct 15, 2024
ccafaca
#2: fix vt build missing directory in ci
tlamonthezie Oct 15, 2024
d2a76df
#2: add python3 to default alpine packages
tlamonthezie Oct 15, 2024
67bb702
#2: try set intel additional env variables in docker
tlamonthezie Oct 15, 2024
8e1784a
#2: update docker image to support additional variables
tlamonthezie Oct 15, 2024
73143f2
#2: update mpich to latest stable release
tlamonthezie Oct 15, 2024
c2e6166
#2: add new setup configurations from vt - wip
tlamonthezie Oct 22, 2024
7f4df13
#2: add ubuntu configurations and setup
tlamonthezie Oct 22, 2024
f2c494c
#2: add missing mpich build parameter
tlamonthezie Oct 22, 2024
a009cb6
#2: update setup commands pipeline to return error if any
tlamonthezie Oct 22, 2024
9f6042a
#2: change setup shell to bash after bash is installed
tlamonthezie Oct 22, 2024
92a5422
#2: install macos mpich as brew package and add PATH_PREFIX docker va…
tlamonthezie Oct 22, 2024
532670f
#2: exit build-docker-image script with docker build status
tlamonthezie Oct 22, 2024
eb57621
#2: fix invalid base docker images
tlamonthezie Oct 22, 2024
6689dca
#2: fix base docker image versions
tlamonthezie Oct 22, 2024
f01fc63
#2: add docker inspect after docker build to validate the build
tlamonthezie Oct 22, 2024
20448ca
#2: add first version of Azure pipline
tlamonthezie Oct 22, 2024
f9089ed
#2: update azure ci
tlamonthezie Oct 22, 2024
42c3f15
#2: update matrix to match azure specs
tlamonthezie Oct 22, 2024
6b5fbf1
#2: update workflow files comments and limit to PRs
tlamonthezie Oct 22, 2024
8bfe3ee
#2: fix inexisting github runner and install mpich using brew on macos
tlamonthezie Oct 23, 2024
76dff48
#2: fix invalid packages list in conf for some setup
tlamonthezie Oct 23, 2024
5e9f721
#2: use same name in jobs for azure and github workflows
tlamonthezie Oct 23, 2024
c7000b1
#2: update workflows names
tlamonthezie Oct 23, 2024
18ccdf7
#2: fix invalid environment variable in a configuration
tlamonthezie Oct 23, 2024
84792e6
#2: test azure job name
tlamonthezie Oct 23, 2024
e38acb0
#2: test parameter in job name for azure
tlamonthezie Oct 23, 2024
a233075
#2: restore azure pipeline
tlamonthezie Oct 23, 2024
594a262
#2: move azure pipeline file
tlamonthezie Oct 23, 2024
2065134
#2: simplify names in workflows
tlamonthezie Oct 23, 2024
5a17b32
#2: update matrix variables casing
tlamonthezie Oct 23, 2024
96cab4e
#2: add PROXY argument to dockerfile
tlamonthezie Oct 31, 2024
2ba602d
#2: add steps to azure pipeline sample
tlamonthezie Oct 31, 2024
6863006
#2: remove trailing whitespaces
tlamonthezie Oct 31, 2024
0e82d3f
#2: try fix yaml processing errors in Azure
tlamonthezie Oct 31, 2024
ba8d2e1
#2: try fix condition in azure pipeline
tlamonthezie Oct 31, 2024
0eb4a23
#2: try fix condition in azure pipeline
tlamonthezie Oct 31, 2024
760dcee
#2: try another fix in azure workflow
tlamonthezie Oct 31, 2024
c8ae463
#2: try fix azure condition evaluation error
tlamonthezie Oct 31, 2024
caa0940
#2: add all test configurations to the Azure pipelines
tlamonthezie Oct 31, 2024
b7ecc34
#2: add ccache environment variables and add comments in config
tlamonthezie Nov 12, 2024
76ca7dc
#2: add 2 images for gcc with zoltan and clang with zoltan
tlamonthezie Nov 12, 2024
fe50324
#2: rename ci pipelines
tlamonthezie Nov 12, 2024
9c1e988
#2: set FC env variable for fortran in clang images
tlamonthezie Nov 12, 2024
425b89f
#2: update flang variable in config
tlamonthezie Nov 12, 2024
77a5e1a
#2: add missing FC environment variable to docker file
tlamonthezie Nov 12, 2024
658f84d
#2: set FC env var and fortran install only for 2 zoltan images
tlamonthezie Nov 12, 2024
09fb093
#2: update config for zoltan and vtk installations
tlamonthezie Nov 15, 2024
964c0b3
#2: fix configuration name
tlamonthezie Nov 15, 2024
414ec53
#2: replace flang-16 dep by flang-new-16 to try a fix and update nvcc…
tlamonthezie Nov 15, 2024
dedea38
#2: add ENV DEBIAN_FRONTEND=noninteractive to base dockerfile
tlamonthezie Nov 15, 2024
370ef89
#2: empty azure matrix temporarily and update config file
tlamonthezie Nov 15, 2024
d122f3e
#2: update setup scripts and fix dependency
tlamonthezie Nov 19, 2024
abda18a
#2: remove unused old setup scripts
tlamonthezie Nov 19, 2024
6bdbe3f
#2: enable running a command in dependencies setup phase
tlamonthezie Nov 19, 2024
e786d7a
#2 : try fix flang-16 linker issues by using -flang-experimental-exec…
tlamonthezie Nov 19, 2024
1674752
#2: fix fortran link
tlamonthezie Nov 19, 2024
f1b9ad0
#2: fix error in vtk dependency script
tlamonthezie Nov 19, 2024
1341c56
#2: fix error in build-setup.py and add mesa drivers to setup having vtk
tlamonthezie Nov 19, 2024
f2017e7
#2: change flang-16 to gfortran-13 in clang16 test env
tlamonthezie Nov 19, 2024
3caae2d
#2: clean scripts and config and add docker image wf- prefix
tlamonthezie Nov 26, 2024
3851116
#2: add docker push step
tlamonthezie Nov 26, 2024
272dbd6
#2: fix invalid cuda image tag
tlamonthezie Nov 26, 2024
0d45000
#2: remove trailing whitespace
tlamonthezie Nov 26, 2024
80273f3
#2: fix missing space in docker build command
tlamonthezie Nov 26, 2024
2fd8113
#2: restore azure matrix and clean yaml files
tlamonthezie Nov 26, 2024
c1cce2d
#2: use double quotes in python scripts as possible for strings and c…
tlamonthezie Nov 26, 2024
88f4514
#2: clean up workflow files
tlamonthezie Nov 26, 2024
db147ee
#2: remove unused script
tlamonthezie Nov 26, 2024
7f14bf4
#2: simplify and clean base dockerfile
tlamonthezie Nov 27, 2024
7e12398
#2: remove trailing whitespaces
tlamonthezie Nov 27, 2024
0aab735
#2: rebuild docker images in CI
tlamonthezie Nov 27, 2024
8132df5
#2: fix config
tlamonthezie Nov 27, 2024
317d0cd
#2: fix gcov version in gcc environments
tlamonthezie Dec 11, 2024
4788af3
#2: add gcovr to alpine image
tlamonthezie Dec 12, 2024
bae72b4
#2: remove build-and-test github actions moved to the test-ci-project…
tlamonthezie Dec 12, 2024
49a463e
#2: add gcovr package by default in all setup and lcov to develop image
tlamonthezie Dec 12, 2024
3059ca4
#2: keep coverage reporter only in develop and in alpine
tlamonthezie Dec 12, 2024
5cecdf4
#2: remove gcov env variable to simplify
tlamonthezie Dec 18, 2024
5eeb99f
#2: rename ci workflow name
tlamonthezie Dec 18, 2024
31aad46
#2: remove trailig whitespace
tlamonthezie Dec 18, 2024
14c6147
#2: clean and set master branch as the reference branch in CI
tlamonthezie Dec 18, 2024
70314fd
#2: fix missing new line in dependency scripts
tlamonthezie Dec 18, 2024
1a38b18
#2: copy scripts directly to docker instead of wget
tlamonthezie Dec 18, 2024
8eabfbd
#2: update workflow to work even if not on master to build images
tlamonthezie Dec 18, 2024
00131e3
#2: update libunwind script output
tlamonthezie Dec 18, 2024
80334d0
#2: update temp directory used in docker when building
tlamonthezie Dec 18, 2024
8417966
#2: try remove arg statements possibly duplicated
tlamonthezie Dec 18, 2024
2d7e33c
#2: update if condition in ci
tlamonthezie Dec 18, 2024
7db08f7
#2: enable temporary pushing docker images
tlamonthezie Dec 18, 2024
7f8ee3b
#2: restore push docker image condition
tlamonthezie Dec 18, 2024
8d243af
#2: fix condition in setup script
tlamonthezie Dec 18, 2024
6425d47
#2: enable pushing images
tlamonthezie Dec 18, 2024
20c8793
#2: finalize setup script
tlamonthezie Dec 19, 2024
8a94864
#2: remove unnecessary scripts
tlamonthezie Dec 19, 2024
37aadfb
#2: remove obsolete image ubuntu 18 gcc8
tlamonthezie Dec 19, 2024
1682242
#2: fix trailing whitespaces
tlamonthezie Dec 19, 2024
7087408
#2: fix setup script syntax error
tlamonthezie Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#2: add packages config to deps in config file and generate setup scr…
…ipts per environment
tlamonthezie committed Sep 23, 2024
commit 8c5a789424f384188c48aea4ec85d9569d3bd446
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build and Test (Template)

# This if a template to build and test a project in all available test environments on Github actions
# Template workkflow to build and test a project in all available test environments on Github actions
# WIP: This is currently a work in progress (#2: Docker image usage)

on:
51 changes: 4 additions & 47 deletions ci/build-docker-base
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@

import copy
import os
import uuid
import sys

from util import resolve_conf
@@ -56,66 +55,24 @@ class DockerBuilder:

# Add compiler packages
compiler = environment.get('compiler')
packages = []
if compiler is not None:
packages.append(compiler.get("cc"))
packages.append(compiler.get("cxx"))

# Add setup instructions
instructions = []
deps = environment.get("deps")
for dep_id in deps:
dep_args = deps.get(dep_id)
# Install deps with arguments
if dep_args is not None and len(dep_args) > 0:
# dep script multiple call
if isinstance(dep_args[0], list):
for (i, dep_args_sub) in enumerate(dep_args):
dep_args_sub = [ f"\"{a}\"" for a in dep_args_sub]
instructions.append(f"./{dep_id}.sh {' '.join(dep_args_sub)}")
# dep script single call
else:
dep_args = [ f"\"{a}\"" for a in dep_args]
instructions.append(f"./{dep_id}.sh {' '.join(dep_args)}")
# No arguments
else:
instructions.append(f"./{dep_id}.sh")

setup_script = ""
with open(
os.path.dirname(__file__) + '/scripts/setup-deps-template.sh',
'r',
encoding="utf-8"
) as file:
setup_script = file.read()
setup_script = setup_script.replace('%INSTRUCTIONS%', '\n'.join(instructions))

setup_filename = f"~setup-deps-{uuid.uuid4()}.sh"
setup_filepath = os.path.join(os.path.dirname(__file__), 'scripts', 'deps', setup_filename)

with open(setup_filepath, "w+", encoding="utf-8") as f:
f.write(setup_script)

cmd = ("docker build"
# General
f" --tag {repo}:{tag}"
f" --build-arg ARCH={image.get('arch')}"
f" --build-arg BASE={image.get('base')}"
# Compiler
f" --build-arg CC={compiler.get('cc', '') if compiler is not None else ''}"
f" --build-arg CXX={compiler.get('cxx', '') if compiler is not None else ''}"
f" --build-arg GCOV={compiler.get('gcov', '') if compiler is not None else ''}"
" --build-arg INSTALL_DEFAULT_PACKAGES=1"
f" --build-arg PACKAGES=\"{' '.join(packages)}\""
f" --build-arg SETUP_FILE=\'{setup_filename}\'"
f" --build-arg CI_ENVIRONMENT={image.get('environment')}"
#
f" --file {os.path.dirname(__file__)}/docker/base.dockerfile ."
" --progress=plain"
# " --no-cache"
)
print(cmd)
os.system(cmd)

# remove temporary setup script
os.remove(setup_filepath)

# TODO: option to push to Dockerhub

DockerBuilder().build(sys.argv[1:])
77 changes: 77 additions & 0 deletions ci/build-setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/env python

import copy
import os
from typing import List

from util import resolve_conf
import yaml

class SetupBuilder:
"""Dockerfile generator class"""

def __instructions(self, dep_id, args: list) -> List[str]:
""" Generate shell instructions to setup a dependency"""

call_args = []
if args is not None and len(args) > 0:
if isinstance(args[0], list):
instructions = []
for (_, sub_args) in enumerate(args):
instructions.extend(self.__instructions(dep_id, sub_args))
return instructions

call_args = [ f"\"{a}\"" for a in args]

return [ f"./deps/{dep_id}.sh {' '.join(call_args)}" ]

def build(self):
"""Build environment setup scripts for each environments defined in config"""

raw_config: dict = {}
with open(os.path.dirname(__file__) + '/config.yaml', 'r', encoding="utf-8") as file:
raw_config = yaml.safe_load(file)
config = resolve_conf(copy.deepcopy(raw_config))

environments = config.get("environments")

for (env_id, environment) in environments.items():


# Add compiler packages
compiler = environment.get('compiler')
packages = copy.deepcopy(environment.get("deps", {}).get("packages", []))
if compiler is not None:
if environment.get("deps") is None:
environment["deps"] = {}
if packages is None:
environment["deps"]["packages"] = []

if compiler.get("cc") is not None and not compiler.get("cc") in packages:
packages.append(compiler.get("cc"))
if compiler.get("cxx") is not None and not compiler.get("cxx") in packages:
packages.append(compiler.get("cxx"))
environment["deps"]["packages"] = packages

# Add setup instructions
instructions = []
for (dep_id, args) in environment.get("deps").items():
instructions.extend(self.__instructions(dep_id, args))

setup_script = ""
with open(
os.path.dirname(__file__) + '/setup-template.sh',
'r',
encoding="utf-8"
) as file:
setup_script = file.read()
setup_script = setup_script.replace('%INSTRUCTIONS%', '\n'.join(instructions))

setup_filename = f"setup-{env_id}.sh"
setup_filepath = os.path.join(os.path.dirname(__file__),
'shared', 'scripts', setup_filename)

with open(setup_filepath, "w+", encoding="utf-8") as f:
f.write(setup_script)

SetupBuilder().build()
3 changes: 1 addition & 2 deletions ci/build-workflow-matrix
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@
import copy
import os
import json
import sys

from util import resolve_conf
import yaml
@@ -51,7 +50,7 @@ class MatrixGenerator:
data = json.dumps({
"_comment": "This file has been generated. Please do not edit",
"matrix": matrix}, indent=2)
with open(os.path.dirname(__file__) + f"/shared/{runner_type}-matrix.json", 'w+',
with open(os.path.dirname(__file__) + f"/shared/workflows/{runner_type}-matrix.json", 'w+',
encoding="utf-8") as file:
file.write(data)

36 changes: 28 additions & 8 deletions ci/config.yaml
Original file line number Diff line number Diff line change
@@ -14,6 +14,23 @@

# Common parameters
parameters:
# Package common dependencies
apt_default_packages:
- ca-certificates
- less
- curl
- jq
- git
- wget
- zlib1g
- zlib1g-dev
- ninja-build
- valgrind
- make-guile
- libomp5
- libunwind-dev
- ccache
brew_default_packages: []
# Python
common_pip_packages: "nanobind yaml setuptools"
conda-py[3.8-3.12]:
@@ -24,7 +41,7 @@ parameters:
- ["3.12", "@common_pip_packages"]
# C/C++
gcc-11: { type: gnu, cc: gcc-11, cxx: g++-11, gcov: gcov }
gcc-14: { type: gnu, cc: gcc-14, cxx: g++-14, gcov: gcov }
gcc-14: { type: gnu, cc: gcc-14, cxx: g++-14, gcov: gcov }

# Environments (OS, commpiler, dependencies)
environments:
@@ -34,29 +51,32 @@ environments:
compiler: "@gcc-14"
# list of optional dependencies to install (matching script at ci/scripts/deps/{dep}.sh {arg1} {arg2} ...)
deps:
packages: "@apt_default_packages"
cmake: ['3.23.4']
conda: ~
conda-python-env: "@conda-py[3.8-3.12]"
# conda: ~
# conda-python-env: [ "@conda-py[3.8-3.12]" ]
openmpi: ['v5.0', '5.0.4', '-j4']
zoltan: [-j4', '/trilinos-install']
mpich: ['4.0.2', '-j4']
vtk: [ '9.3.1' ]
# zoltan: [-j4', '/trilinos-install']
# mpich: ['4.0.2', '-j4']
# vtk: [ '9.3.1' ]

ubuntu-22.04-gcc-11-vtk-9.2.2-py-3x-mpi:
label: Ubuntu 22.04 / gcc-11 / Python[3.8-3.12] / MPI 5.0.4 / VTK 9.3.1
compiler: "@gcc-11"
# list of optional dependencies to install (matching script at ci/scripts/deps/{dep}.sh {arg1} {arg2} ...)
# list dependencies to install (matching script at ci/scripts/deps/{dep}.sh {arg1} {arg2} ...)
deps:
packages: "@apt_default_packages"
cmake: ['3.23.4']
conda: [ ]
conda-python-env: "conda-py[3.8-3.12]"
conda-python-env: [ "@conda-py[3.8-3.12]" ]
vtk: [ '9.3.1' ]
openmpi: ['v5.0', '5.0.4']

macos-12-clang-14-vtk-9.3.1:
label: MacOSX / clang / VTK 9.3.1
compiler: { type: clang, cc: clang-14, cxx: clang-14++, gcov: llvm-gcov }
deps:
packages: "@apt_default_packages"
conda: [ ]
vtk: [ '9.3.1' ]

21 changes: 7 additions & 14 deletions ci/docker/base.dockerfile
Original file line number Diff line number Diff line change
@@ -3,36 +3,29 @@ ARG ARCH=amd64
ARG BASE=ubuntu:22.04
ARG CC=${CC:-""}
ARG CXX=${CXX:-""}
ARG CI_ENVIRONMENT=${CXX:-"ubuntu-develop"}

FROM ${ARCH}/${BASE} as base

SHELL ["/bin/bash", "-c"]

# Copy setup scripts
COPY ci/scripts/deps /opt/scripts/install
RUN ls /opt/scripts/install
RUN chmod u+x /opt/scripts/install/*.sh

# Install packages (works)
ARG PACKAGES=""
ARG INSTALL_DEFAULT_PACKAGES=1
RUN /opt/scripts/install/packages.sh "${PACKAGES}" ${INSTALL_DEFAULT_PACKAGES}
ARG CI_ENVIRONMENT
COPY ci/shared/scripts/setup-${CI_ENVIRONMENT}.sh /opt/scripts/setup.sh
COPY ci/shared/scripts/deps /opt/scripts/deps
RUN chmod u+x /opt/scripts/setup.sh /opt/scripts/deps/*.sh

# Environment variables (conda path, python environments, compiler, cmake path, vtk)
ENV PATH=/opt/cmake/bin:$PATH

ENV CC=$CC
ENV CXX=$CXX
ENV GCOV=$GCOV

ENV CONDA_INSTALL_DIR=/opt/conda
ENV CONDA_AUTO_ACTIVATE_BASE=false

ENV VTK_DIR=/opt/vtk/build

# Run additional setup commands from setup file
ARG SETUP_FILE=""
RUN /opt/scripts/install/${SETUP_FILE}
# Run setup script
RUN /opt/scripts/setup.sh

# Clean
RUN rm -rf /opt/scripts
4 changes: 0 additions & 4 deletions ci/scripts/deps/packages-macos.sh

This file was deleted.

36 changes: 0 additions & 36 deletions ci/scripts/deps/packages-ubuntu.sh

This file was deleted.

Empty file.
Empty file.
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions ci/scripts/setup-deps-template.sh → ci/setup-template.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# This file has been generated by a script. Do not edit.

echo "Installing dependencies..."

CURRENT_DIR="$(dirname -- "$(realpath -- "$0")")"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions ci/shared/scripts/deps/packages-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

PACKAGES=$@

echo "PACKAGES=\"${PACKAGES}\""

apt-get brew install -y -q && \
$PACKAGES
11 changes: 11 additions & 0 deletions ci/shared/scripts/deps/packages-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

PACKAGES=$@

echo "PACKAGES=\"${PACKAGES}\""

apt-get update -y -q && \
apt-get install -y -q --no-install-recommends \
$PACKAGES && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Original file line number Diff line number Diff line change
@@ -3,20 +3,20 @@
# Set up packages through the package manager

DEPS_DIR="$(dirname -- "$(realpath -- "$0")")"
PACKAGES="${1:-""}"
INSTALL_DEFAULT_PACKAGES=${2:-"1"}

echo "Set up dependencies..."
PACKAGES=$@

echo "Install system packages..."
if [[ $(uname -a) == *"Darwin"* ]]; then
bash $DEPS_DIR/packages-macos.sh "$PACKAGES" $INSTALL_DEFAULT_PACKAGES
bash $DEPS_DIR/packages-macos.sh $PACKAGES
exit 0
elif [[ $(uname -a) == *"Linux"* ]]; then
if [[ -f "/etc/lsb-release" ]]
then
. /etc/lsb-release
if [[ $DISTRIB_ID == "Ubuntu" ]]
then
bash $DEPS_DIR/packages-ubuntu.sh "$PACKAGES"
bash $DEPS_DIR/packages-ubuntu.sh $PACKAGES
exit 0
fi
else
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions ci/shared/scripts/setup-macos-12-clang-14-vtk-9.3.1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

# This file has been generated by a script. Do not edit.

echo "Installing dependencies..."

CURRENT_DIR="$(dirname -- "$(realpath -- "$0")")"

pushd $CURRENT_DIR

./deps/packages.sh "ca-certificates" "less" "curl" "jq" "git" "wget" "zlib1g" "zlib1g-dev" "ninja-build" "valgrind" "make-guile" "libomp5" "libunwind-dev" "ccache" "clang-14" "clang-14++"
./deps/conda.sh
./deps/vtk.sh "9.3.1"

popd
22 changes: 22 additions & 0 deletions ci/shared/scripts/setup-ubuntu-22.04-gcc-11-vtk-9.2.2-py-3x-mpi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

# This file has been generated by a script. Do not edit.

echo "Installing dependencies..."

CURRENT_DIR="$(dirname -- "$(realpath -- "$0")")"

pushd $CURRENT_DIR

./deps/packages.sh "ca-certificates" "less" "curl" "jq" "git" "wget" "zlib1g" "zlib1g-dev" "ninja-build" "valgrind" "make-guile" "libomp5" "libunwind-dev" "ccache" "gcc-11" "g++-11"
./deps/cmake.sh "3.23.4"
./deps/conda.sh
./deps/conda-python-env.sh "3.8" "nanobind yaml setuptools"
./deps/conda-python-env.sh "3.9" "nanobind yaml setuptools"
./deps/conda-python-env.sh "3.10" "nanobind yaml setuptools"
./deps/conda-python-env.sh "3.11" "nanobind yaml setuptools"
./deps/conda-python-env.sh "3.12" "nanobind yaml setuptools"
./deps/vtk.sh "9.3.1"
./deps/openmpi.sh "v5.0" "5.0.4"

popd
15 changes: 15 additions & 0 deletions ci/shared/scripts/setup-ubuntu-develop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

# This file has been generated by a script. Do not edit.

echo "Installing dependencies..."

CURRENT_DIR="$(dirname -- "$(realpath -- "$0")")"

pushd $CURRENT_DIR

./deps/packages.sh "ca-certificates" "less" "curl" "jq" "git" "wget" "zlib1g" "zlib1g-dev" "ninja-build" "valgrind" "make-guile" "libomp5" "libunwind-dev" "ccache" "gcc-14" "g++-14"
./deps/cmake.sh "3.23.4"
./deps/openmpi.sh "v5.0" "5.0.4" "-j4"

popd
File renamed without changes.
File renamed without changes.