Skip to content

Fix scheduler readiness semantics #754

Fix scheduler readiness semantics

Fix scheduler readiness semantics #754

Workflow file for this run

name: Flame CI
on: [push, pull_request]
env:
CLICOLOR_FORCE: 1
INSTALL_PREFIX: /opt/flame-test
FLAME_ENDPOINT: http://127.0.0.1:8080
jobs:
ci:
name: BareMetal Python Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
rust: [stable]
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Install Python and uv
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
# Install uv to /usr/bin for flmrun service
sudo cp $HOME/.local/bin/uv /usr/bin/uv
sudo chmod +x /usr/bin/uv
echo "✓ Installed uv to /usr/bin/uv for flmrun"
- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Build Flame
run: |
cargo build --release
- name: Verify systemd availability
run: |
echo "=== Checking systemd ==="
systemctl --version
echo ""
echo "=== Systemd status ==="
systemctl status || echo "systemd status command returned non-zero"
echo ""
echo "=== Check if systemd is running as init ==="
ps -p 1 -o comm=
echo ""
echo "=== Current user ==="
whoami
echo ""
echo "=== Sudo privileges ==="
sudo -v && echo "✓ Sudo available"
- name: Install Flame with flmadm and systemd
run: |
sudo ./target/release/flmadm install --all --src-dir . --skip-build --prefix $INSTALL_PREFIX --enable
echo "$INSTALL_PREFIX/bin" >> $GITHUB_PATH
- name: Setup local configuration
run: |
echo "=== Copy local configuration ==="
mkdir -p ~/.flame
cp ci/flame-local.yaml ~/.flame/flame.yaml
echo "✓ Copied flame-local.yaml to ~/.flame/flame.yaml"
- name: Setup Python environment
run: |
echo "=== Setting up Flame environment ==="
source $INSTALL_PREFIX/sbin/flmenv.sh
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "FLAME_HOME=$FLAME_HOME" >> $GITHUB_ENV
pip3 install pytest pytest-timeout
- name: Verify flamepy installation
run: |
echo "=== Verify flamepy import ==="
python3 -c "import flamepy; print('✓ flamepy imported from:', flamepy.__file__)"
python3 -c "from flamepy import runner; print('✓ runner imported successfully')"
- name: Check service status
run: |
# Wait for services to be ready
sleep 5
# Check service status
sudo systemctl status flame-session-manager || (echo "Session manager not running" && sudo journalctl -u flame-session-manager -n 50 && exit 1)
sudo systemctl status flame-executor-manager || (echo "Executor manager not running" && sudo journalctl -u flame-executor-manager -n 50 && exit 1)
sudo systemctl status flame-object-cache || (echo "Object cache not running" && sudo journalctl -u flame-object-cache -n 50 && exit 1)
echo "✓ Services are running via systemd"
- name: Verify Flame cluster is ready
run: |
echo "=== Check flmctl connectivity ==="
flmctl list -a || echo "Warning: Could not list applications"
echo ""
echo "=== Flame nodes ==="
flmctl list -n || echo "Warning: Could not list nodes"
echo ""
echo "=== Flame node details ==="
for node in $(flmctl list -n 2>/dev/null | awk 'NR > 1 {print $1}'); do
echo "--- Node: $node ---"
flmctl view -n "$node" || echo "Warning: Could not view node $node"
done
echo ""
echo "=== Verify object cache is accessible ==="
curl -s http://127.0.0.1:9090/ || echo "Note: Object cache gRPC endpoint (expected no HTTP response)"
- name: Run Python E2E tests
timeout-minutes: 20
run: |
export PYTHONPATH="$(pwd)/e2e/src:$PYTHONPATH"
export FLAME_LOG=DEBUG
cd e2e
pytest -vv --durations=0 tests/test_runner.py tests/test_flmexec.py
- name: Show service logs on failure
if: failure() || cancelled()
run: |
echo "=== Session Manager Logs (systemd) ==="
sudo journalctl -u flame-session-manager -n 500 || echo "No systemd logs found"
echo ""
echo "=== Session Manager Logs (file) ==="
sudo cat $INSTALL_PREFIX/logs/fsm.log || echo "No FSM log file found"
echo ""
echo "=== Executor Manager Logs (systemd) ==="
sudo journalctl -u flame-executor-manager -n 500 || echo "No systemd logs found"
echo ""
echo "=== Executor Manager Logs (file) ==="
sudo cat $INSTALL_PREFIX/logs/fem.log || echo "No FEM log file found"
echo ""
echo "=== Object Cache Logs (systemd) ==="
sudo journalctl -u flame-object-cache -n 500 || echo "No systemd logs found"
echo ""
echo "=== Object Cache Logs (file) ==="
sudo cat $INSTALL_PREFIX/logs/foc.log || echo "No FOC log file found"
echo ""
echo "=== Active processes ==="
ps aux | grep -E "(flame|python)" || true
echo ""
echo "=== Network connections ==="
netstat -tlnp 2>/dev/null || ss -tlnp || true
- name: Stop Flame services
if: always()
run: |
# Stop services via systemd
sudo systemctl stop flame-executor-manager || true
sudo systemctl stop flame-object-cache || true
sudo systemctl stop flame-session-manager || true
- name: Cleanup
if: always()
run: |
sudo ./target/release/flmadm uninstall --prefix $INSTALL_PREFIX --no-backup --force || true