2024-08-28 11:18:19 +02:00
|
|
|
name: Build and Publish Artifacts
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
rocm_version:
|
|
|
|
description: 'ROCm version'
|
|
|
|
required: true
|
2024-09-23 18:28:48 +02:00
|
|
|
default: '6.2'
|
2024-08-28 11:18:19 +02:00
|
|
|
torch_version:
|
2024-09-23 18:28:48 +02:00
|
|
|
description: 'Torch version (e.g., rocm6.2)'
|
2024-08-28 11:18:19 +02:00
|
|
|
required: true
|
2024-09-23 18:28:48 +02:00
|
|
|
default: 'rocm6.2'
|
2024-08-28 11:18:19 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2024-08-28 16:02:15 +02:00
|
|
|
- name: Free Disk Space (Ubuntu)
|
|
|
|
uses: jlumbroso/free-disk-space@main
|
|
|
|
with:
|
|
|
|
tool-cache: false
|
2024-08-28 11:28:43 +02:00
|
|
|
|
2024-08-28 11:18:19 +02:00
|
|
|
# Step 1: Checkout the repository
|
|
|
|
- name: Checkout repository
|
2024-08-29 12:28:57 +02:00
|
|
|
uses: actions/checkout@v4
|
2024-08-28 11:18:19 +02:00
|
|
|
|
|
|
|
# Step 2: Set up Docker Buildx
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
# Step 3: Build the Docker image
|
|
|
|
- name: Build Docker image
|
|
|
|
run: |
|
2024-08-28 15:29:51 +02:00
|
|
|
echo ${{ inputs.rocm_version }}
|
|
|
|
echo ${{ inputs.torch_version }}
|
|
|
|
|
2024-08-28 11:18:19 +02:00
|
|
|
docker build \
|
2024-08-28 15:28:23 +02:00
|
|
|
--build-arg ROCM_VERSION=${{ inputs.rocm_version }} \
|
|
|
|
--build-arg TORCH_VERSION=${{ inputs.torch_version }} \
|
2024-08-28 11:18:19 +02:00
|
|
|
-t prebuilt-wheels ./prebuilts
|
|
|
|
|
|
|
|
# Step 4: Create a container and run the script
|
|
|
|
- name: Run Docker container and generate wheels
|
|
|
|
run: |
|
2024-08-28 15:23:59 +02:00
|
|
|
docker create --name prebuilt-container prebuilt-wheels
|
2024-08-28 11:18:19 +02:00
|
|
|
docker start -a prebuilt-container
|
|
|
|
|
|
|
|
# Step 5: Copy bitsandbytes wheel artifact to host
|
|
|
|
- name: Copy bitsandbytes wheel to host
|
|
|
|
run: |
|
2024-08-28 16:30:46 +02:00
|
|
|
mkdir -p /tmp/bitsandbytes/
|
|
|
|
docker cp prebuilt-container:/tmp/bitsandbytes/dist/ /tmp/bitsandbytes/
|
2024-08-28 11:18:19 +02:00
|
|
|
|
|
|
|
# Step 6: Copy llama-cpp-python wheel artifact to host
|
|
|
|
- name: Copy llama-cpp-python wheel to host
|
|
|
|
run: |
|
2024-08-28 16:30:46 +02:00
|
|
|
mkdir -p /tmp/llama-cpp-python/
|
|
|
|
docker cp prebuilt-container:/tmp/llama-cpp-python/dist/ /tmp/llama-cpp-python/
|
2024-08-28 11:18:19 +02:00
|
|
|
|
|
|
|
# Step 7: Upload bitsandbytes wheel artifact
|
|
|
|
- name: Upload bitsandbytes wheel
|
2024-08-29 12:28:57 +02:00
|
|
|
uses: actions/upload-artifact@v4
|
2024-08-28 11:18:19 +02:00
|
|
|
with:
|
|
|
|
name: bitsandbytes-wheels
|
|
|
|
path: /tmp/bitsandbytes/dist/*.whl
|
|
|
|
|
|
|
|
# Step 8: Upload llama-cpp-python wheel artifact
|
|
|
|
- name: Upload llama-cpp-python wheel
|
2024-08-29 12:28:57 +02:00
|
|
|
uses: actions/upload-artifact@v4
|
2024-08-28 11:18:19 +02:00
|
|
|
with:
|
|
|
|
name: llama-cpp-python-wheels
|
|
|
|
path: /tmp/llama-cpp-python/dist/*.whl
|
|
|
|
|
|
|
|
# Step 9: Cleanup Docker container
|
|
|
|
- name: Cleanup
|
|
|
|
run: |
|
|
|
|
docker rm prebuilt-container
|