Skip to content

Commit

Permalink
Add a CI step to avoid running the tmate session on the self-hosted m…
Browse files Browse the repository at this point in the history
…achine.

Signed-off-by: Ye Cao <caoye.cao@alibaba-inc.com>
  • Loading branch information
dashanji committed Mar 19, 2023
1 parent ff287e4 commit 68e1730
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/gaia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ jobs:
with:
submodules: true

- name: Detect the tmate session
run: |
if grep -v "grep" .github/workflows/gaia.yml | grep "action-tmate"; then
echo 'WARNING!!!the self-hosted machine can not run tmate session, please debug it manually'
exit 1
fi
- uses: actions/cache@v3
with:
path: ~/.m2/repository
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/gss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ jobs:
if: ${{ github.repository == 'alibaba/GraphScope' }}
steps:
- uses: actions/checkout@v3

- name: Detect the tmate session
run: |
if grep -v "grep" .github/workflows/gss.yml | grep "action-tmate"; then
echo 'WARNING!!!the self-hosted machine can not run tmate session, please debug it manually'
exit 1
fi
- uses: actions/cache@v3
with:
path: ~/.m2/repository
Expand Down Expand Up @@ -110,6 +118,13 @@ jobs:
with:
submodules: true

- name: Detect the tmate session
run: |
if grep -v "grep" .github/workflows/gss.yml | grep "action-tmate"; then
echo 'WARNING!!!the self-hosted machine can not run tmate session, please debug it manually'
exit 1
fi
- uses: actions/download-artifact@v3
with:
name: groot.tar.gz
Expand Down
63 changes: 59 additions & 4 deletions .github/workflows/k8s-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Detect the tmate session
run: |
if grep -v "grep" .github/workflows/k8s-ci.yml | grep "action-tmate"; then
echo 'WARNING!!!the self-hosted machine can not run tmate session, please debug it manually'
exit 1
fi
- name: Build Artifact
run: |
source ${HOME}/.graphscope_env
Expand All @@ -220,6 +227,14 @@ jobs:
if: ${{ github.repository == 'alibaba/GraphScope' }}
steps:
- uses: actions/checkout@v3

- name: Detect the tmate session
run: |
if grep -v "grep" .github/workflows/k8s-ci.yml | grep "action-tmate"; then
echo 'WARNING!!!the self-hosted machine can not run tmate session, please debug it manually'
exit 1
fi
- uses: actions/cache@v3
with:
path: ~/.m2/repository
Expand Down Expand Up @@ -253,6 +268,14 @@ jobs:
if: ${{ github.repository == 'alibaba/GraphScope' }}
steps:
- uses: actions/checkout@v3

- name: Detect the tmate session
run: |
if grep -v "grep" .github/workflows/k8s-ci.yml | grep "action-tmate"; then
echo 'WARNING!!!the self-hosted machine can not run tmate session, please debug it manually'
exit 1
fi
- uses: actions/cache@v3
with:
path: ~/.m2/repository
Expand Down Expand Up @@ -297,6 +320,13 @@ jobs:
with:
submodules: true

- name: Detect the tmate session
run: |
if grep -v "grep" .github/workflows/k8s-ci.yml | grep "action-tmate"; then
echo 'WARNING!!!the self-hosted machine can not run tmate session, please debug it manually'
exit 1
fi
- uses: actions/cache@v3
with:
path: ~/.cache/pip
Expand Down Expand Up @@ -340,6 +370,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Detect the tmate session
run: |
if grep -v "grep" .github/workflows/k8s-ci.yml | grep "action-tmate"; then
echo 'WARNING!!!the self-hosted machine can not run tmate session, please debug it manually'
exit 1
fi
- uses: actions/cache@v3
with:
path: ~/.cache/pip
Expand Down Expand Up @@ -438,10 +475,6 @@ jobs:
--cov-report=term --exitfirst -s -vvv --log-cli-level=INFO \
./graphscope/tests/kubernetes
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: false

- name: Upload Coverage
uses: codecov/codecov-action@v3
with:
Expand Down Expand Up @@ -488,6 +521,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Detect the tmate session
run: |
if grep -v "grep" .github/workflows/k8s-ci.yml | grep "action-tmate"; then
echo 'WARNING!!!the self-hosted machine can not run tmate session, please debug it manually'
exit 1
fi
- uses: actions/cache@v3
with:
path: ~/.cache/pip
Expand Down Expand Up @@ -548,6 +588,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Detect the tmate session
run: |
if grep -v "grep" .github/workflows/k8s-ci.yml | grep "action-tmate"; then
echo 'WARNING!!!the self-hosted machine can not run tmate session, please debug it manually'
exit 1
fi
- uses: actions/cache@v3
with:
path: ~/.m2/repository
Expand Down Expand Up @@ -594,6 +641,14 @@ jobs:
if: ${{ github.repository == 'alibaba/GraphScope' }}
steps:
- uses: actions/checkout@v3

- name: Detect the tmate session
run: |
if grep -v "grep" .github/workflows/k8s-ci.yml | grep "action-tmate"; then
echo 'WARNING!!!the self-hosted machine can not run tmate session, please debug it manually'
exit 1
fi
- uses: actions/download-artifact@v3
with:
name: gie-experimental
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/local-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,15 @@ jobs:
with:
submodules: true

- name: Detect the tmate session
run: |
# hack here: get all field of build-wheels which run on self-hosted runner
if sed -n '/self-hosted/,/mini-test/ p' .github/workflows/local-ci.yml | \
grep -v "grep" - | grep "action-tmate"; then
echo 'WARNING!!!the self-hosted machine can not run tmate session, please debug it manually'
exit 1
fi
- uses: actions/cache@v3
with:
path: ~/.m2/repository
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/pegasus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ jobs:
k8s-test:
runs-on: [self-hosted, ubuntu2004]
steps:
- name: Detect the tmate session
if: "jobs.k8s-test.steps[*].uses == 'mxschmitt/action-tmate@*'"
run: |
echo "WARNING!!!the self-hosted machine can not run tmate session, please debug it manually"
exit 1
- uses: actions/checkout@v3

- name : Prepare Image
Expand Down

0 comments on commit 68e1730

Please sign in to comment.