diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index f9d7ca07..00000000 --- a/.dockerignore +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2026 LiveKit -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Rust build output (huge; rebuilt inside image) -client-sdk-rust/target/ - -# Git and IDE -.git -.gitignore -.gitmodules -.cursor -.vscode -*.swp -*~ - -# Build outputs and caches -build/ -*.log -__pycache__/ - -# Docker -Dockerfile -.dockerignore - -# Docs and misc (optional; uncomment if you never need these in the image) -# README.md -# *.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46d3140c..d8bdaf1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,6 @@ jobs: docs: ${{ steps.filter.outputs.docs }} cpp_tools: ${{ steps.filter.outputs.cpp_tools }} rust_release_check: ${{ steps.filter.outputs.rust_release_check }} - docker: ${{ steps.filter.outputs.docker }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2 @@ -90,10 +89,6 @@ jobs: - .gitmodules - .github/workflows/ci.yml - .github/workflows/cpp-tools.yml - docker: - - docker/** - - .github/workflows/ci.yml - - .github/workflows/docker-images.yml rust_release_check: - client-sdk-rust @@ -104,19 +99,6 @@ jobs: uses: ./.github/workflows/builds.yml secrets: inherit - docker-images: - name: Docker Images - needs: changes - if: ${{ (github.event_name == 'pull_request' && needs.changes.outputs.docker == 'true') || (github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.changes.outputs.docker == 'true') || github.event_name == 'workflow_dispatch' }} - permissions: - contents: read - actions: read - packages: write - uses: ./.github/workflows/docker-images.yml - with: - push_images: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - secrets: inherit - tests: name: Tests needs: changes @@ -165,7 +147,6 @@ jobs: needs: - changes - builds - - docker-images - tests - license-check - cpp-tools diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml deleted file mode 100644 index fcc466b9..00000000 --- a/.github/workflows/docker-images.yml +++ /dev/null @@ -1,596 +0,0 @@ -name: Docker Images - -# Called by top-level ci.yml and make-release.yml -on: - workflow_call: - inputs: - push_images: - description: "When true, publish built images to GHCR." - required: true - type: boolean - push_tag: - description: "Primary image tag to publish when push_images is true (for example v1.2.3)." - required: false - default: "" - type: string - workflow_dispatch: - inputs: - push_images: - description: "When true, publish built images to GHCR." - required: true - default: false - type: boolean - push_tag: - description: "Primary image tag to publish when push_images is true (for example v1.2.3)." - required: false - default: "" - type: string - -permissions: - contents: read - actions: read - packages: write - -jobs: - detect-changes: - name: Detect Docker input changes - runs-on: ubuntu-latest - outputs: - base_changed: ${{ steps.detect.outputs.base_changed }} - sdk_changed: ${{ steps.detect.outputs.sdk_changed }} - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 0 - - - name: Detect changed inputs - id: detect - shell: bash - run: | - set -euo pipefail - - base_ref="${{ github.base_ref }}" - if [[ -z "${base_ref}" ]]; then - base_ref="${{ github.event.pull_request.base.ref }}" - fi - - before_sha="${{ github.event.before }}" - changed_files="" - has_diff_context=false - - if [[ -n "${base_ref}" ]]; then - git fetch --no-tags --depth=1 origin "${base_ref}" >/dev/null 2>&1 || true - fi - - if [[ -n "${base_ref}" ]] && git rev-parse --verify --quiet "origin/${base_ref}" >/dev/null; then - changed_files="$(git diff --name-only "origin/${base_ref}...HEAD")" - has_diff_context=true - elif [[ -n "${before_sha}" ]] && [[ "${before_sha}" != "0000000000000000000000000000000000000000" ]]; then - changed_files="$(git diff --name-only "${before_sha}" "${{ github.sha }}")" - has_diff_context=true - fi - - if [[ "${has_diff_context}" != "true" ]]; then - # Tag/manual workflow calls do not always have an obvious diff base. - # Fall back to full docker flow for deterministic smoke/publish behavior. - base_changed=true - sdk_changed=true - else - base_changed=false - sdk_changed=false - - while IFS= read -r path; do - [[ -z "${path}" ]] && continue - - if [[ "${path}" == "docker/Dockerfile.base" ]]; then - base_changed=true - sdk_changed=true - fi - - case "${path}" in - docker/Dockerfile.sdk|src/*|include/*|client-sdk-rust/*|cmake/*|data/*|cpp-example-collection|CMakeLists.txt|build.sh|build.cmd|build.h.in|.build-info.json.in|CMakePresets.json|.github/workflows/docker-images.yml) - sdk_changed=true - ;; - esac - done <<< "${changed_files}" - fi - - echo "base_changed=${base_changed}" >> "$GITHUB_OUTPUT" - echo "sdk_changed=${sdk_changed}" >> "$GITHUB_OUTPUT" - - docker-build-x64: - name: Build (docker-linux-x64) - runs-on: ubuntu-latest - needs: detect-changes - if: ${{ needs.detect-changes.outputs.sdk_changed == 'true' }} - - steps: - - name: Checkout (with submodules) - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - fetch-depth: 0 - - - name: Free disk space - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: false - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: true - swap-storage: true - - - name: Pull base image from GHCR - if: needs.detect-changes.outputs.base_changed == 'false' - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -euxo pipefail - owner="$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')" - echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - docker pull "ghcr.io/${owner}/client-sdk-cpp-base:base-main-amd64" - docker tag "ghcr.io/${owner}/client-sdk-cpp-base:base-main-amd64" \ - "livekit-cpp-sdk-base-x64:${{ github.sha }}" - - - name: Build base Docker image - if: needs.detect-changes.outputs.base_changed == 'true' - run: | - docker build \ - --build-arg TARGETARCH=amd64 \ - -t livekit-cpp-sdk-base-x64:${{ github.sha }} \ - -f docker/Dockerfile.base \ - docker - - - name: Build SDK Docker image - run: | - docker build \ - --build-arg BASE_IMAGE=livekit-cpp-sdk-base-x64:${{ github.sha }} \ - -t livekit-cpp-sdk-x64:${{ github.sha }} \ - . \ - -f docker/Dockerfile.sdk - - - name: Verify installed SDK inside image - run: | - docker run --rm livekit-cpp-sdk-x64:${{ github.sha }} bash -c \ - 'test -f /opt/livekit-sdk/lib/cmake/LiveKit/LiveKitConfig.cmake' - - - name: Resolve image refs for push - if: ${{ inputs.push_images }} - id: push_refs - shell: bash - run: | - set -euo pipefail - owner="$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')" - resolved_tag="${{ inputs.push_tag }}" - if [[ -z "${resolved_tag}" ]]; then - resolved_tag="sha-${GITHUB_SHA}" - fi - echo "base_image=ghcr.io/${owner}/client-sdk-cpp-base" >> "$GITHUB_OUTPUT" - echo "sdk_image=ghcr.io/${owner}/client-sdk-cpp" >> "$GITHUB_OUTPUT" - echo "resolved_tag=${resolved_tag}" >> "$GITHUB_OUTPUT" - - - name: Login to GHCR (push) - if: ${{ inputs.push_images }} - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -euo pipefail - echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - - - name: Push base image (amd64) - if: ${{ inputs.push_images && needs.detect-changes.outputs.base_changed == 'true' }} - shell: bash - run: | - set -euxo pipefail - primary_tag="${{ steps.push_refs.outputs.resolved_tag }}" - sha_tag="sha-${GITHUB_SHA}" - base_image="${{ steps.push_refs.outputs.base_image }}" - - docker tag livekit-cpp-sdk-base-x64:${{ github.sha }} "${base_image}:${primary_tag}-amd64" - docker push "${base_image}:${primary_tag}-amd64" - - if [[ "${primary_tag}" != "${sha_tag}" ]]; then - docker tag livekit-cpp-sdk-base-x64:${{ github.sha }} "${base_image}:${sha_tag}-amd64" - docker push "${base_image}:${sha_tag}-amd64" - fi - - docker tag livekit-cpp-sdk-base-x64:${{ github.sha }} "${base_image}:base-main-amd64" - docker push "${base_image}:base-main-amd64" - - - name: Push SDK image (amd64) - if: ${{ inputs.push_images }} - shell: bash - run: | - set -euxo pipefail - primary_tag="${{ steps.push_refs.outputs.resolved_tag }}" - sha_tag="sha-${GITHUB_SHA}" - sdk_image="${{ steps.push_refs.outputs.sdk_image }}" - - docker tag livekit-cpp-sdk-x64:${{ github.sha }} "${sdk_image}:${primary_tag}-amd64" - docker push "${sdk_image}:${primary_tag}-amd64" - - if [[ "${primary_tag}" != "${sha_tag}" ]]; then - docker tag livekit-cpp-sdk-x64:${{ github.sha }} "${sdk_image}:${sha_tag}-amd64" - docker push "${sdk_image}:${sha_tag}-amd64" - fi - - - name: Save Docker image artifact - run: | - docker save livekit-cpp-sdk-x64:${{ github.sha }} | gzip > livekit-cpp-sdk-x64-docker.tar.gz - - - name: Upload Docker image artifact - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: livekit-cpp-sdk-docker-x64 - path: livekit-cpp-sdk-x64-docker.tar.gz - retention-days: 7 - - docker-build-linux-arm64: - name: Build (docker-linux-arm64) - runs-on: ubuntu-24.04-arm - needs: detect-changes - if: ${{ needs.detect-changes.outputs.sdk_changed == 'true' }} - - steps: - - name: Checkout (with submodules) - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - submodules: recursive - fetch-depth: 0 - - - name: Free disk space - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: false - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: true - swap-storage: true - - - name: Pull base image from GHCR - if: needs.detect-changes.outputs.base_changed == 'false' - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -euxo pipefail - owner="$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')" - echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - docker pull "ghcr.io/${owner}/client-sdk-cpp-base:base-main-arm64" - docker tag "ghcr.io/${owner}/client-sdk-cpp-base:base-main-arm64" \ - "livekit-cpp-sdk-base-arm64:${{ github.sha }}" - - - name: Build base Docker image - if: needs.detect-changes.outputs.base_changed == 'true' - run: | - docker build \ - --build-arg TARGETARCH=arm64 \ - -t livekit-cpp-sdk-base-arm64:${{ github.sha }} \ - -f docker/Dockerfile.base \ - docker - - - name: Build SDK Docker image - run: | - docker build \ - --build-arg BASE_IMAGE=livekit-cpp-sdk-base-arm64:${{ github.sha }} \ - -t livekit-cpp-sdk:${{ github.sha }} \ - . \ - -f docker/Dockerfile.sdk - - - name: Verify installed SDK inside image - run: | - docker run --rm livekit-cpp-sdk:${{ github.sha }} bash -c \ - 'test -f /opt/livekit-sdk/lib/cmake/LiveKit/LiveKitConfig.cmake' - - - name: Resolve image refs for push - if: ${{ inputs.push_images }} - id: push_refs - shell: bash - run: | - set -euo pipefail - owner="$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')" - resolved_tag="${{ inputs.push_tag }}" - if [[ -z "${resolved_tag}" ]]; then - resolved_tag="sha-${GITHUB_SHA}" - fi - echo "base_image=ghcr.io/${owner}/client-sdk-cpp-base" >> "$GITHUB_OUTPUT" - echo "sdk_image=ghcr.io/${owner}/client-sdk-cpp" >> "$GITHUB_OUTPUT" - echo "resolved_tag=${resolved_tag}" >> "$GITHUB_OUTPUT" - - - name: Login to GHCR (push) - if: ${{ inputs.push_images }} - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -euo pipefail - echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - - - name: Push base image (arm64) - if: ${{ inputs.push_images && needs.detect-changes.outputs.base_changed == 'true' }} - shell: bash - run: | - set -euxo pipefail - primary_tag="${{ steps.push_refs.outputs.resolved_tag }}" - sha_tag="sha-${GITHUB_SHA}" - base_image="${{ steps.push_refs.outputs.base_image }}" - - docker tag livekit-cpp-sdk-base-arm64:${{ github.sha }} "${base_image}:${primary_tag}-arm64" - docker push "${base_image}:${primary_tag}-arm64" - - if [[ "${primary_tag}" != "${sha_tag}" ]]; then - docker tag livekit-cpp-sdk-base-arm64:${{ github.sha }} "${base_image}:${sha_tag}-arm64" - docker push "${base_image}:${sha_tag}-arm64" - fi - - docker tag livekit-cpp-sdk-base-arm64:${{ github.sha }} "${base_image}:base-main-arm64" - docker push "${base_image}:base-main-arm64" - - - name: Push SDK image (arm64) - if: ${{ inputs.push_images }} - shell: bash - run: | - set -euxo pipefail - primary_tag="${{ steps.push_refs.outputs.resolved_tag }}" - sha_tag="sha-${GITHUB_SHA}" - sdk_image="${{ steps.push_refs.outputs.sdk_image }}" - - docker tag livekit-cpp-sdk:${{ github.sha }} "${sdk_image}:${primary_tag}-arm64" - docker push "${sdk_image}:${primary_tag}-arm64" - - if [[ "${primary_tag}" != "${sha_tag}" ]]; then - docker tag livekit-cpp-sdk:${{ github.sha }} "${sdk_image}:${sha_tag}-arm64" - docker push "${sdk_image}:${sha_tag}-arm64" - fi - - - name: Save Docker image artifact - run: | - docker save livekit-cpp-sdk:${{ github.sha }} | gzip > livekit-cpp-sdk-arm64-docker.tar.gz - - - name: Upload Docker image artifact - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: livekit-cpp-sdk-docker-arm64 - path: livekit-cpp-sdk-arm64-docker.tar.gz - retention-days: 7 - - build-collections-linux-arm64: - name: Build (cpp-example-collection-linux-arm64) - runs-on: ubuntu-24.04-arm - needs: - - detect-changes - - docker-build-linux-arm64 - if: | - always() && - needs.detect-changes.outputs.sdk_changed == 'true' && - needs.docker-build-linux-arm64.result != 'failure' && - needs.docker-build-linux-arm64.result != 'cancelled' - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 1 - - # Reclaim ~30GB before loading the multi-GB SDK image and building the - # example collection inside it. Mirrors the docker-build jobs; without it - # the x64 collection build has hit "no space left on device". - - name: Free disk space - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: false - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: true - swap-storage: true - - - name: Download Docker image artifact - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: livekit-cpp-sdk-docker-arm64 - - - name: Load Docker image - run: gzip -dc livekit-cpp-sdk-arm64-docker.tar.gz | docker load - - - name: Build cpp-example-collection against installed SDK - run: | - cpp_ex_ref="$(git rev-parse HEAD:cpp-example-collection)" - docker run -e CPP_EX_REF="${cpp_ex_ref}" --rm livekit-cpp-sdk:${{ github.sha }} bash -lc ' - set -euxo pipefail - git clone https://github.com/livekit-examples/cpp-example-collection.git /tmp/cpp-example-collection - cd /tmp/cpp-example-collection - git fetch --depth 1 origin "$CPP_EX_REF" - git checkout "$CPP_EX_REF" - cmake -S . -B build -DLIVEKIT_LOCAL_SDK_DIR=/opt/livekit-sdk - cmake --build build --parallel - ' - - build-collections-x64: - name: Build (cpp-example-collection-x64) - runs-on: ubuntu-latest - needs: - - detect-changes - - docker-build-x64 - if: | - always() && - needs.detect-changes.outputs.sdk_changed == 'true' && - needs.docker-build-x64.result != 'failure' && - needs.docker-build-x64.result != 'cancelled' - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 1 - - # Reclaim ~30GB before loading the multi-GB SDK image and building the - # example collection inside it. The standard ubuntu-latest runner has hit - # "no space left on device" here without this step. - - name: Free disk space - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: false - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: true - swap-storage: true - - - name: Download Docker image artifact - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: livekit-cpp-sdk-docker-x64 - - - name: Load Docker image - run: gzip -dc livekit-cpp-sdk-x64-docker.tar.gz | docker load - - - name: Build cpp-example-collection against installed SDK - run: | - cpp_ex_ref="$(git rev-parse HEAD:cpp-example-collection)" - docker run -e CPP_EX_REF="${cpp_ex_ref}" --rm livekit-cpp-sdk-x64:${{ github.sha }} bash -lc ' - set -euxo pipefail - git clone https://github.com/livekit-examples/cpp-example-collection.git /tmp/cpp-example-collection - cd /tmp/cpp-example-collection - git fetch --depth 1 origin "$CPP_EX_REF" - git checkout "$CPP_EX_REF" - cmake -S . -B build -DLIVEKIT_LOCAL_SDK_DIR=/opt/livekit-sdk - cmake --build build --parallel - ' - - publish-base-manifest: - name: Publish base manifest - runs-on: ubuntu-latest - needs: - - detect-changes - - docker-build-x64 - - docker-build-linux-arm64 - if: | - always() && - inputs.push_images && - needs.detect-changes.outputs.base_changed == 'true' && - needs.docker-build-x64.result != 'failure' && - needs.docker-build-x64.result != 'cancelled' && - needs.docker-build-linux-arm64.result != 'failure' && - needs.docker-build-linux-arm64.result != 'cancelled' - - steps: - - name: Resolve image refs for push - id: push_refs - shell: bash - run: | - set -euo pipefail - owner="$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')" - resolved_tag="${{ inputs.push_tag }}" - if [[ -z "${resolved_tag}" ]]; then - resolved_tag="sha-${GITHUB_SHA}" - fi - echo "base_image=ghcr.io/${owner}/client-sdk-cpp-base" >> "$GITHUB_OUTPUT" - echo "resolved_tag=${resolved_tag}" >> "$GITHUB_OUTPUT" - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 - - - name: Login to GHCR - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -euo pipefail - echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - - - name: Publish base manifest tags - shell: bash - run: | - set -euxo pipefail - base_image="${{ steps.push_refs.outputs.base_image }}" - primary_tag="${{ steps.push_refs.outputs.resolved_tag }}" - sha_tag="sha-${GITHUB_SHA}" - - docker buildx imagetools create \ - -t "${base_image}:${primary_tag}" \ - "${base_image}:${primary_tag}-amd64" \ - "${base_image}:${primary_tag}-arm64" - - if [[ "${primary_tag}" != "${sha_tag}" ]]; then - docker buildx imagetools create \ - -t "${base_image}:${sha_tag}" \ - "${base_image}:${sha_tag}-amd64" \ - "${base_image}:${sha_tag}-arm64" - fi - - docker buildx imagetools create \ - -t "${base_image}:base-main" \ - "${base_image}:base-main-amd64" \ - "${base_image}:base-main-arm64" - - publish-sdk-manifest: - name: Publish SDK manifest - runs-on: ubuntu-latest - needs: - - detect-changes - - docker-build-x64 - - docker-build-linux-arm64 - if: | - always() && - inputs.push_images && - needs.detect-changes.outputs.sdk_changed == 'true' && - needs.docker-build-x64.result != 'failure' && - needs.docker-build-x64.result != 'cancelled' && - needs.docker-build-linux-arm64.result != 'failure' && - needs.docker-build-linux-arm64.result != 'cancelled' - - steps: - - name: Resolve image refs for push - id: push_refs - shell: bash - run: | - set -euo pipefail - owner="$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')" - resolved_tag="${{ inputs.push_tag }}" - if [[ -z "${resolved_tag}" ]]; then - resolved_tag="sha-${GITHUB_SHA}" - fi - echo "sdk_image=ghcr.io/${owner}/client-sdk-cpp" >> "$GITHUB_OUTPUT" - echo "resolved_tag=${resolved_tag}" >> "$GITHUB_OUTPUT" - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 - - - name: Login to GHCR - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -euo pipefail - echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - - - name: Publish SDK manifest tags - shell: bash - run: | - set -euxo pipefail - sdk_image="${{ steps.push_refs.outputs.sdk_image }}" - primary_tag="${{ steps.push_refs.outputs.resolved_tag }}" - sha_tag="sha-${GITHUB_SHA}" - - docker buildx imagetools create \ - -t "${sdk_image}:${primary_tag}" \ - "${sdk_image}:${primary_tag}-amd64" \ - "${sdk_image}:${primary_tag}-arm64" - - if [[ "${primary_tag}" != "${sha_tag}" ]]; then - docker buildx imagetools create \ - -t "${sdk_image}:${sha_tag}" \ - "${sdk_image}:${sha_tag}-amd64" \ - "${sdk_image}:${sha_tag}-arm64" - fi diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml index f3243434..45bb289d 100644 --- a/.github/workflows/make-release.yml +++ b/.github/workflows/make-release.yml @@ -336,26 +336,12 @@ jobs: name: livekit-sdk-${{ matrix.name }}-${{ steps.version.outputs.version }} path: sdk-out/livekit-sdk-${{ matrix.name }}-${{ steps.version.outputs.version }} - docker-images: - name: Docker Images - if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' - permissions: - contents: read - actions: read - packages: write - uses: ./.github/workflows/docker-images.yml - with: - push_images: ${{ github.ref_type == 'tag' }} - push_tag: ${{ github.ref_type == 'tag' && github.ref_name || '' }} - secrets: inherit - # ---------- Release Job ---------- release: name: Create GitHub Release runs-on: ubuntu-latest needs: - build - - docker-images permissions: contents: write if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' diff --git a/AGENTS.md b/AGENTS.md index 5f083fa4..55da0430 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -91,7 +91,6 @@ Be sure to update the directory layout in this file if the directory layout chan | `cpp-tools/` | Git submodule holding shared LiveKit C++ engineering guidance, clang-format / clang-tidy configs, scripts, docs, and CI workflow | | `client-sdk-rust/livekit-ffi/protocol/*.proto` | FFI contract (protobuf definitions, read-only reference) | | `cmake/` | Build helpers (`protobuf.cmake`, `spdlog.cmake`, `nlohmann_json.cmake`, `LiveKitConfig.cmake.in`) | -| `docker/` | Dockerfile for CI and SDK distribution images | | `scripts/` | Local helper scripts for SDK-specific development tasks | | `docs/` | Documentation root. `docs/` holds hand-written long-form Markdown intended to also read well on GitHub. | | `docs/doxygen/` | Doxygen tool config, theme assets, and Doxygen-only content (`Doxyfile`, `index.md` mainpage, `customization/*.css`, `customization/header.html`, `customization/favicon.ico`). Files here use Doxygen-only syntax (`@ref`, `@brief`, …) and are not intended for human reading on their own. | @@ -401,8 +400,6 @@ all filtered stages; normal pull requests and pushes use the path filters. feedback. - `.github/workflows/license_check.yml` — Cheap license check, run on every CI invocation. -- `.github/workflows/docker-images.yml` — Reusable Docker image smoke-test and - publish workflow (optional push via input), called by CI and release workflows. The `tests.yml` e2e jobs consume two external, pinned composite actions: `livekit/dev-server-action` (local `livekit-server`) and diff --git a/README.md b/README.md index 89c3cee9..459a0ecd 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ cd client-sdk-cpp Building requires a stable Rust toolchain and platform-specific build deps (`protobuf`, `abseil`, `openssl` on Linux). See [docs/building.md](docs/building.md) -for full prerequisites table, Docker recipe, CMake presets, and troubleshooting. +for the full prerequisites table, CMake presets, and troubleshooting. ### Hello, LiveKit diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base deleted file mode 100644 index 8e554a8c..00000000 --- a/docker/Dockerfile.base +++ /dev/null @@ -1,106 +0,0 @@ -# Copyright 2026 LiveKit -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Build with (from docker/ directory): -# docker buildx build --platform linux/$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') -t livekit-cpp-sdk-base -f Dockerfile.base . -# Run with: -# docker run -it --network host livekit-cpp-sdk-base:latest bash - -FROM ubuntu:22.04 - -ENV DEBIAN_FRONTEND=noninteractive -ENV HOME=/root - -# Install make, pkg-config, and base build deps (pkg-config + libglib2.0-dev for Rust glib-sys, libasound2-dev for alsa-sys) -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - curl \ - git \ - libasound2-dev \ - libabsl-dev \ - libclang-dev \ - libcurl4-openssl-dev \ - libdrm-dev \ - libglib2.0-dev \ - libprotobuf-dev \ - libdecor-0-dev \ - libssl-dev \ - libunwind-dev \ - libusb-1.0-0-dev \ - libva-dev \ - libwayland-dev \ - make \ - ninja-build \ - pkg-config \ - protobuf-compiler \ - wget \ - llvm-dev \ - clang \ - xz-utils \ - && rm -rf /var/lib/apt/lists/* - -# Install GCC 14 first (slow; keep early for better layer caching) -RUN apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - flex \ - libgmp-dev \ - libmpc-dev \ - libmpfr-dev \ - && rm -rf /var/lib/apt/lists/* - -RUN cd $HOME \ - && wget https://ftp.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz \ - && tar xf gcc-14.2.0.tar.xz \ - && cd gcc-14.2.0 \ - && ./configure --prefix=$HOME/gcc-14 --enable-languages=c,c++ --disable-multilib --disable-bootstrap \ - && make -j$(nproc) \ - && make install \ - && cd $HOME \ - && rm -rf gcc-14.2.0 gcc-14.2.0.tar.xz - -RUN mkdir -p /home/installs && cp -a $HOME/gcc-14/bin/* /home/installs/ - -ENV CC=$HOME/gcc-14/bin/gcc -ENV CXX=$HOME/gcc-14/bin/g++ -ENV LD_LIBRARY_PATH=$HOME/gcc-14/lib64 - -# Install CMake 3.31.5 for current architecture (prefix dir must exist before installer runs) -# TARGETARCH is set by Docker BuildKit when building (amd64 -> x86_64, arm64 -> aarch64) -ARG TARGETARCH -RUN mkdir -p $HOME/cmake-3.31 \ - && CMAKE_ARCH=$(case "$TARGETARCH" in amd64) echo x86_64 ;; arm64) echo aarch64 ;; *) echo "$TARGETARCH" ;; esac) \ - && wget -q "https://github.com/Kitware/CMake/releases/download/v3.31.5/cmake-3.31.5-linux-${CMAKE_ARCH}.sh" \ - -O cmake-installer.sh \ - && chmod +x cmake-installer.sh \ - && ./cmake-installer.sh --skip-license --prefix=$HOME/cmake-3.31 \ - && rm cmake-installer.sh - -ENV PATH=$HOME/cmake-3.31/bin:$PATH - -# Install Rust (non-interactive) -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ - && . $HOME/.cargo/env && rustup default stable - -ENV PATH=$HOME/.cargo/bin:$PATH - -# Deps for SDL (X11 + OpenGL/GLX for FindOpenGL) -RUN apt-get update && apt-get install -y --no-install-recommends \ - libgl1-mesa-dev \ - libx11-dev \ - libxcursor-dev \ - libxext-dev \ - libxfixes-dev \ - libxi-dev \ - libxrandr-dev \ - && rm -rf /var/lib/apt/lists/* diff --git a/docker/Dockerfile.sdk b/docker/Dockerfile.sdk deleted file mode 100644 index 6d31a878..00000000 --- a/docker/Dockerfile.sdk +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2026 LiveKit -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Build with (from repo root): -# docker buildx build --platform linux/$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') --build-arg BASE_IMAGE=livekit-cpp-sdk-base -t livekit-cpp-sdk . -f docker/Dockerfile.sdk -# Run with: -# docker run -it --network host livekit-cpp-sdk:latest bash - -ARG BASE_IMAGE=livekit-cpp-sdk-base -FROM ${BASE_IMAGE} - -ARG LIVEKIT_VERSION=0.0.0 -ENV SDK_INSTALL_PREFIX=/opt/livekit-sdk - -# Copy project source (build context = repo root) -WORKDIR /client-sdk-cpp -RUN mkdir -p /client-sdk-cpp -COPY src /client-sdk-cpp/src -COPY include /client-sdk-cpp/include -COPY build.sh /client-sdk-cpp/build.sh -COPY CMakePresets.json /client-sdk-cpp/CMakePresets.json -COPY build.cmd /client-sdk-cpp/build.cmd -COPY client-sdk-rust /client-sdk-cpp/client-sdk-rust -COPY data /client-sdk-cpp/data -COPY cmake /client-sdk-cpp/cmake -COPY CMakeLists.txt /client-sdk-cpp/CMakeLists.txt -COPY build.h.in /client-sdk-cpp/build.h.in -COPY .build-info.json.in /client-sdk-cpp/.build-info.json.in - -# Configure Rust linker: use full GCC path so liblto_plugin.so is found (not /home/installs/ which has no plugin) -RUN mkdir -p /client-sdk-cpp/client-sdk-rust/.cargo \ - && printf '%s\n' '[target.x86_64-unknown-linux-gnu]' 'linker = "/root/gcc-14/bin/g++"' \ - '[target.aarch64-unknown-linux-gnu]' 'linker = "/root/gcc-14/bin/g++"' > /client-sdk-cpp/client-sdk-rust/.cargo/config.toml - -# Build and install the SDK into a fixed prefix so downstream projects can -# consume the image as a prebuilt LiveKit SDK environment. -RUN LLVM_VERSION="$(llvm-config --version | cut -d. -f1)" \ - && export LIBCLANG_PATH="/usr/lib/llvm-${LLVM_VERSION}/lib" \ - && export CXXFLAGS="-Wno-deprecated-declarations" \ - && export CFLAGS="-Wno-deprecated-declarations" \ - && chmod +x /client-sdk-cpp/build.sh \ - && cd /client-sdk-cpp \ - && ./build.sh release --version "${LIVEKIT_VERSION}" --bundle --prefix "${SDK_INSTALL_PREFIX}" \ - && test -f "${SDK_INSTALL_PREFIX}/lib/cmake/LiveKit/LiveKitConfig.cmake" diff --git a/docs/README.md b/docs/README.md index 1a4db0c5..d4f68c8b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,7 +3,7 @@ Additional documentation for the SDK. - [Building](building.md) — prerequisites, build scripts, CMake presets, - vcpkg, Docker, integration into your CMake project, troubleshooting. + vcpkg, integration into your CMake project, troubleshooting. - [Authentication](authentication.md) — generating tokens, token source types (initial connect only), and in-session token refresh. - [Logging](logging.md) — compile-time vs runtime filtering, log levels, diff --git a/docs/building.md b/docs/building.md index 8112d019..fd4cbb83 100644 --- a/docs/building.md +++ b/docs/building.md @@ -1,8 +1,8 @@ # Building This document covers everything you need to build the LiveKit C++ SDK from -source: prerequisites, cloning the repository, the build scripts, advanced -CMake/vcpkg flows, and Docker. +source: prerequisites, cloning the repository, the build scripts, and advanced +CMake/vcpkg flows. ## Prerequisites @@ -193,29 +193,6 @@ cmake -B build -S . \ cmake --build build ``` -## Building with Docker - -The Docker setup is split into a reusable base image (toolchain + system -deps) and an SDK image layered on top. **Tested on Linux only.** - -```bash -docker build -t livekit-cpp-sdk-base . -f docker/Dockerfile.base -docker build --build-arg BASE_IMAGE=livekit-cpp-sdk-base \ - -t livekit-cpp-sdk . -f docker/Dockerfile.sdk -docker run -it --network host livekit-cpp-sdk:latest bash -``` - -If you're authoring your own Dockerfile, mirror the `ENV` block in -[docker/Dockerfile.base](https://github.com/livekit/client-sdk-cpp/blob/main/docker/Dockerfile.base): - -```bash -export CC=$HOME/gcc-14/bin/gcc -export CXX=$HOME/gcc-14/bin/g++ -export LD_LIBRARY_PATH=$HOME/gcc-14/lib64:$LD_LIBRARY_PATH -export PATH=$HOME/.cargo/bin:$PATH -export PATH=$HOME/cmake-3.31/bin:$PATH -``` - ## CMake options | Option | Default | Description | diff --git a/scripts/clang-tidy.sh b/scripts/clang-tidy.sh index 5fe8e337..28b067df 100755 --- a/scripts/clang-tidy.sh +++ b/scripts/clang-tidy.sh @@ -36,7 +36,7 @@ fi exec "${shared_script}" \ --repo-root "${repo_root}" \ --build-dir build-release \ - --file-regex '^(?!.*/(_deps|build-[^/]*|client-sdk-rust|cpp-example-collection|vcpkg_installed|docker|docs|data)/).*/src/(?!tests/).*\.(c|cpp|cc|cxx)$' \ + --file-regex '^(?!.*/(_deps|build-[^/]*|client-sdk-rust|cpp-example-collection|vcpkg_installed|docs|data)/).*/src/(?!tests/).*\.(c|cpp|cc|cxx)$' \ --header-filter '.*/(include/livekit|src)/.*\.(h|hpp)$' \ --exclude-header-filter '(.*/src/tests/.*)|(.*/_deps/.*)|(.*/build-[^/]*/.*)' \ "$@"