-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Clean up Docker Compose and add test #668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
fd46ae1
Modularize Docker Compose files
woop cb40963
Add docker compose test
woop 16b5d1d
Add GitHub Actions Docker Compose workflow
woop 76132a7
Fix typos and environment file
woop ff5c895
Get docker container address from docker
woop 88c2a06
Externalize startup script for docker container
woop 9512211
Remove unnecessary Feast SDK installation
woop d39dc26
Clean up Basic notebook parameters
woop e3d1631
Small changes (whitespace and comments)
woop 2f5f923
Add wait-for-it bash script
woop d385868
Shut down docker compose when done
woop 7b8e288
Allow docker-compose files to run independently
woop 3ce193b
Allow Jupyter Notebook clone step to always succeed
woop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| name: docker compose tests | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| basic-redis-e2e-tests-docker-compose: | ||
| runs-on: ubuntu-latest | ||
| name: basic redis e2e tests on docker compose | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: test docker compose | ||
| run: ./infra/scripts/test-docker-compose.sh |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,23 @@ | ||
| # General | ||
| COMPOSE_PROJECT_NAME=feast | ||
| FEAST_VERSION=latest | ||
| FEAST_REPOSITORY_VERSION=v0.4.7 | ||
|
|
||
| # Feast Core | ||
| FEAST_CORE_IMAGE=gcr.io/kf-feast/feast-core | ||
| FEAST_CORE_CONFIG=direct-runner.yml | ||
| FEAST_CORE_GCP_SERVICE_ACCOUNT_KEY=placeholder.json | ||
|
|
||
| # Feast Serving | ||
| FEAST_SERVING_IMAGE=gcr.io/kf-feast/feast-serving | ||
| FEAST_ONLINE_SERVING_CONFIG=online-serving.yml | ||
| FEAST_ONLINE_STORE_CONFIG=redis-store.yml | ||
| # Feast Serving Batch (BigQuery) | ||
| FEAST_BATCH_SERVING_CONFIG=batch-serving.yml | ||
| FEAST_BATCH_STORE_CONFIG=bq-store.yml | ||
| FEAST_BATCH_SERVING_GCP_SERVICE_ACCOUNT_KEY=placeholder.json | ||
| FEAST_JOB_STAGING_LOCATION=gs://your-gcs-bucket/staging | ||
| FEAST_BATCH_JOB_STAGING_LOCATION=gs://your-gcs-bucket/staging | ||
|
|
||
| # Jupyter | ||
| FEAST_JUPYTER_GCP_SERVICE_ACCOUNT_KEY=placeholder.json | ||
| # Feast Serving Online (Redis) | ||
| FEAST_SERVING_IMAGE=gcr.io/kf-feast/feast-serving | ||
| FEAST_ONLINE_SERVING_CONFIG=online-serving.yml | ||
| FEAST_ONLINE_STORE_CONFIG=redis-store.yml | ||
|
|
||
| # Jupyter | ||
| FEAST_JUPYTER_GCP_SERVICE_ACCOUNT_KEY=placeholder.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| version: "3.7" | ||
|
|
||
| services: | ||
| batch-serving: | ||
| image: ${FEAST_SERVING_IMAGE}:${FEAST_VERSION} | ||
| volumes: | ||
| - ./serving/${FEAST_BATCH_SERVING_CONFIG}:/etc/feast/application.yml | ||
| - ./serving/${FEAST_BATCH_STORE_CONFIG}:/etc/feast/store.yml | ||
| - ./gcp-service-accounts/${FEAST_BATCH_SERVING_GCP_SERVICE_ACCOUNT_KEY}:/etc/gcloud/service-accounts/key.json | ||
| depends_on: | ||
| - redis | ||
| ports: | ||
| - 6567:6567 | ||
| restart: on-failure | ||
| environment: | ||
| GOOGLE_APPLICATION_CREDENTIALS: /etc/gcloud/service-accounts/key.json | ||
| FEAST_JOB_STAGING_LOCATION: ${FEAST_BATCH_JOB_STAGING_LOCATION} | ||
| command: | ||
| - "java" | ||
| - "-Xms1024m" | ||
| - "-Xmx1024m" | ||
| - "-jar" | ||
| - "/opt/feast/feast-serving.jar" | ||
| - "--spring.config.location=classpath:/application.yml,file:/etc/feast/application.yml" | ||
|
|
||
| redis: | ||
| image: redis:5-alpine | ||
| ports: | ||
| - "6379:6379" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| version: "3.7" | ||
|
|
||
| services: | ||
| online-serving: | ||
| image: ${FEAST_SERVING_IMAGE}:${FEAST_VERSION} | ||
| volumes: | ||
| - ./serving/${FEAST_ONLINE_SERVING_CONFIG}:/etc/feast/application.yml | ||
| - ./serving/${FEAST_ONLINE_STORE_CONFIG}:/etc/feast/store.yml | ||
woop marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| depends_on: | ||
| - redis | ||
| ports: | ||
| - 6566:6566 | ||
| restart: on-failure | ||
| command: | ||
| - java | ||
| - -jar | ||
| - /opt/feast/feast-serving.jar | ||
| - --spring.config.location=classpath:/application.yml,file:/etc/feast/application.yml | ||
|
|
||
| redis: | ||
| image: redis:5-alpine | ||
| ports: | ||
| - "6379:6379" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| {} | ||
| { | ||
| "type": "service_account", | ||
| "project_id": "just-some-project" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -ex | ||
|
|
||
| # Clone Feast repository into Jupyter container | ||
| git clone -b ${FEAST_REPOSITORY_VERSION} --single-branch https://github.com/gojek/feast.git || true | ||
|
|
||
| # Install CI requirements (only needed for running tests) | ||
| pip install -r feast/sdk/python/requirements-ci.txt | ||
|
|
||
| # Install Feast SDK | ||
| pip install -e feast/sdk/python -U | ||
|
|
||
| # Start Jupyter Notebook | ||
| start-notebook.sh --NotebookApp.token='' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| echo " | ||
| ============================================================ | ||
| Running Docker Compose tests with pytest at 'tests/e2e' | ||
| ============================================================ | ||
| " | ||
|
|
||
| export PROJECT_ROOT_DIR=$(git rev-parse --show-toplevel) | ||
| export COMPOSE_INTERACTIVE_NO_CLI=1 | ||
|
|
||
| # Create Docker Compose configuration file | ||
| cd ${PROJECT_ROOT_DIR}/infra/docker-compose/ | ||
| cp .env.sample .env | ||
|
|
||
| # Start Docker Compose containers | ||
| docker-compose -f docker-compose.yml -f docker-compose.online.yml up -d | ||
|
|
||
| # Get Jupyter container IP address | ||
| export JUPYTER_DOCKER_CONTAINER_IP_ADDRESS=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' feast_jupyter_1) | ||
|
|
||
| # Print Jupyter container information | ||
| docker inspect feast_jupyter_1 | ||
| docker logs feast_jupyter_1 | ||
|
|
||
| # Wait for Jupyter Notebook Container to come online | ||
| ${PROJECT_ROOT_DIR}/infra/scripts/wait-for-it.sh ${JUPYTER_DOCKER_CONTAINER_IP_ADDRESS}:8888 --timeout=300 | ||
|
|
||
| # Run e2e tests for Redis | ||
| docker exec feast_jupyter_1 bash -c 'cd feast/tests/e2e/ && pytest -s basic-ingest-redis-serving.py --core_url core:6565 --serving_url=online-serving:6566' | ||
|
|
||
| # Shut down docker-compose images | ||
| docker-compose -f docker-compose.yml -f docker-compose.online.yml down |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.