Skip to content

Commit

Permalink
Issue dask#613 - update conda env setup for CI images (dask#636)
Browse files Browse the repository at this point in the history
* update conda env setup

* init conda after env create

* switch to conda run, add full-trace flag to sge pytests
  • Loading branch information
kaelancotter authored Mar 22, 2024
1 parent 915cf3f commit 8713202
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 17 deletions.
4 changes: 2 additions & 2 deletions ci/htcondor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ function jobqueue_before_install {

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

function jobqueue_script {
cd ./ci/htcondor
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 "
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 "
cd -
}

Expand Down
3 changes: 2 additions & 1 deletion ci/htcondor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ RUN curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-L
ENV PATH /opt/anaconda/bin:$PATH
# environment.yml file is copied by CI script. If manually building, you should copy it too from parent directory
COPY environment.yml .
RUN conda env update -n base --file environment.yml
RUN conda env create --file environment.yml
SHELL ["conda", "run", "-n", "dask-jobqueue", "/bin/bash", "-c"]

FROM htcondor/execute:el7 as execute

Expand Down
4 changes: 2 additions & 2 deletions ci/pbs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ function jobqueue_before_install {
}

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

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

function jobqueue_after_script {
Expand Down
3 changes: 2 additions & 1 deletion ci/pbs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ RUN curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-L
rm -f miniconda.sh
# environment.yml file is copied by CI script. If manually building, you should copy it too from parent directory
COPY environment.yml .
RUN conda env update -n base --file environment.yml
RUN conda env create --file environment.yml
SHELL ["conda", "run", "-n", "dask-jobqueue", "/bin/bash", "-c"]

# Copy entrypoint and other needed scripts
COPY ./*.sh /
Expand Down
4 changes: 2 additions & 2 deletions ci/sge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ function jobqueue_before_install {
}

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

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

function jobqueue_after_script {
Expand Down
3 changes: 2 additions & 1 deletion ci/sge/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ RUN curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-L
ENV PATH /opt/anaconda/bin:$PATH
# environment.yml file is copied by CI script. If manually building, you should copy it too from parent directory
COPY environment.yml .
RUN conda env update -n base --file environment.yml
RUN conda env create --file environment.yml
SHELL ["conda", "run", "-n", "dask-jobqueue", "/bin/bash", "-c"]

COPY ./*.sh /
COPY ./*.txt /
Expand Down
7 changes: 3 additions & 4 deletions ci/sge/run-master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ while ! ping -c1 slave_one &>/dev/null; do :; done
while ! qconf -sconf &>/dev/null; do sleep 0.1; done
cat /var/lib/gridengine//default/common/act_qmaster

qconf -Msconf /scheduler.txt
qconf -Ahgrp /hosts.txt
qconf -Aq /queue.txt
qconf -Msconf /dask-jobqueue/ci/sge/scheduler.txt
qconf -Ahgrp /dask-jobqueue/ci/sge/hosts.txt
qconf -Aq /dask-jobqueue/ci/sge/queue.txt

qconf -ah slave_one
qconf -ah slave_two
qconf -ah slave_three

qconf -as $HOSTNAME
bash add_worker.sh dask.q slave_one 4
Expand Down
6 changes: 3 additions & 3 deletions ci/slurm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ function show_network_interfaces {
for c in slurmctld c1 c2; do
echo '------------------------------------------------------------'
echo docker container: $c
docker exec $c python -c 'import psutil; print(psutil.net_if_addrs().keys())'
docker exec $c conda run -n dask-jobqueue python -c 'import psutil; print(psutil.net_if_addrs().keys())'
echo '------------------------------------------------------------'
done
}

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

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

function jobqueue_after_script {
Expand Down
3 changes: 2 additions & 1 deletion ci/slurm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ RUN curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-L
ENV PATH /opt/anaconda/bin:$PATH
# environment.yml file is copied by CI script. If manually building, you should copy it too from parent directory
COPY environment.yml .
RUN conda env update -n base --file environment.yml
RUN conda env create --file environment.yml
SHELL ["conda", "run", "-n", "dask-jobqueue", "/bin/bash", "-c"]

ENV LC_ALL en_US.UTF-8

Expand Down

0 comments on commit 8713202

Please sign in to comment.