Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish alternative python package with FEAST_USAGE=False by default #2275

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,27 @@ jobs:
python3 setup.py sdist bdist_wheel
python3 -m twine upload --verbose dist/*

publish-python-sdk-no-telemetry:
runs-on: ubuntu-latest
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
container: python:3.7
steps:
- uses: actions/checkout@v2
- name: Install pip-tools
run: pip install pip-tools
- name: Install dependencies
run: make install-python-ci-dependencies PYTHON=3.7
- name: Publish Python Package
run: |
cd sdk/python
sed -i 's/DEFAULT_FEAST_USAGE_VALUE = "True"/DEFAULT_FEAST_USAGE_VALUE = "False"/g' feast/constants.py
sed -i 's/NAME = "feast"/NAME = "feast-no-telemetry"/g' setup.py
python3 -m pip install --user --upgrade setuptools wheel twine
python3 setup.py sdist bdist_wheel
python3 -m twine upload --verbose dist/*

publish-java-sdk:
container: maven:3.6-jdk-11
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions sdk/python/feast/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
# Environment variable for toggling usage
FEAST_USAGE = "FEAST_USAGE"

# Default value for FEAST_USAGE when environment variable is not set
DEFAULT_FEAST_USAGE_VALUE = "True"

# Environment variable for the path for overwriting universal test configs
FULL_REPO_CONFIGS_MODULE_ENV_NAME: str = "FULL_REPO_CONFIGS_MODULE"

Expand Down
4 changes: 2 additions & 2 deletions sdk/python/feast/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@

import requests

from feast.constants import FEAST_USAGE
from feast.constants import DEFAULT_FEAST_USAGE_VALUE, FEAST_USAGE
from feast.version import get_version

USAGE_ENDPOINT = "https://usage.feast.dev"

_logger = logging.getLogger(__name__)
_executor = concurrent.futures.ThreadPoolExecutor(max_workers=1)

_is_enabled = os.getenv(FEAST_USAGE, default="True") == "True"
_is_enabled = os.getenv(FEAST_USAGE, default=DEFAULT_FEAST_USAGE_VALUE) == "True"

_constant_attributes = {
"session_id": str(uuid.uuid4()),
Expand Down