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: Use the correct dockerhub image tag when building feature servers #2372

Merged
merged 11 commits into from
Mar 7, 2022
8 changes: 6 additions & 2 deletions sdk/python/feast/infra/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def _deploy_feature_server(self, project: str, image_uri: str):
lambda_client = boto3.client("lambda")
api_gateway_client = boto3.client("apigatewayv2")
function = aws_utils.get_lambda_function(lambda_client, resource_name)
_logger.debug("Using function name: %s", resource_name)
_logger.debug("Found function: %s", function)

if function is None:
# If the Lambda function does not exist, create it.
Expand Down Expand Up @@ -262,7 +264,9 @@ def _upload_docker_image(
_logger.info(
f"Pulling remote image {Style.BRIGHT + Fore.GREEN}{dockerhub_image}{Style.RESET_ALL}"
)
for line in docker_client.api.pull(dockerhub_image, stream=True, decode=True):
for line in docker_client.api.pull(
dockerhub_image.replace("_", "."), stream=True, decode=True
):
achals marked this conversation as resolved.
Show resolved Hide resolved
_logger.debug(f" {line}")

auth_token = ecr_client.get_authorization_token()["authorizationData"][0][
Expand All @@ -279,7 +283,7 @@ def _upload_docker_image(
)
_logger.debug(f" {login_status}")

image = docker_client.images.get(dockerhub_image)
image = docker_client.images.get(dockerhub_image.replace("_", "."))
image_remote_name = f"{repository_uri}:{docker_image_version}"
_logger.info(
f"Pushing local image to remote {Style.BRIGHT + Fore.GREEN}{image_remote_name}{Style.RESET_ALL}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime
import itertools
import logging
import os
import time
import unittest
Expand Down Expand Up @@ -35,6 +36,8 @@
)
from tests.utils.data_source_utils import prep_file_source

_logger = logging.getLogger(__name__)


@pytest.mark.integration
def test_entity_ttl_online_store(local_redis_environment, redis_universal_data_sources):
Expand Down Expand Up @@ -262,16 +265,17 @@ def _get_online_features_dict_remotely(
request["features"] = features
else:
request["feature_service"] = features.name
for _ in range(25):
for attempt in range(25):
# Send the request to the remote feature server and get the response in JSON format
response = requests.post(
f"{endpoint}/get-online-features", json=request, timeout=30
).json()
_logger.info(f"Attempt: {attempt}, {response}")
achals marked this conversation as resolved.
Show resolved Hide resolved
# Retry if the response is internal server error, which can happen when lambda is being restarted
if response.get("message") != "Internal Server Error":
break
# Sleep between retries to give the server some time to start
time.sleep(1)
time.sleep(15)
else:
raise Exception("Failed to get online features from remote feature server")
if "metadata" not in response:
Expand Down