Skip to content

Commit ea8f8bd

Browse files
authored
ci: Add build step to run-cluster (Eventual-Inc#3606)
# Overview The `run-cluster` workflow now also builds the commit by calling the `build-commit` workflow first.
1 parent fb66ed1 commit ea8f8bd

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

.github/workflows/build-commit.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
name: build-commit
22

33
on:
4+
workflow_call:
5+
inputs:
6+
arch:
7+
description: The machine architecture to build for
8+
required: true
9+
type: string
10+
python_version:
11+
description: The version of Python to use
12+
required: true
13+
type: string
14+
secrets:
15+
ACTIONS_AWS_ROLE_ARN:
16+
description: The AWS Role ARN for secrets access
17+
required: true
18+
outputs:
19+
wheel_url:
20+
description: The name of the built wheel
21+
value: ${{ jobs.build-commit.outputs.wheel_url }}
422
workflow_dispatch:
523
inputs:
624
arch:
@@ -24,6 +42,8 @@ jobs:
2442
permissions:
2543
id-token: write
2644
contents: read
45+
outputs:
46+
wheel_url: ${{ steps.set-wheel-name.outputs.wheel_url }}
2747
steps:
2848
- name: Set platform substring
2949
run: |
@@ -96,6 +116,7 @@ jobs:
96116
)
97117
echo "wheel_name=$wheel_name" >> $GITHUB_ENV
98118
- name: Print url of the built wheel to GitHub Actions Summary Page
119+
id: set-wheel-name
99120
run: |
100121
console_url="https://us-west-2.console.aws.amazon.com/s3/object/github-actions-artifacts-bucket?prefix=builds/${{ github.sha }}/$wheel_name"
101122
download_url="https://github-actions-artifacts-bucket.s3.us-west-2.amazonaws.com/builds/${{ github.sha }}/$wheel_name"
@@ -105,3 +126,6 @@ jobs:
105126
106127
echo "Directly download the wheel here:" >> $GITHUB_STEP_SUMMARY
107128
echo "$download_url" >> $GITHUB_STEP_SUMMARY
129+
echo "wheel_url=$download_url" >> $GITHUB_OUTPUT
130+
env:
131+
wheel_url: ${{ env.wheel_url }}

.github/workflows/run-cluster.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,25 @@ on:
4545
default: ""
4646

4747
jobs:
48+
build-commit:
49+
uses: ./.github/workflows/build-commit.yaml
50+
if: ${{ inputs.daft_version == '' && inputs.daft_wheel_url == '' }}
51+
with:
52+
arch: x86
53+
python_version: ${{ inputs.python_version }}
54+
secrets:
55+
ACTIONS_AWS_ROLE_ARN: ${{ secrets.ACTIONS_AWS_ROLE_ARN }}
56+
4857
run-command:
4958
runs-on: [self-hosted, linux, x64, ci-dev]
50-
timeout-minutes: 15 # Remove for ssh debugging
59+
# If both the `daft-version` and `daft-wheel-url` parameters are not specified, the `build-commit` job is entirely skipped.
60+
# We still want to run this job, even if `build-commit` is skipped.
61+
# The `always()` guarantees that this job is always run.
62+
if: always()
5163
permissions:
5264
id-token: write
5365
contents: read
66+
needs: build-commit
5467
steps:
5568
- name: Log workflow inputs
5669
run: echo "${{ toJson(github.event.inputs) }}"
@@ -80,7 +93,7 @@ jobs:
8093
--python 3.12 \
8194
.github/ci-scripts/templatize_ray_config.py \
8295
--cluster-name="ray-ci-run-${{ github.run_id }}_${{ github.run_attempt }}" \
83-
--daft-wheel-url='${{ inputs.daft_wheel_url }}' \
96+
--daft-wheel-url='${{ needs.build-commit.outputs.wheel_url || inputs.daft_wheel_url || '' }}' \
8497
--daft-version='${{ inputs.daft_version }}' \
8598
--python-version='${{ inputs.python_version }}' \
8699
--cluster-profile='${{ inputs.cluster_profile }}' \

0 commit comments

Comments
 (0)