From 14a9ea6622da7b61529ad3923af574336f9431e8 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Tue, 11 Apr 2023 03:17:07 +0000 Subject: [PATCH 1/4] [test] add CI workflow for VCS installation --- .github/workflows/check-vcs-installation.yml | 70 ++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/check-vcs-installation.yml diff --git a/.github/workflows/check-vcs-installation.yml b/.github/workflows/check-vcs-installation.yml new file mode 100644 index 000000000000..6306cfad63b1 --- /dev/null +++ b/.github/workflows/check-vcs-installation.yml @@ -0,0 +1,70 @@ +name: Check VCS installation + +on: + push: + branches: + - main + - v*-release + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + check-vcs-installation: + runs-on: ubuntu-20.04 + timeout-minutes: 30 + steps: + - name: Setup system pip + run: | + sudo apt-get update && sudo apt-get install -y python3-dev python3-pip + /usr/bin/python3 --version + /usr/bin/python3 -m pip --version + + - name: Print commit information + run: | + if [[ "${{ github.event_name }}" != 'pull_request' ]]; then + REPOSITORY="${{ github.repository }}" + else + REPOSITORY="${{ github.event.pull_request.head.repo.full_name }}" # name of the fork repository + fi + SHA="${{ github.sha }}" + BRANCH_NAME="${{ github.head_ref || github.ref_name }}" + echo "REPOSITORY: ${REPOSITORY}" + echo "SHA: ${SHA}" + echo "BRANCH_NAME: ${BRANCH_NAME}" + echo "VCS_URL=https://github.com/${REPOSITORY}@${BRANCH_NAME}" >> "${GITHUB_ENV}" + + - name: Check transformers installation from VCS URL + run: | + /usr/bin/python3 -m pip install -vvv "git+${VCS_URL}" + (cd /tmp && /usr/bin/python3 -c 'import transformers') + /usr/bin/python3 -m pip uninstall transformers --yes + + - name: Check transformers Installation from VCS URL (editable) + run: | + /usr/bin/python3 -m pip install -vvv -e "git+${VCS_URL}" + (cd /tmp && /usr/bin/python3 -c 'import transformers') + /usr/bin/python3 -m pip uninstall transformers --yes + + - name: Checkout transformers + uses: actions/checkout@v3 + with: + submodules: "recursive" + + - name: Check transformers installation from VCS repo + run: | + /usr/bin/python3 -m pip install -vvv . + (cd /tmp && /usr/bin/python3 -c 'import transformers') + /usr/bin/python3 -m pip uninstall transformers --yes + + - name: Check transformers installation from VCS repo (editable) + run: | + /usr/bin/python3 -m pip install -vvv -e . + (cd /tmp && /usr/bin/python3 -c 'import transformers') + /usr/bin/python3 -m pip uninstall transformers --yes From 26d0f90969178ec47f7726698b5530563fa295e8 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Tue, 11 Apr 2023 04:16:22 +0000 Subject: [PATCH 2/4] [test] remove editable installation test from VCS URL --- .github/workflows/check-vcs-installation.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/check-vcs-installation.yml b/.github/workflows/check-vcs-installation.yml index 6306cfad63b1..a86588117910 100644 --- a/.github/workflows/check-vcs-installation.yml +++ b/.github/workflows/check-vcs-installation.yml @@ -46,12 +46,6 @@ jobs: (cd /tmp && /usr/bin/python3 -c 'import transformers') /usr/bin/python3 -m pip uninstall transformers --yes - - name: Check transformers Installation from VCS URL (editable) - run: | - /usr/bin/python3 -m pip install -vvv -e "git+${VCS_URL}" - (cd /tmp && /usr/bin/python3 -c 'import transformers') - /usr/bin/python3 -m pip uninstall transformers --yes - - name: Checkout transformers uses: actions/checkout@v3 with: From be23fce1bf4fe072782fbf547eb0bc2b22eeb439 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Tue, 11 Apr 2023 04:48:15 +0000 Subject: [PATCH 3/4] [test] print info about system Python --- .github/workflows/check-vcs-installation.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-vcs-installation.yml b/.github/workflows/check-vcs-installation.yml index a86588117910..db22843f2cd9 100644 --- a/.github/workflows/check-vcs-installation.yml +++ b/.github/workflows/check-vcs-installation.yml @@ -17,14 +17,18 @@ concurrency: jobs: check-vcs-installation: - runs-on: ubuntu-20.04 + runs-on: ubuntu-20.04 # the oldest Ubuntu LTS version timeout-minutes: 30 steps: - name: Setup system pip run: | sudo apt-get update && sudo apt-get install -y python3-dev python3-pip - /usr/bin/python3 --version - /usr/bin/python3 -m pip --version + echo '$ which -a python3' && which -a python3 || true + echo '$ which -a python' && which -a python || true + echo '$ which -a pip3' && which -a pip3 || true + echo '$ which -a pip' && which -a pip || true + echo '$ /usr/bin/python3 --version' && /usr/bin/python3 --version + echo '$ /usr/bin/python3 -m pip --version' && /usr/bin/python3 -m pip --version - name: Print commit information run: | From eb7d390793a9c6cdb0343aa730de1ce04d2b8026 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Tue, 11 Apr 2023 05:08:36 +0000 Subject: [PATCH 4/4] [test] re-add editable installation test from VCS URL --- .github/workflows/check-vcs-installation.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/check-vcs-installation.yml b/.github/workflows/check-vcs-installation.yml index db22843f2cd9..3e760ca63890 100644 --- a/.github/workflows/check-vcs-installation.yml +++ b/.github/workflows/check-vcs-installation.yml @@ -50,6 +50,12 @@ jobs: (cd /tmp && /usr/bin/python3 -c 'import transformers') /usr/bin/python3 -m pip uninstall transformers --yes + - name: Check transformers installation from VCS URL (editable) + run: | + /usr/bin/python3 -m pip install -vvv -e "git+${VCS_URL}#egg=transformers" + (cd /tmp && /usr/bin/python3 -c 'import transformers') + /usr/bin/python3 -m pip uninstall transformers --yes + - name: Checkout transformers uses: actions/checkout@v3 with: