feat: WebSocket client mode for remote DimOS connection #95
This file contains hidden or 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
| # Build & publish dimos-viewer wheels. | |
| # | |
| # Closely follows Rerun's reusable_build_and_upload_wheels.yml pattern: | |
| # - manylinux_2_28 Docker container for Linux builds | |
| # - Same system deps as Rerun's ci_docker Dockerfile | |
| # - Same Rust toolchain (from rust-toolchain file) | |
| # - Same shell defaults and env conventions | |
| # - GitHub Artifacts instead of GCS for wheel storage | |
| # - Trusted publisher (OIDC) for PyPI instead of API token | |
| # | |
| # Triggers: | |
| # PR → main build + test | |
| # push → main build + test | |
| # tag v* build + test + publish to PyPI + GitHub Release | |
| name: Build & Publish dimos-viewer | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| id-token: write | |
| defaults: | |
| run: | |
| shell: bash --noprofile --norc -euo pipefail {0} | |
| env: | |
| PYTHON_VERSION: "3.10" | |
| PACKAGE_DIR: dimos | |
| # --------------------------------------------------------------------------- | |
| jobs: | |
| # ------------------------------------------------------------------- | |
| # 1. Rust checks & tests (native Ubuntu, no container needed) | |
| # ------------------------------------------------------------------- | |
| check: | |
| name: Cargo check & test | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| run: | | |
| rustup install | |
| rustup show active-toolchain | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev \ | |
| libxcb-xfixes0-dev libxkbcommon-dev libvulkan-dev \ | |
| mesa-vulkan-drivers libxkbcommon-x11-0 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-check-${{ hashFiles('**/Cargo.lock') }} | |
| - run: cargo check -p dimos-viewer | |
| - run: cargo test -p dimos-viewer | |
| # ------------------------------------------------------------------- | |
| # 2. Build wheels per platform | |
| # Linux: manylinux_2_28 container with Rerun's exact deps | |
| # macOS: native runner | |
| # ------------------------------------------------------------------- | |
| build-wheel: | |
| name: Build wheel (${{ matrix.platform }}-py${{ matrix.python-version }}) | |
| needs: [check] | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: linux-x64 | |
| python-version: "3.10" | |
| python-tag: cp310-cp310 | |
| os: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| container: quay.io/pypa/manylinux_2_28_x86_64 | |
| compatibility: manylinux_2_28 | |
| - platform: linux-x64 | |
| python-version: "3.11" | |
| python-tag: cp311-cp311 | |
| os: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| container: quay.io/pypa/manylinux_2_28_x86_64 | |
| compatibility: manylinux_2_28 | |
| - platform: linux-x64 | |
| python-version: "3.12" | |
| python-tag: cp312-cp312 | |
| os: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| container: quay.io/pypa/manylinux_2_28_x86_64 | |
| compatibility: manylinux_2_28 | |
| - platform: linux-arm64 | |
| python-version: "3.10" | |
| python-tag: cp310-cp310 | |
| os: ubuntu-22.04-arm | |
| target: aarch64-unknown-linux-gnu | |
| container: quay.io/pypa/manylinux_2_28_aarch64 | |
| compatibility: manylinux_2_28 | |
| - platform: linux-arm64 | |
| python-version: "3.11" | |
| python-tag: cp311-cp311 | |
| os: ubuntu-22.04-arm | |
| target: aarch64-unknown-linux-gnu | |
| container: quay.io/pypa/manylinux_2_28_aarch64 | |
| compatibility: manylinux_2_28 | |
| - platform: linux-arm64 | |
| python-version: "3.12" | |
| python-tag: cp312-cp312 | |
| os: ubuntu-22.04-arm | |
| target: aarch64-unknown-linux-gnu | |
| container: quay.io/pypa/manylinux_2_28_aarch64 | |
| compatibility: manylinux_2_28 | |
| - platform: macos-arm64 | |
| python-version: "3.10" | |
| python-tag: cp310-cp310 | |
| os: macos-14 | |
| target: aarch64-apple-darwin | |
| container: "" | |
| compatibility: "" | |
| - platform: macos-arm64 | |
| python-version: "3.11" | |
| python-tag: cp311-cp311 | |
| os: macos-14 | |
| target: aarch64-apple-darwin | |
| container: "" | |
| compatibility: "" | |
| - platform: macos-arm64 | |
| python-version: "3.12" | |
| python-tag: cp312-cp312 | |
| os: macos-14 | |
| target: aarch64-apple-darwin | |
| container: "" | |
| compatibility: "" | |
| runs-on: ${{ matrix.os }} | |
| container: ${{ matrix.container || null }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # --- Linux (inside manylinux_2_28 container) --- | |
| # Replicates Rerun's ci_docker/Dockerfile setup inline | |
| - name: Install system dependencies (manylinux) | |
| if: matrix.container != '' | |
| run: | | |
| dnf install -y \ | |
| make automake gcc gcc-c++ kernel-devel \ | |
| cmake \ | |
| curl \ | |
| git \ | |
| atk at-spi2-atk \ | |
| fontconfig-devel \ | |
| freetype-devel \ | |
| glib2-devel \ | |
| gtk3-devel \ | |
| openssl-devel \ | |
| xcb-util-renderutil-devel \ | |
| xcb-util-devel \ | |
| xcb-util-wm-devel \ | |
| libxkbcommon-devel \ | |
| python3-pip | |
| dnf clean all | |
| - name: Install Rust (manylinux) | |
| if: matrix.container != '' | |
| env: | |
| RUSTUP_HOME: /usr/local/rustup | |
| CARGO_HOME: /usr/local/cargo | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
| echo "/usr/local/cargo/bin" >> "$GITHUB_PATH" | |
| - name: Set up Rust toolchain (manylinux) | |
| if: matrix.container != '' | |
| run: | | |
| rustup install | |
| rustup show active-toolchain | |
| - name: Install maturin (manylinux) | |
| if: matrix.container != '' | |
| run: | | |
| /opt/python/${{ matrix.python-tag }}/bin/python3 -m pip install --upgrade pip | |
| /opt/python/${{ matrix.python-tag }}/bin/python3 -m pip install maturin>=1.8.1 | |
| echo "/opt/python/${{ matrix.python-tag }}/bin" >> "$GITHUB_PATH" | |
| - name: Build wheel (manylinux) | |
| if: matrix.container != '' | |
| run: | | |
| maturin build \ | |
| --release \ | |
| --manifest-path "${{ env.PACKAGE_DIR }}/Cargo.toml" \ | |
| --target "${{ matrix.target }}" \ | |
| --compatibility "${{ matrix.compatibility }}" \ | |
| --out dist/ | |
| # --- macOS (native runner) --- | |
| - name: Install Rust (macOS) | |
| if: matrix.container == '' | |
| run: | | |
| rustup install | |
| rustup show active-toolchain | |
| - name: Set up Python (macOS) | |
| if: matrix.container == '' | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "${{ matrix.python-version }}" | |
| - name: Install maturin (macOS) | |
| if: matrix.container == '' | |
| run: | | |
| python3 -m pip install maturin>=1.8.1 | |
| - name: Build wheel (macOS) | |
| if: matrix.container == '' | |
| run: | | |
| maturin build \ | |
| --release \ | |
| --manifest-path "${{ env.PACKAGE_DIR }}/Cargo.toml" \ | |
| --target "${{ matrix.target }}" \ | |
| --out dist/ | |
| # --- Common --- | |
| - name: Upload wheel artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheel-${{ matrix.platform }}-py${{ matrix.python-version }} | |
| path: dist/*.whl | |
| # ------------------------------------------------------------------- | |
| # 3. Test installed wheels (x64 + arm64) | |
| # ------------------------------------------------------------------- | |
| test-wheel: | |
| name: Test wheel (${{ matrix.arch }}-py${{ matrix.python-version }}) | |
| needs: [build-wheel] | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - python-version: "3.10" | |
| os: ubuntu-22.04 | |
| arch: x64 | |
| - python-version: "3.11" | |
| os: ubuntu-22.04 | |
| arch: x64 | |
| - python-version: "3.12" | |
| os: ubuntu-22.04 | |
| arch: x64 | |
| - python-version: "3.10" | |
| os: ubuntu-22.04-arm | |
| arch: arm64 | |
| - python-version: "3.11" | |
| os: ubuntu-22.04-arm | |
| arch: arm64 | |
| - python-version: "3.12" | |
| os: ubuntu-22.04-arm | |
| arch: arm64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "${{ matrix.python-version }}" | |
| - name: Download wheel | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: wheel-linux-${{ matrix.arch }}-py${{ matrix.python-version }} | |
| path: dist/ | |
| - name: Install wheel | |
| run: pip install dist/*.whl | |
| - name: Verify binary | |
| run: | | |
| which dimos-viewer | |
| dimos-viewer --help | |
| # ------------------------------------------------------------------- | |
| # 4. Publish to PyPI (tag v* only) | |
| # Uses trusted publisher (OIDC) — no API token needed. | |
| # ------------------------------------------------------------------- | |
| publish-pypi: | |
| name: Publish to PyPI | |
| needs: [test-wheel] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download all wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wheel-* | |
| merge-multiple: true | |
| path: dist/ | |
| - run: ls -la dist/ | |
| - name: Publish to PyPI (trusted publisher) | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/ | |
| skip-existing: true | |
| # ------------------------------------------------------------------- | |
| # 5. GitHub Release (tag v* only) | |
| # ------------------------------------------------------------------- | |
| github-release: | |
| name: GitHub Release | |
| needs: [publish-pypi] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Download all wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wheel-* | |
| merge-multiple: true | |
| path: dist/ | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/*.whl | |
| generate_release_notes: true |