Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev test workflow #190

Closed
wants to merge 71 commits into from
Closed
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
949aad4
first try
ShawnXuan Nov 9, 2023
5b3d178
update
ShawnXuan Nov 9, 2023
697bb75
update
ShawnXuan Nov 9, 2023
14ba5c2
update
ShawnXuan Nov 9, 2023
58f75b6
update
ShawnXuan Nov 9, 2023
a975546
update
ShawnXuan Nov 9, 2023
12b1ab2
update
ShawnXuan Nov 9, 2023
fd6852e
update
ShawnXuan Nov 9, 2023
223b80e
update
ShawnXuan Nov 9, 2023
432af69
update
ShawnXuan Nov 9, 2023
5ccb230
update
ShawnXuan Nov 9, 2023
3b1be9f
update
ShawnXuan Nov 9, 2023
7a3fdfc
update
ShawnXuan Nov 9, 2023
c2231ab
update
ShawnXuan Nov 9, 2023
40eba0b
update
ShawnXuan Nov 9, 2023
61cbcde
update
ShawnXuan Nov 9, 2023
5bb6fc4
update
ShawnXuan Nov 9, 2023
84561e7
update
ShawnXuan Nov 9, 2023
b15d0fe
update
ShawnXuan Nov 9, 2023
ae15ec2
update
ShawnXuan Nov 9, 2023
ed6bd19
update
ShawnXuan Nov 9, 2023
7f82cea
update
ShawnXuan Nov 9, 2023
79fcecb
update
ShawnXuan Nov 9, 2023
34707fe
update
ShawnXuan Nov 9, 2023
8feadc5
update
ShawnXuan Nov 9, 2023
153ec04
update
ShawnXuan Nov 9, 2023
a2b4f0f
update
ShawnXuan Nov 9, 2023
94cb526
update
ShawnXuan Nov 9, 2023
1653725
update
ShawnXuan Nov 9, 2023
25c438c
build test image
ShawnXuan Nov 9, 2023
d8992ff
update
ShawnXuan Nov 9, 2023
17b9343
update
ShawnXuan Nov 9, 2023
b31f97d
update
ShawnXuan Nov 9, 2023
5a8d3c7
update
ShawnXuan Nov 9, 2023
dbc50c4
update
ShawnXuan Nov 9, 2023
5b00d1f
update
ShawnXuan Nov 9, 2023
d9bd1a6
update
ShawnXuan Nov 9, 2023
ce8a93e
update
ShawnXuan Nov 9, 2023
7916dc8
update
ShawnXuan Nov 9, 2023
501b368
update
ShawnXuan Nov 9, 2023
b7ae0e5
update
ShawnXuan Nov 9, 2023
b6b37f0
update
ShawnXuan Nov 9, 2023
72e822e
change epochs to train
ShawnXuan Nov 10, 2023
42eb320
update
ShawnXuan Nov 10, 2023
b79feef
update
ShawnXuan Nov 10, 2023
4d29235
update
ShawnXuan Nov 10, 2023
2f6956a
update
ShawnXuan Nov 10, 2023
5a668fa
update
ShawnXuan Nov 10, 2023
fc365f7
update
ShawnXuan Nov 10, 2023
7feb27e
update
ShawnXuan Nov 10, 2023
665a37e
update
ShawnXuan Nov 10, 2023
edfae1d
gpu1
ShawnXuan Nov 10, 2023
fa123c1
gpu1
ShawnXuan Nov 10, 2023
0fc522e
rm pids-limit
ShawnXuan Nov 10, 2023
4ef5dde
8 gpus
ShawnXuan Nov 10, 2023
66e4a96
ready for pr
ShawnXuan Nov 10, 2023
505ea01
ready for pr
ShawnXuan Nov 10, 2023
33022c0
ready for pr
ShawnXuan Nov 10, 2023
aaaafe9
return 0
ShawnXuan Nov 10, 2023
d86ef2f
return 0
ShawnXuan Nov 10, 2023
ee2f8bb
ready for test
ShawnXuan Nov 10, 2023
e9a131f
ready for test
ShawnXuan Nov 10, 2023
16e7089
ready for test
ShawnXuan Nov 10, 2023
479b55a
Merge branch 'main' into dev_test_workflow
ShawnXuan Nov 11, 2023
fe525ee
Merge branch 'main' into dev_test_workflow
ShawnXuan Nov 13, 2023
d6204f3
Merge branch 'main' into dev_test_workflow
ShawnXuan Nov 13, 2023
d9a6b6e
rm comments and ueless codes
ShawnXuan Nov 13, 2023
295bcbd
Merge branch 'main' of github.com:Oneflow-Inc/CoModels into dev_test_…
ShawnXuan Nov 14, 2023
d4c1981
update
ShawnXuan Nov 14, 2023
19190e6
test
ShawnXuan Nov 14, 2023
d83d22e
Revert "test"
ShawnXuan Nov 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test branch or PR
on:
#push:
# branches:
# - 'dev_test_workflow'
workflow_dispatch:

concurrency:
group: build-test-image-for-comodels
cancel-in-progress: true

env:
CO_MODELS_SRC: CoModels

jobs:
build_job:
name: build test image
runs-on: [self-hosted]
steps:
- name: Checkout CoModels branch
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH }}
path: ${{ env.CO_MODELS_SRC}}
- name: build image
run: |
cd ${{ env.CO_MODELS_SRC}}
bash docker/build.sh


84 changes: 84 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
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' # debug only
workflow_dispatch:

concurrency:
group: comodels-test-${{ github.ref }}
cancel-in-progress: true

env:
CO_MODELS_SRC: CoModels
TEST_DIR: test_dir
TEST_IMG_TAG: comodels_test:latest
TEST_CONTAINER_NAME: co_models_test

jobs:
test_job:
name: Collect information about PR and source
runs-on: [self-hosted]
steps:
#- name: Set up MODEL_ARCH
# if: github.event_name == 'push'
# run: |
# # use resnet50 for debug
# echo "MODEL_ARCH=resnet50" >> $GITHUB_ENV
ShawnXuan marked this conversation as resolved.
Show resolved Hide resolved
- name: Set up MODEL_ARCH from PR
if: github.event.pull_request.draft == false && github.base_ref == 'master'
run: |
model_arch=${{ github.event.pull_request.title }}
# use pr title as the MODEL_ARCH
echo "MODEL_ARCH=$model_arch" >> $GITHUB_ENV
- name: Set up MODEL_ARCH from workflow_dispatch branch
if: github.event_name == 'workflow_dispatch'
run: |
# use branch name as the MODEL_ARCH
model_arch=${{ github.ref_name }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model_arch和分支名有关,是不是不太好

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这也是我纠结的地方,确实需要一个地方,要么就是 pr的title,要么是分支名称

echo "MODEL_ARCH=$model_arch" >> $GITHUB_ENV
- name: Checkout CoModels branch
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
path: ${{ env.CO_MODELS_SRC}}
- name: Prepare test directory
run: |
model_dir='${{ env.CO_MODELS_SRC }}/cv/classification/${{ env.MODEL_ARCH }}'
if [ -d "$model_dir" ] && [ -n "${{ env.MODEL_ARCH }}" ]; then
cp -rL "$model_dir" "${{ env.TEST_DIR }}"
echo "READY_FOR_TEST=true" >> $GITHUB_ENV
else
exit 0
ShawnXuan marked this conversation as resolved.
Show resolved Hide resolved
fi
- name: Prepare Container
if: env.READY_FOR_TEST == true
run: |
docker rm -f ${{ env.TEST_CONTAINER_NAME }} || true
docker run --gpus=all -d --rm --privileged --shm-size=8g \
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
-v /share_nfs/dataset/ImageNet:/data/dataset/ImageNet \
-v /share_nfs/model_zoo/flowvision_cache:/oneflow/flowvision_cache \
-e FLOWVISION_CACHE=/oneflow/flowvision_cache \
-v $(pwd)/${{ env.TEST_DIR }}:/workspace/${{ env.TEST_DIR }} \
-w /workspace/${{ env.TEST_DIR }} \
--name ${{ env.TEST_CONTAINER_NAME }} \
${{ env.TEST_IMG_TAG }} \
sleep 5400
- name: run inference
if: env.READY_FOR_TEST == true
run: |
docker exec ${{ env.TEST_CONTAINER_NAME }} nvidia-smi
docker exec ${{ env.TEST_CONTAINER_NAME }} bash ./infer.sh
- name: run training
if: env.READY_FOR_TEST == true
run: |
docker exec ${{ env.TEST_CONTAINER_NAME }} sed -i 's/main.py/main.py --epochs 1/g' train.sh
#docker exec ${{ env.TEST_CONTAINER_NAME }} sed -i 's/GPU_NUMS=[0-9]*/GPU_NUMS=2/g' train.sh
docker exec ${{ env.TEST_CONTAINER_NAME }} bash ./train.sh


3 changes: 3 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docker build \
--rm \
-t comodels_test -f docker/test_dockerfile .
9 changes: 9 additions & 0 deletions docker/test_dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM registry.cn-beijing.aliyuncs.com/oneflow/oneflow:nightly-cuda11.8


#RUN python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package Pillow==9.5.0 numpy==1.21.6 opencv-python==4.4.0.46 termcolor==1.1.0 yacs==0.1.8
RUN python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package opencv-python==4.4.0.46 termcolor==1.1.0 yacs==0.1.8 tabulate==0.9.0
RUN apt update && apt install -y git
RUN git clone https://github.com/Oneflow-Inc/vision.git \
&& cd vision \
&& python3 -m pip install -e .