Skip to content

Commit 580a27b

Browse files
authored
Merge pull request #530 from bark-simulator/pybind_bazel
Using pybind_bazel and build wheels for Linux/macOS(Python 3.7, 3.8, 3.9)
2 parents 97c7d5e + e2c8d37 commit 580a27b

File tree

47 files changed

+876
-325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+876
-325
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: ManyLinux
2+
3+
on: [push]
4+
5+
jobs:
6+
build_py36:
7+
runs-on: ubuntu-latest
8+
container:
9+
image: docker://barksim/bazel-manylinux
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Setting up virtual environment
13+
run: virtualenv --python=/opt/python/cp36-cp36m/bin/python ./bark/python_wrapper/venv
14+
- name: Getting into venv
15+
run: . ./bark/python_wrapper/venv/bin/activate
16+
- name: Installing Requirements
17+
run: ./bark/python_wrapper/venv/bin/pip3 install --upgrade pip && ./bark/python_wrapper/venv/bin/pip3 install -r ./tools/installers/requirements.txt
18+
- name: Building ManyLinux
19+
env:
20+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
21+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
22+
run: bash package.sh manylinux
23+
24+
build_py37:
25+
runs-on: ubuntu-latest
26+
container:
27+
image: docker://barksim/bazel-manylinux
28+
steps:
29+
- uses: actions/checkout@v1
30+
- name: Setting up virtual environment
31+
run: virtualenv --python=/opt/python/cp37-cp37m/bin/python ./bark/python_wrapper/venv
32+
- name: Getting into venv
33+
run: . ./bark/python_wrapper/venv/bin/activate
34+
- name: Installing Requirements
35+
run: ./bark/python_wrapper/venv/bin/pip3 install --upgrade pip && ./bark/python_wrapper/venv/bin/pip3 install -r ./tools/installers/requirements.txt
36+
- name: Building ManyLinux
37+
env:
38+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
39+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
40+
run: bash package.sh manylinux
41+
42+
build_py38:
43+
runs-on: ubuntu-latest
44+
container:
45+
image: docker://barksim/bazel-manylinux
46+
steps:
47+
- uses: actions/checkout@v1
48+
- name: Setting up virtual environment
49+
run: virtualenv --python=/opt/python/cp38-cp38m/bin/python ./bark/python_wrapper/venv
50+
- name: Getting into venv
51+
run: . ./bark/python_wrapper/venv/bin/activate
52+
- name: Installing Requirements
53+
run: ./bark/python_wrapper/venv/bin/pip3 install --upgrade pip && ./bark/python_wrapper/venv/bin/pip3 install -r ./tools/installers/requirements.txt
54+
- name: Building ManyLinux
55+
env:
56+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
57+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
58+
run: bash package.sh manylinux
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: BUILD_WHEELS_37
2+
3+
on:
4+
push:
5+
tags:
6+
- '**'
7+
8+
jobs:
9+
build_wheels:
10+
name: Build wheels on ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, macos-10.15]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
# Used to host cibuildwheel
21+
- uses: actions/setup-python@v2
22+
23+
- name: Install cibuildwheel
24+
run: python -m pip install twine cibuildwheel==1.11.0
25+
26+
- name: Build wheels for Linux
27+
if: matrix.os == 'ubuntu-latest'
28+
run: python -m cibuildwheel --output-dir wheelhouse
29+
env:
30+
CIBW_BEFORE_BUILD: bash tools/ci/pre_build.sh
31+
CIBW_BUILD: cp37-manylinux_x86_64
32+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
33+
CIBW_BUILD_VERBOSITY": 1
34+
35+
- name: Build wheels for macOS
36+
if: matrix.os == 'macOS-latest' || matrix.os == 'macOS-10.15'
37+
run: python -m cibuildwheel --output-dir wheelhouse
38+
env:
39+
CIBW_BEFORE_BUILD: bash tools/ci/pre_build.sh
40+
CIBW_BUILD: cp37-macosx_x86_64
41+
CIBW_ARCHS_MACOS: x86_64
42+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
43+
CIBW_BUILD_VERBOSITY": 1
44+
CIBW_ENVIRONMENT: BAZELISK_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Deploy wheels
47+
env:
48+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
49+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
50+
run: |
51+
python -m twine upload --skip-existing wheelhouse/*
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: BUILD_WHEELS_38
2+
3+
on:
4+
push:
5+
tags:
6+
- '**'
7+
8+
jobs:
9+
build_wheels:
10+
name: Build wheels on ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, macos-10.15]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
# Used to host cibuildwheel
21+
- uses: actions/setup-python@v2
22+
23+
- name: Install cibuildwheel
24+
run: python -m pip install twine cibuildwheel==1.11.0
25+
26+
- name: Build wheels for Linux
27+
if: matrix.os == 'ubuntu-latest'
28+
run: python -m cibuildwheel --output-dir wheelhouse
29+
env:
30+
CIBW_BEFORE_BUILD: bash tools/ci/pre_build.sh
31+
CIBW_BUILD: cp38-manylinux_x86_64
32+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
33+
CIBW_BUILD_VERBOSITY": 1
34+
35+
- name: Build wheels for macOS
36+
if: matrix.os == 'macOS-latest' || matrix.os == 'macOS-10.15'
37+
run: python -m cibuildwheel --output-dir wheelhouse
38+
env:
39+
CIBW_BEFORE_BUILD: bash tools/ci/pre_build.sh
40+
CIBW_BUILD: cp38-macosx_x86_64
41+
CIBW_ARCHS_MACOS: x86_64
42+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
43+
CIBW_BUILD_VERBOSITY": 1
44+
CIBW_ENVIRONMENT: BAZELISK_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Deploy wheels
47+
env:
48+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
49+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
50+
run: |
51+
python -m twine upload --skip-existing wheelhouse/*
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: BUILD_WHEELS_39
2+
3+
on:
4+
push:
5+
tags:
6+
- '**'
7+
8+
jobs:
9+
build_wheels:
10+
name: Build wheels on ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, macos-10.15]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
# Used to host cibuildwheel
21+
- uses: actions/setup-python@v2
22+
23+
- name: Install cibuildwheel
24+
run: python -m pip install twine cibuildwheel==1.11.0
25+
26+
- name: Build wheels for Linux
27+
if: matrix.os == 'ubuntu-latest'
28+
run: python -m cibuildwheel --output-dir wheelhouse
29+
env:
30+
CIBW_BEFORE_BUILD: bash tools/ci/pre_build.sh
31+
CIBW_BUILD: cp39-manylinux_x86_64
32+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
33+
CIBW_BUILD_VERBOSITY": 1
34+
35+
- name: Build wheels for macOS
36+
if: matrix.os == 'macOS-latest' || matrix.os == 'macOS-10.15'
37+
run: python -m cibuildwheel --output-dir wheelhouse
38+
env:
39+
CIBW_BEFORE_BUILD: bash tools/ci/pre_build.sh
40+
CIBW_BUILD: cp39-macosx_x86_64
41+
CIBW_ARCHS_MACOS: x86_64
42+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
43+
CIBW_BUILD_VERBOSITY": 1
44+
CIBW_ENVIRONMENT: BAZELISK_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Deploy wheels
47+
env:
48+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
49+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
50+
run: |
51+
python -m twine upload --skip-existing wheelhouse/*

.github/workflows/mac_os.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/manylinux.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,6 @@ bark/runtime/tests/data/three_way_plain_old.xodr
164164
bark/runtime/viewer/models/car.mtl
165165
**.blend
166166
**.blend1
167-
**.mtl
167+
**.mtl
168+
MANIFEST.in
169+
_build/**

MANIFEST.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
include ./bazel-bin/bark/pip_package.runfiles/bark_project/bark/core.so bark/core.so
2+
include ./bazel-bin/bark/pip_package.runfiles/bark_project/bark/examples/params/* bark/examples/params/*
3+
include ./bazel-bin/bark/pip_package.runfiles/bark_project/bark/examples/scenarios/* bark/examples/scenarios/*
4+
include ./bazel-bin/bark/pip_package.runfiles/bark_project/bark/examples/scenarios/* bark/examples/scenarios/*
5+
include ./bazel-bin/bark/pip_package.runfiles/bark_project/bark/runtime/tests/data/* bark/runtime/tests/data/*
6+
include ./bazel-bin/bark/pip_package.runfiles/bark_project/bark/benchmark/templates/* bark/benchmark/templates/*
7+
include ./bazel-bin/bark/pip_package.runfiles/bark_project/bark/benchmark/templates/* bark/benchmark/templates/*
8+
include ./bazel-bin/bark/pip_package.runfiles/com_github_interaction_dataset_interaction_dataset/* com_github_interaction_dataset_interaction_dataset/*
9+
include ./bazel-bin/bark/pip_package.runfiles/benchmark_database/* benchmark_database/*

WORKSPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ bark_dependencies()
1212
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
1313
boost_deps()
1414

15+
load("@pybind11_bazel//:python_configure.bzl", "python_configure")
16+
python_configure(name = "local_config_python")
1517

1618
# -------------------------------------------------
1719

__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)