Skip to content

Commit 77fc4c3

Browse files
incorporating code review comments.
Signed-off-by: lrangine <19699092+lokeshrangineni@users.noreply.github.com>
1 parent 8f3e9b7 commit 77fc4c3

File tree

6 files changed

+24
-40
lines changed

6 files changed

+24
-40
lines changed

docs/reference/feature-servers/python-feature-server.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,10 @@ requests.post(
200200
data=json.dumps(push_data))
201201
```
202202

203-
## Starting feature server in SSL mode
203+
## Starting the feature server in SSL mode
204204

205205
### Obtaining a self-signed SSL certificate and key
206-
In development mode we can generate self-signed certificate for testing purpose. In actual production environment it is always recommended to get it from the popular SSL certificate providers.
206+
In development mode we can generate a self-signed certificate for testing. In an actual production environment it is always recommended to get it from an SSL certificate provider.
207207

208208
```shell
209209
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes
@@ -213,7 +213,7 @@ The above command will generate two files
213213
* `key.pem` : certificate private key
214214
* `cert.pem`: certificate public key
215215

216-
### Starting Online Server in SSL Mode
216+
### Starting the Online Server in SSL Mode
217217
To start the feature server in SSL mode, you need to provide the private and public keys using the `--ssl-key-path` and `--ssl-cert-path` arguments with the `feast serve` command.
218218

219219
```shell

docs/reference/online-stores/remote.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ auth:
2323
```
2424
{% endcode %}
2525
26-
`ssl_cert_path` is optional configuration. Path to the public certificate path in case if the online server starts in SSL mode. This may be needed especially if online server started with a self-signed certificate, typically this file ends with .crt, .cer, or .pem.
26+
`ssl_cert_path` is an optional configuration to the public certificate path when the online server starts in SSL mode. This may be needed if the online server is started with a self-signed certificate, typically this file ends with `*.crt`, `*.cer`, or `*.pem`.
2727

2828
## How to configure Authentication and Authorization
2929
Please refer the [page](./../../../docs/getting-started/concepts/permission.md) for more details on how to configure authentication and authorization.

sdk/python/feast/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ def serve_command(
951951
"""Start a feature server locally on a given port."""
952952
if (ssl_key_path and not ssl_cert_path) or (not ssl_key_path and ssl_cert_path):
953953
raise click.BadParameter(
954-
"Please send ssl-cert-path and ssl-key-path args to start feature server in SSL mode."
954+
"Please configure ssl-cert-path and ssl-key-path args to start the feature server in SSL mode."
955955
)
956956

957957
store = create_feature_store(ctx)

sdk/python/feast/feature_server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ def start_server(
367367

368368
if sys.platform != "win32":
369369
options = {
370-
"store": store,
371370
"bind": f"{host}:{port}",
372371
"accesslog": None if no_access_log else "-",
373372
"workers": workers,
@@ -379,7 +378,7 @@ def start_server(
379378
if ssl_key_path and ssl_cert_path:
380379
options["keyfile"] = ssl_key_path
381380
options["certfile"] = ssl_cert_path
382-
FeastServeApplication(**options).run()
381+
FeastServeApplication(store=store, **options).run()
383382
else:
384383
import uvicorn
385384

sdk/python/feast/infra/online_stores/remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class RemoteOnlineStoreConfig(FeastConfigBaseModel):
4242
If type is 'remote', then this is a URL for registry server """
4343

4444
ssl_cert_path: StrictStr = ""
45-
""" str: Path to the public certificate in case if the online server starts in SSL mode. This may be needed especially if online server started with a self-signed certificate, typically this file ends with .crt, .cer, or .pem.
45+
""" str: Path to the public certificate when the online server starts in SSL mode. This may be needed if the online server started with a self-signed certificate, typically this file ends with `*.crt`, `*.cer`, or `*.pem`.
4646
If type is 'remote', then this configuration is needed to connect to remote online server in SSL mode. """
4747

4848

sdk/python/tests/integration/online_store/test_remote_online_store.py

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -228,36 +228,21 @@ def _overwrite_remote_client_feature_store_yaml(
228228
ssl_cert_path: str = "",
229229
):
230230
repo_config = os.path.join(repo_path, "feature_store.yaml")
231-
with open(repo_config, "w") as repo_config:
232-
if ssl_cert_path:
233-
repo_config.write(
234-
dedent(
235-
f"""
236-
project: {PROJECT_NAME}
237-
registry: {registry_path}
238-
provider: local
239-
online_store:
240-
path: {feature_server_url}
241-
type: remote
242-
ssl_cert_path: {ssl_cert_path}
243-
entity_key_serialization_version: 2
244-
"""
245-
)
246-
+ auth_config
247-
)
231+
config_content = dedent(
232+
f"""
233+
project: {PROJECT_NAME}
234+
registry: {registry_path}
235+
provider: local
236+
online_store:
237+
path: {feature_server_url}
238+
type: remote
239+
"""
240+
)
248241

249-
else:
250-
repo_config.write(
251-
dedent(
252-
f"""
253-
project: {PROJECT_NAME}
254-
registry: {registry_path}
255-
provider: local
256-
online_store:
257-
path: {feature_server_url}
258-
type: remote
259-
entity_key_serialization_version: 2
260-
"""
261-
)
262-
+ auth_config
263-
)
242+
if ssl_cert_path:
243+
config_content += f" ssl_cert_path: {ssl_cert_path}\n"
244+
245+
config_content += " entity_key_serialization_version: 2\n" + auth_config
246+
247+
with open(repo_config, "w") as repo_config_file:
248+
repo_config_file.write(config_content)

0 commit comments

Comments
 (0)