-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
659 additions
and
556 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: dotfiles-CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
schedule: | ||
- cron: "0 5 * * 1" | ||
|
||
concurrency: | ||
group: ${{github.ref}}-${{github.head_ref}}-ci | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
Dotfiles: | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
include: | ||
- os: macos-latest | ||
install_deps: brew install chezmoi | ||
- os: ubuntu-latest | ||
install_deps: sudo apt-get update && sudo apt install zsh -y && sh -c "$(curl -fsLS get.chezmoi.io)" -- -b $HOME/.local/bin && export PATH="${HOME}/.local/bin:$PATH" | ||
steps: | ||
- name: Dependencies | ||
run: | | ||
${{matrix.install_deps}} | ||
- name: Install | ||
run: | | ||
export CHEZMOI_BRANCH=${{ github.head_ref || github.ref_name }} | ||
chezmoi init https://github.com/marchdf/dotfiles.git --branch ${CHEZMOI_BRANCH} --promptBool test_machine=t,"Use ZSH_ROOT_DIR for tmux shell"=f --promptString email="" | ||
chezmoi data | ||
chezmoi apply | ||
- name: Cold start zsh | ||
run: | | ||
time zsh -i -c exit | ||
- name: Warm start zsh | ||
run: | | ||
time zsh -i -c exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ ! -x "$(command -v pyenv)" ]]; then | ||
echo "Please install pyenv" | ||
exit 1 | ||
fi | ||
|
||
{{- if eq .nrel_cluster "eagle" }} | ||
source /nopt/nrel/ecom/hpacf/env.sh | ||
module use ${HOME}/modules/linux-centos7-skylake_avx512 | ||
module load gcc | ||
module load binutils | ||
module load git | ||
module load gnutls | ||
module load libtool | ||
module load bzip2 | ||
module load libffi | ||
module load openssl | ||
module load sqlite | ||
export LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib -L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" | ||
export CPPFLAGS="-I${OPENSSL_ROOT_DIR}/include -I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" | ||
{{- else if eq .nrel_cluster "ellis" }} | ||
MODULES_DATE=2023-05-11 | ||
source /data/ssd1/software/${MODULES_DATE}/env.sh | ||
module load gcc | ||
module load binutils | ||
module load git | ||
module load gnutls | ||
module load libtool | ||
module load bzip2 | ||
module load libffi | ||
module load sqlite | ||
export LDFLAGS="-L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" | ||
export CPPFLAGS="-I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" | ||
{{- end }} | ||
export PYTHON_CONFIGURE_OPTS="--enable-optimizations --with-lto" | ||
export PYTHON_CFLAGS="-mtune=native" | ||
|
||
|
||
PYTHON_VERSION="${1}" | ||
if [ ! -z "$python_version" ] | ||
then | ||
pyenv install | ||
else | ||
pyenv install -s ${PYTHON_VERSION} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*- | ||
|
||
# Copyright (c) 2024 Marc Henry de Frahan | ||
|
||
# According to the Zsh Plugin Standard: | ||
# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html | ||
|
||
0=${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}} | ||
0=${${(M)0:#/*}:-$PWD/$0} | ||
|
||
# Then ${0:h} to get hpc's directory | ||
|
||
if [[ ${zsh_loaded_plugins[-1]} != */personal && -z ${fpath[(r)${0:h}]} ]] { | ||
fpath+=( "${0:h}" ) | ||
} | ||
|
||
# Standard hash for plugins, to not pollute the namespace | ||
typeset -gA Plugins | ||
Plugins[PERSONAL_DIR]="${0:h}" | ||
|
||
{{- if .nrel_hpc }} | ||
# Custom for NREL HPC machines | ||
|
||
# Set scratch | ||
if [ -d "/scratch/${USER}" ]; then | ||
export SCRATCH="/scratch/${USER}" | ||
fi | ||
|
||
# Set the modules | ||
{{- if eq .nrel_cluster "eagle" }} | ||
source /nopt/nrel/utils/lmod/lmod/init/zsh | ||
source /nopt/nrel/ecom/hpacf/env.sh | ||
module use ${HOME}/modules/linux-centos7-skylake_avx512/gcc-9.3.0 | ||
export TMPDIR=${SCRATCH}/.tmp | ||
{{- else if eq .nrel_cluster "ellis" }} | ||
MODULES_DATE=2023-05-11 | ||
source /data/ssd1/software/${MODULES_DATE}/env.sh | ||
export TMPDIR=/data/ssd1/home/${USER}/.tmp | ||
{{- else if eq .nrel_cluster "kestrel" }} | ||
source /opt/cray/pe/lmod/lmod/init/zsh | ||
source /nopt/nrel/apps/env.sh | ||
export TMPDIR=${SCRATCH}/.tmp | ||
{{- end }} | ||
|
||
umask u=rwx,go=rx,o=rx | ||
|
||
function load_custom_modules { | ||
|
||
{ | ||
module purge | ||
module load gcc | ||
module load binutils | ||
module load bzip2 | ||
module load cmake | ||
module load ffmpeg/4.2.2 | ||
module load git | ||
module load gnutls | ||
module load htop | ||
module load image-magick | ||
module load libffi | ||
module load libtool | ||
module load py-setuptools-scm | ||
module load sqlite | ||
module load tmux | ||
{{- if eq .nrel_cluster "eagle" }} | ||
module load python/3.7.7 | ||
module load mpt | ||
module load openssl | ||
module load texlive | ||
{{- else if eq .nrel_cluster "ellis" }} | ||
module load python/3.10.10 | ||
{{- end }} | ||
|
||
module load emacs/28.2 | ||
module load ccls | ||
} &> /dev/null | ||
} | ||
|
||
function pv510server() { | ||
module load paraview/5.10.1-server | ||
srun -n $1 -c 1 --cpu_bind=cores pvserver | ||
} | ||
|
||
function pv510gui() { | ||
module load paraview/5.10.1-gui | ||
vglrun paraview | ||
} | ||
|
||
function pvtunnel() { | ||
ssh -L 11111:$1:11111 mhenryde@$1 | ||
} | ||
|
||
{{ end }} | ||
|
||
{{- if .ornl_hpc }} | ||
# Custom for OLCF HPC machines | ||
function load_custom_modules { | ||
{ | ||
module load DefApps-spi/default | ||
module load cmake | ||
module load emacs | ||
module load go | ||
module load htop | ||
module load imagemagick | ||
module load tmux | ||
|
||
module load cray-python | ||
|
||
} &> /dev/null | ||
} | ||
{{ end }} | ||
|
||
{{- if or (.nrel_hpc) (.ornl_hpc) }} | ||
load_custom_modules | ||
{{ end }} | ||
|
||
# Use alternate vim marks [[[ and ]]] as the original ones can | ||
# confuse nested substitutions, e.g.: ${${${VAR}}} | ||
|
||
# vim:ft=zsh:tw=80:sw=4:sts=4:et:foldmarker=[[[,]]] |
Oops, something went wrong.