forked from ROCm/TheRock
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_portable_linux_python_packages.yml
More file actions
92 lines (80 loc) · 3.32 KB
/
Copy pathbuild_portable_linux_python_packages.yml
File metadata and controls
92 lines (80 loc) · 3.32 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
name: Build Portable Linux Python Packages
on:
workflow_dispatch:
inputs:
artifact_github_repo:
description: GitHub repository for artifact_run_id
type: string
default: ROCm/TheRock
artifact_run_id:
description: Workflow run ID to download artifacts from
type: string
default: "17865324892" # TODO: default to the most recent successful run (using a script)
artifact_group:
description: "The artifact group to build (ex: gfx94X-dcgpu, gfx101X-dgpu, gfx1151, gfx120X-all)"
type: string
package_version:
type: string
workflow_call:
inputs:
artifact_github_repo:
type: string
artifact_run_id:
type: string
default: ""
artifact_group:
type: string
package_version:
type: string
permissions:
contents: read
run-name: Build portable Linux Python Packages (${{ inputs.artifact_group }}, ${{ inputs.package_version }})
jobs:
build:
name: Build Python | ${{ inputs.artifact_group }}
# Note: GitHub-hosted runners run out of disk space for some gpu families
runs-on: ${{ github.repository_owner == 'ROCm' && 'azure-linux-scale-rocm' || 'ubuntu-24.04' }}
env:
BUILD_IMAGE: ghcr.io/rocm/therock_build_manylinux_x86_64@sha256:6e8242d347af7e0c43c82d5031a3ac67b669f24898ea8dc2f1d5b7e4798b66bd
ARTIFACT_RUN_ID: "${{ inputs.artifact_run_id != '' && inputs.artifact_run_id || github.run_id }}"
ARTIFACTS_DIR: "${{ github.workspace }}/artifacts"
PACKAGES_DIR: "${{ github.workspace }}/packages"
MANYLINUX: 1
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: '3.12'
- name: Install Python requirements
run: pip install boto3 packaging piprepo setuptools
# Note: we could fetch "all" artifacts if we wanted to include more files
- name: Fetch artifacts
env:
IS_PR_FROM_FORK: ${{ github.event.pull_request.head.repo.fork }}
run: |
python ./build_tools/fetch_artifacts.py \
--run-github-repo=${{ inputs.artifact_github_repo }} \
--run-id=${{ env.ARTIFACT_RUN_ID }} \
--artifact-group=${{ inputs.artifact_group }} \
--output-dir=${{ env.ARTIFACTS_DIR }} \
_dev_ _lib_ _run_
- name: Build Python packages
run: |
./build_tools/linux_portable_build.py \
--image=${{ env.BUILD_IMAGE }} \
--output-dir=${{ env.PACKAGES_DIR }} \
--artifact-dir=${{ env.ARTIFACTS_DIR }} \
--build-python-only \
-- \
"--version=${{ inputs.package_version }}"
- name: Inspect Python packages
run: |
ls -la "${{ env.PACKAGES_DIR }}"
# TODO(#1559): Sanity check (Linux can't find the directories, maybe Docker issues?)
# - name: Sanity check Python packages
# run: |
# piprepo build "${{ env.PACKAGES_DIR }}/dist"
# pip install rocm[devel]==${{ inputs.package_version }} \
# --extra-index-url "${{ env.PACKAGES_DIR }}/dist/simple/"
# rocm-sdk test
# TODO(#1559): upload packages to artifacts S3 bucket and/or a dedicated Python packages bucket