|
19 | 19 | from feast.errors import ( |
20 | 20 | AwsAPIGatewayDoesNotExist, |
21 | 21 | AwsLambdaDoesNotExist, |
| 22 | + ExperimentalFeatureNotEnabled, |
| 23 | + IncompatibleRegistryStoreClass, |
22 | 24 | RepoConfigPathDoesNotExist, |
23 | 25 | S3RegistryBucketForbiddenAccess, |
24 | 26 | S3RegistryBucketNotExist, |
25 | 27 | ) |
26 | 28 | from feast.feature_table import FeatureTable |
27 | 29 | from feast.feature_view import FeatureView |
| 30 | +from feast.flags import FLAG_AWS_LAMBDA_FEATURE_SERVER_NAME |
| 31 | +from feast.flags_helper import enable_aws_lambda_feature_server |
28 | 32 | from feast.infra.passthrough_provider import PassthroughProvider |
29 | 33 | from feast.infra.utils import aws_utils |
30 | 34 | from feast.protos.feast.core.Registry_pb2 import Registry as RegistryProto |
| 35 | +from feast.registry import get_registry_store_class_from_scheme |
31 | 36 | from feast.registry_store import RegistryStore |
32 | 37 | from feast.repo_config import RegistryConfig |
33 | 38 | from feast.version import get_version |
@@ -62,6 +67,22 @@ def update_infra( |
62 | 67 | ) |
63 | 68 |
|
64 | 69 | if self.repo_config.feature_server and self.repo_config.feature_server.enabled: |
| 70 | + if not enable_aws_lambda_feature_server(self.repo_config): |
| 71 | + raise ExperimentalFeatureNotEnabled(FLAG_AWS_LAMBDA_FEATURE_SERVER_NAME) |
| 72 | + |
| 73 | + # Since the AWS Lambda feature server will attempt to load the registry, we |
| 74 | + # only allow the registry to be in S3. |
| 75 | + registry_path = ( |
| 76 | + self.repo_config.registry |
| 77 | + if isinstance(self.repo_config.registry, str) |
| 78 | + else self.repo_config.registry.path |
| 79 | + ) |
| 80 | + registry_store_class = get_registry_store_class_from_scheme(registry_path) |
| 81 | + if registry_store_class != S3RegistryStore: |
| 82 | + raise IncompatibleRegistryStoreClass( |
| 83 | + registry_store_class.__name__, S3RegistryStore.__name__ |
| 84 | + ) |
| 85 | + |
65 | 86 | image_uri = self._upload_docker_image(project) |
66 | 87 | _logger.info("Deploying feature server...") |
67 | 88 |
|
|
0 commit comments