Skip to content

Commit

Permalink
Move changes to relevant scripts.
Browse files Browse the repository at this point in the history
Update meta.yaml
  • Loading branch information
mag1cp1n authored Oct 25, 2023
1 parent 98ec6c0 commit 954da73
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/gh-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
--base-image "$BASE_IMAGE" \
--image-tag "$IMAGE_TAG" \
--use-cuda "$USE_CUDA" \
--ucx-enabled "$USX-ENABLED" \
--source-dir . \
--build-type "${{ inputs.build-type }}"
Expand Down
18 changes: 17 additions & 1 deletion conda/conda-build/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
{# We need to have a default value for the initial pass over the recipe #}
{% set gpu_enabled_bool = false %}
{% endif %}
{% if ucx_enabled == "true" %}
{% set ucx_enabled_bool = true %}
{% elif ucx_enabled == "false" %}
{% set ucx_enabled_bool = false %}
{% else %}
{# We need to have a default value for the initial pass over the recipe #}
{% set ucx_enabled_bool = false %}
{% endif %}

{% if debug_build == "true" %}
{% set debug_build_bool = true %}
{% elif debug_build == "false" %}
Expand Down Expand Up @@ -47,6 +56,13 @@
{% set cpu_tag='' %}
{% endif %}

{% if not ucx_enabled_bool %}
{% set ucx_tag='_ucx' %}
{% else %}
{% set ucx_tag='' %}
{% endif %}


{% if debug_build_bool %}
{% set debug_tag='_debug' %}
{% else %}
Expand All @@ -72,7 +88,7 @@ build:
missing_dso_whitelist:
- '*libcuda.so*'

string: "cuda{{ cuda_major }}_py{{ py_version }}{{ git_describe_hash }}_{{ PKG_BUILDNUM }}{{ cpu_tag }}{{ debug_tag }}"
string: "cuda{{ cuda_major }}_py{{ py_version }}{{ git_describe_hash }}_{{ PKG_BUILDNUM }}{{ cpu_tag }}{{ ucx_tag }}{{ debug_tag }}"

script_env:
- SCCACHE_BUCKET
Expand Down
3 changes: 3 additions & 0 deletions continuous_integration/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ ENV CUDA_VERSION_MINOR=0
ARG USE_CUDA
ENV USE_CUDA=${USE_CUDA}

ARG UCX_ENABLED
ENV UCX_ENABLED=${UCX_ENABLED}

ENV USE_OPENMP=ON

ENV BUILD_MARCH=haswell
Expand Down
8 changes: 1 addition & 7 deletions continuous_integration/build-docker-image
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ do
--source-dir) SOURCE_DIR="$2"; shift;;
--build-type) BUILD_TYPE="$2"; shift;;
--use-cuda) USE_CUDA="$2"; shift;;
--ucx-enabled) UCX_ENABLED="$2"; shift;;
--local-build) LOCAL_BUILD="1";;
--) shift; break;;
*) echo "Invalid option: $1"; exit 1;;
Expand All @@ -34,13 +35,6 @@ done

set -e

if [ "$UCX_ENABLED" = "ON" ]; then
sed -i 's@DLegion_NETWORKS=@DLegion_NETWORKS=ucx@g' $SOURCE_DIR/continuous_integration/home/coder/.local/bin/build-legate-cpp
sed -i '\/conda-build\/conda_build_config\.yaml/a ucx:\n\ - ">=1.14"' $SOURCE_DIR/continuous_integration/home/coder/.local/bin/build-legate-conda
sed -i 's/\-\-no\-ucx/\-\-ucx /g' $SOURCE_DIR/continuous_integration/home/coder/.local/bin/conda-utils
sed -i '/-c conda-forge pytest/s/$/ ucx openmpi/g' $SOURCE_DIR/continuous_integration/home/coder/.local/bin/run-test-or-analysis
fi

# Avoid build errors due to a missing .creds folder
mkdir -p "$SOURCE_DIR/.creds"

Expand Down
12 changes: 11 additions & 1 deletion continuous_integration/home/coder/.local/bin/build-legate-conda
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ build_legate_conda_package() {
GPU_ENABLED=true
[ "${USE_CUDA:-}" = "OFF" ] && GPU_ENABLED=false

conda_build_args+=(--variants "{gpu_enabled:${GPU_ENABLED},python:${python_version}}");
CONFIGURE_UCX=true
[ "${UCX_ENABLED:-}" = "OF" ] && CONFIGURE_UCX=false

conda_build_args+=(--variants "{gpu_enabled:${GPU_ENABLED},python:${python_version},ucx_enabled:${UCX_ENABLED}}");

rm -rf /tmp/legate;
cp -ar ~/legate /tmp/legate;
Expand Down Expand Up @@ -57,6 +60,13 @@ package_version:
- "$(git -C /tmp/legate describe --abbrev=0 --tags | sed 's/[a-zA-Z]//g' | cut -d '.' -f -2).00"
EOF

if [ "$UCX_ENABLED" = "ON" ]; then
cat <<EOF >> /tmp/legate/conda/conda-build/conda_build_config.yaml
ucx:
>=1.14
EOF
fi
cat /tmp/legate/conda/conda-build/conda_build_config.yaml
cat <<EOF > /tmp/legate/conda/conda-build/build.sh
# Install legate_core C++ libs
tar -C "\$PREFIX" --exclude="*.a" --strip-components=1 -xf /tmp/out/legate_core-*-Linux.tar.gz;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build_legate_cpp() {
cmake_args+=(-DBUILD_MARCH=${BUILD_MARCH:-haswell});
cmake_args+=(-DCMAKE_BUILD_TYPE=Release);
cmake_args+=(-DLegion_CUDA_ARCH=all-major);
cmake_args+=(-DLegion_NETWORKS=);
cmake_args+=(-DLegion_NETWORKS=${UCS_ENABLED:-ucx});
cmake_args+=(-DLegion_USE_Python=ON);
cmake_args+=(-DLegion_PYTHON_EXTRA_INSTALL_ARGS="--root;/;--prefix;\"\${CMAKE_INSTALL_PREFIX}\"");
cmake_args+=(-DLegion_Python_Version=$(python3 --version 2>&1 | cut -d' ' -f2 | cut -d'.' -f3 --complement));
Expand Down
4 changes: 3 additions & 1 deletion continuous_integration/home/coder/.local/bin/conda-utils
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ generate_yaml_file() {
fi

cd ~/;
CONFIGURE_UCX=ucx
[ "${UCS_ENABLED:-}" = "OFF" ] && CONFIGURE_UCX=no-ucx
yaml_file=~/"$( \
~/legate/scripts/generate-conda-envs.py \
--os linux \
--compilers \
--ctk ${cuda_version} \
--python ${python_version} \
--openmpi \
--no-ucx \
--${CONFIGURE_UCX} \
| head -n1 | cut -d' ' -f3 \
)"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ run_test_or_analysis() {

case "$1" in
"unit")
ucx_libs=
[ "${UCS_ENABLED:-}" = "ON" ] && usx_libs=ucx openmpi
echo "Executing unit tests..."
mamba install -y -n "${DEFAULT_CONDA_ENV:-legate}" -c conda-forge pytest pytest-mock ipython jupyter_client ucx openmpi
mamba install -y -n "${DEFAULT_CONDA_ENV:-legate}" -c conda-forge pytest pytest-mock ipython jupyter_client $ucx_libs
cd ~/legate/tests/unit
pytest -v --verbosity=6
;;
Expand Down

0 comments on commit 954da73

Please sign in to comment.