-
Notifications
You must be signed in to change notification settings - Fork 1.4k
docs, fixes and scripts to run e2e tests in minikube #1254
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
7 commits
Select commit
Hold shift + click to select a range
e4850c1
minor fixes + scripts to run e2e tests in minikube
oavdeev c901983
script rename
oavdeev 7b38821
merge master
oavdeev 14ec1e8
refactor bash function library
oavdeev aed3b6b
merge master
oavdeev c76c602
fix linter warnings
oavdeev 1c755a0
fix the timeout
oavdeev 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 |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ docs | |
| !docs/coverage | ||
| charts | ||
| env | ||
| **/.terraform | ||
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 |
|---|---|---|
|
|
@@ -184,3 +184,8 @@ sdk/python/docs/html | |
| *_pb2.py | ||
| *_pb2.pyi | ||
| *_pb2_grpc.py | ||
|
|
||
| # VSCode | ||
| .bloop | ||
| .metals | ||
| *.code-workspace | ||
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 |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| ARG BASE_IMAGE=gcr.io/kf-feast/feast-ci:latest | ||
|
|
||
| FROM ${BASE_IMAGE} | ||
|
|
||
| RUN mkdir -p /src/sdk /src/spark/ingestion | ||
|
|
||
| COPY sdk/python /src/sdk/python | ||
|
|
||
| COPY README.md /src/README.md | ||
|
|
||
| WORKDIR /src | ||
|
|
||
| RUN pip install -r sdk/python/requirements-ci.txt | ||
|
|
||
| RUN git init . | ||
| RUN pip install -e sdk/python -U | ||
| RUN pip install "s3fs" "boto3" "urllib3>=1.25.4" | ||
|
|
||
| COPY tests /src/tests | ||
|
|
||
| RUN pip install -r tests/requirements.txt | ||
|
|
||
| COPY infra/scripts /src/infra/scripts | ||
| COPY spark/ingestion/target /src/spark/ingestion/target |
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
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,38 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| NAMESPACE=sparkop | ||
| JOB_NAME=test-runner | ||
|
|
||
| # Delete all sparkapplication resources that may be left over from the previous test runs. | ||
| kubectl delete sparkapplication --all -n sparkop || true | ||
|
|
||
| JOB_SPEC=$(dirname $0)/test_job.yaml | ||
|
|
||
| # Delete previous instance of the job if it exists | ||
| kubectl delete -n ${NAMESPACE} "job/$JOB_NAME" 2>/dev/null || true | ||
|
|
||
| # Create the job | ||
| kubectl apply -n ${NAMESPACE} -f "$JOB_SPEC" | ||
|
|
||
| # Wait for job to have a pod. | ||
| for i in {1..10} | ||
| do | ||
| POD=$(kubectl get pods -n ${NAMESPACE} --selector=job-name=$JOB_NAME --output=jsonpath='{.items[0].metadata.name}') | ||
| if [ ! -z "$POD" ]; then | ||
| break | ||
| else | ||
| sleep 1 | ||
| fi | ||
| done | ||
|
|
||
| echo "Waiting for pod to be ready:" | ||
| kubectl wait -n ${NAMESPACE} --for=condition=ContainersReady "pod/$POD" --timeout=60s || true | ||
|
|
||
| echo "Job output:" | ||
| kubectl logs -n ${NAMESPACE} -f "job/$JOB_NAME" | ||
|
|
||
| # Can't wait for both conditions at once, so wait for complete first then wait for failure | ||
| kubectl wait -n ${NAMESPACE} --for=condition=complete "job/$JOB_NAME" --timeout=60s && exit 0 | ||
| kubectl wait -n ${NAMESPACE} --for=condition=failure "job/$JOB_NAME" --timeout=60s && exit 1 |
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,26 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| STEP_BREADCRUMB='~~~~~~~~' | ||
|
|
||
| pushd "$(dirname $0)" | ||
| source k8s-common-functions.sh | ||
|
|
||
| # spark k8s test - runs in sparkop namespace (so it doesn't interfere with a concurrently | ||
| # running EMR test). | ||
| NAMESPACE=sparkop | ||
| RELEASE=sparkop | ||
|
|
||
| # Clean up old release | ||
| k8s_cleanup "$RELEASE" "$NAMESPACE" | ||
|
|
||
| # Helm install everything in a namespace | ||
| helm_install "$RELEASE" "${DOCKER_REPOSITORY}" "${GIT_TAG}" "$NAMESPACE" --create-namespace | ||
|
|
||
| # Delete all sparkapplication resources that may be left over from the previous test runs. | ||
| kubectl delete sparkapplication --all -n "$NAMESPACE" || true | ||
|
|
||
| # Make sure the test pod has permissions to create sparkapplication resources | ||
| setup_sparkop_role | ||
|
|
||
| echo "DONE" |
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,69 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| export DISABLE_FEAST_SERVICE_FIXTURES=1 | ||
| export DISABLE_SERVICE_FIXTURES=1 | ||
|
|
||
| export FEAST_SPARK_K8S_NAMESPACE=sparkop | ||
| export FEAST_S3_ENDPOINT_URL=http://minio.minio.svc.cluster.local:9000 | ||
|
|
||
| # Used by tests | ||
| export AWS_S3_ENDPOINT_URL=http://minio.minio.svc.cluster.local:9000 | ||
|
|
||
| cat << SPARK_CONF_END >/tmp/spark_conf.yml | ||
| apiVersion: "sparkoperator.k8s.io/v1beta2" | ||
| kind: SparkApplication | ||
| metadata: | ||
| namespace: default | ||
| spec: | ||
| type: Scala | ||
| mode: cluster | ||
| image: "gcr.io/kf-feast/spark-py:v3.0.1" | ||
| imagePullPolicy: Always | ||
| sparkVersion: "3.0.1" | ||
| timeToLiveSeconds: 3600 | ||
| pythonVersion: "3" | ||
| sparkConf: | ||
| "spark.hadoop.fs.s3a.endpoint": http://minio.minio.svc.cluster.local:9000 | ||
| "spark.hadoop.fs.s3a.path.style.access": "true" | ||
| "spark.hadoop.fs.s3a.access.key": ${AWS_ACCESS_KEY_ID} | ||
| "spark.hadoop.fs.s3a.secret.key": ${AWS_SECRET_ACCESS_KEY} | ||
| restartPolicy: | ||
| type: Never | ||
| volumes: | ||
| - name: "test-volume" | ||
| hostPath: | ||
| path: "/tmp" | ||
| type: Directory | ||
| driver: | ||
| cores: 1 | ||
| coreLimit: "1200m" | ||
| memory: "512m" | ||
| labels: | ||
| version: 3.0.1 | ||
| serviceAccount: spark | ||
| volumeMounts: | ||
| - name: "test-volume" | ||
| mountPath: "/tmp" | ||
| executor: | ||
| cores: 1 | ||
| instances: 1 | ||
| memory: "512m" | ||
| labels: | ||
| version: 3.0.1 | ||
| volumeMounts: | ||
| - name: "test-volume" | ||
| mountPath: "/tmp" | ||
| SPARK_CONF_END | ||
| export FEAST_SPARK_K8S_JOB_TEMPLATE_PATH=/tmp/spark_conf.yml | ||
|
|
||
| PYTHONPATH=sdk/python pytest tests/e2e/ \ | ||
| --feast-version develop \ | ||
| --core-url sparkop-feast-core:6565 \ | ||
| --serving-url sparkop-feast-online-serving:6566 \ | ||
| --env k8s \ | ||
| --staging-path s3a://feast-staging \ | ||
| --redis-url sparkop-redis-master.sparkop.svc.cluster.local:6379 \ | ||
| --kafka-brokers sparkop-kafka.sparkop.svc.cluster.local:9092 \ | ||
| -m "not bq" |
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 @@ | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: test-runner | ||
| namespace: sparkop | ||
| spec: | ||
| backoffLimit: 1 | ||
| template: | ||
| spec: | ||
| containers: | ||
| - name: ubuntu | ||
| image: feast:local | ||
| command: ["bash", "-c", "./infra/scripts/test-end-to-end-local.sh"] | ||
| imagePullPolicy: Never | ||
| args: | ||
| - bash | ||
| stdin: true | ||
| stdinOnce: true | ||
| tty: true | ||
| env: | ||
| - name: AWS_ACCESS_KEY_ID | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: minio | ||
| key: accesskey | ||
| - name: AWS_SECRET_ACCESS_KEY | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: minio | ||
| key: secretkey | ||
| - name: AWS_DEFAULT_REGION | ||
| value: us-east-1 | ||
| - name: AWS_S3_SIGNATURE_VERSION | ||
| value: s3v4 | ||
| restartPolicy: Never |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we combine this with infra/scripts/runner-helper.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, done