Optimize k-neighbors similarity queries #910
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
pull_request: | |
branches: | |
- develop | |
types: [opened, synchronize] | |
push: | |
branches: | |
- develop | |
tags: | |
- v* | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Clone fiftyone-brain | |
uses: actions/checkout@v1 | |
with: | |
submodules: true | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Check Python version | |
run: | | |
python --version | |
pip --version | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip setuptools wheel | |
pip install -r requirements/build.txt | |
- name: Set environment | |
env: | |
RELEASE_TAG: ${{ github.ref }} | |
run: | | |
if [[ $RELEASE_TAG =~ ^refs\/tags\/v.* ]]; then | |
echo "RELEASE_VERSION=$(echo '${{ github.ref }}' | sed 's/^refs\/tags\/v//')" >> $GITHUB_ENV | |
fi | |
- name: Build wheel | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: Upload wheel | |
uses: actions/upload-artifact@v4 | |
with: | |
path: dist | |
retention-days: 1 | |
test: | |
needs: [build] | |
runs-on: ubuntu-20.04 | |
env: | |
FIFTYONE_DATASET_ZOO_DIR: ${{ github.workspace }}/.fiftyone | |
FIFTYONE_DO_NOT_TRACK: true | |
FIFTYONE_MODEL_ZOO_DIR: ${{ github.workspace }}/.fiftyone | |
strategy: | |
fail-fast: false | |
matrix: | |
python: | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
steps: | |
- name: Clone fiftyone-brain | |
uses: actions/checkout@v1 | |
with: | |
submodules: true | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip setuptools wheel | |
- name: Download fiftyone-brain wheel | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
- name: Install fiftyone | |
run: | | |
git clone https://${{ secrets.FIFTYONE_GITHUB_TOKEN }}@github.com/voxel51/fiftyone fiftyone-src --depth 1 --branch develop | |
cd fiftyone-src | |
python setup.py bdist_wheel | |
pip install voxel51-eta[storage] fiftyone-db | |
pip install ./dist/*.whl | |
- name: Install ETA from source | |
if: ${{ !startsWith(github.ref, 'refs/heads/rel') && !startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
echo "Installing ETA from source because github.ref = ${{ github.ref }} (not a release)" | |
git clone https://github.com/voxel51/eta eta --depth 1 --branch develop | |
cd eta | |
python setup.py bdist_wheel | |
pip install ./dist/*.whl --force-reinstall | |
- name: Reinstall fiftyone-brain | |
run: | | |
pip install --force-reinstall --no-deps dist/artifact/*.whl | |
- name: Set up ETA credentials | |
env: | |
FIFTYONE_GOOGLE_CREDENTIALS: ${{ secrets.FIFTYONE_GOOGLE_CREDENTIALS }} | |
run: | | |
mkdir -p "${HOME}/.eta" | |
echo "$FIFTYONE_GOOGLE_CREDENTIALS" > "${HOME}/.eta/google-credentials.json" | |
wc "${HOME}/.eta/google-credentials.json" | |
md5sum "${HOME}/.eta/google-credentials.json" | |
- name: Install test dependencies | |
run: | | |
pip install imageio pytest torch torchvision | |
- name: Cache Zoo | |
id: fiftyone-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
.fiftyone | |
key: zoo-${{ hashFiles('tests/**') }} | |
- name: Run tests | |
run: | | |
pytest --verbose tests/ --ignore tests/intensive/ | |
publish: | |
needs: [build] | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Download wheels | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
- name: Install dependencies | |
run: | | |
pip3 install --upgrade importlib-metadata pip setuptools wheel typing-extensions | |
pip3 install twine | |
- name: Set environment | |
env: | |
RELEASE_TAG: ${{ github.ref }} | |
run: | | |
echo "TWINE_PASSWORD=${{ secrets.FIFTYONE_PYPI_TOKEN }}" >> $GITHUB_ENV | |
echo "TWINE_REPOSITORY=pypi" >> $GITHUB_ENV | |
- name: Upload to pypi | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_NON_INTERACTIVE: 1 | |
run: | | |
python3 -m twine upload dist/artifact/* |