-
Notifications
You must be signed in to change notification settings - Fork 59
115 lines (101 loc) · 4.12 KB
/
_build_linux.yml
File metadata and controls
115 lines (101 loc) · 4.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Build Linux Wheels
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
test-matrix:
type: string
required: true
release-type:
type: string
required: false
default: ''
description: 'nightly or final'
docker-hub-username:
type: string
required: true
secrets:
docker-hub-token:
required: true
aws-access-key-id:
required: true
aws-secret-access-key:
required: true
defaults:
run:
shell: bash
jobs:
wheel:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(inputs.test-matrix) }}
steps:
- name: Login to Docker Hub
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: ${{ inputs.docker-hub-username }}
password: ${{ secrets.docker-hub-token }}
- name: Configure AWS
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-access-key-id: ${{ secrets.aws-access-key-id }}
aws-secret-access-key: ${{ secrets.aws-secret-access-key }}
aws-region: us-west-1
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Free up disk space
# Disk space required for CPU builds is usually small enough, so we
# save a few minutes by skipping this step.
if: ${{ matrix.cuda-version != 'cpu' }}
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
tool-cache: true
- name: Set up uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
# NOTE: This is a version used for cibuildwheel but not for wheels.
python-version: '3.14'
activate-environment: true
- name: Install dependencies
run: |
uv pip install cibuildwheel auditwheel
- name: Set version (final)
if: ${{ inputs.release-type == 'final' }}
run: |
VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" pyg_lib/__init__.py`
TORCH_VERSION=`echo "pt${{ matrix.torch-version }}" | sed "s/..$//" | sed "s/\.//g"`
CUDA_VERSION=`echo ${{ matrix.cuda-version }}`
echo "New version name: $VERSION+$TORCH_VERSION$CUDA_VERSION"
sed -i "s/$VERSION/$VERSION+$TORCH_VERSION$CUDA_VERSION/" setup.py
sed -i "s/$VERSION/$VERSION+$TORCH_VERSION$CUDA_VERSION/" pyg_lib/__init__.py
- name: Set version (nightly)
if: ${{ inputs.release-type == 'nightly' }}
run: |
VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" pyg_lib/__init__.py`
TORCH_VERSION=`echo "pt${{ matrix.torch-version }}" | sed "s/..$//" | sed "s/\.//g"`
CUDA_VERSION=`echo ${{ matrix.cuda-version }}`
TODAY=`date +'%Y%m%d'`
echo "New version name: $VERSION.dev$TODAY+$TORCH_VERSION$CUDA_VERSION"
sed -i "s/$VERSION/$VERSION.dev$TODAY+$TORCH_VERSION$CUDA_VERSION/" setup.py
sed -i "s/$VERSION/$VERSION.dev$TODAY+$TORCH_VERSION$CUDA_VERSION/" pyg_lib/__init__.py
shell: bash
- name: Build wheel
run: |
bash ./.github/workflows/utils/build_linux.sh ${{ matrix.cuda-version }} ${{ matrix.python-version }} ${{ matrix.torch-version }}
- name: Upload wheel (final)
if: ${{ inputs.release-type == 'final' }}
run: |
aws s3 sync dist s3://data.pyg.org/whl/torch-${{ matrix.torch-version }}+${{ matrix.cuda-version }} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
- name: Upload wheel (nightly)
if: ${{ inputs.release-type == 'nightly' }}
run: |
aws s3 sync dist s3://data.pyg.org/whl/nightly/torch-${{ matrix.torch-version }}+${{ matrix.cuda-version }} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers