Skip to content

Commit 2c454c4

Browse files
committed
Merge remote-tracking branch 'origin/main' into make-numpy-optional
2 parents 4d1c499 + f5361e4 commit 2c454c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+459
-329
lines changed

CONTRIBUTING.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
We follow a few best practices for writing the Python documentation:
3838

39-
1. Use the google docstring style:
39+
1. Use the Google docstring style:
4040

4141
```python
4242
"""[One Line Summary]
@@ -72,16 +72,17 @@ We use `mkdocs` together with `mike` ([for versioning](https://github.com/jimpor
7272
**Background about `mike`:**
7373
`mike` builds the documentation and commits it as a new directory to the gh-pages branch. Each directory corresponds to one version of the documentation. Additionally, `mike` maintains a json in the root of gh-pages with the mappings of versions/aliases for each of the directories available. With aliases you can define extra names like `dev` or `latest`, to indicate stable and unstable releases.
7474

75-
1. Install Hopsworks with `dev-docs` extras:
75+
1. Install Hopsworks with `requirements-docs.txt`:
7676

7777
```bash
78-
pip install -e ".[dev-docs]"
78+
pip install -r requirements-docs.txt
79+
pip install -e "python[dev]"
7980
```
8081

8182
2. To build the docs, first run the auto doc script:
8283

8384
```bash
84-
python auto_doc.py
85+
python python/auto_doc.py
8586
```
8687

8788
##### Option 1: Build only current version of docs

docs/templates/api/connection.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# Connection API
1+
# Connection
22

3-
## Creation
4-
5-
{{connection_create}}
3+
{{connection}}
64

75
## Properties
86

97
{{connection_properties}}
108

119
## Methods
1210

13-
{{connection_methods}}
11+
{{connection_methods}}

docs/templates/api/connection_api.md

-11
This file was deleted.

docs/templates/api/job.md

-11
This file was deleted.

docs/templates/api/jobs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Jobs API
22

3-
## Handle
3+
## Handle
44

55
{{job_api_handle}}
66

docs/templates/connection_api.md

-11
This file was deleted.

mkdocs.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ nav:
1616
- Guides: https://docs.hopsworks.ai/
1717
- Setup and Installation: https://docs.hopsworks.ai/
1818
- Administration: https://docs.hopsworks.ai/
19-
- API<div class="dropdown"><button class="dropbtn"> API </button> <div id="myDropdown" class="dropdown-content"> <a id="hopsworks_api_link" href="https://docs.hopsworks.ai/hopsworks-api/latest">Hopsworks API</a> <a id="hsfs_api_link" href="https://docs.hopsworks.ai/feature-store-api/latest">Feature Store API</a> <a id="hsfs_javadoc_link" href="https://docs.hopsworks.ai/feature-store-api/latest/javadoc">Feature Store JavaDoc</a> <a id="hsml_api_link" href="https://docs.hopsworks.ai/machine-learning-api/latest">MLOps API</a> </div></div>:
20-
- API Reference:
19+
- API<div class="dropdown"><button class="dropbtn"> API </button> <div id="myDropdown" class="dropdown-content"> <a id="hopsworks_api_link" href="https://docs.hopsworks.ai/hopsworks-api/latest">Python API</a> <a id="hsfs_javadoc_link" href="https://docs.hopsworks.ai/hopsworks-api/latest/javadoc">Feature Store JavaDoc</a> </div></div>:
20+
- Platform API:
2121
- Login: generated/api/login.md
2222
- Connection: generated/api/connection.md
2323
- Projects: generated/api/projects.md
@@ -33,7 +33,7 @@ nav:
3333
- KafkaSchema: generated/api/kafka_schema.md
3434
- Secrets: generated/api/secrets.md
3535
- OpenSearch: generated/api/opensearch.md
36-
- Connection (HSFS): generated/api/connection_api.md
36+
- Feature Store API:
3737
- ExpectationSuite: generated/api/expectation_suite_api.md
3838
- FeatureStore: generated/api/feature_store_api.md
3939
- FeatureGroup: generated/api/feature_group_api.md
@@ -48,11 +48,10 @@ nav:
4848
- UDF: generated/api/udf.md
4949
- HopsworksUDF: generated/api/hopsworks_udf.md
5050
- TransformationFunction: generated/api/transformation_functions_api.md
51-
- Transformation Statistics:
51+
- Transformation Statistics:
5252
- TransformationStatistics: generated/api/transformation_statistics.md
5353
- FeatureTransformationStatistics: generated/api/feature_transformation_statistics.md
5454
- ValidationReport: generated/api/validation_report_api.md
55-
- Job: generated/api/job.md
5655
- Provenance Links: generated/api/links.md
5756
- Statistics:
5857
- Statistics: generated/api/statistics_api.md
@@ -66,7 +65,7 @@ nav:
6665
- EmbeddingIndex: generated/api/embedding_index_api.md
6766
- EmbeddingFeature: generated/api/embedding_feature_api.md
6867
- SimilarityFunctionType: generated/api/similarity_function_type_api.md
69-
- Connection (HSML): generated/connection_api.md
68+
- Machine Learning API:
7069
- Model Registry:
7170
- Model Registry: generated/model-registry/model_registry_api.md
7271
- Model: generated/model-registry/model_api.md
@@ -82,7 +81,6 @@ nav:
8281
- Inference Batcher: generated/model-serving/inference_batcher_api.md
8382
- Resources: generated/model-serving/resources_api.md
8483
# Added to allow navigation using the side drawer
85-
- Hopsworks API: https://docs.hopsworks.ai/hopsworks-api/latest/
8684
- Feature Store JavaDoc: https://docs.hopsworks.ai/feature-store-javadoc/latest/
8785
- Contributing: CONTRIBUTING.md
8886
- Community ↗: https://community.hopsworks.ai/

python/auto_doc.py

+5-24
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"udf": ["hopsworks.udf"],
4141
},
4242
"api/connection.md": {
43-
"connection_create": ["hopsworks.connection.Connection.connection"],
43+
"connection": ["hopsworks.connection.Connection.connection"],
4444
"connection_properties": keras_autodoc.get_properties(
4545
"hopsworks.connection.Connection"
4646
),
@@ -61,7 +61,10 @@
6161
"job_get": ["hopsworks.core.job_api.JobApi.get_job"],
6262
"job_get_all": ["hopsworks.core.job_api.JobApi.get_jobs"],
6363
"job_properties": keras_autodoc.get_properties("hopsworks.job.Job"),
64-
"job_config": ["hopsworks.core.job_api.JobApi.get_configuration"],
64+
"job_config": [
65+
"hopsworks.core.job_api.JobApi.get_configuration",
66+
"hopsworks_common.core.job_configuration.JobConfiguration",
67+
],
6568
"job_methods": keras_autodoc.get_methods(
6669
"hopsworks.job.Job", exclude=["from_response_json", "json"]
6770
),
@@ -190,13 +193,6 @@
190193
"hopsworks.core.opensearch_api.OpenSearchApi"
191194
),
192195
},
193-
"api/connection_api.md": {
194-
"connection": ["hsfs.connection.Connection"],
195-
"connection_properties": keras_autodoc.get_properties(
196-
"hsfs.connection.Connection"
197-
),
198-
"connection_methods": keras_autodoc.get_methods("hsfs.connection.Connection"),
199-
},
200196
"api/spine_group_api.md": {
201197
"fg": ["hsfs.feature_group.SpineGroup"],
202198
"fg_create": ["hsfs.feature_store.FeatureStore.get_or_create_spine_group"],
@@ -413,14 +409,6 @@
413409
"hsfs.validation_report.ValidationReport"
414410
),
415411
},
416-
"api/job.md": {
417-
"job_configuration": ["hsfs.core.job_configuration.JobConfiguration"],
418-
"job": ["hsfs.core.job.Job"],
419-
"job_methods": [
420-
"hsfs.core.job.Job.get_state",
421-
"hsfs.core.job.Job.get_final_state",
422-
],
423-
},
424412
"api/query_api.md": {
425413
"query_methods": keras_autodoc.get_methods(
426414
"hsfs.constructor.query.Query",
@@ -550,13 +538,6 @@
550538
"similarity_function_type": ["hsfs.embedding.SimilarityFunctionType"],
551539
},
552540
# Model registry
553-
"connection_api.md": {
554-
"connection": ["hsml.connection.Connection"],
555-
"connection_properties": keras_autodoc.get_properties(
556-
"hsml.connection.Connection", exclude=["trust_store_path"]
557-
),
558-
"connection_methods": keras_autodoc.get_methods("hsml.connection.Connection"),
559-
},
560541
"model-registry/model_registry_api.md": {
561542
"mr_get": ["hsml.connection.Connection.get_model_registry"],
562543
"mr_modules": keras_autodoc.get_properties(

python/hopsworks/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def login(
8181
project: str = None,
8282
api_key_value: str = None,
8383
api_key_file: str = None,
84-
hostname_verification: bool = True,
84+
hostname_verification: bool = False,
8585
trust_store_path: str = None,
8686
) -> project.Project:
8787
"""Connect to [Serverless Hopsworks](https://app.hopsworks.ai) by calling the `hopsworks.login()` function with no arguments.

python/hopsworks_common/client/hopsworks.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(self, hostname_verification):
5656
self._hostname_verification = os.environ.get(
5757
self.HOPSWORKS_HOSTNAME_VERIFICATION, "{}".format(hostname_verification)
5858
).lower() in ("true", "1", "y", "yes")
59-
self._hopsworks_ca_trust_store_path = self._get_trust_store_path()
59+
self._hopsworks_ca_trust_store_path = self._materialize_ca_chain()
6060

6161
self._project_id = os.environ[self.PROJECT_ID]
6262
self._project_name = self._project_name()
@@ -73,17 +73,12 @@ def __init__(self, hostname_verification):
7373

7474
credentials = self._get_credentials(self._project_id)
7575

76-
self._write_pem_file(credentials["caChain"], self._get_ca_chain_path())
7776
self._write_pem_file(credentials["clientCert"], self._get_client_cert_path())
7877
self._write_pem_file(credentials["clientKey"], self._get_client_key_path())
7978

80-
def _get_hopsworks_rest_endpoint(self):
81-
"""Get the hopsworks REST endpoint for making requests to the REST API."""
82-
return os.environ[self.REST_ENDPOINT]
83-
84-
def _get_trust_store_path(self):
79+
def _materialize_ca_chain(self):
8580
"""Convert truststore from jks to pem and return the location"""
86-
ca_chain_path = Path(self.PEM_CA_CHAIN)
81+
ca_chain_path = Path(self._get_ca_chain_path())
8782
if not ca_chain_path.exists():
8883
keystore_pw = self._cert_key
8984
ks = jks.KeyStore.load(
@@ -95,6 +90,10 @@ def _get_trust_store_path(self):
9590
self._write_ca_chain(ks, ts, ca_chain_path)
9691
return str(ca_chain_path)
9792

93+
def _get_hopsworks_rest_endpoint(self):
94+
"""Get the hopsworks REST endpoint for making requests to the REST API."""
95+
return os.environ[self.REST_ENDPOINT]
96+
9897
def _get_ca_chain_path(self) -> str:
9998
return os.path.join("/tmp", "ca_chain.pem")
10099

0 commit comments

Comments
 (0)