Skip to content

Commit

Permalink
Test workflow changes: on from pull_request_target to pull_request
Browse files Browse the repository at this point in the history
Signed-off-by: Theodor Mihalache <[email protected]>
  • Loading branch information
tmihalac committed Sep 23, 2024
1 parent f8e5935 commit e8b4413
Show file tree
Hide file tree
Showing 15 changed files with 334 additions and 338 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"ghcr.io/devcontainers-contrib/features/maven-sdkman:2": {
"jdkVersion": "11.0.24-amzn"
}
},
}

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created.
"postCreateCommand": "make install-python-ci-dependencies-uv-venv"
// "postCreateCommand": "make install-python-ci-dependencies-uv-venv"

// Configure tool-specific properties.
// "customizations": {},
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/java_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if:
((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) &&
github.repository == 'feast-dev/feast'
github.event.pull_request.base.repo.full_name == 'feast-dev/feast'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -30,7 +30,7 @@ jobs:
if:
((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) &&
github.repository == 'feast-dev/feast'
github.event.pull_request.base.repo.full_name == 'feast-dev/feast'
runs-on: ubuntu-latest
needs: lint-java
steps:
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
if:
((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) &&
github.repository == 'feast-dev/feast'
github.event.pull_request.base.repo.full_name == 'feast-dev/feast'
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -105,18 +105,17 @@ jobs:
if:
((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) &&
github.repository == 'feast-dev/feast'
github.event.pull_request.base.repo.full_name == 'feast-dev/feast'
runs-on: ubuntu-latest
needs: unit-test-java
env:
PYTHON: 3.11
steps:
- uses: actions/checkout@v4
with:
# pull_request runs the workflow in the context of the base repo
# as such actions/checkout needs to be explicit configured to retrieve
# code from the PR.
ref: refs/pull/${{ github.event.pull_request.number }}/merge
repository: ${{ github.event.repository.full_name }} # Uses the full repository name
ref: ${{ github.ref }} # Uses the ref from the event
token: ${{ secrets.GITHUB_TOKEN }} # Automatically provided token
submodules: recursive
- name: Set up JDK 11
uses: actions/setup-java@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:
jobs:
validate-title:
if:
github.repository == 'feast-dev/feast'
github.event.pull_request.base.repo.full_name == 'feast-dev/feast'
name: Validate PR title
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
if:
((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) &&
github.repository == 'feast-dev/feast'
github.event.pull_request.base.repo.full_name == 'feast-dev/feast'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_local_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if:
((github.event.action == 'labeled' && (github.event.label.name == 'approved' || github.event.label.name == 'lgtm' || github.event.label.name == 'ok-to-test')) ||
(github.event.action != 'labeled' && (contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(github.event.pull_request.labels.*.name, 'approved') || contains(github.event.pull_request.labels.*.name, 'lgtm')))) &&
github.repository == 'feast-dev/feast'
github.event.pull_request.base.repo.full_name == 'feast-dev/feast'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ dmypy.json

# Protos
sdk/python/docs/html
sdk/python/feast/protos/
sdk/go/protos/
go/protos/

Expand Down
24 changes: 13 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,31 @@ build: protos build-java build-docker

# Python SDK

install-python-dependencies-uv:
uv pip sync --system sdk/python/requirements/py$(PYTHON_VERSION)-requirements.txt
uv pip install --system --no-deps .

install-python-dependencies-uv-venv:
uv pip sync sdk/python/requirements/py$(PYTHON_VERSION)-requirements.txt
uv pip install --no-deps .

install-python-ci-dependencies:
python -m piptools sync sdk/python/requirements/py$(PYTHON_VERSION)-ci-requirements.txt
pip install --no-deps -e .
python setup.py build_python_protos --inplace

install-python-ci-dependencies-uv:
uv pip sync --system sdk/python/requirements/py$(PYTHON_VERSION)-ci-requirements.txt
uv pip install --system --no-deps -e .
python setup.py build_python_protos --inplace

install-python-ci-dependencies-uv-venv:
uv pip sync sdk/python/requirements/py$(PYTHON_VERSION)-ci-requirements.txt
uv pip install --no-deps -e .
python setup.py build_python_protos --inplace

install-protoc-dependencies:
pip install "protobuf<5" "grpcio-tools>=1.56.2,<2" "mypy-protobuf>=3.1"

lock-python-ci-dependencies:
uv pip compile --system --no-strip-extras setup.py --extra ci --output-file sdk/python/requirements/py$(PYTHON_VERSION)-ci-requirements.txt

package-protos:
cp -r ${ROOT_DIR}/protos ${ROOT_DIR}/sdk/python/feast/protos

compile-protos-python: install-protoc-dependencies
python setup.py build_python_protos --inplace
compile-protos-python:
python infra/scripts/generate_protos.py

install-python:
python -m piptools sync sdk/python/requirements/py$(PYTHON_VERSION)-requirements.txt
Expand Down Expand Up @@ -498,3 +497,6 @@ build-helm-docs:
# Note: requires node and yarn to be installed
build-ui:
cd $(ROOT_DIR)/sdk/python/feast/ui && yarn upgrade @feast-dev/feast-ui --latest && yarn install && npm run build --omit=dev

my-it:
IS_TEST=True FEAST_IS_LOCAL_TEST=True python -m pytest -s -n 1 --integration -k "test_push" --color=yes --durations=5 --timeout=1200 --timeout_method=thread sdk/python/tests/integration
2 changes: 1 addition & 1 deletion docs/reference/alpha-web-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ReactDOM.render(
);
```

When you start the React app, it will look for `project-list.json` to find a list of your projects. The JSON should looks something like this.
When you start the React app, it will look for `projects-list.json` to find a list of your projects. The JSON should look something like this.

```json
{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ require (
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
gopkg.in/yaml.v3 v3.0.0 // indirect
)
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1854,8 +1854,9 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
[build-system]
requires = [
"protobuf<5",
"grpcio-tools>=1.56.2,<2",
"mypy-protobuf>=3.1",
"pybindgen==0.22.0",
"setuptools>=60",
"setuptools_scm>=6.2",
"sphinx!=4.0.0",
"wheel",
]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
# Including this section is comparable to supplying use_scm_version=True in setup.py.
Expand Down
128 changes: 4 additions & 124 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import glob
import os
import pathlib
import re
import shutil
import subprocess
import sys
from pathlib import Path

from setuptools import Command, find_packages, setup
from setuptools.command.build_ext import build_ext as _build_ext
from setuptools.command.build_py import build_py
from setuptools.command.develop import develop
from setuptools.command.install import install
from setuptools import find_packages, setup

NAME = "feast"
DESCRIPTION = "Python SDK for Feast"
Expand Down Expand Up @@ -157,7 +149,6 @@
"virtualenv==20.23.0",
"cryptography>=35.0,<43",
"ruff>=0.3.3",
"protobuf<5",
"mypy-protobuf>=3.1",
"grpcio-tools>=1.56.2,<2",
"grpcio-testing>=1.56.2,<2",
Expand Down Expand Up @@ -244,107 +235,8 @@
else:
use_scm_version = None

PROTO_SUBDIRS = ["core", "registry", "serving", "types", "storage"]
PYTHON_CODE_PREFIX = "sdk/python"


class BuildPythonProtosCommand(Command):
description = "Builds the proto files into Python files."
user_options = [
("inplace", "i", "Write generated proto files to source directory."),
]

def initialize_options(self):
self.python_protoc = [
sys.executable,
"-m",
"grpc_tools.protoc",
] # find_executable("protoc")
self.proto_folder = os.path.join(repo_root, "protos")
self.sub_folders = PROTO_SUBDIRS
self.build_lib = None
self.inplace = 0

def finalize_options(self):
self.set_undefined_options("build", ("build_lib", "build_lib"))

@property
def python_folder(self):
if self.inplace:
return os.path.join(
os.path.dirname(__file__) or os.getcwd(), "sdk/python/feast/protos"
)

return os.path.join(self.build_lib, "feast/protos")

def _generate_python_protos(self, path: str):
proto_files = glob.glob(os.path.join(self.proto_folder, path))
Path(self.python_folder).mkdir(parents=True, exist_ok=True)
subprocess.check_call(
self.python_protoc
+ [
"-I",
self.proto_folder,
"--python_out",
self.python_folder,
"--grpc_python_out",
self.python_folder,
"--mypy_out",
self.python_folder,
]
+ proto_files
)

def run(self):
for sub_folder in self.sub_folders:
self._generate_python_protos(f"feast/{sub_folder}/*.proto")
# We need the __init__ files for each of the generated subdirs
# so that they are regular packages, and don't need the `--namespace-packages` flags
# when being typechecked using mypy.
with open(f"{self.python_folder}/feast/{sub_folder}/__init__.py", "w"):
pass

with open(f"{self.python_folder}/__init__.py", "w"):
pass
with open(f"{self.python_folder}/feast/__init__.py", "w"):
pass

for path in Path(self.python_folder).rglob("*.py"):
for folder in self.sub_folders:
# Read in the file
with open(path, "r") as file:
filedata = file.read()

# Replace the target string
filedata = filedata.replace(
f"from feast.{folder}", f"from feast.protos.feast.{folder}"
)

# Write the file out again
with open(path, "w") as file:
file.write(filedata)


class BuildCommand(build_py):
"""Custom build command."""

def run(self):
self.run_command("build_python_protos")

self.run_command("build_ext")
build_py.run(self)


class DevelopCommand(develop):
"""Custom develop command."""

def run(self):
self.reinitialize_command("build_python_protos", inplace=1)
self.run_command("build_python_protos")

develop.run(self)


setup(
name=NAME,
author=AUTHOR,
Expand All @@ -358,8 +250,6 @@ def run(self):
),
package_dir={"": PYTHON_CODE_PREFIX},
install_requires=REQUIRED,
# https://stackoverflow.com/questions/28509965/setuptools-development-requirements
# Install dev requirements with: pip install -e .[dev]
extras_require={
"dev": DEV_REQUIRED,
"ci": CI_REQUIRED,
Expand Down Expand Up @@ -402,17 +292,7 @@ def run(self):
entry_points={"console_scripts": ["feast=feast.cli:cli"]},
use_scm_version=use_scm_version,
setup_requires=[
# snowflake udf packages refer to conda packages, not pypi libraries. Conda stack is still on protobuf 4
# So we are adding protobuf<5 as a requirement
"protobuf<5",
"grpcio-tools>=1.56.2,<2",
"mypy-protobuf>=3.1",
"pybindgen==0.22.0",
"setuptools_scm>=6.2",
],
cmdclass={
"build_python_protos": BuildPythonProtosCommand,
"build_py": BuildCommand,
"develop": DevelopCommand,
},
"pybindgen==0.22.0", #TODO do we need this?
"setuptools_scm>=6.2", #TODO do we need this?
]
)
2 changes: 1 addition & 1 deletion ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ReactDOM.render(
);
```

When you start the React app, it will look for `projects-list.json` to find a list of your projects. The JSON should looks something like this.
When you start the React app, it will look for `projects-list.json` to find a list of your projects. The JSON should look something like this.

```json
{
Expand Down
Loading

0 comments on commit e8b4413

Please sign in to comment.