Skip to content

device func替代host func #320

device func替代host func

device func替代host func #320

Workflow file for this run

name: Run Container and Execute Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-in-container:
runs-on: self-hosted
container:
image: localhost:5000/flagscale:cuda-12.4.1-python-3.12-torch-2.5.1-commit-e05f659
options: --gpus all --privileged --ipc=host --ulimit memlock=-1 --ulimit stack=67108864
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
ssh-strict: true
ssh-user: git
persist-credentials: true
clean: true
sparse-checkout-cone-mode: true
fetch-tags: false
show-progress: true
lfs: false
submodules: false
set-safe-directory: true
- name: Set up Python and Install Dependencies
run: |
apt update -y
apt-get install -y python3 python3-pip python3-venv git
python3 -m venv venv
. venv/bin/activate
cd /__w/FlagCX/FlagCX
git config --global --add safe.directory /__w/FlagCX/FlagCX
pip install pre-commit
pre-commit install
- name: Run Code Format Check with pre-commit
run: |
cd /__w/FlagCX/FlagCX
. venv/bin/activate
apt update -y
apt-get install clang-format -y
git fetch --all
from_ref=${GITHUB_HEAD_REF}
to_ref=${GITHUB_BASE_REF}
echo "From branch: $from_ref, To branch: $to_ref"
pre-commit run --from-ref "origin/$from_ref" --to-ref "origin/$to_ref"
continue-on-error: false
- name: Check the current working directory
run: |
echo "Current directory: $(pwd)"
ls -l ./test/script
- name: Ensure script has execute permissions
run: chmod +x /__w/FlagCX/FlagCX/test/script/auto_script.sh
- name: Run Auto Test Script in Container
run: |
cd /__w/FlagCX/FlagCX
./test/script/auto_script.sh