File tree Expand file tree Collapse file tree 6 files changed +32
-10
lines changed Expand file tree Collapse file tree 6 files changed +32
-10
lines changed Original file line number Diff line number Diff line change 1
- # TODO: We might need to update this to install flatbuffers from the pinned commit
2
- # in fbcode/executorch/third-party/flatbuffers.submodule.txt
3
- flatbuffers=2.0.0
4
1
cmake=3.22.1
Original file line number Diff line number Diff line change 20
20
21
21
# As Linux job is running inside a Docker container, all of its dependencies
22
22
# have already been installed
23
+ install_flatc_from_source
23
24
install_executorch
24
25
build_executorch_runner " ${BUILD_TOOL} "
Original file line number Diff line number Diff line change @@ -80,5 +80,6 @@ install_buck
80
80
install_conda
81
81
install_pip_dependencies
82
82
print_cmake_info
83
+ install_flatc_from_source
83
84
install_executorch
84
85
build_executorch_runner " ${BUILD_TOOL} "
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ install_executorch() {
27
27
install_conda () {
28
28
pushd .ci/docker || return
29
29
# Install conda dependencies like flatbuffer
30
- conda install --file conda-env-ci.txt
30
+ conda install -y - -file conda-env-ci.txt
31
31
popd || return
32
32
}
33
33
@@ -49,6 +49,25 @@ install_pip_dependencies() {
49
49
popd || return
50
50
}
51
51
52
+ install_flatc_from_source () {
53
+ # NB: This function could be used to install flatbuffer from source
54
+ pushd third-party/flatbuffers || return
55
+
56
+ cmake -G " Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
57
+ if [ " $( uname) " == " Darwin" ]; then
58
+ CMAKE_JOBS=$(( $(sysctl - n hw.ncpu) - 1 ))
59
+ else
60
+ CMAKE_JOBS=$(( $(nproc) - 1 ))
61
+ fi
62
+ cmake --build . -j " ${CMAKE_JOBS} "
63
+
64
+ # Copy the flatc binary to conda path
65
+ EXEC_PATH=$( dirname " $( which python) " )
66
+ cp flatc " ${EXEC_PATH} "
67
+
68
+ popd || return
69
+ }
70
+
52
71
build_executorch_runner_buck2 () {
53
72
# Build executorch runtime with retry as this step is flaky on macos CI
54
73
retry buck2 build //examples/executor_runner:executor_runner
Original file line number Diff line number Diff line change 15
15
jobs :
16
16
linux :
17
17
uses : pytorch/test-infra/.github/workflows/linux_job.yml@main
18
+ strategy :
19
+ matrix :
20
+ include :
21
+ - build-tool : buck2
18
22
with :
19
23
runner : linux.2xlarge
20
24
docker-image : ${{ inputs.docker-image }}
28
32
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
29
33
conda activate "${CONDA_ENV}"
30
34
31
- # Just need to install executorch, everything else has been setup
32
- pip install .
35
+ BUILD_TOOL=${{ matrix.build-tool }}
36
+ # Setup MacOS dependencies as there is no Docker support on MacOS atm
37
+ PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
38
+
33
39
# Run pytest with coverage
34
40
pytest -n auto --cov=./ --cov-report=xml
35
41
53
59
# Setup MacOS dependencies as there is no Docker support on MacOS atm
54
60
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-macos.sh "${BUILD_TOOL}"
55
61
56
- # Just need to install executorch, everything else has been setup
57
- pip install .
58
62
# Run pytest with coverage
59
63
pytest -n auto --cov=./ --cov-report=xml
60
64
# Run gtest
Original file line number Diff line number Diff line change @@ -130,12 +130,12 @@ jobs:
130
130
ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
131
131
script : |
132
132
WORKSPACE=$(pwd)
133
-
134
133
pushd "${WORKSPACE}/pytorch/executorch"
135
134
136
135
BUILD_TOOL=${{ matrix.build-tool }}
137
136
# Setup MacOS dependencies as there is no Docker support on MacOS atm
138
137
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-macos.sh "${BUILD_TOOL}"
138
+
139
139
# Build and test custom ops
140
140
PYTHON_EXECUTABLE=python bash examples/custom_ops/test_custom_ops.sh "${BUILD_TOOL}"
141
141
popd
@@ -179,12 +179,12 @@ jobs:
179
179
ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
180
180
script : |
181
181
WORKSPACE=$(pwd)
182
-
183
182
pushd "${WORKSPACE}/pytorch/executorch"
184
183
185
184
BUILD_TOOL=${{ matrix.build-tool }}
186
185
# Setup MacOS dependencies as there is no Docker support on MacOS atm
187
186
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-macos.sh "${BUILD_TOOL}"
187
+
188
188
# Build and test selective build
189
189
PYTHON_EXECUTABLE=python bash examples/selective_build/test_selective_build.sh "${BUILD_TOOL}"
190
190
popd
You can’t perform that action at this time.
0 commit comments