Skip to content

.github: Add reusable workflow for generic linux_job#783

Merged
seemethere merged 45 commits intomainfrom
seemethere/add_build_test_linux_workflow
Sep 29, 2022
Merged

.github: Add reusable workflow for generic linux_job#783
seemethere merged 45 commits intomainfrom
seemethere/add_build_test_linux_workflow

Conversation

@seemethere
Copy link
Copy Markdown
Member

@seemethere seemethere commented Sep 26, 2022

Context

Adds a reusable workflow for running generic scripts on linux. Should cover cpu as well as all of the current CUDA versions we support in our binary images.

Basic idea behind this is that it gives users an easy interface to create a generic workflow with all of the niceties of our current setup like:

  • Access to ECR / S3 by default
  • NVIDIA Drivers by default (if a GPU is present)
  • with-ssh access by default
  • Proper cleanup / teardown

Users will give a simple script to the reusable workflow that can either be a multiline string defined in the YAML or can just reference a local bash script from the repository itself.

Usage:

name: Run simple workflow

on:
  pull_request:
  workflow_dispatch:

jobs:
  test-cpu:
    uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
    with:
      runner: linux.2xlarge
      gpu-arch-type: cpu
      gpu-arch-version: ""
      script: |
        export PATH="/opt/python/cp38-cp38/bin:${PATH}"
        python3 -m pip install --extra-index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
        # Can import pytorch
        python3 -c 'import torch'
  test-gpu:
    uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
    with:
      runner: linux.4xlarge.nvidia.gpu
      gpu-arch-type: cuda
      gpu-arch-version: 11.6
      script: |
        export PATH="/opt/python/cp38-cp38/bin:${PATH}"
        python3 -m pip install --extra-index-url https://download.pytorch.org/whl/nightly/cpu --pre torch
        # Can import pytorch
        python3 -c 'import torch;assert(torch.cuda.is_available())'

depends on changes from #782

@vercel
Copy link
Copy Markdown

vercel bot commented Sep 26, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
torchci ⬜️ Ignored (Inspect) Sep 28, 2022 at 11:22PM (UTC)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 26, 2022
@seemethere seemethere changed the title seemethere/add build test linux workflow github: Add workflow for build/test on linux Sep 26, 2022
@seemethere seemethere force-pushed the seemethere/add_build_test_linux_workflow branch from c8b56d9 to fc98c0c Compare September 26, 2022 05:56
Adds a workflow for build/test on linux, could potentially use some
improvements to support GPU but this should get _most_ users off the
ground quickly

Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
@seemethere seemethere force-pushed the seemethere/add_build_test_linux_workflow branch from abd9bc9 to a788fb5 Compare September 27, 2022 23:53
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
@seemethere seemethere marked this pull request as ready for review September 28, 2022 23:09
@seemethere seemethere requested a review from a team September 28, 2022 23:12
@seemethere seemethere changed the title github: Add workflow for build/test on linux github: Add reusable workflow for generic linux_job Sep 28, 2022
@seemethere seemethere changed the title github: Add reusable workflow for generic linux_job .github: Add reusable workflow for generic linux_job Sep 28, 2022
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
@seemethere seemethere added the Nova Tooling Tooling Related to Project Nova (CI Tooling) label Sep 28, 2022
Copy link
Copy Markdown
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

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

Looks good to me, can it be perhaps pair it with similar change to pytorch/pytorch that uses those actions rather than have 2 slightly different copies of those actions.

@seemethere seemethere merged commit 69e7c4f into main Sep 29, 2022
@seemethere seemethere deleted the seemethere/add_build_test_linux_workflow branch September 29, 2022 21:56
malfet added a commit to pytorch/pytorch that referenced this pull request Oct 1, 2022
Instead of local copies, use workflows checked into test-infra by pytorch/test-infra#783
malfet added a commit to pytorch/pytorch that referenced this pull request Oct 1, 2022
Instead of local copies, use workflows checked into test-infra by pytorch/test-infra#783
pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request Oct 1, 2022
Instead of local copies, use workflows checked into test-infra by pytorch/test-infra#783

Thought about deleting the actions later, but if I understand how GHA merges work, older PRs merged onto this changes should not cause any problems as it will immediately reference actions from test-infra
Pull Request resolved: #86035
Approved by: https://github.com/kit1980
mehtanirav pushed a commit to pytorch/pytorch that referenced this pull request Oct 4, 2022
Instead of local copies, use workflows checked into test-infra by pytorch/test-infra#783

Thought about deleting the actions later, but if I understand how GHA merges work, older PRs merged onto this changes should not cause any problems as it will immediately reference actions from test-infra
Pull Request resolved: #86035
Approved by: https://github.com/kit1980
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Nova Tooling Tooling Related to Project Nova (CI Tooling)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants