Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add build step to run-cluster #3606

Merged
merged 13 commits into from
Dec 19, 2024
24 changes: 24 additions & 0 deletions .github/workflows/build-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
name: build-commit

on:
workflow_call:
inputs:
arch:
description: The machine architecture to build for
required: true
type: string
jaychia marked this conversation as resolved.
Show resolved Hide resolved
python_version:
description: The version of Python to use
required: true
type: string
raunakab marked this conversation as resolved.
Show resolved Hide resolved
secrets:
ACTIONS_AWS_ROLE_ARN:
description: The AWS Role ARN for secrets access
required: true
raunakab marked this conversation as resolved.
Show resolved Hide resolved
outputs:
wheel_url:
description: The name of the built wheel
raunakab marked this conversation as resolved.
Show resolved Hide resolved
value: ${{ jobs.build-commit.outputs.wheel_url }}
workflow_dispatch:
inputs:
arch:
Expand All @@ -24,6 +42,8 @@ jobs:
permissions:
id-token: write
contents: read
outputs:
wheel_url: ${{ steps.set-wheel-name.outputs.wheel_url }}
steps:
- name: Set platform substring
run: |
Expand Down Expand Up @@ -96,6 +116,7 @@ jobs:
)
echo "wheel_name=$wheel_name" >> $GITHUB_ENV
- name: Print url of the built wheel to GitHub Actions Summary Page
id: set-wheel-name
run: |
console_url="https://us-west-2.console.aws.amazon.com/s3/object/github-actions-artifacts-bucket?prefix=builds/${{ github.sha }}/$wheel_name"
download_url="https://github-actions-artifacts-bucket.s3.us-west-2.amazonaws.com/builds/${{ github.sha }}/$wheel_name"
Expand All @@ -105,3 +126,6 @@ jobs:

echo "Directly download the wheel here:" >> $GITHUB_STEP_SUMMARY
echo "$download_url" >> $GITHUB_STEP_SUMMARY
echo "wheel_url=$download_url" >> $GITHUB_OUTPUT
env:
wheel_url: ${{ env.wheel_url }}
17 changes: 15 additions & 2 deletions .github/workflows/run-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,25 @@ on:
default: ""

jobs:
build-commit:
uses: ./.github/workflows/build-commit.yaml
if: ${{ inputs.daft_version == '' && inputs.daft_wheel_url == '' }}
with:
arch: x86
python_version: ${{ inputs.python_version }}
secrets:
ACTIONS_AWS_ROLE_ARN: ${{ secrets.ACTIONS_AWS_ROLE_ARN }}
raunakab marked this conversation as resolved.
Show resolved Hide resolved

run-command:
runs-on: [self-hosted, linux, x64, ci-dev]
timeout-minutes: 15 # Remove for ssh debugging
jaychia marked this conversation as resolved.
Show resolved Hide resolved
# If both the `daft-version` and `daft-wheel-url` parameters are not specified, the `build-commit` job is entirely skipped.
# We still want to run this job, even if `build-commit` is skipped.
# The `always()` guarantees that this job is always run.
if: always()
raunakab marked this conversation as resolved.
Show resolved Hide resolved
permissions:
id-token: write
contents: read
needs: build-commit
steps:
- name: Log workflow inputs
run: echo "${{ toJson(github.event.inputs) }}"
Expand Down Expand Up @@ -80,7 +93,7 @@ jobs:
--python 3.12 \
.github/ci-scripts/templatize_ray_config.py \
--cluster-name="ray-ci-run-${{ github.run_id }}_${{ github.run_attempt }}" \
--daft-wheel-url='${{ inputs.daft_wheel_url }}' \
--daft-wheel-url='${{ needs.build-commit.outputs.wheel_url || inputs.daft_wheel_url || '' }}' \
--daft-version='${{ inputs.daft_version }}' \
--python-version='${{ inputs.python_version }}' \
--cluster-profile='${{ inputs.cluster_profile }}' \
Expand Down
Loading