Skip to content

Commit

Permalink
Merge branch 'master' of github.com:trxcllnt/rapids-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Jan 12, 2022
2 parents 281198d + 5deb6b2 commit 2cba8ea
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ To debug tests running in the container, use the `rapids.cudf.pytest.debug`:
make rapids.cudf.pytest.debug args="-k 'test_reindex_dataframe'"
```

This launches pytest with `ptvsd` for debugging in VSCode.
This launches pytest with `debugpy` for debugging in VSCode.


### Working interactively in the RAPIDS container
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/rapids.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [[ "$USE_FISH_SHELL" == "YES" ]]; then \
fi' \
&& apt update \
&& apt install --no-install-recommends -y \
jq ed git vim nano sudo curl wget entr \
jq ed git vim nano sudo curl wget entr less \
# CMake dependencies
curl libssl-dev libcurl4-openssl-dev zlib1g-dev \
# Need tzdata for the pyarrow<->ORC tests
Expand Down
6 changes: 3 additions & 3 deletions etc/bash-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
# Commands to run each project's pytests:
#
# Note: These commands automatically change into the correct directory before executing `pytest`.
# Note: Pass --debug to use with the VSCode debugger `ptvsd`. All other arguments are forwarded to pytest.
# Note: Pass --debug to use with the VSCode debugger `debugpy`. All other arguments are forwarded to pytest.
# Note: Arguments that end in '.py' are assumed to be pytest files used to reduce the number of tests
# collected on startup by pytest. These arguments will be expanded out to their full paths relative
# to the directory where pytests is run.
Expand All @@ -143,7 +143,7 @@
# Usage:
# test-cudf-python -n <num_cores> - Run all pytests in parallel with `pytest-xdist`
# test-cudf-python -v -x -k 'a_test_function_name' - Run all tests named 'a_test_function_name', be verbose, and exit on first fail
# test-cudf-python -v -x -k 'a_test_function_name' --debug - Run all tests named 'a_test_function_name', and start ptvsd for VSCode debugging
# test-cudf-python -v -x -k 'a_test_function_name' --debug - Run all tests named 'a_test_function_name', and start debugpy for VSCode debugging
# test-cudf-python -v -x -k 'test_a or test_b' foo/test_file.py - Run all tests named 'test_a' or 'test_b' in file paths matching foo/test_file.py
#
###
Expand Down Expand Up @@ -1259,7 +1259,7 @@ test-python() {
if [[ $debug != true ]]; then
eval "set -x; pytest $args $paths";
else
eval "set -x; python -m ptvsd --host 0.0.0.0 --port 5678 --wait -m pytest $args $paths";
eval "set -x; python -m debugpy --listen 0.0.0.0:5678 --wait-for-client -m pytest $args $paths";
fi
)
}
Expand Down
26 changes: 21 additions & 5 deletions etc/conda-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,21 @@ touch $INSIDE__ENV_YML
CHANGED="$(diff -qw $OUTSIDE_ENV_YML $INSIDE__ENV_YML || true)"

FRESH_CONDA_ENV=${FRESH_CONDA_ENV:-0}
RECREATE_CONDA_ENV=0

# if no directory for the conda env, create the conda env
if [ ! -d "$CONDA_HOME/envs/$ENV_NAME" ]; then
FRESH_CONDA_ENV=1
create-conda-env() {
# create a new environment
mamba update -n base -c defaults conda
mamba update -n base -c conda-forge mamba
mamba env create -n $ENV_NAME --file $INSIDE__ENV_YML
# copy the conda environment.yml from inside the container to the outside
cp $INSIDE__ENV_YML $OUTSIDE_ENV_YML
}

# if no directory for the conda env, create the conda env
if [ ! -d "$CONDA_HOME/envs/$ENV_NAME" ]; then
FRESH_CONDA_ENV=1
create-conda-env
# otherwise if the environment.yml inside/outside are different, update the existing conda env
elif [ -n "${CHANGED// }" ]; then
(
Expand Down Expand Up @@ -91,17 +96,28 @@ elif [ -n "${CHANGED// }" ]; then
cp $INSIDE__ENV_YML $OUTSIDE_ENV_YML
else
while true; do
read -p "Failed to update conda environment. Continue anyway? (Y/N, default: Y) " CHOICE </dev/tty
echo "Failed to update conda environment. Select how to proceed."
echo "(Y) Continue anyway."
echo "(N) Exit."
echo "(R) Remove and re-create the conda environment from scratch instead of upgrading."
read -p "Choose an action to continue (Y/N/R, default: Y) " CHOICE </dev/tty
if [ "$CHOICE" = "" ]; then CHOICE="Y"; fi
case $CHOICE in
[Nn]* ) exit 1;;
[Rr]* ) RECREATE_CONDA_ENV=1; break;;
[Yy]* ) break;;
* ) echo "Please answer 'y' or 'n'";;
* ) echo "Please answer Y/N/R."
esac
done
fi
fi

if [ "$RECREATE_CONDA_ENV" -eq "1" ]; then
mamba env remove --name $ENV_NAME
FRESH_CONDA_ENV=1
create-conda-env
fi

export FRESH_CONDA_ENV

rm -f "$RAPIDS_HOME/rmm.yml" || true >/dev/null 2>&1;
Expand Down
2 changes: 1 addition & 1 deletion etc/conda-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies:
- pytest-xdist
- python=${PYTHON_VERSION}
- pip:
- ptvsd
- debugpy
EOF

CUDA_TOOLKIT_VERSION=${CONDA_CUDA_TOOLKIT_VERSION:-$CUDA_SHORT_VERSION};
Expand Down
3 changes: 3 additions & 0 deletions etc/rapids/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ shopt -s checkwinsize
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# Support UTF-8 characters in less
export LESSCHARSET='utf-8'

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
Expand Down

0 comments on commit 2cba8ea

Please sign in to comment.