Skip to content

Commit 3c586c1

Browse files
authored
Merge branch 'main' into make-mlmodel-server-less-restrictive
2 parents c6352fe + 92c13e2 commit 3c586c1

File tree

558 files changed

+400055
-344931
lines changed

Some content is hidden

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

558 files changed

+400055
-344931
lines changed

.github/workflows/conan.yml

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
name: Test conan packages
2+
3+
on:
4+
# Runs for PRs that directly change conan code, and weekdays at 11:15pm UTC.
5+
# Additional logic in the prepare job below makes it so scheduled builds only run
6+
# on new commits.
7+
schedule:
8+
- cron: "15 11 * * 1-5"
9+
workflow_dispatch:
10+
pull_request:
11+
paths:
12+
- conanfile.py
13+
- test_package/conanfile.py
14+
15+
jobs:
16+
prepare:
17+
if: github.repository_owner == 'viamrobotics'
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout Code
21+
uses: actions/checkout@v4
22+
- name: Get current git info
23+
if: github.event_name == 'schedule'
24+
id: git_info
25+
run: |
26+
echo "current_commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
27+
echo "current_branch=$(git branch --show-current)" >> $GITHUB_OUTPUT
28+
- name: Get last successful commit
29+
if: github.event_name == 'schedule'
30+
id: last_successful_commit
31+
uses: tylermilner/last-successful-commit-hash-action@v1
32+
with:
33+
branch: main
34+
workflow-id: conan.yml
35+
github-token: ${{ github.token }}
36+
- name: Cancel scheduled build with no new commits
37+
uses: andymckay/[email protected]
38+
if: |
39+
github.event_name == 'schedule' &&
40+
steps.git_info.outputs.current_commit == steps.last_successful_commit.outputs.commit-hash
41+
42+
build_macos:
43+
if: github.repository_owner == 'viamrobotics'
44+
needs: [prepare]
45+
runs-on: macos-latest
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
include:
50+
- target: aarch64-apple-darwin
51+
platform: macosx_arm64
52+
- target: x86_64-apple-darwin
53+
platform: macosx_x86_64
54+
steps:
55+
- name: Checkout Code
56+
uses: actions/checkout@v4
57+
58+
- name: Install dependencies
59+
run: |
60+
brew install cmake
61+
brew install python ninja buf
62+
python -m pip install conan
63+
64+
- name: Create package
65+
run: |
66+
# `buf` tries to read a CLI config file that we don't actually use located at
67+
# ~/.config/buf/config.yaml. We don't always have permission to access this
68+
# directory in CI, so we set the `BUF_CONFIG_DIR` to some other value that we
69+
# do have permissions for. See https://github.com/bufbuild/buf/issues/2698 for
70+
# more details.
71+
export BUF_CONFIG_DIR=$(mktemp -d)
72+
conan profile detect
73+
conan create . --build=missing -s compiler.cppstd=17
74+
75+
build_linux_ubuntu_jammy:
76+
if: github.repository_owner == 'viamrobotics'
77+
needs: [prepare]
78+
runs-on: ${{ matrix.runs_on }}
79+
container:
80+
image: ${{ matrix.image }}
81+
strategy:
82+
fail-fast: false
83+
matrix:
84+
include:
85+
- target: aarch64-ubuntu-jammy-gnu
86+
platform: linux_aarch64-ubuntu-jammy
87+
image: ubuntu:22.04
88+
runs_on: buildjet-8vcpu-ubuntu-2204-arm
89+
- target: x86_64-ubuntu-jammy-gnu
90+
platform: linux_x86_64-ubuntu-jammy
91+
image: ubuntu:22.04
92+
runs_on: buildjet-8vcpu-ubuntu-2204
93+
94+
steps:
95+
- name: Checkout Code
96+
uses: actions/checkout@v4
97+
98+
- name: Install dependencies
99+
run: |
100+
apt-get update
101+
apt-get -y dist-upgrade
102+
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
103+
build-essential \
104+
ca-certificates \
105+
curl \
106+
doxygen \
107+
g++ \
108+
gdb \
109+
gnupg \
110+
gpg \
111+
less \
112+
ninja-build \
113+
python3 \
114+
python3-pip \
115+
software-properties-common \
116+
sudo \
117+
wget \
118+
119+
sudo wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
120+
sudo echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
121+
122+
apt-get update
123+
apt-get -y install cmake
124+
125+
pip install conan
126+
127+
- name: Create package
128+
shell: bash
129+
run: |
130+
conan profile detect
131+
conan create . --build=missing -s compiler.cppstd=14
132+
133+
build_linux_debian:
134+
if: github.repository_owner == 'viamrobotics'
135+
needs: [prepare]
136+
runs-on: ${{ matrix.runs_on }}
137+
container:
138+
image: ${{ matrix.image }}
139+
strategy:
140+
fail-fast: false
141+
matrix:
142+
include:
143+
- target: aarch64-debian-bullseye
144+
platform: linux_aarch64-debian-bullseye
145+
image: debian:bullseye
146+
runs_on: buildjet-8vcpu-ubuntu-2204-arm
147+
- target: x86_64-debian-bullseye
148+
platform: linux_x86_64-debian-bullseye
149+
image: debian:bullseye
150+
runs_on: buildjet-8vcpu-ubuntu-2204
151+
- target: aarch64-debian-bookworm
152+
platform: linux_aarch64-debian-bookworm
153+
image: debian:bookworm
154+
runs_on: buildjet-8vcpu-ubuntu-2204-arm
155+
- target: x86_64-debian-bookworm
156+
platform: linux_x86_64-debian-bookworm
157+
image: debian:bookworm
158+
runs_on: buildjet-8vcpu-ubuntu-2204
159+
160+
steps:
161+
- name: Checkout Code
162+
uses: actions/checkout@v4
163+
164+
- name: Install dependencies
165+
run: |
166+
apt-get update
167+
apt-get -y dist-upgrade
168+
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
169+
build-essential \
170+
ca-certificates \
171+
cmake \
172+
curl \
173+
g++ \
174+
gdb \
175+
gnupg \
176+
gpg \
177+
less \
178+
ninja-build \
179+
python3 \
180+
python3-pip \
181+
python3-venv \
182+
software-properties-common \
183+
sudo \
184+
wget
185+
186+
- name: Update CMake for bullseye
187+
if: ${{ matrix.image == 'debian:bullseye' }}
188+
run: |
189+
apt-add-repository -y 'deb http://deb.debian.org/debian bullseye-backports main'
190+
191+
apt-get update
192+
apt-get -y install cmake
193+
194+
apt-get -y --no-install-recommends install -t bullseye-backports cmake
195+
196+
# Note bullseye can use regular pip + conan no problem, but
197+
# bookworm is a managed environment, so we use a venv in both because it is more
198+
# trouble to bifurcate them.
199+
- name: Install conan in venv and create package
200+
shell: bash
201+
run: |
202+
python3 -m venv ./conan_venv
203+
source ./conan_venv/bin/activate
204+
205+
pip install conan
206+
conan profile detect
207+
conan create . --build=missing -s compiler.cppstd=14

.github/workflows/docker.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
on:
2+
workflow_dispatch:
3+
inputs:
4+
image-prefix:
5+
description: "gets suffixed with 'base' and 'sdk' to create actual image name"
6+
default: ghcr.io/viamrobotics/cpp-
7+
dockerfile:
8+
default: Dockerfile.debian.bullseye
9+
tag:
10+
default: bullseye-amd64
11+
build-base:
12+
description: "whether to build the base image. the base images change less often and may not be necessary to rebuild."
13+
type: boolean
14+
default: false
15+
build-sdk:
16+
description: "whether to build the SDK image. if this is true and no corresponding base image exists, the job will fail."
17+
type: boolean
18+
default: false
19+
push:
20+
description: "whether to push the images after building them"
21+
type: boolean
22+
default: false
23+
24+
jobs:
25+
build-container:
26+
runs-on: ubuntu-latest
27+
permissions:
28+
contents: read
29+
packages: write
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- uses: docker/login-action@v3
34+
with:
35+
registry: ghcr.io
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
# build base (if inputs.build-base)
40+
- uses: docker/metadata-action@v5
41+
id: base-meta
42+
if: inputs.build-base
43+
with:
44+
images: ${{ inputs.image-prefix }}base
45+
- uses: docker/build-push-action@v5
46+
if: inputs.build-base
47+
with:
48+
push: ${{ inputs.push }}
49+
tags: "${{ inputs.image-prefix }}base:${{ inputs.tag }}"
50+
file: etc/docker/base-images/${{ inputs.dockerfile }}
51+
labels: ${{ steps.base-meta.output.labels }}
52+
53+
# build sdk (if inputs.build-sdk)
54+
- uses: docker/metadata-action@v5
55+
id: sdk-meta
56+
if: inputs.build-sdk
57+
with:
58+
images: ${{ inputs.image-prefix }}sdk
59+
- uses: docker/build-push-action@v5
60+
if: inputs.build-sdk
61+
with:
62+
build-args: |
63+
BASE_TAG=${{ inputs.image-prefix }}base:${{ inputs.tag }}
64+
push: ${{ inputs.push }}
65+
tags: "${{ inputs.image-prefix }}sdk:${{ inputs.tag }}"
66+
file: etc/docker/Dockerfile.sdk-build
67+
labels: ${{ steps.sdk-meta.output.labels }}

.github/workflows/docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
workflow_dispatch:
55
push:
66
paths:
7-
- 'src/**'
8-
- 'README.md'
7+
- "src/**"
8+
- "README.md"
99
branches: [main]
1010

1111
jobs:
@@ -30,7 +30,7 @@ jobs:
3030
run: doxygen Doxyfile
3131

3232
- name: Upload artifacts
33-
uses: actions/upload-artifact@v3
33+
uses: actions/upload-artifact@v4
3434
with:
3535
name: html-docs
3636
path: etc/docs/api/current

.github/workflows/linter.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
name: cpp-linter
22

3-
on: pull_request
3+
on:
4+
pull_request:
5+
workflow_dispatch:
46

57
jobs:
68
cpp-linter:
79
if: github.repository_owner == 'viamrobotics'
810
runs-on: ubuntu-latest
9-
container:
10-
image: ghcr.io/viamrobotics/canon:amd64
11+
container: ghcr.io/viamrobotics/cpp-base:bullseye-amd64
1112
steps:
1213
- name: Checkout Code
1314
uses: actions/checkout@v4
1415
with:
1516
fetch-depth: 0
16-
- name: install clang-format
17-
run: sudo apt install -y clang-format
1817
- name: verify no uncommitted changes
1918
run: |
19+
chown $(whoami) .
2020
git init
2121
git add .
22-
chown -R testbot .
23-
sudo -u testbot bash -lc 'sh ./bin/run-clang-format.sh'
22+
./bin/run-clang-format.sh
2423
GEN_DIFF=$(git status -s)
2524
2625
if [ -n "$GEN_DIFF" ]; then

0 commit comments

Comments
 (0)