Skip to content

Commit bc6a394

Browse files
committed
Added CD GHA
1 parent a68fe71 commit bc6a394

File tree

5 files changed

+184
-1
lines changed

5 files changed

+184
-1
lines changed

.devcontainer/Dockerfile.amd64

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM ubuntu:22.04
2+
3+
RUN apt-get update --fix-missing &&\
4+
apt-get install -y --no-install-recommends build-essential ca-certificates git g++ pkg-config python3 curl ninja-build tar zip unzip zlib1g-dev libssl-dev wget &&\
5+
apt-get autoclean &&\
6+
apt-get autoremove &&\
7+
apt-get clean &&\
8+
rm -rf /var/lib/apt/lists/*
9+
10+
RUN update-ca-certificates
11+
12+
RUN wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3.tar.gz &&\
13+
tar -xzf cmake-3.28.3.tar.gz &&\
14+
cd cmake-3.28.3 &&\
15+
./configure &&\
16+
make install &&\
17+
cd .. &&\
18+
rm cmake-3.28.3.tar.gz &&\
19+
rm -r cmake-3.28.3
20+
21+
RUN git clone https://github.com/microsoft/vcpkg &&\
22+
cd vcpkg &&\
23+
git checkout 3b213864579b6fa686e38715508f7cd41a50900f &&\
24+
./bootstrap-vcpkg.sh -disableMetrics &&\
25+
./vcpkg install grpc:x64-linux &&\
26+
./vcpkg install eigen3:x64-linux &&\
27+
./vcpkg install cli11:x64-linux

.devcontainer/Dockerfile.arm64

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM arm64v8/ubuntu:22.04
2+
SHELL ["/bin/bash", "-c"]
3+
4+
RUN apt-get update --fix-missing &&\
5+
apt-get install -y --no-install-recommends build-essential ca-certificates cmake git g++ pkg-config python3 curl ninja-build tar zip unzip zlib1g-dev libssl-dev wget &&\
6+
apt-get autoclean &&\
7+
apt-get autoremove &&\
8+
apt-get clean &&\
9+
rm -rf /var/lib/apt/lists/*
10+
11+
RUN update-ca-certificates
12+
13+
RUN wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3.tar.gz &&\
14+
tar -xzf cmake-3.28.3.tar.gz &&\
15+
cd cmake-3.28.3 &&\
16+
./configure &&\
17+
make install &&\
18+
cd .. &&\
19+
rm cmake-3.28.3.tar.gz &&\
20+
rm -r cmake-3.28.3
21+
22+
RUN git clone https://github.com/microsoft/vcpkg &&\
23+
cd vcpkg &&\
24+
git checkout 3b213864579b6fa686e38715508f7cd41a50900f &&\
25+
export VCPKG_FORCE_SYSTEM_BINARIES=arm &&\
26+
./bootstrap-vcpkg.sh -disableMetrics &&\
27+
./vcpkg install grpc:arm64-linux &&\
28+
./vcpkg install eigen3:arm64-linux &&\
29+
./vcpkg install cli11:arm64-linux

.github/workflows/cd.yml

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Commented out due to speed of runners. Uncomment when we get the better ones.
2+
3+
# # This workflow automatically releases binaries upon tagging.
4+
# name: spot-cpp-sdk CD
5+
6+
# on:
7+
# push:
8+
# tags:
9+
# - '*'
10+
11+
# concurrency:
12+
# group: ${{ github.workflow }}-${{ github.ref }}
13+
# cancel-in-progress: true
14+
15+
# env:
16+
# REGISTRY: ghcr.io
17+
# # github.repository as <account>/<repo>
18+
# IMAGE_NAME: bdaiinstitute/spot_cpp_sdk_builder
19+
20+
# jobs:
21+
# build-docker-image:
22+
# permissions:
23+
# contents: read
24+
# packages: write
25+
# # This is used to complete the identity challenge
26+
# # with sigstore/fulcio when running outside of PRs.
27+
# id-token: write
28+
# strategy:
29+
# fail-fast: false
30+
# matrix:
31+
# config:
32+
# - { arch: "amd64" }
33+
# - { arch: "arm64" }
34+
# name: Build docker image for ${{ matrix.config.arch }}
35+
# runs-on: ubuntu-latest
36+
# steps:
37+
# - name: Checkout repository
38+
# uses: actions/checkout@v4
39+
40+
# - name: Set up QEMU # as virtualization is necessary to build container images
41+
# uses: docker/setup-qemu-action@v3
42+
43+
# - name: Setup Docker buildx # to workaround: https://github.com/docker/build-push-action/issues/461
44+
# uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
45+
46+
# - name: Log into registry ${{ env.REGISTRY }}
47+
# uses: docker/login-action@v3 # https://github.com/docker/login-action
48+
# with:
49+
# registry: ${{ env.REGISTRY }}
50+
# username: ${{ github.actor }}
51+
# password: ${{ secrets.GITHUB_TOKEN }}
52+
53+
# # Extract metadata (tags, labels) for Docker
54+
# # https://github.com/docker/metadata-action
55+
# - name: Extract Docker metadata
56+
# id: meta
57+
# uses: docker/metadata-action@v5
58+
# with:
59+
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}_${{ matrix.config.arch }}
60+
61+
# - name: Build and push
62+
# uses: docker/build-push-action@v5 # https://github.com/docker/build-push-action
63+
# id: build
64+
# with:
65+
# context: .
66+
# file: .devcontainer/Dockerfile.${{ matrix.config.arch }}
67+
# tags: ${{ steps.meta.outputs.tags }}
68+
# labels: ${{ steps.meta.outputs.labels }}
69+
# cache-from: type=gha
70+
# cache-to: type=gha,mode=max
71+
# push: true
72+
73+
# build-artifacts:
74+
# strategy:
75+
# fail-fast: false
76+
# matrix:
77+
# config:
78+
# - { arch: "amd64" }
79+
# - { arch: "arm64" }
80+
# name: Build spot-cpp-sdk for ${{ matrix.config.arch }}
81+
# # needs: build-docker-image
82+
# runs-on: ubuntu-latest
83+
# container:
84+
# # env cannot be used here...
85+
# image: ghcr.io/bdaiinstitute/spot_cpp_sdk_builder_${{ matrix.config.arch }}:latest
86+
# steps:
87+
# - name: Checkout repository
88+
# uses: actions/checkout@v4
89+
90+
# - name: Build spot-sdk-cpp
91+
# run: |
92+
# cd spot-sdk-cpp/cpp
93+
# mkdir build
94+
# cd build
95+
# cmake ../ -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE -DBUILD_CHOREOGRAPHY_LIBS=ON
96+
# make -j2 install package
97+
98+
# - name: Upload ${{ matrix.config.arch }} artifact
99+
# uses: actions/upload-artifact@v4
100+
# with:
101+
# name: ${{ matrix.config.arch }}-artifact
102+
# path: '*.deb'
103+
# retention-days: 1
104+
105+
# bundle-debians:
106+
# name: Release artifacts
107+
# runs-on: ubuntu-latest
108+
# needs: build-artifacts
109+
# steps:
110+
# - name: Download artifacts
111+
# uses: actions/download-artifact@v4
112+
# with:
113+
# pattern: '*-artifact'
114+
# merge-multiple: true
115+
116+
# - name: Release to GitHub
117+
# uses: softprops/action-gh-release@v1
118+
# with:
119+
# name: Release ${{ github.ref_name }}
120+
# files: '*.deb'
121+

cpp/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ file(GLOB_RECURSE bosdyn_protos_files CONFIGURE_DEPENDS
4444
if (bosdyn_protos_files)
4545
add_library(bosdyn_api_obj OBJECT ${bosdyn_protos_files})
4646
set_property(TARGET bosdyn_api_obj PROPERTY POSITION_INDEPENDENT_CODE 1)
47-
target_link_libraries(bosdyn_api_obj PUBLIC ${PROTOBUF_LIBRARIES} gRPC::grpc gRPC::grpc++)
47+
target_link_libraries(bosdyn_api_obj PUBLIC protobuf::libprotobuf gRPC::grpc gRPC::grpc++)
4848
target_include_directories(bosdyn_api_obj PUBLIC
4949
$<BUILD_INTERFACE:${protos_OUTPUT_DIR}>
5050
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>

docs/cpp/quickstart.md

+6
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ make -j6 install
154154

155155
The `make` command generates a lot of deprecation warnings during the compiling of the classes generated from the protobuf definitions. This is expected as the protobuf definitions contain `deprecated` flags for fields that will not be supported in future versions of the SDK.
156156

157+
Build the SDK and generate a debian package using the `make` command below:
158+
159+
```
160+
make -j6 install package
161+
```
162+
157163
**On Windows:**
158164

159165
- Open the `sln` file in the build folder in Microsoft Visual Studio.

0 commit comments

Comments
 (0)