fix(demo): avoid str/String mismatch when forwarding PyTorch json lines #47
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
| name: CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install LibTorch | |
| run: | | |
| curl -L https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.0.0%2Bcpu.zip -o libtorch.zip | |
| unzip libtorch.zip | |
| echo "LIBTORCH=$(pwd)/libtorch" >> $GITHUB_ENV | |
| echo "LD_LIBRARY_PATH=$(pwd)/libtorch/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV | |
| - name: Install PyTorch CPU wheel | |
| run: python -m pip install --upgrade pip && python -m pip install torch --index-url https://download.pytorch.org/whl/cpu | |
| - name: Build | |
| run: cargo build --verbose --workspace | |
| - name: Run tests | |
| run: cargo test --verbose --workspace | |
| - name: Run alignment regression | |
| env: | |
| RUST_TORCH_REPEAT: "3" | |
| RUST_TORCH_MIN_SPEED_RATIO: "0.05" | |
| RUST_TORCH_MAX_LOSS_RATIO: "12.0" | |
| RUST_TORCH_CI_SOFT: "1" | |
| run: python demo_visual/ci_regression.py | |
| - name: Run clippy | |
| run: cargo clippy --workspace -- -D warnings | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| demo-smoke: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install PyTorch CPU wheel | |
| run: python -m pip install --upgrade pip && python -m pip install torch --index-url https://download.pytorch.org/whl/cpu | |
| - name: Start demo server | |
| run: | | |
| cargo run --release -p demo_visual --bin demo_visual > demo.log 2>&1 & | |
| echo $! > demo.pid | |
| for i in $(seq 1 120); do | |
| if curl -fsS http://127.0.0.1:3003/promo_status >/dev/null 2>&1; then | |
| echo "demo is ready" | |
| exit 0 | |
| fi | |
| sleep 2 | |
| done | |
| echo "demo failed to become ready in time" | |
| tail -n 200 demo.log || true | |
| exit 1 | |
| - name: Check demo endpoints | |
| run: | | |
| curl -fsS http://127.0.0.1:3003/ > /tmp/demo.html | |
| curl -fsS http://127.0.0.1:3003/pipeline_stats | |
| curl -fsS http://127.0.0.1:3003/promo_status | |
| - name: Stop demo server | |
| if: always() | |
| run: | | |
| kill "$(cat demo.pid)" || true | |
| sleep 2 |