Skip to content

Commit dc07ef5

Browse files
authored
build-input-dep-whl: cleanup (#121)
- fix input descriptions - remove unused inputs - use generic `WHL_FILE`, `SDIST_FILE` as env-var outputs
1 parent 0714562 commit dc07ef5

File tree

3 files changed

+34
-23
lines changed

3 files changed

+34
-23
lines changed

.github/actions/build-xformers/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ runs:
1515
# shellcheck disable=SC1091
1616
source "${VENV}/bin/activate"
1717
18-
bash "$(dirname "$0")/build_xformers.sh" || (echo "xformers build failed" >&2 && exit 1)
18+
bash ${{ github.action_path }}/build_xformers.sh" || (echo "xformers build failed" >&2 && exit 1)
1919
shell: bash

.github/actions/build-xformers/build_xformers.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/bash
22
# this sets the following github actions env vars:
3-
# - xformers_whl
4-
# - xformers_tarfile
3+
# - WHL_FILE
4+
# - SDIST_FILE
5+
# - WHL_STATUS
56
set -eu
67

78
# FIXME: this should be in the base runner image
@@ -24,7 +25,7 @@ SUCCESS=0
2425
uv build --wheel --sdist --no-build-isolation || SUCCESS=$?
2526
sccache --show-stats
2627

27-
echo "xformers_whl_status=${SUCCESS}" | tee -a "$GITHUB_ENV"
28+
echo "WHL_STATUS=${SUCCESS}" | tee -a "$GITHUB_ENV"
2829

2930
if [ ${SUCCESS} -ne 0 ]; then
3031
exit 1
@@ -35,5 +36,5 @@ uv run --pre --no-project --with wheel-metadata-injector wheel-metadata-injector
3536

3637
XFORMERS_TARFILE="$(find dist -type f -iname "*\.tar.gz" -exec basename {} \;)"
3738

38-
echo "xformers_whl=${XFORMERS_WHL}" | tee -a "$GITHUB_ENV"
39-
echo "xformers_tarfile=${XFORMERS_TARFILE}" | tee -a "$GITHUB_ENV"
39+
echo "WHL_FILE=${XFORMERS_WHL}" | tee -a "$GITHUB_ENV"
40+
echo "SDIST_FILE=${XFORMERS_TARFILE}" | tee -a "$GITHUB_ENV"

.github/workflows/build-input-dep-whl.yml

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ on:
6363
type: string
6464
required: true
6565
repo:
66-
description: "REPO to build, e.g. 'nm-vllm-ent'"
66+
description: "REPO to build, e.g. 'facebookresearch/xformers'"
6767
type: string
6868
required: true
6969
branch:
@@ -74,8 +74,8 @@ on:
7474
description: "python version, e.g. 3.12.5"
7575
type: string
7676
default: 3.12.5
77-
partitions_file:
78-
description: "file defining the test partitions"
77+
package_name:
78+
description: "package name, e.g. 'xformers'"
7979
type: string
8080
required: true
8181
target_device:
@@ -116,6 +116,12 @@ jobs:
116116
tarfile: fromJSON(${{ steps.build.outputs.outputs }}).tarfile
117117

118118
steps:
119+
- name: checkout nm-cicd
120+
id: checkout-nm-cicd
121+
uses: actions/checkout@v4
122+
with:
123+
ref: ${{ inputs.gitref }}
124+
119125
- name: checkout ${{ inputs.repo }}
120126
id: checkout-repo
121127
uses: actions/checkout@v4
@@ -124,7 +130,7 @@ jobs:
124130
ref: ${{ inputs.branch }}
125131
fetch-depth: 0
126132
token: ${{ secrets.CICD_GITHUB_PAT }}
127-
path: ${{ inputs.repo }}
133+
path: ${{ env.CLIENT_PATH }}
128134
submodules: recursive
129135

130136
- name: 'Authenticate to Google Cloud'
@@ -163,26 +169,33 @@ jobs:
163169

164170
- name: copy whl and source distribution
165171
run: |
166-
assets_base="gs://nm-vllm-certs/${{inputs.package_name}}/assets/${RUN_ID}"
167-
gcloud storage cp "${DIST_PATH}/${whl}" "${assets_base}/${whl}"
168-
gcloud storage cp "${DIST_PATH}/${tarfile}" "${assets_base}/${tarfile}"
169-
env:
170-
RUN_ID: ${{github.run_id}}
172+
if [[ -z "${WHL_FILE}" || -z "${SDIST_FILE}" ]]; then
173+
echo "::error::WHL_FILE or SDIST_FILE are not set"
174+
exit 1
175+
fi
176+
177+
assets_base="gs://nm-vllm-certs/${{inputs.repo}}/assets/${GITHUB_RUN_ID}"
178+
echo "Copying sdist and whl to ${assets_base}"
179+
echo "sdist=${DIST_PATH}/${SDIST_FILE}"
180+
echo "whl=${DIST_PATH}/${WHL_FILE}"
181+
182+
gcloud storage cp "${DIST_PATH}/${WHL_FILE}" "${assets_base}/${whl}"
183+
gcloud storage cp "${DIST_PATH}/${SDIST_FILE}" "${assets_base}/${tarfile}"
171184
172185
- name: upload whl
173186
uses: actions/upload-artifact@v4
174187
if: success() || failure()
175188
with:
176-
name: ${{ env.whl }}
177-
path: ${{ env.DIST_PATH }}/${{ env.whl }}
189+
name: ${{ env.WHL_FILE }}
190+
path: ${{ env.DIST_PATH }}/${{ env.WHL_FILE }}
178191
retention-days: 5
179192

180193
- name: upload tar.gz
181194
uses: actions/upload-artifact@v4
182195
if: success() || failure()
183196
with:
184-
name: ${{ inputs.python }}-${{ env.tarfile }}
185-
path: ${{ env.DIST_PATH }}/${{ env.tarfile }}
197+
name: ${{ inputs.python }}-${{ env.SDIST_FILE }}
198+
path: ${{ env.DIST_PATH }}/${{ env.SDIST_FILE }}
186199
retention-days: 5
187200

188201
- name: summary
@@ -195,14 +208,11 @@ jobs:
195208
repo: ${{ inputs.repo }}
196209
branch: ${{ inputs.branch }}
197210
python: ${{ inputs.python }}
198-
whl_status: ${{ steps.build.outputs.whl_status }}
211+
whl_status: ${{ env.WHL_STATUS }}}
199212

200213
- name: run status
201214
id: run_status
202215
if: success() || failure()
203-
env:
204-
BUILD_STATUS: ${{ env.whl_status }}
205-
WHL_STATUS: ${{ env.whl_status }}
206216
run: |
207217
echo "build status: ${WHL_STATUS}"
208218
if [ -z "${WHL_STATUS}" ] || [ "${WHL_STATUS}" -ne "0" ]; then exit 1; fi

0 commit comments

Comments
 (0)