• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: linux-build-rg
2
3on:
4  workflow_call:
5    inputs:
6      build-environment:
7        required: true
8        type: string
9        description: Top-level label for what's being built/tested.
10      docker-image-name:
11        required: true
12        type: string
13        description: Name of the base docker image to build with.
14      build-generates-artifacts:
15        required: false
16        type: boolean
17        default: true
18        description: If set, upload generated build artifacts.
19      build-with-debug:
20        required: false
21        type: boolean
22        default: false
23        description: If set, build in debug mode.
24      sync-tag:
25        required: false
26        type: string
27        default: ""
28        description: |
29          If this is set, our linter will use this to make sure that every other
30          job with the same `sync-tag` is identical.
31      cuda-arch-list:
32        required: false
33        type: string
34        default: "5.2"
35        description: |
36          List of CUDA architectures CI build should target.
37      runner-group:
38        required: false
39        type: string
40        default: "arc-lf-linux.2xlarge"
41        description: Runner group to select group type
42      test-matrix:
43        required: false
44        type: string
45        description: |
46          An option JSON description of what test configs to run later on. This
47          is moved here from the Linux test workflow so that we can apply filter
48          logic using test-config labels earlier and skip unnecessary builds
49      s3-bucket:
50        description: S3 bucket to download artifact
51        required: false
52        type: string
53        default: "gha-artifacts"
54      aws-role-to-assume:
55        description: role to assume for downloading artifacts
56        required: false
57        type: string
58        default: ""
59    secrets:
60      HUGGING_FACE_HUB_TOKEN:
61        required: false
62        description: |
63          HF Auth token to avoid rate limits when downloading models or datasets from hub
64
65    outputs:
66      docker-image:
67        value: ${{ jobs.build.outputs.docker-image }}
68        description: The docker image containing the built PyTorch.
69      test-matrix:
70        value: ${{ jobs.build.outputs.test-matrix }}
71        description: An optional JSON description of what test configs to run later on.
72
73jobs:
74  build:
75    # Don't run on forked repos
76    if: github.repository_owner == 'pytorch'
77    runs-on:
78      group: ${{ inputs.runner-group }}
79    timeout-minutes: 240
80    outputs:
81      docker-image: ${{ steps.linux-build.outputs.docker-image }}
82      test-matrix: ${{ steps.linux-build.outputs.test-matrix }}
83    steps:
84      # [pytorch repo ref]
85      # Use a pytorch/pytorch reference instead of a reference to the local
86      # checkout because when we run this action we don't *have* a local
87      # checkout. In other cases you should prefer a local checkout.
88      - name: Checkout PyTorch
89        uses: pytorch/pytorch/.github/actions/checkout-pytorch@release/2.4
90
91      - name: Linux Build
92        id: linux-build
93        uses: ./.github/actions/linux-build
94        with:
95          build-environment: ${{ inputs.build-environment }}
96          docker-image-name: ${{ inputs.docker-image-name }}
97          build-generates-artifacts: ${{ inputs.build-generates-artifacts }}
98          build-with-debug: ${{ inputs.build-with-debug }}
99          sync-tag: ${{ inputs.sync-tag }}
100          cuda-arch-list: ${{ inputs.cuda-arch-list }}
101          test-matrix: ${{ inputs.test-matrix }}
102          s3-bucket: ${{ inputs.s3-bucket }}
103          aws-role-to-assume: ${{ inputs.aws-role-to-assume }}
104          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105          HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
106