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

first version of init_eessi.sh script (WIP) #4

Closed
wants to merge 1 commit into from
Closed
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
32 changes: 32 additions & 0 deletions .github/workflows/test-scripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions
name: Tests for scripts in EESSI software layer
on: [push, pull_request]
jobs:
build:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python: [2.7, 3.5, 3.6, 3.7, 3.8]
fail-fast: false
steps:
- uses: actions/checkout@v2

- name: set up Python
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python}}
architecture: x64

- name: install OS & Python packages
run: |
pip install archspec

- name: test scripts
run: |
python eessi_cpu_subdir.py
source init_eessi.sh
# check which $EESSI_* environment variables were defined
env | grep '^EESSI' | sort
# make sure there are no empty subpaths
echo "$EESSI_PATH" | grep -v '//'
10 changes: 10 additions & 0 deletions eessi_cpu_subdir.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Determine subdirectory of EESSI prefix to use, based on CPU microarchitecture of host
import os
import archspec.cpu

host_cpu = archspec.cpu.host()

cpu_family = host_cpu.family.name
cpu_codename = host_cpu.name

print(os.path.join(cpu_family, cpu_codename))
8 changes: 8 additions & 0 deletions init_eessi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
echo "Initializing environment for EESSI..."

export EESSI_MOUNT="/tmp/cvmfs"
export EESSI_REPO="pilot.eessi-hpc.org"
export EESSI_CPU_SUBDIR="$(python eessi_cpu_subdir.py)"
export EESSI_PATH="$EESSI_MOUNT/$EESSI_REPO/$EESSI_CPU_SUBDIR"

echo ">> EESSI path: $EESSI_PATH"