-
Notifications
You must be signed in to change notification settings - Fork 1k
223 lines (218 loc) · 8.14 KB
/
build_wheels.yml
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
name: build wheels
# Call this workflow from other workflows in the repository by specifying "uses: ./.github/workflows/build_wheels.yml"
# Developers who are starting a new release should use this workflow to ensure wheels will be built correctly.
# Devs should check out their fork, add a tag to the last master commit on their fork, and run the release off of their fork on the added tag to ensure wheels will be built correctly.
on:
workflow_dispatch: # Allows manual trigger of the workflow
inputs:
custom_version: # Optional input for a custom version
description: 'Custom version to publish (e.g., v1.2.3) -- only edit if you know what you are doing'
required: false
type: string
token:
description: 'Personal Access Token'
required: true
default: ""
type: string
workflow_call:
inputs:
custom_version: # Optional input for a custom version
description: 'Custom version to publish (e.g., v1.2.3) -- only edit if you know what you are doing'
required: false
type: string
token:
description: 'Personal Access Token'
required: true
default: ""
type: string
jobs:
build-python-wheel:
name: Build wheels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: x64
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: './ui/.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Build UI
run: make build-ui
- id: get-version
uses: ./.github/actions/get-semantic-release-version
with:
custom_version: ${{ github.event.inputs.custom_version }}
token: ${{ github.event.inputs.token }}
- name: Build wheels
env:
VERSION: ${{ steps.get-version.outputs.release_version }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
git fetch --tags
git checkout ${VERSION}
python -m pip install build
python -m build --wheel --outdir wheelhouse/
- uses: actions/upload-artifact@v4
with:
name: python-wheels
path: ./wheelhouse/*.whl
build-source-distribution:
name: Build source distribution
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Setup Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: x64
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: './ui/.nvmrc'
registry-url: 'https://registry.npmjs.org'
- id: get-version
uses: ./.github/actions/get-semantic-release-version
with:
custom_version: ${{ github.event.inputs.custom_version }}
token: ${{ github.event.inputs.token }}
- name: Build and install dependencies
env:
VERSION: ${{ steps.get-version.outputs.release_version }}
# There's a `git restore` in here because `make install-go-ci-dependencies` is actually messing up go.mod & go.sum.
run: |
git fetch --tags
git checkout ${VERSION}
pip install -U pip setuptools wheel twine
make build-ui
git status
git restore go.mod go.sum
git restore sdk/python/feast/ui/yarn.lock
- name: Build
run: |
python3 setup.py sdist
- uses: actions/upload-artifact@v4
with:
name: source-distribution
path: dist/*
# We add this step so the docker images can be built as part of the pre-release verification steps.
build-docker-images:
name: Build Docker images
runs-on: ubuntu-latest
needs: [ build-python-wheel, build-source-distribution ]
strategy:
matrix:
component: [ feature-server-dev, feature-server-java, feature-transformation-server, feast-operator ]
env:
REGISTRY: feastdev
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- id: get-version
uses: ./.github/actions/get-semantic-release-version
with:
custom_version: ${{ github.event.inputs.custom_version }}
token: ${{ github.event.inputs.token }}
- name: Build image
env:
VERSION_WITHOUT_PREFIX: ${{ steps.get-version.outputs.version_without_prefix }}
RELEASE_VERSION: ${{ steps.get-version.outputs.release_version }}
run: |
echo "Building docker image for ${{ matrix.component }} with version $VERSION_WITHOUT_PREFIX and release version $RELEASE_VERSION"
make build-${{ matrix.component }}-docker REGISTRY=${REGISTRY} VERSION=${VERSION_WITHOUT_PREFIX}
verify-python-wheels:
name: Verify Python wheels
runs-on: ${{ matrix.os }}
needs: [ build-python-wheel, build-source-distribution ]
strategy:
matrix:
os: [ ubuntu-latest, macos-13 ]
python-version: [ "3.9", "3.10", "3.11" ]
from-source: [ True, False ]
env:
# this script is for testing servers
# it starts server with timeout and checks whether process killed by timeout (started healthy) or died by itself
TEST_SCRIPT: |
timeout 10s $@ & pid=$!
wait $pid
ret=$?
if [[ $ret -ne 124 ]]
then
exit $ret
else
echo "Succeeded!"
fi
steps:
- uses: actions/checkout@v4
- name: Setup Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- uses: actions/download-artifact@v4.1.7
with:
name: python-wheels
path: dist
- uses: actions/download-artifact@v4.1.7
with:
name: source-distribution
path: dist
- name: Install OS X dependencies
if: matrix.os == 'macos-13'
run: brew install coreutils
- name: Install wheel
if: ${{ !matrix.from-source }}
# try to install all wheels; only the current platform wheel should be actually installed
run: |
cd dist/
pip install wheel
for f in *.whl; do pip install $f || true; done
- name: Install sdist
# try to install the sdist
if: ${{ matrix.from-source }}
run: pip install dist/*tar.gz
# Validate that the feast version installed is not development and is the correct version of the tag we ran it off of.
- id: get-version
uses: ./.github/actions/get-semantic-release-version
with:
custom_version: ${{ github.event.inputs.custom_version }}
token: ${{ github.event.inputs.token }}
- name: Validate Feast Version
env:
VERSION_WITHOUT_PREFIX: ${{ steps.get-version.outputs.version_without_prefix }}
run: |
feast version
if ! VERSION_OUTPUT=$(feast version); then
echo "Error: Failed to get Feast version."
exit 1
fi
VERSION_REGEX='[0-9]+\.[0-9]+\.[0-9]+'
OUTPUT_REGEX='^Feast SDK Version: "$VERSION_REGEX"$'
VERSION=$(echo $VERSION_OUTPUT | grep -oE "$VERSION_REGEX")
OUTPUT=$(echo $VERSION_OUTPUT | grep -E "$REGEX")
echo "Installed Feast Version: $VERSION and using Feast Version: $VERSION_WITHOUT_PREFIX"
if [ -n "$OUTPUT" ] && [ "$VERSION" = "$VERSION_WITHOUT_PREFIX" ]; then
echo "Correct Feast Version Installed"
else
echo "$VERSION_OUTPUT from installed wheel is not in the correct format or doesn't have the right version $VERSION."
exit 1
fi
# This is temporarily disabled.
# - name: Smoke test
# run: |
# feast init test_repo
# cd test_repo/feature_repo
# feast apply
# echo "$TEST_SCRIPT" > run-and-wait.sh
# bash run-and-wait.sh feast serve
# bash run-and-wait.sh feast ui