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

Pre commit plus new images #3622

Merged
merged 5 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions .cmake-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# ------------------------------------------------
# Options affecting comment reflow and formatting.
# ------------------------------------------------
with section("markup"):
# If comment markup is enabled, don't reflow the first comment block in each
# listfile. Use this to preserve formatting of your copyright/license
# statements.
first_comment_is_literal = True

# -----------------------------
# Options affecting formatting.
# -----------------------------
with section("format"):
# If an argument group contains more than this many sub-groups (parg or kwarg
# groups) then force it to a vertical layout.
max_subgroups_hwrap = 12
# If a positional argument group contains more than this many arguments, then
# force it to a vertical layout.
max_pargs_hwrap = 12
# If a candidate layout is wrapped horizontally but it exceeds this many
# lines, then reject the layout.
max_lines_hwrap = 6
78 changes: 15 additions & 63 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/ubuntu-python3:18.04
image: docker.pkg.github.com/espressomd/docker/ubuntu-18.04:a1192b35590a1a474c55fe1e9a1e6c25758454ea

stages:
- permission
- prepare
- build
- additional_checks
Expand Down Expand Up @@ -31,16 +30,6 @@ variables:
CCACHE_MAXSIZE: 100G
with_ccache: "true"

check_permission:
<<: *notification_job_definition
stage: permission
only:
- /.*external.*/
when: manual
allow_failure: false
script:
- exit 0

status_pending:
<<: *notification_job_definition
stage: prepare
Expand All @@ -49,7 +38,7 @@ status_pending:
style:
<<: *global_job_definition
stage: prepare
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/clang-python3:6.0
image: docker.pkg.github.com/espressomd/docker/clang:a1192b35590a1a474c55fe1e9a1e6c25758454ea
dependencies: []
before_script:
- git submodule deinit .
Expand All @@ -69,7 +58,7 @@ style:
style_doxygen:
<<: *global_job_definition
stage: prepare
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/ubuntu-python3:cuda-10.1
image: docker.pkg.github.com/espressomd/docker/ubuntu-cuda-10.1:a1192b35590a1a474c55fe1e9a1e6c25758454ea
dependencies: []
script:
- mkdir build
Expand Down Expand Up @@ -118,7 +107,7 @@ no_rotation:
debian:10:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/debian-python3:10
image: docker.pkg.github.com/espressomd/docker/debian:a1192b35590a1a474c55fe1e9a1e6c25758454ea
script:
- export with_cuda=false
- export myconfig=maxset make_check_python=false
Expand All @@ -130,7 +119,7 @@ debian:10:
opensuse:15.1:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
image: docker.pkg.github.com/espressomd/docker/opensuse:a1192b35590a1a474c55fe1e9a1e6c25758454ea
script:
- export with_cuda=false myconfig=maxset make_check_python=false
- bash maintainer/CI/build_cmake.sh
Expand All @@ -141,7 +130,7 @@ opensuse:15.1:
centos:7:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/centos-python3:7
image: docker.pkg.github.com/espressomd/docker/centos:a1192b35590a1a474c55fe1e9a1e6c25758454ea
script:
- export with_cuda=false myconfig=maxset make_check_python=true
- bash maintainer/CI/build_cmake.sh
Expand All @@ -152,24 +141,20 @@ centos:7:
fedora:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/centos-python3:next
image: docker.pkg.github.com/espressomd/docker/fedora:a1192b35590a1a474c55fe1e9a1e6c25758454ea
script:
- export with_cuda=false myconfig=maxset make_check_python=false
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux

#ubuntu:1604 not needed: used in ubuntu-python3:cuda-9.0
#ubuntu:1804 not needed: default used in non-CUDA builds
#ubuntu:1904 not needed: base image for builds on different architectures

### Builds with CUDA

cuda10-maxset:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/ubuntu-python3:cuda-10.1
image: docker.pkg.github.com/espressomd/docker/ubuntu-cuda-10.1:a1192b35590a1a474c55fe1e9a1e6c25758454ea
script:
- export myconfig=maxset with_coverage=false test_timeout=900 srcdir=${CI_PROJECT_DIR}
- export cmake_params="-DIPYTHON_EXECUTABLE=$(which jupyter)"
Expand All @@ -186,7 +171,7 @@ cuda10-maxset:
cuda9-maxset:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/ubuntu-python3:cuda-9.0
image: docker.pkg.github.com/espressomd/docker/ubuntu-cuda-9.0:a1192b35590a1a474c55fe1e9a1e6c25758454ea
script:
- export myconfig=maxset with_coverage=true test_timeout=900 srcdir=${CI_PROJECT_DIR}
- sed -i 's/ or "DISPLAY" in os.environ/ or True/' src/python/espressomd/visualization.pyx
Expand All @@ -204,7 +189,7 @@ cuda9-maxset:
tutorials-samples-maxset:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/ubuntu-python3:cuda-10.1
image: docker.pkg.github.com/espressomd/docker/ubuntu-cuda-10.1:a1192b35590a1a474c55fe1e9a1e6c25758454ea
script:
- export myconfig=maxset with_coverage=false make_check_unit_tests=false make_check_python=false
- export make_check_tutorials=true make_check_samples=true make_check_benchmarks=false test_timeout=1200
Expand All @@ -217,7 +202,7 @@ tutorials-samples-maxset:
tutorials-samples-default:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/ubuntu-python3:cuda-10.1
image: docker.pkg.github.com/espressomd/docker/ubuntu-cuda-10.1:a1192b35590a1a474c55fe1e9a1e6c25758454ea
script:
- export myconfig=default with_coverage=false make_check_unit_tests=false make_check_python=false
- export make_check_tutorials=true make_check_samples=true make_check_benchmarks=false test_timeout=1200
Expand All @@ -232,7 +217,7 @@ tutorials-samples-default:
tutorials-samples-empty:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/ubuntu-python3:cuda-10.1
image: docker.pkg.github.com/espressomd/docker/ubuntu-cuda-10.1:a1192b35590a1a474c55fe1e9a1e6c25758454ea
script:
- export myconfig=empty with_coverage=false make_check_unit_tests=false make_check_python=false
- export make_check_tutorials=true make_check_samples=true make_check_benchmarks=false test_timeout=1200 with_scafacos=false
Expand All @@ -247,7 +232,7 @@ tutorials-samples-empty:
tutorials-samples-no-gpu:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/ubuntu-python3:cuda-10.1
image: docker.pkg.github.com/espressomd/docker/ubuntu-cuda-10.1:a1192b35590a1a474c55fe1e9a1e6c25758454ea
script:
- export myconfig=maxset with_coverage=false make_check_unit_tests=false make_check_python=false
- export make_check_tutorials=true make_check_samples=true make_check_benchmarks=false test_timeout=1200 hide_gpu=true
Expand All @@ -261,7 +246,7 @@ tutorials-samples-no-gpu:
installation:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/ubuntu-python3:cuda-10.1
image: docker.pkg.github.com/espressomd/docker/ubuntu-cuda-10.1:a1192b35590a1a474c55fe1e9a1e6c25758454ea
script:
- export myconfig=maxset with_coverage=false make_check_unit_tests=false make_check_python=false
- export srcdir=${CI_PROJECT_DIR} test_timeout=1800
Expand Down Expand Up @@ -292,7 +277,7 @@ installation:
empty:
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/clang-python3:6.0
image: docker.pkg.github.com/espressomd/docker/clang:a1192b35590a1a474c55fe1e9a1e6c25758454ea
script:
- export myconfig=empty with_static_analysis=true
- bash maintainer/CI/build_cmake.sh
Expand Down Expand Up @@ -324,39 +309,6 @@ rocm-maxset:
tags:
- amdgpu

### Builds on different architectures

.arch_template: &arch_definition
<<: *global_job_definition
stage: build
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
script:
- export with_cuda=false test_timeout=900 check_skip_long=true
- export OMPI_MCA_btl_vader_single_copy_mechanism=none
- export myconfig=maxset
- bash maintainer/CI/build_cmake.sh
timeout: 6h
tags:
- docker
- linux
when: manual

ubuntu:arm64:
<<: *arch_definition

ubuntu:armhf:
<<: *arch_definition

ubuntu:i386:
<<: *arch_definition
timeout: 1h
only:
- branches
- tags

ubuntu:ppc64le:
<<: *arch_definition

### Builds with OS X

osx:
Expand Down
37 changes: 37 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
fail_fast: false
exclude: 'libs'
repos:
- repo: local
hooks:
- id: clang-format
name: clang-format
entry: sh maintainer/format/clang-format.sh
language: system
always_run: false
files: '.*\.(cpp|hpp|cu|cuh)'
args: ["-i", "-style=file"]

- id: autopep8
name: autopep8
entry: sh maintainer/format/autopep8.sh
language: system
always_run: false
files: '.*\.(py|pyx|pxd)'
exclude: '\.pylintrc|.*.\.py\.in'
args: ["--ignore=E266,W291,W293", "--in-place", "--aggressive"]

- id: cmake-format
name: cmake-format
entry: sh maintainer/format/cmake-format.sh
language: system
always_run: false
files: 'CMakeLists.txt'
args: ["-i"]

- id: ex-flags
name: executable flags
entry: sh maintainer/format/ex_flag.sh
language: system
always_run: false
exclude: '.*\.(sh|py|sh\.in|cmakein)|.git'
types: [file, executable]
Loading