Skip to content

Commit 5d0eb93

Browse files
committed
Refactor installation scripts to improve environment setup and streamline installation process
1 parent 5facb00 commit 5d0eb93

3 files changed

Lines changed: 25 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ jobs:
6565
key: ${{ runner.os }}-rmgpy-${{ hashFiles('ARC/devtools/install_rmg.sh') }}
6666
restore-keys: ${{ runner.os }}-rmgpy-
6767

68-
- name: Build ARC (make install)
68+
- name: Install all extras
6969
shell: micromamba-shell {0}
7070
working-directory: ARC
71-
run: make install
71+
run: bash devtools/install_all.sh --no-clean
7272

7373
- name: Run Unit Tests
7474
shell: micromamba-shell {0}

devtools/install_all.sh

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
#!/bin/bash -l
1+
#!/usr/bin/env bash
22
set -euo pipefail
33

4+
###################################################################################
5+
# Flag for cleaning
6+
#################################################################################
7+
SKIP_CLEAN=false
8+
[[ "${1:-}" == --no-clean ]] && SKIP_CLEAN=true
9+
10+
411
# -----------------------------------------------------------------------------
512
# Helper: aggressively clean conda/micromamba caches & remove any known build
613
# directories in our workspace. Ignores any permission errors.
@@ -41,56 +48,56 @@ pushd . >/dev/null
4148
# 1) RMG
4249
echo "=== Installing RMG ==="
4350
bash devtools/install_rmg.sh
44-
cleanup_disk
51+
! $SKIP_CLEAN && cleanup_disk
4552

4653
# 2) PyRDL
4754
echo "=== Installing PyRDL ==="
4855
bash devtools/install_pyrdl.sh
49-
cleanup_disk
56+
! $SKIP_CLEAN && cleanup_disk
5057

5158
# 3) ARC itself (skip env creation in CI)
5259
if [[ -z "${CI:-}" ]]; then
5360
echo "=== Installing ARC ==="
5461
bash devtools/install_arc.sh
55-
cleanup_disk
62+
! $SKIP_CLEAN && cleanup_disk
5663
else
5764
echo "ℹ️ CI detected, skipping arc_env creation."
5865
fi
5966

6067
# 4) GCN (CPU)
6168
echo "=== Installing GCN CPU ==="
6269
bash devtools/install_gcn_cpu.sh
63-
cleanup_disk
70+
! $SKIP_CLEAN && cleanup_disk
6471

6572
# 5) AutoTST
6673
echo "=== Installing AutoTST ==="
6774
bash devtools/install_autotst.sh
68-
cleanup_disk
75+
! $SKIP_CLEAN && cleanup_disk
6976

7077
# 6) KinBot
7178
echo "=== Installing KinBot ==="
7279
bash devtools/install_kinbot.sh
73-
cleanup_disk
80+
! $SKIP_CLEAN && cleanup_disk
7481

7582
# 7) Open Babel
7683
echo "=== Installing OpenBabel ==="
7784
bash devtools/install_ob.sh
78-
cleanup_disk
85+
! $SKIP_CLEAN && cleanup_disk
7986

8087
# 8) xtb
8188
echo "=== Installing xtb ==="
8289
bash devtools/install_xtb.sh
83-
cleanup_disk
90+
! $SKIP_CLEAN && cleanup_disk
8491

8592
# 9) Sella
8693
echo "=== Installing Sella ==="
8794
bash devtools/install_sella.sh
88-
cleanup_disk
95+
! $SKIP_CLEAN && cleanup_disk
8996

9097
# 10) TorchANI
9198
echo "=== Installing TorchANI ==="
9299
bash devtools/install_torchani.sh
93-
cleanup_disk
100+
! $SKIP_CLEAN && cleanup_disk
94101

95102
popd >/dev/null
96103

devtools/install_rmg.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ cd "$RMG_PY_PATH"
6868
echo "📚 Creating conda env: $ENV_NAME"
6969
$COMMAND env create -n "$ENV_NAME" -f environment.yml || {
7070
echo "⚠️ Environment likely exists; trying update..."
71-
$COMMAND env update -n "$ENV_NAME" -f environment.yml
71+
if [[ "$COMMAND" == micromamba ]]; then
72+
micromamba env update -n "$ENV_NAME" --file environment.yml
73+
else
74+
$COMMAND env update -n "$ENV_NAME" -f environment.yml
75+
fi
7276
}
7377

7478
###############################################################################

0 commit comments

Comments
 (0)