From 6ea7828776b01a90ead71279a2457eb0057549d0 Mon Sep 17 00:00:00 2001 From: Ethan Rodkin Date: Wed, 29 Jan 2025 09:15:29 -0500 Subject: [PATCH 1/4] try fixing protogen --- .github/workflows/update_protos.yml | 49 +++++++++++++++++++++++------ src/viam/sdk/robot/client.cpp | 11 +++++++ src/viam/sdk/robot/client.hpp | 12 +++++++ 3 files changed, 62 insertions(+), 10 deletions(-) diff --git a/.github/workflows/update_protos.yml b/.github/workflows/update_protos.yml index de4600f9a..e24198cbd 100644 --- a/.github/workflows/update_protos.yml +++ b/.github/workflows/update_protos.yml @@ -1,6 +1,9 @@ name: Update Protos + Open PR on: + pull_request: + branches: + - main workflow_dispatch: repository_dispatch: types: @@ -8,20 +11,44 @@ on: jobs: update-protos: - if: github.repository_owner == 'viamrobotics' + #if: github.repository_owner == 'viamrobotics' runs-on: ubuntu-latest container: image: ghcr.io/viamrobotics/canon:amd64 steps: - uses: actions/checkout@v4 - - name: setup-grpc + - name: install dependencies run: | - git clone https://github.com/Microsoft/vcpkg.git \ - && cd vcpkg && ./bootstrap-vcpkg.sh && ./vcpkg integrate install \ - && ./vcpkg install grpc \ - && ./vcpkg install upb - - name: setup-openssl - run: apt-get update && sudo apt-get -y --no-install-recommends install libssl-dev + apt-get update + apt-get -y dist-upgrade + DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ + build-essential \ + ca-certificates \ + curl \ + g++ \ + gdb \ + 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 \ + #- name: setup-grpc + #run: | + #git clone https://github.com/Microsoft/vcpkg.git \ + #&& cd vcpkg && ./bootstrap-vcpkg.sh && ./vcpkg integrate install \ + #&& ./vcpkg install grpc \ + #&& ./vcpkg install upb + #- name: setup-openssl + #run: apt-get update && sudo apt-get -y --no-install-recommends install libssl-dev - uses: MarkusJx/install-boost@v2.4.4 with: boost_version: 1.81.0 @@ -34,8 +61,10 @@ jobs: - uses: arduino/setup-protoc@v1 - name: Update buf run: | - cmake -B build -DVIAMCPPSDK_USE_DYNAMIC_PROTOS=ON -DCMAKE_PREFIX_PATH=./vcpkg/installed/x64-linux/share \ - && cmake --build ./build --target update-buf + cmake -B build -DVIAMCPPSDK_USE_DYNAMIC_PROTOS=ON && cmake --build ./build --target update-buf + #run: | + #cmake -B build -DVIAMCPPSDK_USE_DYNAMIC_PROTOS=ON -DCMAKE_PREFIX_PATH=./vcpkg/installed/x64-linux/share \ + #&& cmake --build ./build --target update-buf env: BOOST_ROOT: ${{ github.workspace }}/boost/boost - name: Generate buf diff --git a/src/viam/sdk/robot/client.cpp b/src/viam/sdk/robot/client.cpp index 25613ac88..536f076e8 100644 --- a/src/viam/sdk/robot/client.cpp +++ b/src/viam/sdk/robot/client.cpp @@ -355,5 +355,16 @@ void RobotClient::stop_all(const std::unordered_map& extra) { } } +// RobotClient::status RobotClient::get_machine_status() const { +// robot::v1::GetMachineStatusResponse resp; +// resp.config(); +// return make_client_helper(this, *impl_->stub_, &StubType::GetMachineStatus) +//.invoke([](auto& response) { +// switch (response.state) { +// case +// } +// }); +//} + } // namespace sdk } // namespace viam diff --git a/src/viam/sdk/robot/client.hpp b/src/viam/sdk/robot/client.hpp index fd62660af..37b835c15 100644 --- a/src/viam/sdk/robot/client.hpp +++ b/src/viam/sdk/robot/client.hpp @@ -34,6 +34,15 @@ namespace sdk { /// `with_channel` require a user call to `close()`. class RobotClient { public: + /// @enum status + /// @brief the current status of the robot + /// @ingroup Robot + // enum class status : uint8_t { + // k_initializing, + // k_running, + // k_unspecified, + //}; + struct frame_system_config { WorldState::transform frame; ProtoStruct kinematics; @@ -132,6 +141,9 @@ class RobotClient { /// @param id The ID of the operation to cancel. void cancel_operation(std::string id); + /// @brief gets the current status of the machine + // status get_machine_status() const; + private: std::vector> threads_; std::atomic should_refresh_; From 18064e7e11b0a0364786f7ac0955a75c60824918 Mon Sep 17 00:00:00 2001 From: Ethan Rodkin Date: Wed, 29 Jan 2025 09:28:44 -0500 Subject: [PATCH 2/4] confirm changes --- .github/workflows/update_protos.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update_protos.yml b/.github/workflows/update_protos.yml index e24198cbd..85efa5ad4 100644 --- a/.github/workflows/update_protos.yml +++ b/.github/workflows/update_protos.yml @@ -69,14 +69,17 @@ jobs: BOOST_ROOT: ${{ github.workspace }}/boost/boost - name: Generate buf run: | - cmake -B build -DVIAMCPPSDK_USE_DYNAMIC_PROTOS=ON -DCMAKE_PREFIX_PATH=./vcpkg/installed/x64-linux/share \ - && cmake --build ./build --target update-static-protos + cmake -B build -DVIAMCPPSDK_USE_DYNAMIC_PROTOS=ON && cmake --build ./build --target update-static-protos + #run: | + #cmake -B build -DVIAMCPPSDK_USE_DYNAMIC_PROTOS=ON -DCMAKE_PREFIX_PATH=./vcpkg/installed/x64-linux/share \ + #&& cmake --build ./build --target update-static-protos env: BOOST_ROOT: ${{ github.workspace }}/boost/boost - name: cleanup - run: rm -rf boost/ && rm -rf vcpkg/ + run: echo $(git status) + #run: rm -rf boost/ && rm -rf vcpkg/ - name: Update proto tag - run: echo "${{ github.event.client_payload.tag }}" > src/viam/api/api_proto_tag.lock + run: echo "${{ github.event.client_payload.tag }}" > src/viam/api/api_proto_tag.lock && echo $(git diff src/viam/api/api_proto_tag.lock) - name: Add + Commit + Open PR uses: peter-evans/create-pull-request@v3 with: From 0c5bff00cd617438d4c9e8e1a31c8dbaf242444c Mon Sep 17 00:00:00 2001 From: Ethan Rodkin Date: Wed, 29 Jan 2025 09:36:00 -0500 Subject: [PATCH 3/4] get ready for primetime --- .github/workflows/update_protos.yml | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/.github/workflows/update_protos.yml b/.github/workflows/update_protos.yml index 85efa5ad4..56f1593f2 100644 --- a/.github/workflows/update_protos.yml +++ b/.github/workflows/update_protos.yml @@ -1,9 +1,6 @@ name: Update Protos + Open PR on: - pull_request: - branches: - - main workflow_dispatch: repository_dispatch: types: @@ -11,12 +8,14 @@ on: jobs: update-protos: - #if: github.repository_owner == 'viamrobotics' + if: github.repository_owner == 'viamrobotics' runs-on: ubuntu-latest container: image: ghcr.io/viamrobotics/canon:amd64 steps: - uses: actions/checkout@v4 + # note (erodkin): these dependencies were cribbed from what we use to build the SDK + # in the release job. Only very cursory effort was made to prune. - name: install dependencies run: | apt-get update @@ -41,14 +40,6 @@ jobs: software-properties-common \ sudo \ wget \ - #- name: setup-grpc - #run: | - #git clone https://github.com/Microsoft/vcpkg.git \ - #&& cd vcpkg && ./bootstrap-vcpkg.sh && ./vcpkg integrate install \ - #&& ./vcpkg install grpc \ - #&& ./vcpkg install upb - #- name: setup-openssl - #run: apt-get update && sudo apt-get -y --no-install-recommends install libssl-dev - uses: MarkusJx/install-boost@v2.4.4 with: boost_version: 1.81.0 @@ -62,24 +53,17 @@ jobs: - name: Update buf run: | cmake -B build -DVIAMCPPSDK_USE_DYNAMIC_PROTOS=ON && cmake --build ./build --target update-buf - #run: | - #cmake -B build -DVIAMCPPSDK_USE_DYNAMIC_PROTOS=ON -DCMAKE_PREFIX_PATH=./vcpkg/installed/x64-linux/share \ - #&& cmake --build ./build --target update-buf env: BOOST_ROOT: ${{ github.workspace }}/boost/boost - name: Generate buf run: | cmake -B build -DVIAMCPPSDK_USE_DYNAMIC_PROTOS=ON && cmake --build ./build --target update-static-protos - #run: | - #cmake -B build -DVIAMCPPSDK_USE_DYNAMIC_PROTOS=ON -DCMAKE_PREFIX_PATH=./vcpkg/installed/x64-linux/share \ - #&& cmake --build ./build --target update-static-protos env: BOOST_ROOT: ${{ github.workspace }}/boost/boost - name: cleanup - run: echo $(git status) - #run: rm -rf boost/ && rm -rf vcpkg/ + run: rm -rf boost/ - name: Update proto tag - run: echo "${{ github.event.client_payload.tag }}" > src/viam/api/api_proto_tag.lock && echo $(git diff src/viam/api/api_proto_tag.lock) + run: echo "${{ github.event.client_payload.tag }}" > src/viam/api/api_proto_tag.lock - name: Add + Commit + Open PR uses: peter-evans/create-pull-request@v3 with: From bb5f69e8007b8bb78a8adc7373974c0a2b7cabaa Mon Sep 17 00:00:00 2001 From: Ethan Rodkin Date: Wed, 29 Jan 2025 09:37:49 -0500 Subject: [PATCH 4/4] remove get_machine_status stuff --- src/viam/sdk/robot/client.cpp | 11 ----------- src/viam/sdk/robot/client.hpp | 12 ------------ 2 files changed, 23 deletions(-) diff --git a/src/viam/sdk/robot/client.cpp b/src/viam/sdk/robot/client.cpp index 536f076e8..25613ac88 100644 --- a/src/viam/sdk/robot/client.cpp +++ b/src/viam/sdk/robot/client.cpp @@ -355,16 +355,5 @@ void RobotClient::stop_all(const std::unordered_map& extra) { } } -// RobotClient::status RobotClient::get_machine_status() const { -// robot::v1::GetMachineStatusResponse resp; -// resp.config(); -// return make_client_helper(this, *impl_->stub_, &StubType::GetMachineStatus) -//.invoke([](auto& response) { -// switch (response.state) { -// case -// } -// }); -//} - } // namespace sdk } // namespace viam diff --git a/src/viam/sdk/robot/client.hpp b/src/viam/sdk/robot/client.hpp index 37b835c15..fd62660af 100644 --- a/src/viam/sdk/robot/client.hpp +++ b/src/viam/sdk/robot/client.hpp @@ -34,15 +34,6 @@ namespace sdk { /// `with_channel` require a user call to `close()`. class RobotClient { public: - /// @enum status - /// @brief the current status of the robot - /// @ingroup Robot - // enum class status : uint8_t { - // k_initializing, - // k_running, - // k_unspecified, - //}; - struct frame_system_config { WorldState::transform frame; ProtoStruct kinematics; @@ -141,9 +132,6 @@ class RobotClient { /// @param id The ID of the operation to cancel. void cancel_operation(std::string id); - /// @brief gets the current status of the machine - // status get_machine_status() const; - private: std::vector> threads_; std::atomic should_refresh_;