Skip to content

Commit 02df03a

Browse files
woopgitbook-bot
authored andcommitted
GitBook: [master] 2 pages and one asset modified
1 parent 1395f3f commit 02df03a

3 files changed

Lines changed: 82 additions & 64 deletions

File tree

162 KB
Loading

‎docs/getting-started/deploying-feast/docker-compose.md‎

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,56 @@ The docker compose setup uses Direct Runner for the Apache Beam jobs that popula
2222
### 0. Requirements
2323

2424
* [Docker compose](https://docs.docker.com/compose/install/) must be installed.
25-
* The following list of TCP ports must be free:
26-
* 6565, 6566, 8888, and 9094.
27-
* Alternatively it is possible to modify port mappings in `/docker-compose/docker-compose.yml`.
2825
* \(for batch serving only\) For batch serving you will also need a [GCP service account key](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) that has access to [Google Cloud Storage](https://cloud.google.com/storage) and [BigQuery](https://cloud.google.com/bigquery).
29-
* \(for batch serving only\) [Google Cloud SDK ](https://cloud.google.com/sdk/install)installed, authenticated, and configured to the project you will use.
26+
* \(for batch serving only\) [Google Cloud SDK ](https://cloud.google.com/sdk/install)installed, authenticated, and configured to the GCP project you will use.
3027

3128
## 1. Set up environment
3229

33-
Clone the [Feast repository](https://github.com/feast-dev/feast/) and navigate to the `docker-compose` sub-directory:
34-
35-
```bash
36-
git clone https://github.com/feast-dev/feast.git && \
37-
cd feast && export FEAST_HOME_DIR=$(pwd) && \
38-
cd infra/docker-compose
39-
```
30+
Clone the [Feast repository](https://github.com/gojek/feast/) and navigate to the `infra/docker-compose` sub-directory:
4031

4132
Make a copy of the `.env.sample` file:
4233

4334
```bash
4435
cp .env.sample .env
4536
```
4637

47-
## 2. Docker Compose for Online Serving Only
38+
The following command will bring up a Feast deployment with a single Feast Core instance without any online stores:
4839

49-
### 2.1 Start Feast \(without batch retrieval support\)
40+
```javascript
41+
docker-compose up -d
42+
```
43+
44+
## 2. Docker Compose for Online Serving
5045

51-
If you do not require batch serving, then its possible to simply bring up Feast:
46+
Run the following command if you would like to start both Feast Core and Feast Serving at the same time. The Feast Serving online deployment will use Redis as its database.
5247

5348
```javascript
54-
docker-compose up -d
49+
docker-compose \
50+
-f docker-compose.yml \
51+
-f docker-compose.online.yml \
52+
up -d
53+
```
54+
55+
If you already have Feast Core running \(externally or from the earlier section\), then you can optionally bring up only the Feast Serving online deployment for Redis.
56+
57+
```javascript
58+
docker-compose -f docker-compose.online.yml up -d
5559
```
5660

57-
A Jupyter Notebook environment is now available to use Feast:
61+
Your Feast deployment should now be starting up. Have a look at the docker logs, especially that of the Jupyter container:
62+
63+
```text
64+
docker logs feast_jupyter_1
65+
```
5866

59-
[http://localhost:8888/tree/feast/examples](http://localhost:8888/tree/feast/examples)
67+
Once it is ready you should be able to connect to a local notebook that contains Feast examples. This may take a few minutes.
68+
69+
```text
70+
[I 05:50:22.991 NotebookApp] The Jupyter Notebook is running at:
71+
[I 05:50:22.991 NotebookApp] http://localhost:8888/
72+
```
73+
74+
{% embed url="http://localhost:8888/tree/feast/examples" caption="" %}
6075

6176
## 3. Docker Compose for Online and Batch Serving
6277

@@ -103,10 +118,14 @@ We will also need to configure the `bq-store.yml` file inside `infra/docker-comp
103118
Start Feast:
104119

105120
```javascript
106-
docker-compose up -d
121+
docker-compose \
122+
-f docker-compose.yml \
123+
-f docker-compose.online.yml \
124+
-f docker-compose.batch.yml \
125+
up -d
107126
```
108127

109-
A Jupyter Notebook environment is now available to use Feast:
128+
A Jupyter Notebook environment should become available within a few minutes:
110129

111-
[http://localhost:8888/tree/feast/examples](http://localhost:8888/tree/feast/examples)
130+
{% embed url="http://localhost:8888/tree/feast/examples" %}
112131

‎docs/user-guide/statistics.md‎

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
Data is a first-class citizen in machine learning projects, it is critical to have tests and validations around data. To that end, Feast avails various feature statistics to users in order to give users visibility into the data that has been ingested into the system.
44

5-
![overview](../assets/statistics-sources.png)
5+
![overview](../.gitbook/assets/statistics-sources.png)
66

7-
Feast exposes feature statistics at two points in the Feast system:
8-
1. Inflight feature statistics from the population job
9-
2. Historical feature statistics from the warehouse stores
7+
Feast exposes feature statistics at two points in the Feast system: 1. Inflight feature statistics from the population job 2. Historical feature statistics from the warehouse stores
108

119
## Historical Feature Statistics
1210

@@ -15,10 +13,10 @@ Feast supports the computation of feature statistics over data already written t
1513
### Retrieving Statistics
1614

1715
Statistics can be retrieved from Feast using the python SDK's `get_statistics` method. This requires a connection to Feast core.
18-
16+
1917
Feature statistics can be retrieved for a single feature set, from a single valid warehouse store. Users can opt to either retrieve feature statistics for a discrete subset of data by providing an `ingestion_id` , a unique id generated for a dataset when it is ingested into feast:
2018

21-
```{python}
19+
```text
2220
# A unique ingestion id is returned for each batch ingestion
2321
ingestion_id=client.ingest(feature_set,df)
2422
@@ -29,9 +27,9 @@ stats = client.get_statistics(
2927
ingestion_ids=[ingestion_id])
3028
```
3129

32-
Or by selecting data within a time range by providing a `start_date` and `end_date` (the start date is inclusive, the end date is not):
30+
Or by selecting data within a time range by providing a `start_date` and `end_date` \(the start date is inclusive, the end date is not\):
3331

34-
```{python}
32+
```text
3533
start_date=datetime(2020,10,1,0,0,0)
3634
end_date=datetime(2020,10,2,0,0,0)
3735
@@ -51,15 +49,15 @@ Note that when providing a time range, Feast will NOT filter out duplicated rows
5149

5250
Feast returns the statistics in the form of the protobuf [DatasetFeatureStatisticsList](https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/statistics.proto#L36), which can be subsequently passed to TFDV methods to [validate the dataset](https://www.tensorflow.org/tfx/data_validation/get_started#checking_the_data_for_errors)...
5351

54-
```{python}
52+
```text
5553
anomalies = tfdv.validate_statistics(
5654
statistics=stats_2, schema=feature_set.export_tfx_schema())
5755
tfdv.display_anomalies(anomalies)
5856
```
5957

6058
Or [visualise the statistics](https://www.tensorflow.org/tfx/data_validation/get_started#computing_descriptive_data_statistics) in [facets](https://github.com/PAIR-code/facets).
6159

62-
```{python}
60+
```text
6361
tfdv.visualize_statistics(stats)
6462
```
6563

@@ -69,23 +67,23 @@ Refer to the [example notebook](https://github.com/feast-dev/feast/blob/master/e
6967

7068
Feast supports retrieval of feature statistics across multiple datasets or days.
7169

72-
```{python}
70+
```text
7371
stats = client.get_statistics(
7472
feature_set_id='project/feature_set',
7573
store='warehouse',
7674
features=['feature_1', 'feature_2'],
7775
ingestion_ids=[ingestion_id_1, ingestion_id_2])
7876
```
7977

80-
However, when querying across multiple datasets, Feast computes the statistics for each dataset independently (for caching purposes), and aggregates the results. As a result of this, certain un-aggregatable statistics are dropped in the process, such as medians, uniqueness counts, and histograms.
78+
However, when querying across multiple datasets, Feast computes the statistics for each dataset independently \(for caching purposes\), and aggregates the results. As a result of this, certain un-aggregatable statistics are dropped in the process, such as medians, uniqueness counts, and histograms.
8179

8280
Refer to the table below for the list of statistics that will be dropped.
8381

8482
### Caching
8583

8684
Feast caches the results of all feature statistics requests, and will, by default, retrieve and return the cached results. To recompute previously computed feature statistics, set `force_refresh` to `true` when retrieving the statistics:
8785

88-
```{python}
86+
```text
8987
stats=client.get_statistics(
9088
feature_set_id='project/feature_set',
9189
store='warehouse',
@@ -100,45 +98,45 @@ This will force Feast to recompute the statistics, and replace any previously ca
10098

10199
Feast supports most, but not all of the feature statistics defined in TFX's [FeatureNameStatistics](https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/statistics.proto#L147). For the definition of each statistic and information about how each one is computed, refer to the [protobuf definition](https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/statistics.proto#L147).
102100

103-
| Type | Statistic | Supported | Aggregateable |
104-
| --- | --- | --- | --- |
105-
| Common | NumNonMissing | ✔ | ✔ |
106-
| | NumMissing | ✔ | ✔ |
107-
| | MinNumValues | ✔ | ✔ |
108-
| | MaxNumValues | ✔ | ✔ |
109-
| | AvgNumValues | ✔ | ✔ |
110-
| | TotalNumValues | ✔ | ✔ |
111-
| | NumValuesHist | | |
101+
| Type | Statistic | Supported | Aggregateable |
102+
| :--- | :--- | :--- | :--- |
103+
| Common | NumNonMissing | ✔ | ✔ |
104+
| | NumMissing | ✔ | ✔ |
105+
| | MinNumValues | ✔ | ✔ |
106+
| | MaxNumValues | ✔ | ✔ |
107+
| | AvgNumValues | ✔ | ✔ |
108+
| | TotalNumValues | ✔ | ✔ |
109+
| | NumValuesHist | | |
112110
| Numeric | Min | ✔ | ✔ |
113-
| | Max | ✔ | ✔ |
114-
| | Median | ✔ | |
115-
| | Mean | ✔ | ✔ |
116-
| | Stdev | ✔ | ✔ |
117-
| | NumZeroes | ✔ | ✔ |
118-
| | Quantiles | ✔ | |
119-
| | Histogram | ✔ | |
111+
| | Max | ✔ | ✔ |
112+
| | Median | ✔ | |
113+
| | Mean | ✔ | ✔ |
114+
| | Stdev | ✔ | ✔ |
115+
| | NumZeroes | ✔ | ✔ |
116+
| | Quantiles | ✔ | |
117+
| | Histogram | ✔ | |
120118
| String | RankHistogram | ✔ | |
121-
| | TopValues | ✔ | |
122-
| | Unique | ✔ | |
123-
| | AvgLength | ✔ | ✔ |
119+
| | TopValues | ✔ | |
120+
| | Unique | ✔ | |
121+
| | AvgLength | ✔ | ✔ |
124122
| Bytes | MinNumBytes | ✔ | ✔ |
125-
| | MaxNumBytes | ✔ | ✔ |
126-
| | AvgNumBytes | ✔ | ✔ |
127-
| | Unique | ✔ | |
128-
| Struct/List | - (uses common statistics only) | - | - |
123+
| | MaxNumBytes | ✔ | ✔ |
124+
| | AvgNumBytes | ✔ | ✔ |
125+
| | Unique | ✔ | |
126+
| Struct/List | - \(uses common statistics only\) | - | - |
129127

130128
## Inflight Feature Statistics
131129

132130
For insight into data currently flowing into Feast through the population jobs, [statsd](https://github.com/statsd/statsd) is used to capture feature value statistics.
133131

134-
Inflight feature statistics are windowed (default window length is 30s) and computed at two points in the feature population pipeline:
132+
Inflight feature statistics are windowed \(default window length is 30s\) and computed at two points in the feature population pipeline:
135133

136134
1. Prior to store writes, after successful validation
137135
2. After successful store writes
138136

139137
The following metrics are written at the end of each window as [statsd gauges](https://github.com/statsd/statsd/blob/master/docs/metric_types.md#gauges):
140138

141-
```
139+
```text
142140
feast_ingestion_feature_value_min
143141
feast_ingestion_feature_value_max
144142
feast_ingestion_feature_value_mean
@@ -156,9 +154,10 @@ the gauge metric type is used over histogram because statsd only supports positi
156154
The metrics are tagged with and can be aggregated by the following keys:
157155

158156
| key | description |
159-
| --- | --- |
160-
| feast_store | store the population job is writing to
161-
| feast_project_name | feast project name
162-
| feast_featureSet_name | feature set name
163-
| feast_feature_name | feature name
164-
| ingestion_job_name | id of the population job writing the feature values.
157+
| :--- | :--- |
158+
| feast\_store | store the population job is writing to |
159+
| feast\_project\_name | feast project name |
160+
| feast\_featureSet\_name | feature set name |
161+
| feast\_feature\_name | feature name |
162+
| ingestion\_job\_name | id of the population job writing the feature values. |
163+

0 commit comments

Comments
 (0)