-
Notifications
You must be signed in to change notification settings - Fork 2
146 lines (127 loc) · 4.56 KB
/
nightly.yaml
File metadata and controls
146 lines (127 loc) · 4.56 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Nightly
on:
workflow_dispatch:
inputs:
xla_commit:
description: "Explicit openxla/xla commit to build"
required: false
type: string
rocm_xla_commit:
description: "Explicit ROCm/xla commit to build"
required: false
type: string
schedule:
- cron: '0 0 * * *'
concurrency:
group: ${{ github.workflow_sha }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
resolve-commits:
uses: ./.github/workflows/_resolve_openxla_commits.yaml
with:
source: head
xla_commit: ${{ inputs.xla_commit }}
rocm_xla_commit: ${{ inputs.rocm_xla_commit }}
nightly-pjrt-artifacts:
needs: resolve-commits
uses: ./.github/workflows/_build.yaml
with:
xla_commit: ${{ needs.resolve-commits.outputs.xla_commit }}
rocm_xla_commit: ${{ needs.resolve-commits.outputs.rocm_xla_commit }}
# bazel_extra_args: "--config=dbg"
secrets:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
publish-nightly:
needs:
- resolve-commits
- nightly-pjrt-artifacts
runs-on: ubuntu-latest
steps:
- name: "Checking out repository"
uses: actions/checkout@v4
- name: Compute nightly tag
id: nightly-tag
shell: bash
env:
INPUT_XLA_COMMIT: ${{ inputs.xla_commit }}
run: |
if [ -n "$INPUT_XLA_COMMIT" ]; then
echo "tag=manual-$(date -u +%Y-%m-%dT%H-%M-%SZ)" >> "$GITHUB_OUTPUT"
else
echo "tag=nightly-$(date -u +%F)" >> "$GITHUB_OUTPUT"
fi
- name: Commit nightly pins
env:
BASE_REF: ${{ github.ref_name }}
INPUT_XLA_COMMIT: ${{ inputs.xla_commit }}
XLA_COMMIT: ${{ needs.resolve-commits.outputs.xla_commit }}
ROCM_XLA_COMMIT: ${{ needs.resolve-commits.outputs.rocm_xla_commit }}
shell: bash
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git fetch origin "$BASE_REF" --tags
if [ -z "$INPUT_XLA_COMMIT" ]; then
git fetch origin nightly || true
git checkout -B nightly "origin/$BASE_REF"
else
git checkout -B "${{ steps.nightly-tag.outputs.tag }}" "origin/$BASE_REF"
fi
cat > openxla/commits.env <<EOF
XLA_COMMIT=$XLA_COMMIT
ROCM_XLA_COMMIT=$ROCM_XLA_COMMIT
EOF
git add openxla/commits.env
git commit --allow-empty -m "chore: nightly pins ${{ steps.nightly-tag.outputs.tag }}"
- name: Push nightly branch and tag
shell: bash
env:
INPUT_XLA_COMMIT: ${{ inputs.xla_commit }}
run: |
if git ls-remote --exit-code --tags origin "${{ steps.nightly-tag.outputs.tag }}" >/dev/null 2>&1; then
echo "Tag ${{ steps.nightly-tag.outputs.tag }} already exists" >&2
exit 1
fi
git tag "${{ steps.nightly-tag.outputs.tag }}"
if [ -z "$INPUT_XLA_COMMIT" ]; then
git push --force-with-lease origin HEAD:nightly
fi
git push origin "refs/tags/${{ steps.nightly-tag.outputs.tag }}"
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Generate nightly release notes
id: release-notes
shell: bash
env:
XLA_BRANCH: ${{ needs.resolve-commits.outputs.xla_branch }}
XLA_COMMIT: ${{ needs.resolve-commits.outputs.xla_commit }}
ROCM_XLA_BRANCH: ${{ needs.resolve-commits.outputs.rocm_xla_branch }}
ROCM_XLA_COMMIT: ${{ needs.resolve-commits.outputs.rocm_xla_commit }}
run: |
if [ -n "$XLA_BRANCH" ]; then
xla_line="- openxla/xla: $XLA_BRANCH @ $XLA_COMMIT"
else
xla_line="- openxla/xla: $XLA_COMMIT"
fi
if [ -n "$ROCM_XLA_BRANCH" ]; then
rocm_xla_line="- ROCm/xla: $ROCM_XLA_BRANCH @ $ROCM_XLA_COMMIT"
else
rocm_xla_line="- ROCm/xla: $ROCM_XLA_COMMIT"
fi
{
echo "body<<EOF"
echo "OpenXLA commits used for this nightly:"
echo
echo "$xla_line"
echo "$rocm_xla_line"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Release nightly artifacts
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.nightly-tag.outputs.tag }}
body: ${{ steps.release-notes.outputs.body }}
files: |
*.tar.gz/*.tar.gz