Skip to content

update

update #27

Workflow file for this run

name: Test branch or PR
on:
pull_request:
types: [opened, review_requested, ready_for_review, synchronize, unlocked]
merge_group:
types: [checks_requested]
push:
branches:
- 'dev_test_workflow'
workflow_dispatch:
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
env:
CO_MODELS_SRC: CoModels
TEST_DIR: test_dir
TEST_IMG_TAG: registry.cn-beijing.aliyuncs.com/oneflow/manylinux2014_x86_64_cuda12.2:bba403da5da597c3f7905dfc52b24989ee21ffb1
TEST_CONTAINER_NAME: co_models_test
jobs:
test_job:
name: Collect information about PR and source
#runs-on: ${{ matrix.runs-on }} # todo
#runs-on: ubuntu-latest
runs-on: [self-hosted]
steps:
- name: Set up branch name
id: event-info
if: github.event_name == 'push'
run: |
branch=${{ github.ref_name }}
echo "BRANCH=$branch" >> $GITHUB_ENV
- name: Set up model name from workflow_dispatch branch
if: github.event_name == 'workflow_dispatch'
run: |
branch=${{ github.ref_name }}
echo "BRANCH=$branch" >> $GITHUB_ENV
- name: Checkout CoModels branch
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH }}
path: ${{ env.CO_MODELS_SRC}}
- name: Prepare test directory
run: |
model_dir='${{ env.CO_MODELS_SRC }}/cv/classification/resnet50'
cp -rL $model_dir ${{ env.TEST_DIR }}
- name: Prepare Container
run: |
pwd
docker rm -f ${{ env.TEST_CONTAINER_NAME }} || true
docker run --gpus=all -d --rm --privileged --shm-size=8g \
--pids-limit 2000 \
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
-v /share_nfs/dataset/ImageNet:/data/dataset/ImageNet \
-v ${{ env.TEST_DIR }}:/${{ env.TEST_DIR }} \
-w /data/dataset \
--name ${{ env.TEST_CONTAINER_NAME }} \
${{ env.TEST_IMG_TAG }} \
sleep 5400
# && python3 -m oneflow --doctor
#model_dir='${{ env.CO_MODELS_SRC }}/cv/classification/${{ env.BRANCH }}'
#docker images | grep oneflow
#model_dir='${{ env.CO_MODELS_SRC }}/cv/classification/resnet50'
#cp -rL $model_dir ${{ env.TEST_DIR }}
- name: Test container
#if: ${{ !fromJson(matrix.cache-hit) && contains(matrix.runs-on, 'self-hosted') }}
run: |
docker exec ${{ env.TEST_CONTAINER_NAME }} ls
- name: Test container1
#if: ${{ !fromJson(matrix.cache-hit) && contains(matrix.runs-on, 'self-hosted') }}
run: |
docker exec ${{ env.TEST_CONTAINER_NAME }} python3 -m pip list
- name: Install OneFlow
#if: ${{ !fromJson(matrix.cache-hit) && contains(matrix.runs-on, 'self-hosted') }}
run: |
docker exec ${{ env.TEST_CONTAINER_NAME }} python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
docker exec ${{ env.TEST_CONTAINER_NAME }} python3 -m pip install --pre oneflow -f https://oneflow-staging.oss-cn-beijing.aliyuncs.com/branch/master/cu118