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

Include gitlab-sync in master branch #416

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5a5de4a
First version of CI to mirror pull_requests to Gitlab
jakob-fritz Jan 8, 2024
832e7e5
Exit instead of return needed
jakob-fritz Jan 8, 2024
5e0118a
Hopefully now, variable is expanded instead using the name
jakob-fritz Jan 8, 2024
c49accd
Another attempt to get the action to work
jakob-fritz Jan 8, 2024
d8604b7
Try exapnding the predefined variable
jakob-fritz Jan 8, 2024
249741b
Updated workflow for mirroring
jakob-fritz Jan 15, 2024
f38f0e5
Updated ref to use lastest code from PR; not merge
jakob-fritz Jan 15, 2024
be3aef7
Using default shallow checkout
jakob-fritz Jan 15, 2024
ef6a866
Set sha for checkout properly
jakob-fritz Jan 18, 2024
3de1b56
Formatted md-file to trigger CI
jakob-fritz Jan 26, 2024
fefe88b
Minor formatting updates in README
jakob-fritz Jan 29, 2024
28472dc
Uses newer checkout-action to use new node-version (20)
jakob-fritz Jan 29, 2024
bcd64a5
Use specific version of github2lab action
jakob-fritz Feb 5, 2024
d347bd3
Try to merge code (from PR) first
jakob-fritz Apr 16, 2024
8a316e2
Moved the check of condition from shell to yaml
jakob-fritz Apr 16, 2024
2712998
Don't rerun CI on every push during this development
jakob-fritz Apr 16, 2024
ccd646a
First fetch, to be able to checkout branch
jakob-fritz Apr 16, 2024
efdaa05
Don't run main CI during development
jakob-fritz Apr 16, 2024
cbf0b5d
Added more reporting for better debugging
jakob-fritz Apr 16, 2024
faec097
Corrected querying of a variable
jakob-fritz Apr 16, 2024
d906604
Redone storing of var again
jakob-fritz Apr 16, 2024
6961ef3
Reverted and changed way to store variable
jakob-fritz Apr 16, 2024
9cfeea3
Changed way to use variables (set locally and later in github_env)
jakob-fritz Apr 17, 2024
d1b7250
Make unshallow before merging to properly compare history
jakob-fritz Apr 17, 2024
82d9233
Don't run mirror on push now (as gitlab-file is incorrect in this bra…
jakob-fritz Apr 17, 2024
f34de9c
Also allow non-fast-forward merges
jakob-fritz Apr 17, 2024
c7db47a
Add name and email for merge-commit
jakob-fritz Apr 17, 2024
e33a611
Unshallow repo if needed
jakob-fritz Apr 17, 2024
2e9930f
Wrong syntax for if else
jakob-fritz Apr 17, 2024
5f45785
Updated name of step, as merge is not ff-only anymore
jakob-fritz Apr 18, 2024
7de7187
Added triggers for workflows again
jakob-fritz Apr 22, 2024
fb4b745
Moved development of action into main branch and added version-tag
jakob-fritz Apr 22, 2024
cdb77d4
WIP: Use HPC for CI (#386)
jakob-fritz Apr 22, 2024
9ab9b63
Reduced diff to master
jakob-fritz Apr 23, 2024
488e7a4
ci_pipeline.yml now more similar to upstream
jakob-fritz Apr 24, 2024
24cdf05
Split installation and running into two jobs
jakob-fritz Apr 24, 2024
cbaae05
Make create_gitlab_ci branch up-to-date before merging into master (#…
jakob-fritz Apr 24, 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
88 changes: 49 additions & 39 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,12 @@ jobs:
run: |
flakeheaven lint --benchmark pySDC

# mirror_to_gitlab:

# runs-on: ubuntu-latest

# steps:
# - name: Checkout
# uses: actions/checkout@v1

# - name: Mirror
# uses: jakob-fritz/github2lab_action@main
# env:
# MODE: 'mirror' # Either 'mirror', 'get_status', or 'both'
# GITLAB_TOKEN: ${{ secrets.GITLAB_SECRET_H }}
# FORCE_PUSH: "true"
# GITLAB_HOSTNAME: "codebase.helmholtz.cloud"
# GITLAB_PROJECT_ID: "3525"
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

user_cpu_tests_linux:
runs-on: ubuntu-latest

strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10']
python: ['3.8', '3.9', '3.10']
env: ['base', 'fenics', 'mpi4py', 'petsc']

defaults:
Expand Down Expand Up @@ -144,7 +126,53 @@ jobs:
path: |
data_libpressio
coverage_libpressio_3.10.dat


user_monodomain_tests_linux:
runs-on: ubuntu-latest

defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: "pySDC/projects/Monodomain/etc/environment-monodomain.yml"
create-args: >-
python=3.10

- name: Compile C++ ionic models
env:
IONIC_MODELS_PATH: "pySDC/projects/Monodomain/problem_classes/ionicmodels/cpp"
run: |
c++ -O3 -Wall -shared -std=c++11 -fPIC -fvisibility=hidden $(python3 -m pybind11 --includes) ${IONIC_MODELS_PATH}/bindings_definitions.cpp -o ${IONIC_MODELS_PATH}/ionicmodels$(python3-config --extension-suffix)

- name: Run pytest for CPU stuff
run: |
echo "print('Loading sitecustomize.py...')
import coverage
coverage.process_startup() " > sitecustomize.py
coverage run -m pytest --continue-on-collection-errors -v --durations=0 pySDC/tests -m monodomain

- name: Make coverage report
run: |
mv data data_monodomain
coverage combine
mv .coverage coverage_monodomain_3.10.dat

- name: Uploading artifacts
uses: actions/upload-artifact@v3
with:
name: cpu-test-artifacts
path: |
data_monodomain
coverage_monodomain_3.10.dat


# user_cpu_tests_macos:
# runs-on: macos-12
#
Expand All @@ -169,24 +197,6 @@ jobs:
# run: |
# pytest --continue-on-collection-errors -v --durations=0 pySDC/tests -m ${{ matrix.env }}


# wait_for_gitlab:
# runs-on: ubuntu-latest

# needs:
# - mirror_to_gitlab

# steps:
# - name: Wait
# uses: jakob-fritz/github2lab_action@main
# env:
# MODE: 'get_status' # Either 'mirror', 'get_status', or 'both'
# GITLAB_TOKEN: ${{ secrets.GITLAB_SECRET_H }}
# FORCE_PUSH: "true"
# GITLAB_HOSTNAME: "codebase.helmholtz.cloud"
# GITLAB_PROJECT_ID: "3525"
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# # - name: Get and prepare artifacts
# # run: |
# # pipeline_id=$(curl --header "PRIVATE-TOKEN: ${{ secrets.GITLAB_SECRET_H }}" --silent "https://gitlab.hzdr.de/api/v4/projects/3525/repository/commits/${{ github.head_ref || github.ref_name }}" | jq '.last_pipeline.id')
Expand All @@ -206,6 +216,7 @@ jobs:
- lint
- user_cpu_tests_linux
- user_libpressio_tests
- user_monodomain_tests_linux
# - wait_for_gitlab

defaults:
Expand Down Expand Up @@ -346,4 +357,3 @@ jobs:
# rm -rf data
# unzip artifacts.zip
#

116 changes: 116 additions & 0 deletions .github/workflows/gitlab_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---

name: Mirror to Gitlab to trigger CI

on:
push:
pull_request_target:
schedule:
- cron: '1 5 2 * *'

jobs:
check_permission:
runs-on: ubuntu-latest
if: >-
(github.repository_owner == 'Parallel-in-Time') &&
((github.event_name == 'push') ||
(github.event_name == 'schedule') ||
((github.event_name == 'pull_request_target') &&
(contains(github.event.pull_request.labels.*.name, 'gitlab-mirror'))
)
)
steps:
- name: Query permissions of triggering actor
id: query_permission_triggering_actor
if: github.event_name == 'pull_request_target'
uses: actions-cool/check-user-permission@v2
with:
username: ${{ github.triggering_actor }}
require: 'write'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Interpret the queried result
if: github.event_name == 'pull_request_target'
run: |
echo "Current permission level is ${{ steps.query_permission_triggering_actor.outputs.user-permission }}"
echo "Job originally triggered by ${{ github.actor }}"
echo "Checking permission returned ${{ steps.query_permission_triggering_actor.outputs.require-result }}"
if ${{ steps.query_permission_triggering_actor.outputs.require-result }}
then
echo 'Permissions granted'
exit 0
else
echo 'Not enough permissions. Please ask a member of Parallel-in-Time to rerun the job.'
exit 1
fi
- name: Pass if workflow from push or schedule
if: >-
(github.event_name == 'push') ||
(github.event_name == 'schedule')
run: exit 0
# - name: Fail for other triggers
# if: >-
# (github.event_name != 'push') &&
# (github.event_name != 'schedule') &&
# (github.event_name != 'pull_request_target')
# run: exit 1

mirror_to_gitlab:
runs-on: ubuntu-latest
if: >-
(github.repository_owner == 'Parallel-in-Time') &&
((github.event_name == 'push') ||
(github.event_name == 'schedule') ||
((github.event_name == 'pull_request_target') &&
(contains(github.event.pull_request.labels.*.name, 'gitlab-mirror'))
)
)
needs:
- check_permission
steps:
- name: set proper sha
run: |
echo "${{ github.event_name }}"
if [ "${{ github.event_name }}" == 'push' ] || [ "${{ github.event_name }}" == 'schedule' ]
then
echo "USED_SHA=${{ github.sha }}" >> "$GITHUB_ENV"
fi
if [ "${{ github.event_name }}" == 'pull_request_target' ]
then
echo "USED_SHA=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV"
fi
- name: Checkout
uses: actions/checkout@v4
with:
ref: "${{ env.USED_SHA }}"
persist-credentials: false
- name: check if merge is possible (merge is used for testing)
if: github.event_name == 'pull_request_target'
run: |
if $(git rev-parse --is-shallow-repository); then
git fetch --unshallow
else
git fetch
fi
echo "Checkout of ${{ github.base_ref }}"
git checkout "${{ github.base_ref }}"
echo "Git pull"
git pull
MIRROR_BRANCH="TEMPORARY_MERGE_PR_${{ github.event.number }}"
echo MIRROR_BRANCH="$MIRROR_BRANCH" >> $GITHUB_ENV
echo "Create new branch $MIRROR_BRANCH and check it out"
git checkout -b "$MIRROR_BRANCH"
echo "Setting git committer info, so that merge-commit can be created"
git config user.email "[email protected]"
git config user.name "Sync bot"
echo "Merge the two parts of the Merge-Request to test the resulting version"
git merge "${{ github.event.pull_request.head.sha }}"
- name: Mirror and wait for Gitlab-CI
uses: jakob-fritz/[email protected]
env:
MODE: 'all' # Either 'mirror', 'get_status', 'get_artifact', or 'all'
GITLAB_TOKEN: ${{ secrets.GITLAB_SECRET }}
FORCE_PUSH: "true"
GITLAB_HOSTNAME: "gitlab.jsc.fz-juelich.de"
GITLAB_PROJECT_ID: "6029"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MIRROR_BRANCH: ${{ env.MIRROR_BRANCH }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ data/*
step_*.png
*.pkl
*.swp
*_data.json
!_dataRef.json

# Created by https://www.gitignore.io

Expand Down Expand Up @@ -158,3 +160,7 @@ Temporary Items
.vscode
*.cpp
pySDC/playgrounds/FEniCS/jitfailure-dolfin_expression_fc28530d435fa2de045af3312fc07c3b/recompile.sh

# videos
*.mp4
*.mkv
79 changes: 79 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,84 @@
---

stages:
- test
- benchmark
- upload


variables:
JUWELS_ACCOUNT: "cstma"


prepare_JUWELS:
stage: benchmark
rules:
- if: $CI_COMMIT_MESSAGE !~ /.*\[CI-no-benchmarks\]/
tags:
- jacamar
- juwels
- login
- shell
script:
- mkdir -p benchmarks
# load the latest Python module (currently 3.11)
- module --force purge
- module load Stages/2024
- module load GCC
- module load OpenMPI
- module load FFTW
- module load mpi4py
- module load SciPy-Stack
- module load CuPy
- pip install -e .
- pip install pytest-benchmark coverage


test_JUWELS:
stage: benchmark
needs:
- prepare_JUWELS
rules:
- if: $CI_COMMIT_MESSAGE !~ /.*\[CI-no-benchmarks\]/
tags:
- jacamar
- juwels
- login
- shell
parallel:
matrix:
- SHELL_SCRIPT: ['benchmark', 'cupy']
artifacts:
when: always
paths:
- coverage_*.dat
- sbatch.err
- sbatch.out
before_script:
- mkdir -p benchmarks
# load the latest Python module (currently 3.11)
- module --force purge
- module load Stages/2024
- module load GCC
- module load OpenMPI
- module load FFTW
- module load mpi4py
- module load SciPy-Stack
- module load CuPy
script:
# - touch benchmarks/output.json
- echo $SYSTEMNAME
- sbatch --wait etc/juwels_${SHELL_SCRIPT}.sh
- touch .coverage.empty
- python -m coverage combine
- mv .coverage coverage_${SHELL_SCRIPT}.dat
after_script:
- echo "Following Errors occured:"
- cat sbatch.err
- echo "Following was written to stdout:"
- cat sbatch.out


#test_kit:
# image: rcaspart/micromamba-cuda
# stage: benchmark
Expand Down Expand Up @@ -64,6 +140,9 @@ stages:
benchmark:
image: mambaorg/micromamba
stage: benchmark
when: manual
tags:
- docker
rules:
- if: $CI_COMMIT_MESSAGE !~ /.*\[CI-no-benchmarks\]/
artifacts:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

:arrow_left: [Back to main page](./README.md)

- January 24, 2024: Version 5.4.0 contains the code for the [second order SDC paper](https://arxiv.org/abs/2310.08352) by [\@ikrom96git](https://github.com/ikrom96git). It also has some changes to the FEniCS
part, including correct treatment of boundary conditions and first steps with FEniCS-x.
- July 28, 2023: For Version 5.3 a lot of pull requests got merged, thanks to [\@brownbaerchen](https://github.com/brownbaerchen),
[\@tlunet](https://github.com/tlunet), [\@lisawim](https://github.com/lisawim), [\@ikrom96git](https://github.com/ikrom96git) for all the contributions.
Besides the usual bugfixing and polishing, `pySDC` now comes with linear multistep methods, classical Runge Kutta methods, DAE sweepers, and more/improved projects.
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ authors:
orcid: https://orcid.org/0000-0002-8869-0784
affiliation: "Hamburg University of Technology, Institute of Mathematics, 21073 Hamburg, Germany"

version: 5.3.0
version: 5.4.3
doi: 10.5281/zenodo.594191
date-released: 2023-07-25
date-released: 2024-03-27
keywords:
- "parallel-in-time"
- "spectral deferred corrections"
Expand Down
Loading
Loading