goosefs-sdk 0.1.9

Goosefs Rust gRPC Client - Direct gRPC client for Goosefs Master/Worker
Documentation
# Copyright (C) 2026 Tencent. All rights reserved.
#
# 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.

name: Integration (GooseFS Docker)

on:
  push:
    branches: [main, master]
    paths-ignore:
      - "website/**"
      - ".github/workflows/docs.yml"
  pull_request:
    paths-ignore:
      - "website/**"
      - ".github/workflows/docs.yml"
  workflow_dispatch:
    inputs:
      run_macos_docker:
        description: >-
          Also run Docker IT on a macOS runner that already has Docker
          (self-hosted M4 / Mac with Docker Desktop). GitHub-hosted
          macos-14 ARM cannot nest VMs.
        type: boolean
        default: false
      macos_runner:
        description: Runner label for macOS Docker IT (e.g. macos-14 or self-hosted label)
        type: string
        default: macos-14

concurrency:
  group: integration-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always
  GOOSEFS_MASTER_ADDR: 127.0.0.1:9200
  GOOSEFS_AUTH_TYPE: simple
  GFS_ADDR: 127.0.0.1:9200

# Default Docker GooseFS IT: Linux amd64 rust + python.
# Apple Silicon unit coverage remains in ci.yml (macos-14). Optional macOS
# Docker IT: workflow_dispatch with run_macos_docker=true on a self-hosted Mac.
#
# Unit/fmt/clippy CI (ci.yml) stays fully parallel — it does not pull the
# GooseFS image.

jobs:
  goosefs-integration:
    name: ${{ matrix.kind }}-it (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    timeout-minutes: 90
    strategy:
      fail-fast: false
      max-parallel: 2
      matrix:
        include:
          - os: ubuntu-latest
            kind: rust
          - os: ubuntu-latest
            kind: python
            python-version: "3.11"
    steps:
      - uses: actions/checkout@v7

      - name: Setup Rust
        uses: ./.github/actions/setup

      - name: Install uv
        if: matrix.kind == 'python'
        uses: astral-sh/setup-uv@v7
        with:
          enable-cache: true

      - name: Setup Python
        if: matrix.kind == 'python'
        uses: actions/setup-python@v7
        with:
          python-version: ${{ matrix.python-version }}

      - name: Sync + build binding
        if: matrix.kind == 'python'
        working-directory: bindings/python
        run: |
          uv sync --all-extras --group dev --group test
          uv run maturin develop --uv --release

      - name: Setup GooseFS
        uses: ./.github/actions/setup-goosefs

      - name: Start Pushgateway (for metrics_pushgateway example)
        if: matrix.kind == 'rust'
        run: |
          docker run -d --name goosefs-sdk-pushgateway -p 127.0.0.1:9091:9091 prom/pushgateway:v1.9.0
          python3 - <<'PY'
          import socket, time, sys
          for _ in range(30):
              try:
                  socket.create_connection(("127.0.0.1", 9091), 1).close()
                  print("pushgateway ready")
                  sys.exit(0)
              except OSError:
                  time.sleep(1)
          sys.exit("pushgateway did not become ready")
          PY

      - name: Rust ignored integration tests
        if: matrix.kind == 'rust'
        run: bash scripts/ci/run_rust_integration.sh

      - name: Rust examples
        if: matrix.kind == 'rust'
        run: bash scripts/ci/run_rust_examples.sh

      - name: Rust cluster benchmarks
        if: matrix.kind == 'rust'
        run: bash scripts/ci/run_rust_benchmarks.sh cluster

      - name: Pytest (full, with cluster)
        if: matrix.kind == 'python'
        working-directory: bindings/python
        run: uv run --group test pytest -v --tb=short

      - name: Python examples
        if: matrix.kind == 'python'
        run: bash scripts/ci/run_python_examples.sh

      - name: Python benchmarks
        if: matrix.kind == 'python'
        run: bash scripts/ci/run_python_benchmarks.sh

      - name: Tear down GooseFS
        if: always()
        working-directory: fixtures/goosefs
        run: |
          docker compose -f docker-compose-goosefs.yml down -v || true
          docker rm -f goosefs-sdk-pushgateway || true

  # Optional: Mac M4 / Apple Silicon with a working Docker daemon.
  macos-docker-integration:
    name: macos-docker-it (${{ inputs.macos_runner }})
    if: github.event_name == 'workflow_dispatch' && inputs.run_macos_docker
    runs-on: ${{ inputs.macos_runner }}
    timeout-minutes: 120
    steps:
      - uses: actions/checkout@v7

      - name: Verify Docker
        run: |
          docker info
          docker compose version

      - name: Setup Rust
        uses: ./.github/actions/setup

      - name: Install uv
        uses: astral-sh/setup-uv@v7
        with:
          enable-cache: true

      - name: Setup Python
        uses: actions/setup-python@v7
        with:
          python-version: "3.11"

      - name: Sync + build binding
        working-directory: bindings/python
        run: |
          uv sync --all-extras --group dev --group test
          uv run maturin develop --uv --release

      - name: Setup GooseFS
        uses: ./.github/actions/setup-goosefs

      - name: Rust ignored integration tests
        run: bash scripts/ci/run_rust_integration.sh

      - name: Rust examples
        run: bash scripts/ci/run_rust_examples.sh

      - name: Rust cluster benchmarks
        run: bash scripts/ci/run_rust_benchmarks.sh cluster

      - name: Pytest (full, with cluster)
        working-directory: bindings/python
        run: uv run --group test pytest -v --tb=short

      - name: Python examples
        run: bash scripts/ci/run_python_examples.sh

      - name: Python benchmarks
        run: bash scripts/ci/run_python_benchmarks.sh

      - name: Tear down GooseFS
        if: always()
        working-directory: fixtures/goosefs
        run: docker compose -f docker-compose-goosefs.yml down -v || true