Skip to content

Commit 8713202

Browse files
authored
Issue #613 - update conda env setup for CI images (#636)
* update conda env setup * init conda after env create * switch to conda run, add full-trace flag to sge pytests
1 parent 915cf3f commit 8713202

File tree

9 files changed

+20
-17
lines changed

9 files changed

+20
-17
lines changed

ci/htcondor.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ function jobqueue_before_install {
2121

2222
function jobqueue_install {
2323
cd ./ci/htcondor
24-
docker-compose exec -T submit /bin/bash -c "cd /dask-jobqueue; pip3 install -e .;chown -R submituser ."
24+
docker-compose exec -T submit conda run -n dask-jobqueue /bin/bash -c "cd /dask-jobqueue; pip3 install -e .;chown -R submituser ."
2525
cd -
2626
}
2727

2828
function jobqueue_script {
2929
cd ./ci/htcondor
30-
docker-compose exec -T --user submituser submit /bin/bash -c "cd; pytest /dask-jobqueue/dask_jobqueue --log-cli-level DEBUG --capture=tee-sys --verbose -E htcondor "
30+
docker-compose exec -T --user submituser submit conda run -n dask-jobqueue /bin/bash -c "cd; pytest /dask-jobqueue/dask_jobqueue --log-cli-level DEBUG --capture=tee-sys --verbose -E htcondor "
3131
cd -
3232
}
3333

ci/htcondor/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ RUN curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-L
77
ENV PATH /opt/anaconda/bin:$PATH
88
# environment.yml file is copied by CI script. If manually building, you should copy it too from parent directory
99
COPY environment.yml .
10-
RUN conda env update -n base --file environment.yml
10+
RUN conda env create --file environment.yml
11+
SHELL ["conda", "run", "-n", "dask-jobqueue", "/bin/bash", "-c"]
1112

1213
FROM htcondor/execute:el7 as execute
1314

ci/pbs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ function jobqueue_before_install {
2020
}
2121

2222
function jobqueue_install {
23-
docker exec pbs_master /bin/bash -c "cd /dask-jobqueue; pip install -e .; chown -R pbsuser ."
23+
docker exec pbs_master conda run -n dask-jobqueue /bin/bash -c "cd /dask-jobqueue; pip install -e .; chown -R pbsuser ."
2424
}
2525

2626
function jobqueue_script {
27-
docker exec -u pbsuser pbs_master /bin/bash -c "cd; pytest /dask-jobqueue/dask_jobqueue --verbose -s -E pbs"
27+
docker exec -u pbsuser pbs_master conda run -n dask-jobqueue /bin/bash -c "cd; pytest /dask-jobqueue/dask_jobqueue --verbose -s -E pbs"
2828
}
2929

3030
function jobqueue_after_script {

ci/pbs/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ RUN curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-L
3232
rm -f miniconda.sh
3333
# environment.yml file is copied by CI script. If manually building, you should copy it too from parent directory
3434
COPY environment.yml .
35-
RUN conda env update -n base --file environment.yml
35+
RUN conda env create --file environment.yml
36+
SHELL ["conda", "run", "-n", "dask-jobqueue", "/bin/bash", "-c"]
3637

3738
# Copy entrypoint and other needed scripts
3839
COPY ./*.sh /

ci/sge.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ function jobqueue_before_install {
1919
}
2020

2121
function jobqueue_install {
22-
docker exec sge_master /bin/bash -c "cd /dask-jobqueue; pip install -e ."
22+
docker exec sge_master conda run -n dask-jobqueue /bin/bash -c "cd /dask-jobqueue; pip install -e ."
2323
}
2424

2525
function jobqueue_script {
26-
docker exec sge_master /bin/bash -c "cd; pytest /dask-jobqueue/dask_jobqueue --verbose -s -E sge"
26+
docker exec sge_master conda run -n dask-jobqueue /bin/bash -c "cd; pytest /dask-jobqueue/dask_jobqueue --verbose --full-trace -s -E sge"
2727
}
2828

2929
function jobqueue_after_script {

ci/sge/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ RUN curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-L
1111
ENV PATH /opt/anaconda/bin:$PATH
1212
# environment.yml file is copied by CI script. If manually building, you should copy it too from parent directory
1313
COPY environment.yml .
14-
RUN conda env update -n base --file environment.yml
14+
RUN conda env create --file environment.yml
15+
SHELL ["conda", "run", "-n", "dask-jobqueue", "/bin/bash", "-c"]
1516

1617
COPY ./*.sh /
1718
COPY ./*.txt /

ci/sge/run-master.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ while ! ping -c1 slave_one &>/dev/null; do :; done
99
while ! qconf -sconf &>/dev/null; do sleep 0.1; done
1010
cat /var/lib/gridengine//default/common/act_qmaster
1111

12-
qconf -Msconf /scheduler.txt
13-
qconf -Ahgrp /hosts.txt
14-
qconf -Aq /queue.txt
12+
qconf -Msconf /dask-jobqueue/ci/sge/scheduler.txt
13+
qconf -Ahgrp /dask-jobqueue/ci/sge/hosts.txt
14+
qconf -Aq /dask-jobqueue/ci/sge/queue.txt
1515

1616
qconf -ah slave_one
1717
qconf -ah slave_two
18-
qconf -ah slave_three
1918

2019
qconf -as $HOSTNAME
2120
bash add_worker.sh dask.q slave_one 4

ci/slurm.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ function show_network_interfaces {
2222
for c in slurmctld c1 c2; do
2323
echo '------------------------------------------------------------'
2424
echo docker container: $c
25-
docker exec $c python -c 'import psutil; print(psutil.net_if_addrs().keys())'
25+
docker exec $c conda run -n dask-jobqueue python -c 'import psutil; print(psutil.net_if_addrs().keys())'
2626
echo '------------------------------------------------------------'
2727
done
2828
}
2929

3030
function jobqueue_install {
31-
docker exec slurmctld /bin/bash -c "cd /dask-jobqueue; pip install -e ."
31+
docker exec slurmctld conda run -n dask-jobqueue /bin/bash -c "cd /dask-jobqueue; pip install -e ."
3232
}
3333

3434
function jobqueue_script {
35-
docker exec slurmctld /bin/bash -c "cd; pytest /dask-jobqueue/dask_jobqueue --verbose -E slurm -s"
35+
docker exec slurmctld conda run -n dask-jobqueue /bin/bash -c "cd; pytest /dask-jobqueue/dask_jobqueue --verbose -E slurm -s"
3636
}
3737

3838
function jobqueue_after_script {

ci/slurm/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ RUN curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-L
99
ENV PATH /opt/anaconda/bin:$PATH
1010
# environment.yml file is copied by CI script. If manually building, you should copy it too from parent directory
1111
COPY environment.yml .
12-
RUN conda env update -n base --file environment.yml
12+
RUN conda env create --file environment.yml
13+
SHELL ["conda", "run", "-n", "dask-jobqueue", "/bin/bash", "-c"]
1314

1415
ENV LC_ALL en_US.UTF-8
1516

0 commit comments

Comments
 (0)