Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/nightly-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,29 @@ jobs:
scripts/build_mac_dep.sh ranges_v3 fmt double_conversion folly re2
./packaging/build_conda.sh

- name: Fix Velox Dylib Paths
shell: bash -l {0}
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
cd conda-bld/osx-64
pkg_name=`ls ./torcharrow-* | sed -n -e 's/.*\(torcharrow.*\).tar.bz2/\1/p'`
mkdir ./${pkg_name}
tar -xf ./${pkg_name}.tar.bz2 -C ./${pkg_name}
rm ./${pkg_name}.tar.bz2
cd ./${pkg_name}

source ${GITHUB_WORKSPACE}/packaging/fix_conda_dylib_paths.sh
conda_lib_folder=lib/python${PYTHON_VERSION}/site-packages/torcharrow
so_name=`ls ${conda_lib_folder}/_torcharrow.* | sed -n -e 's/.*\(_torcharrow.*\.so\)/\1/p'`
fix_velox_dylib_paths ${conda_lib_folder}/${so_name}
otool -L ${conda_lib_folder}/${so_name}

tar -cjf ../${pkg_name}.tar.bz2 *
cd ..
rm -rf ./${pkg_name}
cd ../..

- name: Conda Upload
shell: bash -l {0}
env:
Expand Down
2 changes: 1 addition & 1 deletion packaging/build_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ setup_env 0.1
setup_conda_pytorch_constraint

mkdir -p conda-bld
conda build $CONDA_CHANNEL_FLAGS --no-anaconda-upload --output-folder conda-bld --python "$PYTHON_VERSION" packaging/torcharrow
conda build $CONDA_CHANNEL_FLAGS -c conda-forge --no-anaconda-upload --output-folder conda-bld --python "$PYTHON_VERSION" packaging/torcharrow
39 changes: 39 additions & 0 deletions packaging/fix_conda_dylib_paths.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

function fix_velox_dylib_paths() {
velox_so=$1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we check there is exactly one parameter ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you elaborate?


# other libs
libs="libgflags libglog libz libssl libcrypto libbz2 liblz4 libzstd libsodium"

for libx in ${libs}
do
liby=$(otool -L "${velox_so}" | sed -n -e "s/\\(.*${libx}\..*dylib\\).*/\\1/p" | tr -d '[:blank:]')

install_name_tool -change "${liby}" "@loader_path/../../../${libx}.dylib" "${velox_so}"
done

libx=libevent
# libevent
liby=$(otool -L "${velox_so}" | sed -n -e "s/\\(.*${libx}-.*dylib\\).*/\\1/p" | tr -d '[:blank:]')
install_name_tool -change "${liby}" "@loader_path/../../../${libx}.dylib" "${velox_so}"

# boost libs
boost_libs="libboost_context libboost_filesystem libboost_atomic libboost_regex libboost_system libboost_thread"

for libx in ${boost_libs}
do
liby=$(otool -L "${velox_so}" | sed -n -e "s/\\(.*${libx}.*dylib\\).*/\\1/p" | tr -d '[:blank:]')

install_name_tool -change "${liby}" "@loader_path/../../../${libx}.dylib" "${velox_so}"
done

libx=libboost_program
liby=$(otool -L "${velox_so}" | sed -n -e "s/\\(.*${libx}.*dylib\\).*/\\1/p" | tr -d '[:blank:]')
install_name_tool -change "${liby}" "@loader_path/../../../${libx}_options.dylib" "${velox_so}"
}
12 changes: 7 additions & 5 deletions packaging/torcharrow/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,22 @@ requirements:
- typing
- tabulate
- pyarrow
- arrow
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw arrow on conda is a completely different lib ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and arrow-cpp

- arrow-cpp==8.0.0
- cffi
- glog==0.4.0
- glog==0.6.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anything changed on Velox side?

Copy link
Contributor Author

@bearzx bearzx Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think velox always uses the glog installed from brew, which was recently updated from 0.5.0 to 0.6.0. Building with glog0.6.0 and running with glog0.4.0 will not work (some symbol not found error when running). However, the conda default channel hasn't updated to 0.6.0 yet, it only exists on conda-forge, hence this change.

Copy link
Contributor Author

@bearzx bearzx Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also why we need to specify -c conda-forge when installing.

- libsodium
{{ environ.get('CONDA_PYTORCH_CONSTRAINT') }}
- libboost
- libevent
- bzip2
- lz4-c

build:
string: py{{py}}
script_env:
- BUILD_VERSION
- CPU_TARGET
- PYTHON_VERSION

#GitHub Actions usually provide Mac without AVX2 support, for now just skip the test until Velox can be run without AVX2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the test is already enabled now, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, that's why I'm removing the stale comment here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might need to add command pytest --no-header -v torcharrow/test back the test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah here I'm only running an import test for now. For some reason the last time I ran the tests, there were some ones failing on some path comparison issues (don't remember the details, but something like comparing './abc' to 'abc failed). This will go into another PR to investigate.

#pytest --no-header -v torcharrow/test
test:
imports:
- torcharrow
Expand Down