Skip to content

Commit

Permalink
add yaml format check in pre-commit
Browse files Browse the repository at this point in the history
pre-commit check of all yaml files in the repository, with yamlfmt
format yaml file automatically and with yamllint check the final format.
  • Loading branch information
unkcpz committed Aug 10, 2020
1 parent 97cedfd commit 0353ab0
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 67 deletions.
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0 # Use the ref you want to point at
hooks:
- id: check-yaml
- id: sort-simple-yaml
- id: trailing-whitespace

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.21.0 # or higher tag
hooks:
- id: yamllint
args: [-c=.yamllint]

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.0.11 # or specific tag
hooks:
- id: yamlfmt
8 changes: 8 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extends: default

rules:
# 80 chars should be enough, but don't fail if a line is longer
line-length:
max: 200
level: warning
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ verdi computer setup --config https:///..../mycomputer.yml
verdi computer configure ssh mycomputer
```

Note: Some computers may need to be accessed via a proxy - e.g., for Piz Daint:
Note: Some computers may need to be accessed via a proxy - e.g., for Piz Daint:
```
proxy_command: ssh <username>@ela.cscs.ch netcat daint.cscs.ch 22
```
Expand Down
19 changes: 10 additions & 9 deletions computers/daint-hybrid/[email protected]
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
label: "cp2k-6.1-18464"
description: "CP2K with CUDA on daint, compiled by CSCS"
input_plugin: "cp2k"
---
label: cp2k-6.1-18464
description: CP2K with CUDA on daint, compiled by CSCS
input_plugin: cp2k
on_computer: true
remote_abs_path: "/apps/daint/UES/jenkins/7.0.UP01/gpu/easybuild/software/CP2K/6.1-CrayGNU-19.10-cuda-10.1/bin/cp2k.psmp"
computer: "daint-hybrid"
remote_abs_path: /apps/daint/UES/jenkins/7.0.UP01/gpu/easybuild/software/CP2K/6.1-CrayGNU-19.10-cuda-10.1/bin/cp2k.psmp
computer: daint-hybrid
prepend_text: |
### code prepend_text start ###
module load CP2K
### code prepend_text end ###
append_text: " "
### code prepend_text start ###
module load CP2K
### code prepend_text end ###
append_text: ' '
39 changes: 20 additions & 19 deletions computers/daint-hybrid/daint-hybrid.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
label: "daint-hybrid"
hostname: "daint.cscs.ch"
description: "Piz Daint supercomputer at CSCS Lugano, Switzerland, using the hybrid partition. HyperThreading is off"
transport: "ssh"
scheduler: "slurm"
shebang: "#!/bin/bash -l"
mpiprocs_per_machine: "12"
num_cores_per_mpiproc: "1"
---
label: daint-hybrid
hostname: daint.cscs.ch
description: Piz Daint supercomputer at CSCS Lugano, Switzerland, using the hybrid partition. HyperThreading is off
transport: ssh
scheduler: slurm
shebang: '#!/bin/bash -l'
mpiprocs_per_machine: '12'
num_cores_per_mpiproc: '1'
queue_name: normal
work_dir: "/scratch/snx3000/{username}/aiida/"
mpirun_command: "srun -n {tot_num_mpiprocs}"
work_dir: /scratch/snx3000/{username}/aiida/
mpirun_command: srun -n {tot_num_mpiprocs}
prepend_text: |
### computer prepend_text start ###
#SBATCH --partition=normal
#SBATCH --constraint=gpu
#SBATCH --hint=nomultithread
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
export CRAY_CUDA_MPS=1
ulimit -s unlimited
module load daint-gpu
### computer prepend_text end ###
### computer prepend_text start ###
#SBATCH --partition=normal
#SBATCH --constraint=gpu
#SBATCH --hint=nomultithread
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
export CRAY_CUDA_MPS=1
ulimit -s unlimited
module load daint-gpu
### computer prepend_text end ###
19 changes: 10 additions & 9 deletions computers/daint-mc/[email protected]
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
label: "cp2k-6.1-18464"
description: "CP2K 6.1 compiled by CSCS"
input_plugin: "cp2k"
---
label: cp2k-6.1-18464
description: CP2K 6.1 compiled by CSCS
input_plugin: cp2k
on_computer: true
remote_abs_path: "/apps/daint/UES/jenkins/7.0.UP01/mc/easybuild/software/CP2K/6.1-CrayGNU-19.10/bin/cp2k.psmp"
computer: "daint-mc"
remote_abs_path: /apps/daint/UES/jenkins/7.0.UP01/mc/easybuild/software/CP2K/6.1-CrayGNU-19.10/bin/cp2k.psmp
computer: daint-mc
prepend_text: |
### code prepend_text start ###
module load CP2K
### code prepend_text end ###
append_text: " "
### code prepend_text start ###
module load CP2K
### code prepend_text end ###
append_text: ' '
17 changes: 9 additions & 8 deletions computers/daint-mc/daint-mc.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
label: "daint-mc"
hostname: "daint.cscs.ch"
---
label: daint-mc
hostname: daint.cscs.ch
description: Piz Daint supercomputer at CSCS Lugano, Switzerland, multicore partition.
transport: ssh
scheduler: "slurm"
work_dir: "/scratch/snx3000/{username}/aiida_run/"
shebang: "#!/bin/bash"
mpirun_command: "srun -n {tot_num_mpiprocs}"
mpiprocs_per_machine: "36"
scheduler: slurm
work_dir: /scratch/snx3000/{username}/aiida_run/
shebang: '#!/bin/bash'
mpirun_command: srun -n {tot_num_mpiprocs}
mpiprocs_per_machine: '36'
prepend_text: |
### computer prepend_text start ###
#SBATCH --partition=normal
Expand All @@ -18,4 +19,4 @@ prepend_text: |
module load daint-mc
ulimit -s unlimited
### computer prepend_text end ###
append_text: " "
append_text: ' '
23 changes: 12 additions & 11 deletions computers/fidis/[email protected]
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
label: "cp2k-5.1"
description: "CP2K 5.1 compiled by SCITAS"
input_plugin: "cp2k"
---
label: cp2k-5.1
description: CP2K 5.1 compiled by SCITAS
input_plugin: cp2k
on_computer: true
remote_abs_path: "/ssoft/spack/cornalin/v2/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/cp2k-5.1-gke4ujsx5qhx6zt7ncfo22hajqhp6n6b/bin/cp2k.popt"
computer: "fidis"
remote_abs_path: /ssoft/spack/cornalin/v2/opt/spack/linux-rhel7-x86_E5v4_Mellanox/intel-17.0.2/cp2k-5.1-gke4ujsx5qhx6zt7ncfo22hajqhp6n6b/bin/cp2k.popt
computer: fidis
prepend_text: |
source /ssoft/spack/bin/slmodules.sh -r deprecated
module load intel
module load intel-mpi intel-mkl
module load cp2k/5.1-mpi
export CP2K_DATA_DIR=/work/lsmo/aiida-lsmo-codes/data/cp2k/data
append_text: " "
source /ssoft/spack/bin/slmodules.sh -r deprecated
module load intel
module load intel-mpi intel-mkl
module load cp2k/5.1-mpi
export CP2K_DATA_DIR=/work/lsmo/aiida-lsmo-codes/data/cp2k/data
append_text: ' '
20 changes: 10 additions & 10 deletions computers/fidis/fidis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

label: "fidis"
hostname: "fidis.epfl.ch"
---
label: fidis
hostname: fidis.epfl.ch
description: fidis EPFL computer
transport: ssh
scheduler: "slurm"
work_dir: "/scratch/{username}/aiida_run/"
shebang: "#!/bin/bash"
mpirun_command: "srun -n {tot_num_mpiprocs}"
mpiprocs_per_machine: "28"
prepend_text: " "
append_text: " "
scheduler: slurm
work_dir: /scratch/{username}/aiida_run/
shebang: '#!/bin/bash'
mpirun_command: srun -n {tot_num_mpiprocs}
mpiprocs_per_machine: '28'
prepend_text: ' '
append_text: ' '

0 comments on commit 0353ab0

Please sign in to comment.