├── .github ├── ISSUE_TEMPLATE │ └── bug_report.md └── workflow │ ├── signoff-check.yml │ └── sigoff-check │ ├── Dockerfile │ ├── action.yml │ └── signoff-check └── README.md /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: GaryShen2008 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **Steps/Code to reproduce bug** 14 | Please provide a list of steps or a code sample to reproduce the issue. 15 | Avoid posting private or sensitive data. 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Environment details (please complete the following information)** 21 | - Environment location: [Standalone, YARN, Kubernetes, Cloud(specify cloud provider)] 22 | - Spark configuration settings related to the issue 23 | -------------------------------------------------------------------------------- /.github/workflow/signoff-check.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # A workflow to check if PR got sign-off 16 | name: signoff check 17 | 18 | on: 19 | pull_request_target: 20 | types: [opened, synchronize, reopened] 21 | 22 | jobs: 23 | signoff-check: 24 | runs-on: ubuntu-latest 25 | steps: 26 | - uses: actions/checkout@v2 27 | 28 | - name: sigoff-check job 29 | uses: ./.github/workflows/signoff-check 30 | env: 31 | OWNER: NVIDIA 32 | REPO_NAME: spark-xgboost-examples 33 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 34 | PULL_NUMBER: ${{ github.event.number }} 35 | -------------------------------------------------------------------------------- /.github/workflow/sigoff-check/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM python:alpine 16 | 17 | WORKDIR / 18 | COPY signoff-check . 19 | RUN pip install PyGithub && chmod +x /signoff-check 20 | 21 | # require envs: OWNER,REPO_NAME,GITHUB_TOKEN,PULL_NUMBER 22 | ENTRYPOINT ["/signoff-check"] 23 | -------------------------------------------------------------------------------- /.github/workflow/sigoff-check/action.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | name: 'signoff check action' 16 | description: 'check if PR got signed off' 17 | runs: 18 | using: 'docker' 19 | image: 'Dockerfile' 20 | -------------------------------------------------------------------------------- /.github/workflow/sigoff-check/signoff-check: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2021, NVIDIA CORPORATION. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | """A signoff check 18 | The tool checks if any commit got signoff in a pull request. 19 | NOTE: this script is for github actions only, you should not use it anywhere else. 20 | """ 21 | import os 22 | import re 23 | import sys 24 | from argparse import ArgumentParser 25 | 26 | from github import Github 27 | 28 | SIGNOFF_REGEX = re.compile('Signed-off-by:') 29 | 30 | 31 | def signoff(token: str, owner: str, repo_name: str, pull_number: int): 32 | gh = Github(token, per_page=100, user_agent='signoff-check', verify=True) 33 | pr = gh.get_repo(f"{owner}/{repo_name}").get_pull(pull_number) 34 | for c in pr.get_commits(): 35 | if SIGNOFF_REGEX.search(c.commit.message): 36 | print('Found signoff.\n') 37 | print(f"Commit sha:\n{c.commit.sha}") 38 | print(f"Commit message:\n{c.commit.message}") 39 | return True 40 | return False 41 | 42 | 43 | def main(token: str, owner: str, repo_name: str, pull_number: int): 44 | try: 45 | if not signoff(token, owner, repo_name, pull_number): 46 | raise Exception('No commits w/ signoff') 47 | except Exception as e: # pylint: disable=broad-except 48 | print(e) 49 | sys.exit(1) 50 | 51 | 52 | if __name__ == '__main__': 53 | parser = ArgumentParser(description="signoff check") 54 | parser.add_argument("--owner", help="repo owner", default='') 55 | parser.add_argument("--repo_name", help="repo name", default='') 56 | parser.add_argument("--token", help="github token, will use GITHUB_TOKEN if empty", default='') 57 | parser.add_argument("--pull_number", help="pull request number", type=int) 58 | args = parser.parse_args() 59 | 60 | GITHUB_TOKEN = args.token if args.token else os.environ.get('GITHUB_TOKEN') 61 | assert GITHUB_TOKEN, 'env GITHUB_TOKEN should not be empty' 62 | OWNER = args.owner if args.owner else os.environ.get('OWNER') 63 | assert OWNER, 'env OWNER should not be empty' 64 | REPO_NAME = args.repo_name if args.repo_name else os.environ.get('REPO_NAME') 65 | assert REPO_NAME, 'env REPO_NAME should not be empty' 66 | PULL_NUMBER = args.pull_number if args.pull_number else int(os.environ.get('PULL_NUMBER')) 67 | assert PULL_NUMBER, 'env PULL_NUMBER should not be empty' 68 | 69 | main(token=GITHUB_TOKEN, owner=OWNER, repo_name=REPO_NAME, pull_number=PULL_NUMBER) 70 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Note: 2 | ## This repo has been deprecated. We provide a new public repo [spark-rapids-examples](https://github.com/NVIDIA/spark-rapids-examples), which includes not only XGBoost examples but also Spark ETL examples on GPU with our [spark-rapids](https://github.com/NVIDIA/spark-rapids). 3 | --------------------------------------------------------------------------------