Add serverless agent. #949
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: [main, deepmind] | |
pull_request: | |
branches: [main] | |
jobs: | |
mujoco_mpc: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
additional_label: "with Clang 14" | |
cmake_args: >- | |
-G Ninja | |
-DCMAKE_C_COMPILER:STRING=clang-14 | |
-DCMAKE_CXX_COMPILER:STRING=clang++-14 | |
-DMJPC_BUILD_GRPC_SERVICE:BOOL=ON | |
additional_targets: "agent_server direct_server filter_server" | |
tmpdir: "/tmp" | |
- os: macos-12 | |
cmake_args: >- | |
-G Ninja | |
-DMJPC_BUILD_GRPC_SERVICE:BOOL=ON | |
additional_targets: "agent_server direct_server filter_server" | |
tmpdir: "/tmp" | |
name: "MuJoCo MPC on ${{ matrix.os }} ${{ matrix.additional_label }}" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare Linux | |
if: ${{ runner.os == 'Linux' }} | |
run: > | |
sudo apt-get update && sudo apt-get install | |
libgl1-mesa-dev | |
libxinerama-dev | |
libxcursor-dev | |
libxrandr-dev | |
libxi-dev | |
ninja-build | |
- name: Prepare macOS | |
if: ${{ runner.os == 'macOS' }} | |
run: brew install ninja | |
- name: Prepare Windows | |
if: ${{ runner.os == 'Windows' }} | |
# Install llvm 16 manually, remove after | |
# https://github.com/actions/runner-images/issues/8125 is resolved and that | |
# version is included in the image by default | |
run: > | |
choco install nasm | |
choco upgrade llvm | |
- name: For the deepmind branch, use MuJoCo HEAD rather than a fixed commit | |
if: ${{ github.ref_name == 'deepmind' }} | |
run: | |
echo "cmake_extra_args=-DMUJOCO_MPC_MUJOCO_GIT_TAG:STRING=main" > "$GITHUB_ENV" | |
- name: Configure MuJoCo MPC | |
shell: bash | |
run: > | |
mkdir build && | |
cd build && | |
cmake .. -DCMAKE_BUILD_TYPE:STRING=Release | |
${{ matrix.cmake_args }} | |
$cmake_extra_args | |
- name: Build MuJoCo MPC | |
working-directory: build | |
run: cmake --build . --config=Release ${{ matrix.cmake_build_args }} --target mjpc agent_test cost_derivatives_test norm_test rollout_test threadpool_test trajectory_test utilities_test direct_force_test direct_optimize_test direct_parameter_test direct_sensor_test direct_trajectory_test direct_utilities_test batch_filter_test batch_prior_test kalman_test unscented_test ${{ matrix.additional_targets }} | |
- name: Test MuJoCo MPC | |
working-directory: build | |
run: ctest -C Release --output-on-failure . | |
- name: Notify team chat | |
shell: bash | |
env: | |
GCHAT_API: ${{ secrets.GCHAT_API }} | |
JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/\ | |
${{ github.run_id }}" | |
if: ${{ failure() && github.event_name == 'push' && env.GCHAT_API != '' }} | |
run: > | |
curl | |
"$GCHAT_API&threadKey=$GITHUB_SHA&messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD" | |
-X POST | |
-H "Content-Type: application/json" | |
-d "{ | |
'text': '<$JOB_URL|*FAILURE*>: | |
job \`${{ matrix.os }}${{ matrix.additional_label }}\` | |
commit \`$(echo $GITHUB_SHA | head -c6)\`\n | |
\`\`\`Author: ${{ github.event.head_commit.author.name }} | |
<${{ github.event.head_commit.author.email }}> | |
\n\n${{ github.event.head_commit.message }}\`\`\` | |
'}" |