Please see Development Guide for project level development instructions.
- Overview
- Community
- Making a pull request
- Feast Python SDK / CLI
- (Experimental) Feast UI
- Feast Java Serving
- Feast Go Client
- Issues
This guide is targeted at developers looking to contribute to Feast components in the main Feast repository:
See Contribution process and Community for details on how to get more involved in the community.
A quick few highlights:
- RFCs
- Community Slack
- Feast Dev Mailing List
- Community Calendar
- Includes biweekly community calls at 10AM PST
We use the convention that the assignee of a PR is the person with the next action.
This means that often, the assignee may be empty (if no reviewer has been found yet), the reviewer, or the PR writer if there are comments to be addressed.
A quick list of things to keep in mind as you're making changes:
- As you make changes
- Make your changes in a forked repo (instead of making a branch on the main Feast repo)
- Sign your commits as you go (to avoid DCO checks failing)
- Rebase from master instead of using
git pullon your PR branch - Install pre-commit hooks to ensure all the default linters / formatters are run when you push.
- When you make the PR
- Make a pull request from the forked repo you made
- Ensure you add a GitHub label (i.e. a kind tag to the PR (e.g.
kind/bugorkind/housekeeping)) or else checks will fail. - Ensure you leave a release note for any user facing changes in the PR. There is a field automatically generated in the PR request. You can write
NONEin that field if there are no user facing changes. - Please run tests locally before submitting a PR (e.g. for Python, the local integration tests)
- Try to keep PRs smaller. This makes them easier to review.
Fork the Feast Github repo and clone your fork locally. Then make changes to a local branch to the fork.
See Creating a pull request from a fork
Setup pre-commit to automatically lint and format the codebase on commit:
- Ensure that you have Python (3.7 and above) with
pip, installed. - Install
pre-commitwithpip& install pre-push hooks
pip install pre-commit
pre-commit install --hook-type pre-commit --hook-type pre-push- On push, the pre-commit hook will run. This runs
make formatandmake lint.
⚠️ Warning: using the default integrations with IDEs like VSCode or IntelliJ will not sign commits. When you submit a PR, you'll have to re-sign commits to pass the DCO check.
Use git signoffs to sign your commits. See https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification for details
Then, you can sign off commits with the -s flag:
git commit -s -m "My first commit"
GPG-signing commits with -S is optional.
Our preference is the use of git rebase [master] instead of git merge : git pull -r.
Note that this means if you are midway through working through a PR and rebase, you'll have to force push:
git push --force-with-lease origin [branch name]
Setting up your development environment for Feast Python SDK / CLI:
- Ensure that you have Docker installed in your environment. Docker is used to provision service dependencies during testing, and build images for feature servers and other components.
- Please note that we use Docker with BuiltKit.
- Ensure that you have
make, Python (3.7 and above) withpip, installed. - Recommended: Create a virtual environment to isolate development dependencies to be installed
# create & activate a virtual environment
python -m venv venv/
source venv/bin/activate- Upgrade
pipif outdated
pip install --upgrade pip- (Optional): Install Node & Yarn. Then run the following to build Feast UI artifacts for use in
feast ui
make build-ui
- Install development dependencies for Feast Python SDK / CLI
pip install -e ".[dev]"Feast Python SDK / CLI codebase:
- Conforms to Black code style
- Has type annotations as enforced by
mypy - Has imports sorted by
isort - Is lintable by
flake8
To ensure your Python code conforms to Feast Python code standards:
- Autoformat your code to conform to the code style:
make format-python- Lint your Python code before submitting it for review:
make lint-pythonSetup pre-commit hooks to automatically format and lint on commit.
Unit tests (pytest) for the Feast Python SDK / CLI can run as follows:
make test-python
⚠️ Local configuration can interfere with Unit tests and cause them to fail:
- Ensure no AWS configuration is present and no AWS credentials can be accessed by
boto3- Ensure Feast Python SDK / CLI is not configured with configuration overrides (ie
~/.feast/configshould be empty).
There are two sets of tests you can run:
- Local integration tests (for faster development, tests file offline store & key online stores)
- Full integration tests (requires cloud environment setups)
For this approach of running tests, you'll need to have docker set up locally: Get Docker
It leverages a file based offline store to test against emulated versions of Datastore, DynamoDB, and Redis, using ephemeral containers.
These tests create new temporary tables / datasets locally only, and they are cleaned up. when the containers are torn down.
make test-python-integration-localTo test across clouds, on top of setting up Redis, you also need GCP / AWS / Snowflake setup.
Note: you can manually control what tests are run today by inspecting RepoConfiguration and commenting out tests that are added to
DEFAULT_FULL_REPO_CONFIGS
GCP
- Install the Cloud SDK.
- Then run login to gcloud:
gcloud auth login
gcloud auth application-default login
- When you run
gcloud auth application-default login, you should see some output of the form:
Credentials saved to file: [$HOME/.config/gcloud/application_default_credentials.json]
- You should run
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/.config/gcloud/application_default_credentials.json”to add the application credentials to your .zshrc or .bashrc.
- Run
export GCLOUD_PROJECT=[your project]to your .zshrc or .bashrc. - Running
gcloud config listshould give you something like this:
$ gcloud config list
[core]
account = [your email]
disable_usage_reporting = True
project = [your project]
Your active configuration is: [default]- Export gcp specific environment variables. Namely,
export GCS_REGION='[your gcs region e.g US]'
export GCS_STAGING_LOCATION='[your gcs staging location]'AWS
- TODO(adchia): flesh out setting up AWS login (or create helper script)
- To run the AWS Redshift and Dynamo integration tests you will have to export your own AWS credentials. Namely,
export AWS_REGION='[your aws region]'
export AWS_CLUSTER_ID='[your aws cluster id]'
export AWS_USER='[your aws user]'
export AWS_DB='[your aws database]'
export AWS_STAGING_LOCATION='[your s3 staging location uri]'
export AWS_IAM_ROLE='[redshift and s3 access role]'
export AWS_LAMBDA_ROLE='[your aws lambda execution role]'
export AWS_REGISTRY_PATH='[your aws registry path]'Snowflake
- See https://signup.snowflake.com/ to setup a trial.
- Then to run successfully, you'll need some environment variables setup:
export SNOWFLAKE_CI_DEPLOYMENT='[snowflake_deployment]'
export SNOWFLAKE_CI_USER='[your user]'
export SNOWFLAKE_CI_PASSWORD='[your pw]'
export SNOWFLAKE_CI_ROLE='[your CI role e.g. SYSADMIN]'
export SNOWFLAKE_CI_WAREHOUSE='[your warehouse]'Then run make test-python-integration. Note that for Snowflake / GCP / AWS, this will create new temporary tables / datasets.
(Advanced) Running specific provider tests or running your test against specific online or offline stores
- If you don't need to have your test run against all of the providers(
gcp,aws, andsnowflake) or don't need to run against all of the online stores, you can tag your test with specific providers or stores that you need(@pytest.mark.universal_online_storesor@pytest.mark.universal_online_storeswith theonlyparameter). Theonlyparameter selects specific offline providers and online stores that your test will test against. Example:
# Only parametrizes this test with the sqlite online store
@pytest.mark.universal_online_stores(only=["sqlite"])
def test_feature_get_online_features_types_match():- You can also filter tests to run by using pytest's cli filtering. Instead of using the make commands to test Feast, you can filter tests by name with the
-kparameter. The parametrized integration tests are all uniquely identified by their provider and online store so the-koption can select only the tests that you need to run. For example, to run only Redshift related tests, you can use the following command:
python -m pytest -n 8 --integration -k Redshift sdk/python/testsTest across clouds requires existing accounts on GCP / AWS / Snowflake, and may incur costs when using these services.
For this approach of running tests, you'll need to have docker set up locally: Get Docker
It's possible to run some integration tests against emulated local versions of these services, using ephemeral containers. These tests create new temporary tables / datasets locally only, and they are cleaned up. when the containers are torn down.
The services with containerized replacements currently implemented are:
- Datastore
- DynamoDB
- Redis
- Trino
- HBase
- Postgres
You can run make test-python-integration-container to run tests against the containerized versions of dependencies.
You can run make test-python-universal-spark to run all tests against the Spark offline store. (Note: you'll have to run pip install -e ".[dev]" first).
Not all tests are passing yet
You can run make test-python-universal-trino to run all tests against the Trino offline store. (Note: you'll have to run pip install -e ".[dev]" first)
TODO
TODO
TODO
Setting up your development environment for Feast Go SDK:
- Install Golang,
protocwith the Golang & grpc plugins
Build the Feast Go Client with the go toolchain:
make go buildFeast Go Client codebase:
- Conforms to the code style enforced by
go fmt. - Is lintable by
go vet.
Autoformat your Go code to satisfy the Code Style standard:
go fmtLint your Go code:
go vetSetup pre-commit hooks to automatically format and lint on commit.
Unit tests for the Feast Go Client can be run as follows:
go test- Update your current master on your forked branch and make a pull request against your own forked master.
- Enable workflows by going to actions and clicking
Enable Workflows.- Pushes will now run your edited workflow yaml file against your test code.
- Unfortunately, in order to test any github workflow changes, you must push the code to the branch and see the output in the actions tab.
- pr-integration-tests workflow is skipped
- Add
ok-to-testgithub label.
- Add
- pr-integration-tests errors out with
Error: fatal: invalid refspec '+refs/pull//merge:refs/remotes/pull//merge'- This is because github actions cannot pull the branch version for some reason so just find your PR number in your pull request header and hard code it into the
uses: actions/checkout@v2section (i.e replacerefs/pull/${{ github.event.pull_request.number }}/mergewithrefs/pull/<pr number>/merge)
- This is because github actions cannot pull the branch version for some reason so just find your PR number in your pull request header and hard code it into the
- AWS/GCP workflow
- Currently still cannot test GCP/AWS workflow without setting up secrets in a forked repository.