Skip to content

Commit

Permalink
chore: Fix Dockerfiles to install feast correctly (#2635)
Browse files Browse the repository at this point in the history
* chore: Fix Dockerfiles to install feast correctly

Also removes an unsued python script since we use the pypa/gh-action-pypi-publish action to build and publish wheels now.

Signed-off-by: Achal Shah <achals@gmail.com>

* more fixes

Signed-off-by: Achal Shah <achals@gmail.com>

* add a verify step before we publish to pypi wheel

Signed-off-by: Achal Shah <achals@gmail.com>

* more fixes

Signed-off-by: Achal Shah <achals@gmail.com>
  • Loading branch information
achals authored May 4, 2022
1 parent d59a91c commit cef4d3c
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 59 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:

publish-python-sdk:
runs-on: ubuntu-latest
needs: [build-python-sdk, build-python-sdk-macos-py310]
needs: [verify-python-wheel]
steps:
- uses: actions/download-artifact@v2
with:
Expand All @@ -139,20 +139,35 @@ jobs:
password: ${{ secrets.PYPI_PASSWORD }}


verify-python-wheel:
runs-on: ubuntu-latest
needs: [build-python-sdk, build-python-sdk-macos-py310]
steps:
- name: Setup Python
id: setup-python
uses: actions/setup-python@v2
with:
python-version: "3.8"
architecture: x64
- uses: actions/download-artifact@v2
with:
name: wheels
path: dist
- name: Install wheel
run: pip install dist/*38*linux*.whl
- name: Install sdist
run: pip install dist/*tar.gz

build-python-sdk:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-10.15 ]

steps:
- uses: actions/checkout@v2

- name: Build wheels
uses: pypa/cibuildwheel@v2.4.0
with:
package-dir: sdk/python
env:
CIBW_BUILD: "cp3*_x86_64"
CIBW_SKIP: "cp36-* *-musllinux_x86_64 cp310-macosx_x86_64"
Expand Down Expand Up @@ -195,13 +210,12 @@ jobs:
make install-go-ci-dependencies
- name: Build
run: |
cd sdk/python
python3 setup.py sdist bdist_wheel
- uses: actions/upload-artifact@v2
with:
name: wheels
path: sdk/python/dist/*
path: dist/*


publish-java-sdk:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pip install --upgrade pip

4. Install development dependencies for Feast Python SDK / CLI
```sh
pip install -e "sdk/python[dev]"
pip install -e ".[dev]"
```

### Code Style & Linting
Expand Down
47 changes: 0 additions & 47 deletions infra/scripts/publish-python-sdk.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

RUN git clone https://github.com/feast-dev/feast.git /root/feast
RUN cd /root/feast/sdk/python && pip install -e '.[redis]'
RUN cd /root/feast/ && pip install -e '.[redis]'

WORKDIR /app
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/infra/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def _get_docker_image_version() -> str:
f"version {get_version()}. If you want to update the Feast SDK version, make "
"sure to first fetch all new release tags from Github and then reinstall the library:\n"
"> git fetch --all --tags\n"
"> pip install -e sdk/python"
"> pip install -e '.'"
)
return version

Expand Down
6 changes: 5 additions & 1 deletion sdk/python/feast/infra/transformation_servers/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ COPY sdk/python/feast/infra/transformation_servers/app.py app.py
# Copy necessary parts of the Feast codebase
COPY sdk/python sdk/python
COPY protos protos
COPY go go
COPY setup.py setup.py
COPY pyproject.toml pyproject.toml
COPY README.md README.md


# Install dependencies
RUN pip3 install -e 'sdk/python'
RUN pip3 install -e '.'

# Start feature transformation server
CMD [ "python", "app.py" ]
2 changes: 1 addition & 1 deletion ui/feature_repo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ git clone https://github.com/feast-dev/feast.git
Install a dev build of feast
```bash
cd feast
pip install -e "sdk/python[dev]"
pip install -e ".[dev]"
```

Then for this demo, you'll actually need to fix a bug by adding this to `type_map.py#L144`:
Expand Down

0 comments on commit cef4d3c

Please sign in to comment.