Skip to content

Commit 1bdbfb5

Browse files
romanwozniakfeast-ci-bot
authored andcommitted
Add Feast CLI / python SDK documentation (feast-dev#199)
* Storage registration quickstart For Feast admins. * Minimum requirements for Feast GKE cluster * Storage specs quickstart for admins * WIP - End user quickstart * Example spec files * Updated protobuf generated files Using vendored protobuf, here are the new generated files * Removed references to granularity from the docs * Removed references to granularity from the docs * Added info on how to register features and run an import job from CLI; other fixes in the docs; * fix typos * - WIP on python SDK quickstart documentation * - add training/serving data retrieval sections * - setting core/serving tags in helm to latest release version * - removed storage options from feature declaration specs * Update doc for CLI * Typo * Update default values.yaml for Feast Use Feast image tag 0.1.1 because it fixes some templating in BigQuery https://github.com/gojek/feast/releases/tag/v0.1.1 * Fix incorrect destination path when installing feast cli
1 parent 7548e61 commit 1bdbfb5

File tree

16 files changed

+683
-52
lines changed

16 files changed

+683
-52
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ For Feast administrators:
4444
* [Installation quickstart](docs/install.md)
4545
* [Helm charts](charts/README.md) details
4646

47+
For Feast end users:
48+
* [Creating features](docs/endusers.md)
49+
50+
For Feast developers:
51+
* [Building the CLI](cli/README.md)
52+
4753
## Notice
4854

4955
Feast is still under active development. Your feedback and contributions are important to us. Please check our [contributing guide](CONTRIBUTING.md) for details.

charts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ kubectl delete persistentvolumeclaim feast-postgresql
5858
The following table lists the configurable parameters of the Feast chart and their default values.
5959

6060
| var | desc | default |
61-
| -- | -- | -- |
61+
| --- | --- | --- |
6262
| `core.image.registry` | core docker image registry | feast |
6363
| `core.image.repository` | core docker image repository | feast-core |
6464
| `core.image.tag` | core docker image version | 0.1.0 |

charts/feast/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ core:
55
pullPolicy: IfNotPresent
66
registry: gcr.io/kf-feast
77
repository: feast-core
8-
tag: "1234"
8+
tag: "0.1.1"
99
replicaCount: 1
1010
resources:
1111
limits:
@@ -78,7 +78,7 @@ serving:
7878
pullPolicy: IfNotPresent
7979
registry: gcr.io/kf-feast
8080
repository: feast-serving
81-
tag: "1234"
81+
tag: "0.1.1"
8282
replicaCount: 1
8383
resources:
8484
limits:

cli/README.md

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,29 @@ feast, as well as manage and run ingestion jobs.
55

66
## Installation
77

8-
### Download the compiled binary
8+
The quickest way to get the CLI is to download the compiled binary:
99

10-
The quickest way to get the CLI is to download the compiled binary: #TODO
11-
12-
### Building from source
13-
14-
The following dependencies are required to build the CLI from source:
15-
* [`go`](https://golang.org/)
16-
* [`protoc`](https://developers.google.com/protocol-buffers/)
17-
* [`dep`](https://github.com/golang/dep)
18-
19-
See below for specific instructions on how to install the dependencies.
20-
21-
After the dependencies are installed, you can build the CLI using:
2210
```sh
23-
# at feast top-level directory
24-
$ make build-cli
11+
# For Mac OS users
12+
wget https://github.com/gojek/feast/releases/download/v0.1.1/feast-cli-v0.1.1-darwin-amd64
13+
chmod +x feast-cli-v0.1.1-darwin-amd64
14+
sudo mv feast-cli-v0.1.1-darwin-amd64 /usr/local/bin/feast
15+
16+
# For Linux users
17+
wget https://github.com/gojek/feast/releases/download/v0.1.1/feast-cli-v0.1.1-linux-amd64
18+
chmod +x feast-cli-v0.1.1-linux-amd64
19+
sudo mv feast-cli-v0.1.1-linux-amd64 /usr/local/bin/feast
2520
```
2621

27-
### Dependencies
28-
29-
#### `protoc-gen-go`
30-
31-
To ensure you have a matching version of `protoc-gen-go`, install the vendored version:
32-
```sh
33-
$ go install ./vendor/github.com/golang/protobuf/protoc-gen-go
34-
$ which protoc-gen-go
35-
~/go/bin/protoc-gen-go
36-
```
22+
### Building from source
3723

38-
#### `dep`
24+
If you want to develop the CLI or build it from source, you need to have at least Golang version 1.11 installed because Feast use go modules.
3925

40-
On MacOS you can install or upgrade to the latest released version with Homebrew:
4126
```sh
42-
$ brew install dep
43-
$ brew upgrade dep
44-
```
27+
git clone https://github.com/gojek/feast
28+
cd feast
29+
go build -o feast ./cli/feast
4530

46-
On other platforms you can use the `install.sh` script:
47-
```sh
48-
$ curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
31+
# Test running feast CLI
32+
./feast
4933
```

docs/concepts.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ A Feature is an individual measurable property or characteristic of an Entity. I
1919
* Entity - It must be associated with a known Entity within Feast
2020
* ValueType - The feature type must be defined, e.g. String, Bytes, Int64, Int32, Float etc.
2121
* Requirements - Properties related to how a feature should be stored for serving and training
22-
* Granularity - Time series features require a defined granularity
2322
* StorageType - For both serving and training a storage type must be defined
2423

2524
Feast needs to know these attributes in order to be able to ingest, store and serve a feature. A Feature is only a feature when Feast knows about it; This seems contrite, but it introduces a best practice whereby a feature only becomes available for ingestion, serving and training in production when Feast has added the feature to its catalog.

docs/endusers.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# Feast End Users Quickstart Guide
2+
3+
## Pre-requisities
4+
5+
* A working Feast Core: Consult your Feast admin or [install your own](install.md).
6+
* Feast CLI tools: Use [pre-built
7+
binaries](https://github.com/gojek/feast/releases) or [compile your
8+
own](../cli/README.md).
9+
10+
Make sure your CLI is correctly configured for your Feast Core. If
11+
you're running a local Feast Core, it would be:
12+
```sh
13+
feast config set coreURI localhost
14+
```
15+
16+
## Introduction
17+
18+
There are several stages to using Feast:
19+
1. Register your feature
20+
2. Ingest data for your feature
21+
3. Query feature data for training your models
22+
4. Query feature data for serving your models
23+
24+
## Registering your feature
25+
26+
In order to register a feature, you will first need to register a:
27+
* Storage location (typically done by your Feast admin)
28+
* Entity
29+
30+
All registrations are done using [specs](specs.md).
31+
32+
### Registering an entity
33+
34+
Then register an entity, which is for grouping features under a unique
35+
key or id. Typically these map to a domain object, e.g., a customer, a
36+
merchant, a sales region.
37+
38+
[`wordEntity.yml`](../examples/wordEntity.yml)
39+
```
40+
name: word
41+
description: word found in shakespearean works
42+
```
43+
44+
Register the entity spec:
45+
```sh
46+
feast apply entity wordEntity.yml
47+
```
48+
49+
### Registering your feature
50+
51+
Next, define your feature:
52+
53+
[`wordCountFeature.yml`](../examples/wordCountFeature.yml)
54+
```
55+
id: word.count
56+
name: count
57+
entity: word
58+
59+
description: number of times the word appears
60+
valueType: INT64
61+
uri: https://github.com/bob/example
62+
```
63+
64+
Register it:
65+
```sh
66+
feast apply feature wordCountFeature.yml
67+
```
68+
69+
## Ingest data for your feature
70+
71+
Feast supports ingesting feature from 4 type of sources:
72+
73+
* File (either CSV or JSON)
74+
* Bigquery Table
75+
* Pubsub Topic
76+
* Pubsub Subscription
77+
78+
Let's take a look on how to create an import job spec and ingest some data from a CSV file.
79+
You may find more information on how to ingest data from different sources
80+
here: [[Import Specs]](specs.md#import-spec)
81+
82+
### Prepare your data
83+
`word_counts.csv`
84+
```csv
85+
count,word
86+
28944,the
87+
27317,and
88+
21120,i
89+
20136,to
90+
17181,of
91+
14945,a
92+
13989,you
93+
12949,my
94+
11513,in
95+
11488,that
96+
9545,is
97+
8855,not
98+
8293,with
99+
8043,me
100+
8003,it
101+
...
102+
```
103+
104+
And then upload it into your Google Storage bucket:
105+
106+
```sh
107+
gsutil cp word_counts.csv gs://your-bucket
108+
```
109+
110+
### Define the job import spec
111+
`shakespeareWordCountsImport.yml`
112+
```yaml
113+
type: file.csv
114+
sourceOptions:
115+
path: gs://your-bucket/word_counts.csv
116+
entities:
117+
- word
118+
schema:
119+
entityIdColumn: word
120+
timestampValue: 2019-01-01T00:00:00.000Z
121+
fields:
122+
- name: count
123+
featureId: word.count
124+
- name: word
125+
```
126+
127+
### Start the ingestion job
128+
Next, use `feast` CLI to run your ingestion job, defined in
129+
`shakespeareWordCountsImport.yml`:
130+
```sh
131+
feast jobs run shakespeareWordCountsImport.yml
132+
```
133+
134+
You can also list recent ingestion jobs by running:
135+
```sh
136+
feast list jobs
137+
```
138+
139+
Or get detailed information about the results of ingestion with:
140+
```sh
141+
feast get job <id>
142+
```
143+

0 commit comments

Comments
 (0)