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

fix: Add spark to lambda dockerfile #2480

Merged
merged 13 commits into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from 7 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
3 changes: 2 additions & 1 deletion sdk/python/feast/infra/feature_servers/aws_lambda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ COPY go go
COPY README.md README.md

# Install Feast for AWS with Lambda dependencies
RUN pip3 install -e 'sdk/python[aws,redis]'
# TODO(achals): The additional spark deps should be removed. Details at https://github.com/feast-dev/feast/pull/2480.
RUN pip3 install -e 'sdk/python[aws,redis,spark]'
RUN pip3 install -r sdk/python/feast/infra/feature_servers/aws_lambda/requirements.txt --target "${LAMBDA_TASK_ROOT}"

# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
Expand Down
8 changes: 5 additions & 3 deletions sdk/python/feast/proto_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def to_json_object(printer: _Printer, message: ProtoMessage) -> JsonObject:
return value

def from_json_object(
parser: _Parser, value: JsonObject, message: ProtoMessage
parser: _Parser, value: JsonObject, message: ProtoMessage,
) -> None:
if value is None:
message.null_val = 0
Expand Down Expand Up @@ -140,10 +140,12 @@ def to_json_object(printer: _Printer, message: ProtoMessage) -> JsonObject:
return [printer._MessageToJsonObject(item) for item in message.val]

def from_json_object(
parser: _Parser, value: JsonObject, message: ProtoMessage
parser: _Parser, value: JsonObject, message: ProtoMessage,
) -> None:
print("going to convert message")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove print

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

array = value if isinstance(value, list) else value["val"]
for item in array:
print(f"item: {item}")
parser.ConvertMessage(item, message.val.add())

_patch_proto_json_encoding(RepeatedValue, to_json_object, from_json_object)
Expand Down Expand Up @@ -181,7 +183,7 @@ def to_json_object(printer: _Printer, message: ProtoMessage) -> JsonObject:
return list(message.val)

def from_json_object(
parser: _Parser, value: JsonObject, message: ProtoMessage
parser: _Parser, value: JsonObject, message: ProtoMessage,
) -> None:
array = value if isinstance(value, list) else value["val"]
message.val.extend(array)
Expand Down
8 changes: 4 additions & 4 deletions sdk/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"mmh3",
"pandas>=1.0.0",
"pandavro==1.5.*",
"protobuf>=3.10",
"protobuf>=3.10,<3.20",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: do we want to also update py3.7-requirements.txt and other files?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yeah good point

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just read through what the make lock-python-*dependencies command does and existing requirements file - I don't think any changes are needed here.

"proto-plus<1.19.7",
"pyarrow>=4.0.0",
"pydantic>=1.0.0",
Expand Down Expand Up @@ -111,7 +111,7 @@
"mock==2.0.0",
"moto",
"mypy==0.931",
"mypy-protobuf==3.1.0",
"mypy-protobuf>=3.2",
"avro==1.10.0",
"gcsfs",
"urllib3>=1.25.4",
Expand Down Expand Up @@ -150,7 +150,7 @@
+ GE_REQUIRED
)

DEV_REQUIRED = ["mypy-protobuf>=3.1.0", "grpcio-testing==1.*"] + CI_REQUIRED
DEV_REQUIRED = ["mypy-protobuf>=3.2", "grpcio-testing==1.*"] + CI_REQUIRED

# Get git repo root directory
repo_root = str(pathlib.Path(__file__).resolve().parent.parent.parent)
Expand Down Expand Up @@ -422,7 +422,7 @@ def run(self):
"setuptools_scm",
"grpcio",
"grpcio-tools==1.34.0",
"mypy-protobuf==3.1.0",
"mypy-protobuf>=3.2",
"sphinx!=4.0.0",
],
package_data={
Expand Down