Skip to content

Commit ecf7c69

Browse files
committed
Split env installation into a separate step
1 parent 7bc7c16 commit ecf7c69

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

.github/workflows/build-test-reusable.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ jobs:
8888
path: $HOME/miniforge3/envs/triton
8989
key: conda-${{ inputs.env_manager }}-py${{ matrix.python }}-${{ hashFiles('scripts/triton.yml', 'python/pyproject.toml', 'python/setup.py') }}-${{ env.CACHE_NUMBER }}
9090

91+
- name: Install Manager Environment
92+
run: |
93+
install-env
94+
9195
- name: Print inputs
9296
run: |
9397
cat <<EOF

scripts/run-base.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22

3+
install_env() {
4+
:
5+
}
6+
37
source /opt/intel/oneapi/setvars.sh >/dev/null
48

59
script_dir=$(dirname "$0")

scripts/run-conda.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
#!/bin/bash
22

3-
install_conda() {
3+
install_env() {
44
conda create -n triton --override-channels -c conda-forge python=$python_version.*
55
conda env update -f scripts/triton.yml
66
find /opt/intel/oneapi/ \( -name '*.so' -or -name '*.so.*' \) -exec cp -n {} $HOME/miniforge3/envs/triton/lib \;
77
ln -snf /usr/include/level_zero $HOME/miniforge3/envs/triton/bin/../x86_64-conda-linux-gnu/sysroot/usr/include/level_zero
88
find /usr -name libze_\* -exec cp -n {} $HOME/miniforge3/envs/triton/lib \;
9-
conda info
10-
conda list -n triton
119
}
1210

1311
source /opt/intel/oneapi/setvars.sh >/dev/null
@@ -18,7 +16,5 @@ script_dir=$(dirname "$0")
1816
source "$script_dir/run-util.sh"
1917

2018
export PATH="$HOME/miniforge3/bin:$PATH"
21-
test -d "$HOME/miniforge3/envs/triton" || install_conda
22-
print_conda_info
2319

2420
conda run --no-capture-output -n triton bash "$script_name"

scripts/run-util.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
print_conda_info() {
2-
test ! -f first_run || return 0
3-
touch first_run
1+
print_env_info() {
42
conda info
53
conda list -n triton
64
}
@@ -11,6 +9,11 @@ while [ -v 1 ]; do
119
python_version=$2
1210
shift 2
1311
;;
12+
install-env)
13+
install_env
14+
print_env_info
15+
exit 0
16+
;;
1417
*)
1518
script_name=$1
1619
shift

0 commit comments

Comments
 (0)