Skip to content

Commit

Permalink
Publish alternative python sdk with FEAST_USAGE=False by default (#2275)
Browse files Browse the repository at this point in the history
Signed-off-by: pyalex <moskalenko.alexey@gmail.com>
  • Loading branch information
pyalex authored Feb 3, 2022
1 parent f68dd88 commit ffe82fd
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
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

0 comments on commit ffe82fd

Please sign in to comment.