Skip to content

Commit 129c150

Browse files
authored
Merge pull request #4 from wheelos/docker
update docker build pipeline
2 parents 57b647d + 2cad8db commit 129c150

Some content is hidden

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

45 files changed

+2372
-1162
lines changed

.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
max-line-length = 88
3+
extend-ignore = E203, W503
4+
exclude = .git,__pycache__,build,dist

.github/workflows/lint-format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ jobs:
6060
if: github.event_name == 'pull_request'
6161
run: |
6262
echo "Running apollo_lint.sh in diff mode for PR..."
63-
${{ github.workspace }}/scripts/ci/apollo_ci.sh --all --diff origin/${{ github.base_ref }}
63+
${{ github.workspace }}/scripts/ci/apollo_lint.sh --all --diff origin/${{ github.base_ref }}
6464
env:
6565
GITHUB_BASE_REF: ${{ github.base_ref }}
6666

6767
- name: Run Lint and Format Checks (Push Full Mode)
6868
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
6969
run: |
7070
echo "Running apollo_lint.sh in full mode for push to main branch..."
71-
${{ github.workspace }}/scripts/ci/apollo_ci.sh --all
71+
${{ github.workspace }}/scripts/ci/apollo_lint.sh --all

.vscode/settings.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"editor.formatOnSave": true,
66
"editor.formatOnPaste": true,
77
"editor.codeActionsOnSave": {
8-
"source.fixAll": true,
9-
"source.fixAll.eslint": true,
10-
"source.organizeImports": true
8+
"source.fixAll": "explicit",
9+
"source.fixAll.eslint": "explicit",
10+
"source.organizeImports": "explicit"
1111
},
1212
"files.trimTrailingWhitespace": true,
1313
"files.insertFinalNewline": true,
@@ -25,7 +25,7 @@
2525
"editor.bracketPairColorization.enabled": true,
2626
"editor.guides.bracketPairs": "active",
2727
"editor.renderWhitespace": "boundary",
28-
"editor.cursorSmoothCaretAnimation": true,
28+
"editor.cursorSmoothCaretAnimation": "on",
2929
"editor.smoothScrolling": true,
3030
"editor.fontSize": 14,
3131
// ——————————————————————
@@ -69,7 +69,11 @@
6969
// Markdown
7070
"[markdown]": {
7171
"editor.wordWrap": "on",
72-
"editor.quickSuggestions": true
72+
"editor.quickSuggestions": {
73+
"comments": "on",
74+
"strings": "on",
75+
"other": "on"
76+
}
7377
},
7478
// Python (Black uses 88)
7579
"[python]": {

MODULE.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ bazel_dep(name = "rules_pkg", version = "0.10.1")
1111
bazel_dep(name = "rules_proto", version = "6.0.2")
1212
bazel_dep(name = "rules_python", version = "0.34.0")
1313

14+
# TODO: Keep the version of Python toolchain consistent with Docker.
15+
# Note whether there is any duplication with .apollo.bazelrc?
16+
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
17+
python.defaults(python_version = "3.8")
18+
python.toolchain(python_version = "3.8")
19+
1420
# boost
1521
bazel_dep(name = "boost.bind", version = "1.87.0")
1622
bazel_dep(name = "boost.array", version = "1.87.0")

README.md

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# Welcome to Apollo's GitHub page!
22

3-
[Apollo-Lite](https://github.com/wheelos/apollo-lite) is a high-performance, flexible architecture accelerating the development, testing, and deployment of Autonomous Vehicles.
3+
[Apollo-Lite](https://github.com/wheelos/apollo-lite) is a high-performance,
4+
flexible architecture accelerating the development, testing, and deployment of
5+
Autonomous Vehicles.
46

57
---
6-
> We choose to go to the moon in this decade and do the other things,
7-
> not because they are easy, but because they are hard.
8+
9+
> We choose to go to the moon in this decade and do the other things, not
10+
> because they are easy, but because they are hard.
811
>
912
> -- John F. Kennedy, 1962
13+
1014
---
1115

1216
## Table of Contents
@@ -23,8 +27,12 @@
2327

2428
## Introduction
2529

26-
Apollo is packed with powerful modules and features designed for autonomous driving development. Before you take it for a spin, please ensure your environment is properly calibrated and configured by following the prerequisites and installation instructions below.
27-
For a deeper dive, check out Apollo's [architecture overview](http://apollo.auto/docs/architecture_overview.html) to understand its core technologies and platform design.
30+
Apollo is packed with powerful modules and features designed for autonomous
31+
driving development. Before you take it for a spin, please ensure your
32+
environment is properly calibrated and configured by following the prerequisites
33+
and installation instructions below. For a deeper dive, check out Apollo's
34+
[architecture overview](http://apollo.auto/docs/architecture_overview.html) to
35+
understand its core technologies and platform design.
2836

2937
---
3038

@@ -45,9 +53,13 @@ For a deeper dive, check out Apollo's [architecture overview](http://apollo.auto
4553
## Quick Start
4654

4755
### 1. Setup Host Environment
48-
Run the following scripts in order to prepare your host machine, which will perform the following steps sequentially:
56+
57+
Run the following scripts in order to prepare your host machine, which will
58+
perform the following steps sequentially:
59+
4960
1. Install Docker (checks if already installed, then proceeds)
50-
2. Install NVIDIA Container Toolkit (checks if already installed, depends on Docker)
61+
2. Install NVIDIA Container Toolkit (checks if already installed, depends on
62+
Docker)
5163
3. Perform host system configurations
5264

5365
```bash
@@ -56,11 +68,12 @@ bash docker/setup_host/setup_host.sh
5668
```
5769

5870
### 2. Start Docker Container
71+
5972
Download and start the Apollo container image (only needs to be done once):
6073

6174
```bash
62-
# docker pull & start
63-
bash docker/scripts/dev_start.sh
75+
# docker pull & start testing
76+
bash docker/scripts/dev_start.sh -d testing
6477
```
6578

6679
Enter the running container environment in subsequent sessions with:
@@ -70,17 +83,13 @@ Enter the running container environment in subsequent sessions with:
7083
bash docker/scripts/dev_into.sh
7184
```
7285

73-
### 3. Build Apollo
74-
75-
Inside the container, install build dependencies:
86+
Setting Environment Variables
7687

7788
```bash
78-
# update bazel & gcc
79-
sudo bash docker/build/installers/install_bazel.sh
80-
sudo bash docker/build/installers/install_gcc.sh
89+
source cyber/setup.bash
8190
```
8291

83-
> **Note:** Current container image does not have the latest Bazel and GCC. You need to manually install/upgrade them. Future container versions will include these by default.
92+
### 3. Build Apollo
8493

8594
Build the entire Apollo project with:
8695

@@ -100,16 +109,19 @@ To build a single module, use:
100109

101110
## Copyright and License
102111

103-
Apollo is licensed under the [Apache License 2.0](LICENSE). Please adhere to the licensing terms when using or contributing to this project.
112+
Apollo is licensed under the [Apache License 2.0](LICENSE). Please adhere to the
113+
licensing terms when using or contributing to this project.
104114

105115
---
106116

107117
## Connect with us
108118

109119
- ⭐ Star and Fork to support the project!
110-
- 💬 Join our [community discussion group](http://apollo.auto/community) to chat with developers.
120+
- 💬 Join our [community discussion group](http://apollo.auto/community) to chat
121+
with developers.
111122
- 📧 For collaboration or business inquiries, contact: [email protected]
112123

113124
---
114125

115-
Thank you for being part of Apollo's journey towards autonomous driving innovation!
126+
Thank you for being part of Apollo's journey towards autonomous driving
127+
innovation!

cyber/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ install(
3232
#"cyber/proto/py_pb2.BUILD": "BUILD",
3333
},
3434
deps = [
35-
"//cyber/python/cyber_py3:cyber_python_library",
35+
# "//cyber/python/cyber_py3:cyber_python_library",
3636
#"//cyber/proto:pb_cyber",
3737
#"//cyber/proto:cyber_proto_hdrs",
3838
#"//cyber/proto:cyber_proto_so",

cyber/python/cyber_py3/BUILD

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
11
load("@rules_python//python:defs.bzl", "py_library")
2-
load("//tools/install:install.bzl", "install", "install_files")
2+
load("@rules_python//python:packaging.bzl", "py_package", "py_wheel", "py_wheel_dist")
33

44
package(default_visibility = ["//visibility:public"])
55

6-
filegroup(
7-
name = "runtime_files",
8-
srcs = glob([
9-
"*.py",
10-
]) + ["cyber_py3.BUILD"]
6+
7+
py_wheel(
8+
name = "cyber_wheel",
9+
distribution = "pycyber",
10+
version = "0.1.0",
11+
python_tag = "py3",
12+
deps = [":cyber_pkg"],
13+
)
14+
15+
py_wheel_dist(
16+
name = "cyber_dist",
17+
wheel = ":cyber_wheel",
18+
out = "dist",
1119
)
1220

13-
install(
14-
name = "cyber_python_library",
15-
data = [":runtime_files"],
16-
data_dest = "cyber/python/cyber/python/cyber_py3"
21+
py_package(
22+
name = "cyber_pkg",
23+
packages = ["pycyber"],
24+
deps = [
25+
":cyber",
26+
":cyber_time",
27+
":cyber_timer",
28+
":parameter",
29+
":record",
30+
],
1731
)
1832

1933
py_library(
@@ -22,6 +36,7 @@ py_library(
2236
data = [
2337
"//cyber/python/internal:_cyber_time_wrapper.so",
2438
"//cyber/python/internal:_cyber_wrapper.so",
39+
"@fastrtps",
2540
],
2641
)
2742

@@ -30,6 +45,7 @@ py_library(
3045
srcs = ["cyber_timer.py"],
3146
data = [
3247
"//cyber/python/internal:_cyber_timer_wrapper.so",
48+
"@fastrtps",
3349
],
3450
)
3551

@@ -38,6 +54,7 @@ py_library(
3854
srcs = ["cyber.py"],
3955
data = [
4056
"//cyber/python/internal:_cyber_wrapper.so",
57+
"@fastrtps",
4158
],
4259
)
4360

@@ -46,6 +63,7 @@ py_library(
4663
srcs = ["parameter.py"],
4764
data = [
4865
"//cyber/python/internal:_cyber_parameter_wrapper.so",
66+
"@fastrtps",
4967
],
5068
)
5169

@@ -54,5 +72,6 @@ py_library(
5472
srcs = ["record.py"],
5573
data = [
5674
"//cyber/python/internal:_cyber_record_wrapper.so",
75+
"@fastrtps",
5776
],
5877
)

cyber/python/cyber_py3/cyber_py3.BUILD

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

cyber/python/cyber_py3/examples/listener.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_listener_class():
4242
test_node.spin()
4343

4444

45-
if __name__ == '__main__':
45+
if __name__ == "__main__":
4646
cyber.init()
4747
test_listener_class()
4848
cyber.shutdown()

cyber/setup.bash

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,18 @@ for entry in "${mainboard_path}" \
2727
done
2828
pathprepend "${HOME}/.local/bin" PATH
2929

30-
pathprepend "${APOLLO_ROOT_DIR}" PYTHONPATH
30+
# pathprepend "${APOLLO_ROOT_DIR}" PYTHONPATH
31+
32+
# Set up the Python environment
33+
# For cyber python
3134
pathprepend "${bazel_bin_path}" PYTHONPATH
32-
pathprepend ${bazel_bin_path}/cyber/python/internal PYTHONPATH
33-
pathprepend "${PYTHON_INSTALL_PATH}/lib/python${PYTHON_VERSION}/site-packages" PYTHONPATH
34-
pathprepend "${PYTHON_INSTALL_PATH}/bin/" PATH
35+
# For cyber c++ wrap so
36+
pathprepend "${bazel_bin_path}/cyber/python/internal" PYTHONPATH
37+
# For common_msgs
38+
pathprepend "${bazel_bin_path}/modules" PYTHONPATH
39+
40+
# for protobuf python
41+
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
3542

3643
export CYBER_DOMAIN_ID=80
3744
export CYBER_IP=127.0.0.1

0 commit comments

Comments
 (0)