Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/docker-base-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ jobs:
runner: ubuntu-24.04-arm

runs-on: ${{ matrix.runner }}
# Unstable distros (debian sid) are allowed to fail without blocking the
# merge/publish of the stable cells. A stable cell's failure still gates.
continue-on-error: ${{ endsWith(matrix.cell.target, '-sid') }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -137,6 +140,9 @@ jobs:
matrix:
cell: ${{ fromJson(needs.matrix.outputs.cells) }}
runs-on: ubuntu-latest
# Match the build job: a missing-digest sid merge fails on its own without
# blocking the stable cells' manifest push.
continue-on-error: ${{ endsWith(matrix.cell.target, '-sid') }}
steps:
- uses: docker/setup-buildx-action@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
cpp-linter:
if: github.repository_owner == 'viamrobotics'
runs-on: ubuntu-latest
container: ghcr.io/viamrobotics/cpp-base:bullseye-amd64
container: ghcr.io/viamrobotics/cpp-sdk-system-debian:bullseye
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down
71 changes: 4 additions & 67 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ jobs:
include:
- target: aarch64-ubuntu-jammy-gnu
platform: linux_aarch64-ubuntu-jammy
image: ubuntu:22.04
image: ghcr.io/viamrobotics/cpp-sdk-system-ubuntu:jammy
runs_on: github-linux-arm64-8core
- target: x86_64-ubuntu-jammy-gnu
platform: linux_x86_64-ubuntu-jammy
image: ubuntu:22.04
image: ghcr.io/viamrobotics/cpp-sdk-system-ubuntu:jammy
runs_on: ubuntu-large

steps:
Expand All @@ -164,39 +164,6 @@ jobs:
with:
ref: ${{ needs.prepare.outputs.sha }}

- name: Install dependencies
run: |
apt-get update
apt-get -y dist-upgrade
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
build-essential \
ca-certificates \
curl \
doxygen \
g++ \
gdb \
git \
gnupg \
gpg \
less \
libboost-all-dev \
libgrpc++-dev \
libprotobuf-dev \
libssl-dev \
ninja-build \
pkg-config \
protobuf-compiler \
protobuf-compiler-grpc \
software-properties-common \
sudo \
wget \

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
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

apt-get update
apt-get -y install cmake=3.25.2-0kitware1ubuntu22.04.1 cmake-data=3.25.2-0kitware1ubuntu22.04.1

Comment on lines -167 to -199

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

- name: Setup build directory
run: mkdir builds

Expand Down Expand Up @@ -234,11 +201,11 @@ jobs:
include:
- target: aarch64-debian-bookworm
platform: linux_aarch64-debian-bookworm
image: debian:bookworm
image: ghcr.io/viamrobotics/cpp-sdk-system-debian:bookworm
runs_on: github-linux-arm64-8core
- target: x86_64-debian-bookworm
platform: linux_x86_64-debian-bookworm
image: debian:bookworm
image: ghcr.io/viamrobotics/cpp-sdk-system-debian:bookworm
runs_on: ubuntu-large

steps:
Expand All @@ -247,36 +214,6 @@ jobs:
with:
ref: ${{ needs.prepare.outputs.sha }}

- name: Install dependencies
run: |
apt-get update
apt-get -y dist-upgrade
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
build-essential \
ca-certificates \
cmake \
curl \
doxygen \
g++ \
gdb \
git \
gnupg \
gpg \
less \
libboost-all-dev \
libc-ares-dev \
libgrpc++-dev \
libprotobuf-dev \
libre2-dev \
libssl-dev \
ninja-build \
pkg-config \
protobuf-compiler-grpc \
software-properties-common \
sudo \
wget \
zlib1g-dev

- name: Setup build directory
run: mkdir builds

Expand Down
40 changes: 4 additions & 36 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if: github.repository_owner == 'viamrobotics'
runs-on: ubuntu-latest
container:
image: debian:bookworm
image: ghcr.io/viamrobotics/cpp-sdk-system-debian:bookworm
strategy:
fail-fast: false
matrix:
Expand All @@ -26,46 +26,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install dependencies
- name: Install test-only dependencies
run: |
apt-get update
apt-get -y dist-upgrade
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
build-essential \
ca-certificates \
cmake \
clang-tidy-15 \
curl \
doxygen \
g++ \
gettext \
gdb \
git \
gnupg \
gpg \
less \
libboost-all-dev \
libc-ares-dev \
libgrpc++-dev \
libprotobuf-dev \
libre2-dev \
libssl-dev \
lsof \
ninja-build \
pkg-config \
protobuf-compiler-grpc \
software-properties-common \
sudo \
wget \
zlib1g-dev

bash -c 'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add -'
apt-add-repository -y 'deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-15 main'
apt-add-repository -y 'deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-15 main'
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install -t llvm-toolchain-bookworm-15 \
clang-15 \
clang-tidy-15 \
clang-format
lsof

- name: Build viam server
run: |
Expand Down
1 change: 0 additions & 1 deletion etc/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ COPY scripts/ /opt/scripts/
RUN chmod -R +x /opt/scripts

RUN /opt/scripts/install-base.sh
RUN /opt/scripts/install-llvm.sh
RUN /opt/scripts/install-cmake.sh


Expand Down
6 changes: 6 additions & 0 deletions etc/docker/scripts/install-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Universal devkit: compilers, build tools, and the apt machinery the later
# scripts lean on (wget/gnupg for signed-by repo adds, software-properties-common
# for add-apt-repository on distros that still want it).
#
# The LLVM toolchain (clang, clang-tidy, clang-format) comes from the distro's own
# default version. Consumers needing a specific major install it themselves.

set -euo pipefail
[[ "${DEBUG:-}" ]] && set -x
Expand All @@ -17,6 +20,9 @@ rm -rf /var/lib/apt/lists/*
apt_install \
build-essential \
ca-certificates \
clang \
clang-format \
clang-tidy \
curl \
g++ \
gcc \
Expand Down
41 changes: 0 additions & 41 deletions etc/docker/scripts/install-llvm.sh

This file was deleted.

5 changes: 0 additions & 5 deletions etc/docker/scripts/lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ set -euo pipefail

# ---- pinned toolchain versions (not configurable at docker build time) ----

# LLVM_VERSION: the clang/clang-tidy/clang-format major version installed by
# install-llvm.sh.
LLVM_VERSION=19
export LLVM_VERSION

# CMAKE_MIN_VERSION: minimum cmake install-cmake.sh accepts before pulling a
# newer one from Kitware (Ubuntu) or Debian backports.
CMAKE_MIN_VERSION=3.25
Expand Down
4 changes: 4 additions & 0 deletions src/viam/sdk/common/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ std::string bytes_to_string(const std::vector<unsigned char>& b) {
return img_string;
}

namespace {

std::string random_debug_key() {
static const char alphanum[] = "abcdefghijklmnopqrstuvwxyz";
static std::default_random_engine generator(
Expand All @@ -111,6 +113,8 @@ std::string random_debug_key() {
return key;
}

} // namespace

ProtoStruct debug_map() {
return debug_map(random_debug_key());
}
Expand Down
4 changes: 4 additions & 0 deletions src/viam/sdk/common/version_metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ std::string sdk_version() {
return result;
}

namespace {

int get_sub_version(int which) {
static const std::array<int, 3> components = [] {
std::array<int, 3> result;
Expand All @@ -38,6 +40,8 @@ int get_sub_version(int which) {
return components[which];
}

} // namespace

int sdk_major_version() {
return get_sub_version(0);
}
Expand Down
Loading