This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
169 lines (149 loc) · 5.68 KB
/
nightly-conda.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: TorchArrow Nightly Build and Test for Conda
on:
schedule:
- cron: "0 0 * * *"
# Use the following to trigger test on a dev PR
# pull_request:
# branches:
# - main
# # For PR created by ghstack
# - gh/*/*/base
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
linux-container:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- 3.7
- 3.8
- 3.9
steps:
- name: Print CPU info
run: |
cat /proc/cpuinfo
- name: Create Conda Env
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
activate-environment: conda_build_env
- name: Check out source repository
uses: actions/checkout@v2
with:
submodules: recursive
# Based on https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
run: |
echo "::set-output name=timestamp::$(/bin/date -u "+%Y%m%d-%H:%M:%S")"
shell: bash
- name: Load ccache files
uses: actions/cache@v2
with:
path: .ccache
key: ubuntu-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
ubuntu-ccache-
- name: Install dependencies with APT
run: |
sudo apt-get update
sudo apt install -y g++ cmake ccache ninja-build checkinstall git \
libssl-dev libboost-all-dev libdouble-conversion-dev libgoogle-glog-dev \
libgflags-dev libevent-dev libre2-dev libfl-dev libbison-dev
# Based on https://github.com/facebookincubator/velox/blob/99429407c3d524e07b32b8b19a03aa7382f819cf/.circleci/config.yml#L114-L116
- name: Configure ccache
run: |
echo "$GITHUB_WORKSPACE"
CCACHE_DIR=$GITHUB_WORKSPACE/.ccache_root ccache -sz -M 1G
CCACHE_DIR=$GITHUB_WORKSPACE/.ccache ccache -sz -M 1G
- name: Build and install folly and fmt
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CCACHE_DIR: $GITHUB_WORKSPACE/.ccache_root
CPU_TARGET: sse
# sudo doesn't preserve environment vairable; set it after sudo: https://stackoverflow.com/questions/8633461/how-to-keep-environment-variables-when-using-sudo/33183620#33183620
run: |
sudo scripts/setup-ubuntu.sh
- name: Conda Build
shell: bash -l {0}
env:
PYTHON_VERSION: ${{ matrix.python-version }}
CPU_TARGET: sse
run: |
# source /opt/conda/etc/profile.d/conda.sh
conda activate conda_build_env
conda install -yq conda-build -c conda-forge
./packaging/build_conda.sh
- name: Conda Upload
shell: bash -l {0}
env:
PYTHON_VERSION: ${{ matrix.python-version }}
CONDA_NIGHTLY_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_NIGHTLY_PYTORCHBOT_TOKEN }}
CONDA_CHANNEL: pytorch-nightly
run: |
conda install -yq -c anaconda anaconda-client
anaconda -t "${CONDA_NIGHTLY_PYTORCHBOT_TOKEN}" upload ./conda-bld/linux-64/torcharrow-*.tar.bz2 -u "$CONDA_CHANNEL" --label main --no-progress --force
macos-container:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version:
- 3.7
- 3.8
- 3.9
steps:
- name: Create Conda Env
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
activate-environment: conda_build_env
- name: Check out source repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies from Brew
run: |
brew install --formula ninja flex bison cmake ccache icu4c boost gflags glog libevent
- name: Conda Build
shell: bash -l {0}
env:
PYTHON_VERSION: ${{ matrix.python-version }}
MACOSX_DEPLOYMENT_TARGET: 10.15
CPU_TARGET: sse
run: |
conda activate conda_build_env
conda install -yq conda-build -c conda-forge
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:
PYTHON_VERSION: ${{ matrix.python-version }}
CONDA_NIGHTLY_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_NIGHTLY_PYTORCHBOT_TOKEN }}
run: |
conda install -yq anaconda-client
anaconda -t "${CONDA_NIGHTLY_PYTORCHBOT_TOKEN}" upload ./conda-bld/osx-64/torcharrow-*.tar.bz2 -u "$CONDA_CHANNEL" --label main --no-progress --force