├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── Utils └── setup │ └── k8s │ ├── common │ ├── docker │ │ └── setup.bash │ ├── helm │ │ └── setup.bash │ ├── kubeadm │ │ └── setup.bash │ ├── minikube │ │ └── setup.bash │ └── setup.bash │ ├── control-plane │ ├── minikube.setup.bash │ └── setup.bash │ └── worker │ └── setup.bash └── sdv_demo.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | log 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "AutoTest"] 2 | path = AutoTest 3 | url = git@github.com:autocore-ai/ats-script.git 4 | [submodule "Autoware"] 5 | path = Autoware 6 | url = git@github.com:autocore-ai/AutowareArchitectureProposal.git 7 | [submodule "CloudViewer"] 8 | path = CloudViewer 9 | url = git@github.com:autocore-ai/CloudViewer.git 10 | [submodule "RSU"] 11 | path = RSU 12 | url = git@github.com:autocore-ai/RSU.git 13 | [submodule "Utils/mcu"] 14 | path = Utils/mcu 15 | url = git@github.com:autocore-ai/pcu_mcu_hal.git 16 | [submodule "Utils/zenoh"] 17 | path = Utils/zenoh 18 | url = git@github.com:autocore-ai/zenoh.git 19 | [submodule "Utils/zenoh-plugin-dds"] 20 | path = Utils/zenoh-plugin-dds 21 | url = git@github.com:autocore-ai/zenoh-plugin-dds.git 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AutoCore SDV Project 2 | 3 | ![Logo](https://user-images.githubusercontent.com/71419791/117961292-88465b80-b350-11eb-9cb5-221226b419c9.png "AutoCore") 4 | 5 | For business and partnership, please visit our website: [www.autocore.ai](http://www.autocore.ai "AutoCore Homepage"). 6 | 7 | ## Table of Contents 8 | 9 | 1. [Overview](#overview) 10 | 2. [Quick Start Guide](#quick-start-guide) 11 | 12 | ## Overview 13 | 14 | SDV (Software Defined Vehicle) project is a cooperative project between Autocore and Futurewei, which aims at providing the technology-consulting services by means of this 100 percent open source software stack with reference design for SDVs. Cloud-Edge service is also integrated as a part of this project to extend the V2X capabilities. 15 | 16 | The SDV software stack is based on open source Autoware/ROS2/DDS and Zenoh, where DDS/Zenoh act as the E2E Vehicle-Edge-Cloud middleware layer for the SDV platform. Thru the integration with Futurewei’ s open source KubeEdge project, the SDV platform will leverage Cloud Native Ecosystem tools to provide management, monitoring and software LCM (Life-Cycle-Management) functions. 17 | 18 | The system architecture of SDV platform project is shown in the figure below: 19 | 20 | ![Architecture](https://user-images.githubusercontent.com/7805397/121767077-c1a8fb80-cb88-11eb-87f3-e412ccec417c.png "Architecture") 21 | 22 | The software modules in host container runtime are as follows: 23 | 24 | ![](https://user-images.githubusercontent.com/7805397/112241214-c98d8980-8c84-11eb-8115-91281f22ac07.png) 25 | 26 | And the PCU Container runtime acts as the Domain controller in vehicle with the following software modules: 27 | 28 | ![](https://user-images.githubusercontent.com/7805397/112241219-cd211080-8c84-11eb-8cd3-e7db20d08565.png) 29 | 30 | ## Quick Start Guide 31 | 32 | ### Hardware requirement 33 | 34 | - Host: 35 | 36 | - Host PC: 37 | - CPU: x86_64 4 Core or above 38 | - RAM: 8G+ 39 | - Disk: 30G+ free space 40 | - OS: Ubuntu 18.04+ 41 | - cable Ethernet 42 | 43 | - For each Worker (default sets 2 workers in cluster): 44 | 45 | - [AutoCore PCU][autocore pcu] 46 | 47 | - Flash images from [Release](https://github.com/autocore-ai/SDV/releases/tag/v1.0-alpha) for k8s install 48 | - cable Ethernet 49 | 50 | **OR** 51 | 52 | - Worker PC (**Needs when you don't have [AutoCore PCU][autocore pcu]**): 53 | - CPU: x86_64 8 Core or above 54 | - RAM: 8G+ 55 | - Disk: 30G+ free space 56 | - OS: Ubuntu 18.04+ 57 | - cable Ethernet 58 | 59 | ### Environment setup 60 | 61 | 1. Host PC: 62 | 63 | - ```bash 64 | $ source Utils/setup/k8s/control-plane/setup.bash 65 | ``` 66 | Concole will output the information like `kubeadm join xxx`, please use this information for clients to join in later steps. 67 | 68 | 1. [AutoCore PCU][autocore pcu] **OR** Worker PC: 69 | 70 | - ```bash 71 | $ source Utils/setup/k8s/worker/setup.bash 72 | ``` 73 | - ```bash 74 | $ sudo kubeadm join xxx 75 | ``` 76 | Please find the `xxx` in the concole output of Host PC as described in step 1. 77 | 78 | 1. Back to Host PC 79 | 80 | - For each worker node, label them: 81 | ```bash 82 | $ kubectl label node app=autoware 83 | ``` 84 | 85 | ### Deploy workloads with config file 86 | 87 | Default configs 2 workers in cluster, and if you have two works hardware, just run the default command: 88 | 89 | ```bash 90 | $ kubectl apply -f https://raw.githubusercontent.com/autocore-ai/SDV/develop/sdv_demo.yaml 91 | ``` 92 | 93 | And if you have other custom deployment, Just download sdv_demo.yaml and fix the `replicas: 2` to your worker count N: 94 | 95 | ```diff 96 | spec: 97 | - replicas: 2 98 | + replicas: N 99 | selector: 100 | ``` 101 | 102 | then use this config file: 103 | 104 | ```bash 105 | $ kubectl apply -f sdv_demo.yaml 106 | ``` 107 | 108 | ### Use [CloudViewer][cloudviewer] to display scene and send commands. 109 | 110 | Open [CloudViewer][cloudviewer] with [Chromium][chromium] based browser 111 | 112 | - Config IP Address to Host PC IP (defaults `127.0.0.1`) 113 | 114 | - Move viewer with key `WSAD` and mouse midde and right key. 115 | 116 | - Click on vehicle and traffic light to inspect and send commands. 117 | 118 | 119 | ## Video tutorial 120 | 121 | [![SDV demo on multi AutoCore PCUs](https://i3.ytimg.com/vi/Js2b5Xu01Lw/hqdefault.jpg)](https://youtu.be/Js2b5Xu01Lw "SDV demo on multi AutoCore PCUs") 122 | 123 | [autocore pcu]: https://github.com/autocore-ai/autocore_pcu_doc 124 | [sdv_demo.yaml]: https://raw.githubusercontent.com/autocore-ai/SDV/develop/sdv_demo.yaml 125 | [cloudviewer]: https://autocore-ai.github.io/CloudViewer/ 126 | [chromium]: https://www.chromium.org/ 127 | -------------------------------------------------------------------------------- /Utils/setup/k8s/common/docker/setup.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ $(id -u) -eq 0 ]; then 6 | echo "Don't run as root" >&2 7 | exit 1 8 | fi 9 | 10 | if [ -z "$(command -v curl)" ]; then 11 | sudo apt install -y curl 12 | fi 13 | 14 | if [ -z "$(command -v docker)" ]; then 15 | if [ $(arch) == 'x86_64' ]; then 16 | sudo curl https://get.docker.com | sudo sh 17 | elif [ $(arch) == 'aarch64' ]; then 18 | echo "ARM64 arch needs install docker manually" 19 | else 20 | echo "Unknow arch" 21 | exit 1 22 | fi 23 | fi 24 | 25 | sudo usermod -aG docker $USER 26 | 27 | echo '{"exec-opts": ["native.cgroupdriver=systemd"]}' | sudo tee /etc/docker/daemon.json 28 | 29 | sudo systemctl daemon-reload 30 | 31 | sudo service docker restart 32 | -------------------------------------------------------------------------------- /Utils/setup/k8s/common/helm/setup.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ $(id -u) -eq 0 ]; then 6 | echo "Don't run as root" >&2 7 | exit 1 8 | fi 9 | 10 | if [ -x "$(command -v helm)" ]; then 11 | return 12 | fi 13 | 14 | curl https://baltocdn.com/helm/signing.asc | sudo apt-key add - 15 | 16 | sudo apt install -y apt-transport-https 17 | 18 | echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list 19 | 20 | sudo apt update 21 | 22 | sudo apt install -y helm 23 | -------------------------------------------------------------------------------- /Utils/setup/k8s/common/kubeadm/setup.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ $(id -u) -eq 0 ]; then 6 | echo "Don't run as root" >&2 7 | exit 1 8 | fi 9 | 10 | if [ -x "$(command -v kubeadm)" ] && [ -x "$(command -v kubectl)" ]; then 11 | return 12 | fi 13 | 14 | if [ -z "$(command -v curl)" ]; then 15 | sudo apt install -y curl 16 | fi 17 | 18 | sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg 19 | 20 | echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list 21 | 22 | sudo apt update 23 | 24 | sudo apt install -y kubelet kubeadm kubectl 25 | 26 | sudo swapoff -a 27 | 28 | sudo sed -i '/ swap / s/^/#/' /etc/fstab 29 | -------------------------------------------------------------------------------- /Utils/setup/k8s/common/minikube/setup.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ $(id -u) -eq 0 ]; then 6 | echo "Don't run as root" >&2 7 | exit 1 8 | fi 9 | 10 | if [ -x "$(command -v minikube)" ]; then 11 | return 12 | fi 13 | 14 | if [ $(arch) == 'x86_64' ]; then 15 | DEB_URL="https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb" 16 | elif [ $(arch) == 'aarch64' ]; then 17 | DEB_URL="https://storage.googleapis.com/minikube/releases/latest/minikube_latest_arm64.deb" 18 | else 19 | echo "Unknow arch" 20 | exit 1 21 | fi 22 | 23 | TEMP_DEB="$(mktemp)" 24 | 25 | wget -O "$TEMP_DEB" "$DEB_URL" 26 | 27 | sudo dpkg -i "$TEMP_DEB" 28 | 29 | rm -f "$TEMP_DEB" 30 | -------------------------------------------------------------------------------- /Utils/setup/k8s/common/setup.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ $(id -u) -eq 0 ]; then 6 | echo "Don't run as root" >&2 7 | exit 1 8 | fi 9 | 10 | CURDIR="$( dirname "${BASH_SOURCE[0]}" )" 11 | 12 | source $CURDIR/kubeadm/setup.bash 13 | 14 | source $CURDIR/minikube/setup.bash 15 | 16 | source $CURDIR/helm/setup.bash 17 | 18 | source $CURDIR/docker/setup.bash 19 | 20 | cat <&2 7 | exit 1 8 | fi 9 | 10 | # export HTTP_PROXY=$http_proxy 11 | # export HTTPS_PROXY=$https_proxy 12 | # export NO_PROXY=$no_proxy 13 | 14 | minikube delete -p sdv-demo 15 | 16 | minikube start --cpus=8 --memory=12g --nodes 3 -p sdv-demo 17 | 18 | kubectl label node sdv-demo app=host 19 | 20 | kubectl label node sdv-demo-m02 app=autoware 21 | 22 | kubectl label node sdv-demo-m03 app=autoware 23 | 24 | if [ -x "$(command -v code)" ]; then 25 | code --install-extension ms-azuretools.vscode-docker 26 | code --install-extension ms-kubernetes-tools.vscode-kubernetes-tools 27 | fi 28 | -------------------------------------------------------------------------------- /Utils/setup/k8s/control-plane/setup.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ $(id -u) -eq 0 ]; then 6 | echo "Don't run as root" >&2 7 | exit 1 8 | fi 9 | 10 | sudo apt update 11 | 12 | CURDIR="$( dirname "${BASH_SOURCE[0]}" )" 13 | 14 | source $CURDIR/../common/setup.bash 15 | 16 | sudo kubeadm init --pod-network-cidr=10.244.0.0/16 17 | 18 | mkdir -p $HOME/.kube 19 | 20 | sudo cp -rf /etc/kubernetes/admin.conf $HOME/.kube/config 21 | 22 | sudo chown $(id -u):$(id -g) $HOME/.kube/config 23 | 24 | kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml 25 | 26 | kubectl label node $(hostname) app=host 27 | 28 | kubectl taint nodes --all node-role.kubernetes.io/master- 29 | 30 | if [ -x "$(command -v code)" ]; then 31 | code --install-extension ms-azuretools.vscode-docker 32 | code --install-extension ms-kubernetes-tools.vscode-kubernetes-tools 33 | fi 34 | -------------------------------------------------------------------------------- /Utils/setup/k8s/worker/setup.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ $(id -u) -eq 0 ]; then 6 | echo "Don't run as root" >&2 7 | exit 1 8 | fi 9 | 10 | sudo apt update 11 | 12 | CURDIR="$( dirname "${BASH_SOURCE[0]}" )" 13 | 14 | source $CURDIR/../common/setup.bash 15 | 16 | echo "Join worker nodes with last command in control-plane console." 17 | -------------------------------------------------------------------------------- /sdv_demo.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: sdv 5 | --- 6 | apiVersion: apps/v1 7 | kind: StatefulSet 8 | metadata: 9 | name: autoware 10 | namespace: sdv 11 | labels: 12 | app: autoware 13 | spec: 14 | replicas: 2 15 | selector: 16 | matchLabels: 17 | app: autoware 18 | serviceName: "sdv" 19 | template: 20 | metadata: 21 | labels: 22 | app: autoware 23 | spec: 24 | hostNetwork: true 25 | nodeSelector: 26 | app: autoware 27 | affinity: 28 | podAntiAffinity: 29 | requiredDuringSchedulingIgnoredDuringExecution: 30 | - labelSelector: 31 | matchExpressions: 32 | - key: app 33 | operator: In 34 | values: 35 | - autoware 36 | topologyKey: "kubernetes.io/hostname" 37 | volumes: 38 | - name: volume 39 | emptyDir: {} 40 | containers: 41 | - name: zenoh-plugin-dds 42 | image: autocore/zenoh-plugin-dds:sdv 43 | imagePullPolicy: Always 44 | command: ["/bin/sh"] 45 | args: 46 | [ 47 | "-c", 48 | "exec zenoh-bridge-dds --scope /demo/dds -m peer -d 2${POD_NAME##*-}", 49 | ] 50 | env: 51 | - name: POD_NAME 52 | valueFrom: 53 | fieldRef: 54 | fieldPath: metadata.name 55 | - name: sdk 56 | image: autocore/autoware-architecture-proposal-sdk:sdv 57 | imagePullPolicy: Always 58 | volumeMounts: 59 | - name: volume 60 | mountPath: /AutowareArchitectureProposal 61 | command: ["/bin/bash"] 62 | args: 63 | [ 64 | "-c", 65 | "export ROS_DOMAIN_ID=2${POD_NAME##*-} && cd /AutowareArchitectureProposal && source install/setup.bash && ros2 launch sdv_demo_launch sdv_demo.launch.xml", 66 | ] 67 | env: 68 | - name: RMW_IMPLEMENTATION 69 | value: rmw_cyclonedds_cpp 70 | - name: POD_NAME 71 | valueFrom: 72 | fieldRef: 73 | fieldPath: metadata.name 74 | initContainers: 75 | - name: exe 76 | image: autocore/autoware-architecture-proposal-exe:sdv 77 | imagePullPolicy: Always 78 | command: ["/bin/sh"] 79 | args: ["-c", "mv /AutowareArchitectureProposal/install /volume/"] 80 | volumeMounts: 81 | - name: volume 82 | mountPath: /volume 83 | - name: env 84 | image: ghcr.io/autocore-ai/autoware-architecture-proposal-env:sdv 85 | imagePullPolicy: Always 86 | command: ["/bin/sh"] 87 | args: ["-c", "mv /AutowareArchitectureProposal/env /volume/"] 88 | volumeMounts: 89 | - name: volume 90 | mountPath: /volume 91 | --- 92 | apiVersion: apps/v1 93 | kind: Deployment 94 | metadata: 95 | name: storage 96 | namespace: sdv 97 | labels: 98 | app: storage 99 | spec: 100 | selector: 101 | matchLabels: 102 | app: storage 103 | template: 104 | metadata: 105 | labels: 106 | app: storage 107 | spec: 108 | hostNetwork: true 109 | nodeSelector: 110 | app: host 111 | containers: 112 | - name: storage 113 | image: autocore/zenoh:sdv 114 | command: ["/bin/sh"] 115 | args: ["-c", "exec /zenohd --mem-storage=/rsu/**"] 116 | ports: 117 | - name: http 118 | containerPort: 8000 119 | protocol: TCP 120 | --- 121 | apiVersion: apps/v1 122 | kind: Deployment 123 | metadata: 124 | name: rsu 125 | namespace: sdv 126 | labels: 127 | app: rsu 128 | spec: 129 | selector: 130 | matchLabels: 131 | app: rsu 132 | template: 133 | metadata: 134 | labels: 135 | app: rsu 136 | spec: 137 | hostNetwork: true 138 | nodeSelector: 139 | app: host 140 | volumes: 141 | - name: volume 142 | emptyDir: {} 143 | containers: 144 | - name: rsu 145 | image: autocore/rsu-exe:develop 146 | imagePullPolicy: Always 147 | volumeMounts: 148 | - name: volume 149 | mountPath: /config 150 | env: 151 | - name: HOST_IP 152 | valueFrom: 153 | fieldRef: 154 | fieldPath: status.hostIP 155 | - name: RUST_LOG 156 | value: info 157 | initContainers: 158 | - name: cfg 159 | image: autocore/rsu-cfg:develop 160 | imagePullPolicy: Always 161 | command: ["/bin/sh"] 162 | args: ["-c", "mv /config/* /volume/"] 163 | volumeMounts: 164 | - name: volume 165 | mountPath: /volume 166 | --- 167 | apiVersion: apps/v1 168 | kind: Deployment 169 | metadata: 170 | name: autotest 171 | namespace: sdv 172 | labels: 173 | app: autotest 174 | spec: 175 | selector: 176 | matchLabels: 177 | app: autotest 178 | template: 179 | metadata: 180 | labels: 181 | app: autotest 182 | spec: 183 | hostNetwork: true 184 | nodeSelector: 185 | app: host 186 | containers: 187 | - name: autotest 188 | image: autocore/autotest:sdv 189 | imagePullPolicy: Always 190 | env: 191 | - name: RMW_IMPLEMENTATION 192 | value: rmw_cyclonedds_cpp 193 | - name: ROS_DOMAIN_ID 194 | value: "20" 195 | - name: HOST_IP 196 | valueFrom: 197 | fieldRef: 198 | fieldPath: status.hostIP 199 | --- 200 | kind: ClusterRole 201 | apiVersion: rbac.authorization.k8s.io/v1 202 | metadata: 203 | name: monitor 204 | rules: 205 | - apiGroups: [""] 206 | resources: ["pods"] 207 | verbs: ["list", "watch"] 208 | --- 209 | kind: ClusterRoleBinding 210 | apiVersion: rbac.authorization.k8s.io/v1 211 | metadata: 212 | name: monitor 213 | subjects: 214 | - kind: ServiceAccount 215 | name: default 216 | namespace: sdv 217 | roleRef: 218 | kind: ClusterRole 219 | name: monitor 220 | apiGroup: rbac.authorization.k8s.io --------------------------------------------------------------------------------