From d7298862b0d851b422b685824c08f06175d4441d Mon Sep 17 00:00:00 2001 From: "wenmeng.zwm" Date: Sun, 9 Oct 2022 18:12:47 +0800 Subject: [PATCH 01/11] add citest and inter test --- .github/workflows/citest.yaml | 55 +++++++++++++++++++++++++++++++++++ .github/workflows/lint.yaml | 24 +++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 .github/workflows/citest.yaml create mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/citest.yaml b/.github/workflows/citest.yaml new file mode 100644 index 00000000..65cde97e --- /dev/null +++ b/.github/workflows/citest.yaml @@ -0,0 +1,55 @@ +name: citest + +on: + push: + branches: + - master + - "release/**" + paths-ignore: + - "setup.*" + - "requirements.txt" + - "requirements/**" + - "docs/**" + - "tools/**" + - ".dev_scripts/**" + - "README.md" + - "README_zh-CN.md" + - "NOTICE" + - ".github/workflows/lint.yaml" + - ".github/workflows/publish.yaml" + + pull_request: + paths-ignore: + - "setup.*" + - "requirements.txt" + - "requirements/**" + - "docs/**" + - "tools/**" + - ".dev_scripts/**" + - "README.md" + - "README_zh-CN.md" + - "NOTICE" + - ".github/workflows/lint.yaml" + - ".github/workflows/publish.yaml" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + unittest: + # The type of runner that the job will run on + runs-on: [modelscope-self-hosted] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + lfs: 'true' + - name: Checkout LFS objects + run: git lfs checkout + - name: Run unittest + shell: bash + run: | + set -e + source ~/ci_env.sh + bash .dev_scripts/dockerci.sh diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 00000000..1ac76975 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,24 @@ +name: Lint test + +on: [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.6 + uses: actions/setup-python@v2 + with: + python-version: 3.6 + - name: Install pre-commit hook + run: | + pip install pre-commit + cp .github/hooks/pre-commit .git/hooks/ + - name: Linting + run: pre-commit run --all-files + From 8be89d9f6ce10b6a67938318754a2ceb811721f9 Mon Sep 17 00:00:00 2001 From: "wenmeng.zwm" Date: Sun, 9 Oct 2022 18:16:46 +0800 Subject: [PATCH 02/11] update lint.yaml --- .github/workflows/lint.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 1ac76975..8a073a01 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -18,7 +18,6 @@ jobs: - name: Install pre-commit hook run: | pip install pre-commit - cp .github/hooks/pre-commit .git/hooks/ - name: Linting run: pre-commit run --all-files From 208823401fb16541b773dcea87d04f5b145ba25e Mon Sep 17 00:00:00 2001 From: "wenmeng.zwm" Date: Sun, 9 Oct 2022 18:29:06 +0800 Subject: [PATCH 03/11] fix format --- .github/workflows/citest.yaml | 2 +- .github/workflows/lint.yaml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/citest.yaml b/.github/workflows/citest.yaml index 65cde97e..82b713e5 100644 --- a/.github/workflows/citest.yaml +++ b/.github/workflows/citest.yaml @@ -52,4 +52,4 @@ jobs: run: | set -e source ~/ci_env.sh - bash .dev_scripts/dockerci.sh + bash .dev_scripts/dockerci.sh diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 8a073a01..34f7abe7 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -20,4 +20,3 @@ jobs: pip install pre-commit - name: Linting run: pre-commit run --all-files - From 6e9ab972d4a9ab3b0d458d91ae42a99a04ea61b4 Mon Sep 17 00:00:00 2001 From: "wenmeng.zwm" Date: Mon, 10 Oct 2022 10:35:27 +0800 Subject: [PATCH 04/11] update cienv path --- .github/workflows/citest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/citest.yaml b/.github/workflows/citest.yaml index 82b713e5..b16d3f16 100644 --- a/.github/workflows/citest.yaml +++ b/.github/workflows/citest.yaml @@ -51,5 +51,5 @@ jobs: shell: bash run: | set -e - source ~/ci_env.sh + source /mnt/modelscope/ci_env.sh bash .dev_scripts/dockerci.sh From e7b37b09d4c753cdf081aab9fb7fcd3addcde500 Mon Sep 17 00:00:00 2001 From: "wenmeng.zwm" Date: Mon, 10 Oct 2022 12:03:05 +0800 Subject: [PATCH 05/11] do linter test only in alibaba internal env --- .dev_scripts/ci_container_test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.dev_scripts/ci_container_test.sh b/.dev_scripts/ci_container_test.sh index 129a6c25..95088f30 100644 --- a/.dev_scripts/ci_container_test.sh +++ b/.dev_scripts/ci_container_test.sh @@ -9,7 +9,9 @@ git config --global --add safe.directory /Maas-lib # linter test # use internal project for pre-commit due to the network problem -pre-commit run -c .pre-commit-config_local.yaml --all-files +if [ `git remote -v | grep alibaba | wc -l` -gt 1 ]; then + pre-commit run -c .pre-commit-config_local.yaml --all-files +fi if [ $? -ne 0 ]; then echo "linter test failed, please run 'pre-commit run --all-files' to check" exit -1 From ca7189e77a18ce0990788ed92b8fb8a695db41a0 Mon Sep 17 00:00:00 2001 From: "wenmeng.zwm" Date: Mon, 10 Oct 2022 17:38:03 +0800 Subject: [PATCH 06/11] add dummy git config --- .dev_scripts/ci_container_test.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.dev_scripts/ci_container_test.sh b/.dev_scripts/ci_container_test.sh index 95088f30..fa5e4534 100644 --- a/.dev_scripts/ci_container_test.sh +++ b/.dev_scripts/ci_container_test.sh @@ -6,6 +6,8 @@ awk -F: '/^[^#]/ { print $1 }' requirements/nlp.txt | xargs -n 1 pip install -f pip install -r requirements/tests.txt git config --global --add safe.directory /Maas-lib +git config --global user.email tmp +git config --global user.name tmp.com # linter test # use internal project for pre-commit due to the network problem From 51e268dc9779e53bc04d6fdffe49c9b68c4c57b3 Mon Sep 17 00:00:00 2001 From: "wenmeng.zwm" Date: Wed, 12 Oct 2022 11:20:07 +0800 Subject: [PATCH 07/11] change filemode --- .github/workflows/citest.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/citest.yaml b/.github/workflows/citest.yaml index b16d3f16..3d2abae9 100644 --- a/.github/workflows/citest.yaml +++ b/.github/workflows/citest.yaml @@ -41,6 +41,14 @@ jobs: # The type of runner that the job will run on runs-on: [modelscope-self-hosted] steps: + - name: ResetFileMode + shell: bash + run: | + # reset filemode to allow action runner to delete files + # generated by root in docker + set -e + sudo chown -R $USER:$USER $ACTION_RUNNER_DIR + - name: Checkout uses: actions/checkout@v2 with: From 66819860b78d34d1c5106c6938b9a7c25c982d0d Mon Sep 17 00:00:00 2001 From: "wenmeng.zwm" Date: Wed, 12 Oct 2022 11:33:59 +0800 Subject: [PATCH 08/11] format yaml --- .github/workflows/citest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/citest.yaml b/.github/workflows/citest.yaml index 3d2abae9..29f4a0b9 100644 --- a/.github/workflows/citest.yaml +++ b/.github/workflows/citest.yaml @@ -45,7 +45,7 @@ jobs: shell: bash run: | # reset filemode to allow action runner to delete files - # generated by root in docker + # generated by root in docker set -e sudo chown -R $USER:$USER $ACTION_RUNNER_DIR From 705040c04ab7404510febfae0ace369d546b371d Mon Sep 17 00:00:00 2001 From: "wenmeng.zwm" Date: Wed, 12 Oct 2022 11:53:16 +0800 Subject: [PATCH 09/11] format --- .github/workflows/citest.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/citest.yaml b/.github/workflows/citest.yaml index 29f4a0b9..ede4b94f 100644 --- a/.github/workflows/citest.yaml +++ b/.github/workflows/citest.yaml @@ -44,10 +44,11 @@ jobs: - name: ResetFileMode shell: bash run: | - # reset filemode to allow action runner to delete files - # generated by root in docker + # reset filemode to allow action runner to delete files + # generated by root in docker set -e - sudo chown -R $USER:$USER $ACTION_RUNNER_DIR + echo "ACTION_RUNNER_DIR: $ACTION_RUNNER_DIR" + sudo chown -R $USER:$USER $ACTION_RUNNER_DIR - name: Checkout uses: actions/checkout@v2 From 7962f9067daedefa37f8f41d4e56840b6c691083 Mon Sep 17 00:00:00 2001 From: "wenmeng.zwm" Date: Wed, 12 Oct 2022 11:56:36 +0800 Subject: [PATCH 10/11] format --- .github/workflows/citest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/citest.yaml b/.github/workflows/citest.yaml index ede4b94f..00c6bbbf 100644 --- a/.github/workflows/citest.yaml +++ b/.github/workflows/citest.yaml @@ -47,7 +47,7 @@ jobs: # reset filemode to allow action runner to delete files # generated by root in docker set -e - echo "ACTION_RUNNER_DIR: $ACTION_RUNNER_DIR" + source ~/.bashrc sudo chown -R $USER:$USER $ACTION_RUNNER_DIR - name: Checkout From d325c41d1fbe8cd5aec8da72bad3ea16ce70c207 Mon Sep 17 00:00:00 2001 From: "wenmeng.zwm" Date: Wed, 12 Oct 2022 13:29:24 +0800 Subject: [PATCH 11/11] make movie_scene_seg isolated --- tests/run_config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/run_config.yaml b/tests/run_config.yaml index 4c571b7f..4bbdb92f 100644 --- a/tests/run_config.yaml +++ b/tests/run_config.yaml @@ -10,6 +10,7 @@ isolated: # test cases that may require excessive anmount of GPU memory, which - test_easycv_trainer.py - test_segformer.py - test_segmentation_pipeline.py + - test_movie_scene_segmentation.py envs: default: # default env, case not in other env will in default, pytorch.