Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
9d97bb3
Add integration test
Feb 8, 2019
7b78f35
Add cleanup stage, remove interpreter
Feb 8, 2019
85c1b35
Change directory to point to fork
Feb 8, 2019
449c789
Remove dependency on gsutil
Feb 9, 2019
e139805
Add exit handler
Feb 9, 2019
4923975
Add wait script for redis
Feb 10, 2019
b4cfe02
Add bq to terraform image
Feb 10, 2019
30808a2
Change hard coded path
Feb 10, 2019
c46125d
Update readme and makefile
Feb 11, 2019
e9130a2
Change docker image
Feb 11, 2019
445b11f
Remove redundant line
Feb 11, 2019
76c2c2b
Merge branch 'master' of github.com:/gojek/feast into integration-test
Feb 11, 2019
4f44a18
Update helm values template
Feb 11, 2019
8419650
Use kube redis instead
Feb 11, 2019
7d969e4
Fix empty bq script
Feb 11, 2019
a107566
Point back to gojek repo
Feb 11, 2019
627191d
Rearrange columns
Feb 11, 2019
292694f
Remove double brackets
Feb 11, 2019
d0891aa
Light refactor, added readme
Feb 15, 2019
ffa6365
Add makefile for integration tests
Feb 17, 2019
8d3bbe8
[WIP] use PR code
Feb 18, 2019
32678ea
Add docker build stage
Feb 26, 2019
009a61a
Override git image command
Feb 28, 2019
04bb2d0
Add docker builder image, remove revision from feast module
Feb 28, 2019
108db83
Remove revision
Feb 28, 2019
a7d6efd
Removed another reference to revision
Feb 28, 2019
e1442e2
Hardcode chart location
Feb 28, 2019
dfa1a38
Change bq to delete on destroy
Mar 28, 2019
b0c00f4
Merge github.com:gojek/feast into integration-test
Mar 28, 2019
c22f629
Merge branch 'master' of github.com:gojek/feast into integration-test
davidheryanto Mar 28, 2019
78fc481
Update paths of temporary folder created in Feast Core tests
davidheryanto Mar 28, 2019
fcbcdc1
Merge branch 'integration-test' of github.com:/zhilingc/feast into in…
Mar 28, 2019
017f392
Update options.path in import_csv.yaml
davidheryanto Mar 28, 2019
67c0596
Update terraform modules to support workspace and no granularity
davidheryanto Mar 28, 2019
e505d4d
Merge branch 'integration-test' of github.com:/zhilingc/feast into in…
Mar 28, 2019
8d75981
Revert chart path reference to /feast instead of /tmp/feast
Mar 28, 2019
dc3479f
Remove reference to store in order to use default stores
Mar 28, 2019
35a61f4
Update Argo workflow to accept gitRef argument
davidheryanto Mar 28, 2019
4477f53
Change logtype to JSON
Mar 28, 2019
a7b9a8a
Give ability to create folders in bucket
Mar 28, 2019
7a5c90b
Change workspace path to be in gs
Mar 28, 2019
9f93f0a
Remove mentions of granularity
Mar 28, 2019
b43e05e
Drop job id when comparing data
Mar 28, 2019
8bac0a7
Disable authentication for redis
Mar 28, 2019
7a332a0
Sort first, then alter columns
Mar 28, 2019
7fb8414
Fix wrong column name
Mar 28, 2019
508a604
Cleanup tests
Mar 29, 2019
aa715dc
Clean up tests
Mar 29, 2019
9f7d00a
Ensure dataframe dtypes are the same when running tests
davidheryanto Mar 29, 2019
0d175ad
Add options to run mvn package using 4 threads and ignore resolving o…
davidheryanto Mar 29, 2019
11aa3dd
Merge commit '0d175ad' into integration-test
davidheryanto Mar 29, 2019
27d2f9b
Rename step and template name in argo workflow
davidheryanto Mar 29, 2019
9668243
Accept gke_machine_type parameter in feast terraform module
davidheryanto Mar 29, 2019
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
120 changes: 119 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,122 @@ vendor
.direnv

.terraform/
*.tfvars
*.tfvars

# python
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
.vscode
23 changes: 21 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
VERSION_FILE=VERSION
FEAST_VERSION=`cat $(VERSION_FILE)`
#
# Copyright 2019 The Feast Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

VERSION_FILE = VERSION
FEAST_VERSION = `cat $(VERSION_FILE)`

test:
mvn test

test-integration:
$(MAKE) -C testing/integration test-integration ID=$(ID)

build-deps:
$(MAKE) -C protos gen-go
dep ensure
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/java/feast/core/CoreApplicationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
*/
@RunWith(SpringRunner.class)
@SpringBootTest(properties = {
"feast.jobs.workspace=${java.io.tmpdir}${random.uuid}",
"feast.jobs.workspace=${java.io.tmpdir}/${random.uuid}",
"spring.datasource.url=jdbc:h2:mem:testdb",
"feast.store.warehouse.type=file.json",
"feast.store.warehouse.options={\"path\":\"/tmp/foobar\"}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*/
@RunWith(SpringRunner.class)
@SpringBootTest(properties = {
"feast.jobs.workspace=${java.io.tmpdir}${random.uuid}",
"feast.jobs.workspace=${java.io.tmpdir}/${random.uuid}",
"spring.datasource.url=jdbc:h2:mem:testdb",
"feast.store.warehouse.type=file.json",
"feast.store.warehouse.options={\"path\":\"/tmp/foobar\"}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*/
@RunWith(SpringRunner.class)
@SpringBootTest(properties = {
"feast.jobs.workspace=${java.io.tmpdir}${random.uuid}",
"feast.jobs.workspace=${java.io.tmpdir}/${random.uuid}",
"spring.datasource.url=jdbc:h2:mem:testdb",
"feast.store.serving.type=redis",
"feast.store.serving.options={\"host\":\"localhost\",\"port\":1234}",
Expand Down
4 changes: 2 additions & 2 deletions testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ update-config: get-cluster-credentials
update-plugins: get-cluster-credentials
kubectl create configmap plugins --from-file=plugins.yaml=prow/plugins.yaml --dry-run -o yaml | kubectl replace configmap plugins -f -

build-push:
docker build test-image/ -t $(REGISTRY)/$(PROJECT)/test-image:$(VERSION)
build-push-test-image:
docker build -f docker-images/test-image/Dockerfile -t $(REGISTRY)/$(PROJECT)/test-image:$(VERSION) .
$(PUSH) "$(REGISTRY)/$(PROJECT)/test-image:$(VERSION)"
16 changes: 10 additions & 6 deletions testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This folder contains the Feast test infrastructure.

## Components

* test-image/ - Base docker image and script for running tests.
* docker-images/ - Docker images for running tests
* prow/ - Prow configuration (plugins and jobs)
* tf/ - Terraform modules to provision the base testing infrastructure on GCP
* infrastructure/ - Terraform modules to provision the base testing infrastructure on GCP

## Set up

Expand All @@ -23,7 +23,7 @@ mv tf/gcs
terraform import google_storage_bucket.kf-feast-terraform-state kf-feast-terraform-state
```

4. Ensure that all variables are set correctly in `tf/terraform.tfvars`. It is likely that the GCP project will need to be updated.
4. Ensure that all variables are set correctly in `infrastructure/terraform.tfvars`. It is likely that the GCP project will need to be updated.

5. Create the primary Kubernetes cluster which will host Prow and Argo

Expand Down Expand Up @@ -51,7 +51,11 @@ To update Prow jobs, plugins, or the Docker image used for testing, modify one o

- `prow/config.yaml`
- `prow/plugins.yaml`
- `test-image/Dockerfile`
- `test-image/run.sh`
- `docker-images/test-image/Dockerfile`
- `docker-images/test-image/run.sh`

After making modifications, run `make`. This will update the Prow configuration, build a new test image, and push it to the container registry.
After making modifications, run `make`. This will update the Prow configuration, build a new test image, and push it to the container registry.

## Installing Argo

Argo is used to run integration tests. It follows the [standard installation process described in the argo quickstart](https://github.com/argoproj/argo/blob/master/demo.md), with the artifact repository [configured to use gcs](https://github.com/argoproj/argo/blob/master/ARTIFACT_REPO.md).
25 changes: 25 additions & 0 deletions testing/docker-images/docker-builder-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM docker:18.09

# from https://github.com/GoogleCloudPlatform/cloud-sdk-docker/blob/master/alpine/Dockerfile
ENV CLOUD_SDK_VERSION=236.0.0

ENV PATH /google-cloud-sdk/bin:$PATH
RUN apk --no-cache add \
curl \
python \
py-crcmod \
bash \
libc6-compat \
openssh-client \
git \
gnupg \
&& curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
tar xzf google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
rm google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz && \
ln -s /lib /lib64 && \
gcloud config set core/disable_usage_reporting true && \
gcloud config set component_manager/disable_update_check true && \
gcloud config set metrics/environment github_docker_image && \
gcloud --version

RUN gcloud auth configure-docker
19 changes: 19 additions & 0 deletions testing/docker-images/terraform-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM debian:stretch

RUN apt-get update && apt-get install -y jq wget python zip netcat

RUN wget -qO- https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-233.0.0-linux-x86_64.tar.gz | tar xzf - \
&& /google-cloud-sdk/bin/gcloud -q components install kubectl \
&& /google-cloud-sdk/bin/gcloud -q components install beta \
&& /google-cloud-sdk/bin/gcloud -q components install bq

ENV PATH="/google-cloud-sdk/bin:${PATH}"

RUN wget https://releases.hashicorp.com/terraform/0.11.11/terraform_0.11.11_linux_amd64.zip \
&& unzip terraform_0.11.11_linux_amd64.zip \
&& mv terraform /bin/terraform

RUN wget -qO- https://storage.googleapis.com/kubernetes-helm/helm-v2.12.3-linux-arm64.tar.gz | tar xzf - \
&& mv linux-arm64/helm /bin/helm

RUN helm init --client-only
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ resource "google_container_cluster" "primary-test-cluster" {
node_config {
oauth_scopes = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/devstorage.read_write",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/bigquery",
"https://www.googleapis.com/auth/bigquery.insertdata",
]

machine_type = "n1-standard-4"
Expand Down
23 changes: 23 additions & 0 deletions testing/integration/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Copyright 2019 The Feast Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

.PHONY: test-integration it-redis-bq-dataflow

test-integration:
@$(MAKE) it-redis-bq-dataflow ID=$(ID)

it-redis-bq-dataflow:
argo submit --watch tests/redis-bq-dataflow/workflow.yaml -p prId=$(ID)
29 changes: 29 additions & 0 deletions testing/integration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Integration tests

Integration tests for Feast are run on argo workflows. The tests follow the following steps:

1. Provision infrastructure using Terraform
2. Test using pytest
3. Teardown infrastructure using Terraform

## Terraform modules

The `tf/modules` directory contains Terraform modules to set up the necessary infrastructure. Currently contains:

- `cluster`: kubernetes cluster with necessary permissions to run Feast jobs
- `feast-helm`: Feast helm installation.

## Tests

The `tests` directory contains the integration tests. Each folder should contain the following:

1. The terraform scripts to set up the necessary infra.
2. Data to run the tests on
3. A pytest file that executes the ingestion jobs and then tests for correctness.
4. Argo workflow yaml to orchestrate the entire process.

Multiple tests can be run on the same infrastructure.

### Adding new tests

To add your own tests, either (1) create a new test case within an existing folder or (2) create a new folder with the resources mentioned above.
7 changes: 7 additions & 0 deletions testing/integration/tests/redis-bq-dataflow/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Example environment variables that need to be set when running this test locally
# Export the variables like so:
# set -a; source .env.local
FEAST_CORE_URL=localhost:6565
FEAST_SERVING_URL=localhost:6566
PROJECT_ID=kf-feast
BUCKET_NAME=it-feast-storage
9 changes: 9 additions & 0 deletions testing/integration/tests/redis-bq-dataflow/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# redis-bq-dataflow

This repository contains an end-to-end test that sets up the following infrastructure:

1. Feast configured to run jobs on dataflow
2. Redis as serving store
3. BQ as warehouse store

And then runs the tests in `test_feast.py`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: myentity
description: my test entity
tags:
- tag1
- tag2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
id: myentity.feature_double_redis
name: feature_double_redis
entity: myentity
owner: bob@example.com
description: test entity.
valueType: DOUBLE
uri: https://github.com/bob/example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
id: myentity.feature_float_redis
name: feature_float_redis
entity: myentity
owner: bob@example.com
description: test entity.
valueType: FLOAT
uri: https://github.com/bob/example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
id: myentity.feature_int32_redis
name: feature_int32_redis
entity: myentity
owner: bob@example.com
description: test entity.
valueType: INT32
uri: https://github.com/bob/example
Loading