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

chore: Added a test case to use env variables in yaml file #126

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ To build and run the Go Feature Server locally, create a feature_store.yaml file

```bash
go build -o feast ./go/main.go
./feast --type=http --port
./feast --type=http --port=8080
```
34 changes: 34 additions & 0 deletions go/internal/feast/registry/repoconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,40 @@ online_store:
assert.Empty(t, config.Flags)
}

func TestNewRepoConfigWithEnvironmentVariables(t *testing.T) {
dir, err := os.MkdirTemp("", "feature_repo_*")
assert.Nil(t, err)
defer func() {
assert.Nil(t, os.RemoveAll(dir))
}()
filePath := filepath.Join(dir, "feature_store.yaml")
data := []byte(`
project: feature_repo
registry: "data/registry.db"
provider: local
online_store:
type: redis
connection_string: ${REDIS_CONNECTION_STRING}
`)
err = os.WriteFile(filePath, data, 0666)
assert.Nil(t, err)
os.Setenv("REDIS_CONNECTION_STRING", "localhost:6380")
config, err := NewRepoConfigFromFile(dir)
registryConfig, err := config.GetRegistryConfig()
assert.Nil(t, err)
assert.Equal(t, "feature_repo", config.Project)
assert.Equal(t, dir, config.RepoPath)
assert.Equal(t, "data/registry.db", registryConfig.Path)
assert.Equal(t, "local", config.Provider)
assert.Equal(t, map[string]interface{}{
"type": "redis",
"connection_string": "localhost:6380",
}, config.OnlineStore)
assert.Empty(t, config.OfflineStore)
assert.Empty(t, config.FeatureServer)
assert.Empty(t, config.Flags)
}

func TestNewRepoConfigRegistryMap(t *testing.T) {
dir, err := os.MkdirTemp("", "feature_repo_*")
assert.Nil(t, err)
Expand Down
7 changes: 5 additions & 2 deletions sdk/python/feast/transformation_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import grpc
import pyarrow as pa
from grpc_health.v1 import health, health_pb2_grpc
from grpc_health.v1 import health, health_pb2, health_pb2_grpc
from grpc_reflection.v1alpha import reflection

from feast.errors import OnDemandFeatureViewNotFoundException
Expand Down Expand Up @@ -73,10 +73,13 @@ def start_server(store: FeatureStore, port: int):
add_TransformationServiceServicer_to_server(TransformationServer(store), server)

# Add health check service to server
health_pb2_grpc.add_HealthServicer_to_server(health.HealthServicer(), server)
health_servicer = health.HealthServicer()
health_pb2_grpc.add_HealthServicer_to_server(health_servicer, server)
health_servicer.set("", health_pb2.HealthCheckResponse.SERVING)

service_names_available_for_reflection = (
DESCRIPTOR.services_by_name["TransformationService"].full_name,
health_pb2.DESCRIPTOR.services_by_name["Health"].full_name,
reflection.SERVICE_NAME,
)
reflection.enable_server_reflection(service_names_available_for_reflection, server)
Expand Down
9 changes: 7 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,17 @@
"uvicorn[standard]>=0.14.0,<1",
"gunicorn; platform_system != 'Windows'",
"dask[dataframe]>=2024.2.1",
# For HTTP Registry
"httpx>=0.23.3",
]

GO_REQUIRED = [
"cffi~=1.15.0",
]

HTTP_REGISTRY_REQUIRED = [
# For HTTP Registry
"httpx>=0.23.3",
]

GCP_REQUIRED = [
"google-api-core>=1.23.0,<3",
"googleapis-common-protos>=1.52.0,<2",
Expand Down Expand Up @@ -231,6 +234,7 @@
+ ELASTICSEARCH_REQUIRED
+ SQLITE_VEC_REQUIRED
+ SINGLESTORE_REQUIRED
+ HTTP_REGISTRY_REQUIRED
)

DOCS_REQUIRED = CI_REQUIRED
Expand Down Expand Up @@ -488,6 +492,7 @@ def run(self):
"elasticsearch": ELASTICSEARCH_REQUIRED,
"sqlite_vec": SQLITE_VEC_REQUIRED,
"singlestore": SINGLESTORE_REQUIRED,
"http_registry": HTTP_REGISTRY_REQUIRED,
},
include_package_data=True,
license="Apache",
Expand Down
Loading