Skip to content

Commit 405ac6c

Browse files
authored
14 user friendly installation (#12)
2 parents 876aaa8 + 34b8d6c commit 405ac6c

File tree

14 files changed

+34
-71
lines changed

14 files changed

+34
-71
lines changed

.gitlab-ci.yml

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
image: ghcr.io/itpplasma/devel-tex
22

3-
workflow:
4-
rules:
5-
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
6-
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
7-
- if: $CI_PIPELINE_SOURCE == "web"
8-
93
variables:
104
GIT_HTTPS: "true"
115

@@ -124,7 +118,7 @@ kim:
124118
- set_branch
125119
- clone_gitlab kim
126120
- cd kim
127-
- ../scripts/checkout_branch.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
121+
- ../scripts/checkout_branch.sh $CI_COMMIT_REF_NAME
128122
- mkdir build
129123
- cd build
130124
- cmake .. -DCMAKE_Fortran_FLAGS=-I/usr/include/hdf5/serial
@@ -145,7 +139,10 @@ neo2-job:
145139
- source activate.sh
146140
- pushd external; install_package fgsl 1.6.0; popd
147141
- clone_github NEO-2
148-
- scripts/setup/neo2.sh
142+
- cd NEO-2
143+
- ../scripts/checkout_branch.sh $CI_COMMIT_REF_NAME
144+
- make
145+
- cd python; pip install -e .
149146
artifacts:
150147
paths:
151148
- NEO-2/
@@ -176,7 +173,7 @@ simple:
176173
- source activate.sh
177174
- clone_github SIMPLE
178175
- cd SIMPLE
179-
- ../scripts/checkout_branch.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
176+
- ../scripts/checkout_branch.sh $CI_COMMIT_REF_NAME
180177
- make
181178
artifacts:
182179
paths:
@@ -191,7 +188,7 @@ gorilla:
191188
- set_branch
192189
- clone_github GORILLA
193190
- cd GORILLA
194-
- ../scripts/checkout_branch.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
191+
- ../scripts/checkout_branch.sh $CI_COMMIT_REF_NAME
195192
- ./build.sh
196193
artifacts:
197194
paths:

README.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ to setup development and use of internal and external codes. Our development
55
environment is Visual Studio Code, and we strongly recommend GitHub Copilot
66
there and in the [CLI](https://docs.github.com/en/copilot/github-copilot-in-the-cli/setting-up-github-copilot-in-the-cli).
77

8-
CODE is based around our standard Debian bookworm system at ITPcp and provides
8+
CODE is based around our standard Debian bookworm system at ITPcp and provides
99

1010
- Setup scripts `scripts/setup/...`
1111
- Quality-of-life shell commands via `scripts/util.sh`
@@ -42,19 +42,19 @@ Then open the directory in VS Code with
4242

4343
code code
4444

45-
When asked to initialize the devcontainer, remove the message.
45+
When asked to initialize the devcontainer, remove the message.
4646
Run the setup script manually with
4747

48-
source scripts/setup.sh
48+
scripts/setup.sh
4949

5050
The setup will install external dependencies and create and activate
5151
a Python virtual environment in the hidden `.venv` directory.
5252

53-
If you work outside a container, also manually put a line
53+
If you work outside a container, also manually run
5454

5555
source /path/to/code/activate.sh
5656

57-
in your bashrc.
57+
and put this line in your bashrc.
5858

5959

6060
## Testing
@@ -64,5 +64,3 @@ Integration tests are run by
6464
pytest tests/
6565

6666
This will perform all the tests in `tests/` and its subfolders.
67-
68-

images/devel/Dockerfile

-5
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,3 @@ COPY scripts/setup/debian/octave.sh /tmp/setup_octave.sh
2626
RUN apt-get update -y && bash /tmp/setup_octave.sh && \
2727
apt-get clean && rm -rf /var/cache/apt/* && \
2828
rm -rf /var/lib/apt/lists/* && rm -rf /tmp/*
29-
30-
# Prepare required packages for venv
31-
COPY requirements.txt .
32-
RUN python3 -m pip install -r requirements.txt --break-system-packages && \
33-
python3 -m pip cache purge

modules/mars/2022

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module-whatis "MARS (2022)"
44

5-
prereq nvhpc/24.5
5+
prereq nvhpc/24.1
66

77
setenv MARSHOME $env(CODE)/external/MARS/MarsQ_2022
88
prepend-path PATH $env(MARSHOME)

requirements.txt

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Basics
22
wheel
33
pip
4-
setuptools<65 # For f90wrap
4+
setuptools
55
jupyterlab
66
notebook
77
ipython
@@ -80,7 +80,3 @@ Shapely
8080
importlib-metadata
8181
freeqdsk
8282
freegs
83-
84-
# Simsopt
85-
simsopt
86-
booz-xform

scripts/setup.sh

100644100755
+8-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
#!/bin/bash
22

3+
set -e
4+
35
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
46

57
export CODE=$SCRIPTPATH/..
6-
export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=accept-new"
8+
export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=accept-new"
79

8-
source $CODE/scripts/setup/venv.sh
9-
source $CODE/activate.sh
10+
$CODE/scripts/setup/venv.sh
11+
source $CODE/.venv/bin/activate
1012

1113
pushd $CODE/external
12-
$CODE/scripts/setup/fgsl.sh
14+
$CODE/scripts/setup/fgsl.sh
15+
$CODE/scripts/setup/triangle.sh
1316
popd
1417

1518
pushd $CODE
16-
source $CODE/scripts/setup/libneo.sh
19+
$CODE/scripts/setup/libneo.sh
1720
popd
18-
19-
source $CODE/activate.sh

scripts/setup/archlinux.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ pacman -S --noconfirm --needed \
7272
pugixml \
7373
zstd \
7474
cppzmq \
75-
util-linux
75+
util-linux \
76+
graphviz
7677

7778
# The following packages need to be installed from the AUR:
7879
# - metis

scripts/setup/debian/libs.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ apt-get install -y -q --no-install-recommends \
2929
slepc-dev \
3030
h5utils \
3131
hdf5-tools \
32-
netcdf-bin
32+
netcdf-bin \
33+
graphviz

scripts/setup/libneo.sh

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22

33
set -e
4+
5+
source $CODE/scripts/util.sh
6+
47
echo "Building and installing 'efit_to_boozer'..."
58
if [ ! -d "efit_to_boozer" ] ; then
69
echo "Cloning 'efit_to_boozer'..."

scripts/setup/mac.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ eval "$(/usr/local/bin/brew shellenv)"
88
brew install gcc make cmake ninja [email protected] [email protected]
99
brew install autoconf automake autogen
1010
brew install openblas suitesparse metis
11-
brew install hdf5 netcdf netcdf-fortran fftw
11+
brew install hdf5 netcdf netcdf-fortran fftw graphviz
1212
brew install --cask orbstack devpod visual-studio-code
1313

1414
sudo ln -s /Applications/OrbStack.app/Contents/MacOS/xbin/docker /usr/local/bin/docker

scripts/setup/mars.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
set -e
4-
module load nvhpc/24.5
4+
module load nvhpc/24.1
55
git clone [email protected]:plasma/codes/mars.git MARS
66
cd MARS/MarsQ_2022
77
make

scripts/setup/neo2.sh

-31
This file was deleted.

scripts/setup/venv.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ source .venv/bin/activate
1919
python -m pip install --upgrade pip
2020
python -m pip install --upgrade meson
2121
python -m pip install --upgrade ninja
22-
python -m pip install -r requirements.txt
22+
python -m pip install --upgrade -r requirements.txt

scripts/util.sh

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ alias vscode='code $CODE'
1414
set_branch() {
1515
if [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" ]; then
1616
export CODE_BRANCH=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
17+
elif [ -n "$CI_COMMIT_REF_NAME" ]; then
18+
export CODE_BRANCH=$CI_COMMIT_REF_NAME
1719
else
1820
pushd $CODE
1921
export CODE_BRANCH=$(git branch --show-current)

0 commit comments

Comments
 (0)