-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate sparkop e2e tests to kf-feast cluster (#62)
* Migrate sparkop e2e tests to kf-feast cluster Signed-off-by: Khor Shu Heng <khor.heng@gojek.com> * Run tests within pod Signed-off-by: Khor Shu Heng <khor.heng@gojek.com> * Add resource to test spark job Signed-off-by: Khor Shu Heng <khor.heng@gojek.com> * Update to spark 3.0.2 Signed-off-by: Khor Shu Heng <khor.heng@gojek.com> * Add java options to enable netty reflection Signed-off-by: Khor Shu Heng <khor.heng@gojek.com> Co-authored-by: Khor Shu Heng <khor.heng@gojek.com>
- Loading branch information
1 parent
b8f0313
commit e543bfb
Showing
5 changed files
with
136 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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 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,54 @@ | ||
feast-jobservice: | ||
envOverrides: | ||
FEAST_CORE_URL: feast-release-feast-core:6565 | ||
FEAST_SPARK_LAUNCHER: k8s | ||
FEAST_SPARK_K8S_NAMESPACE: sparkop-e2e | ||
FEAST_SPARK_K8S_USE_INCLUSTER_CONFIG: True | ||
FEAST_TELEMETRY: False | ||
FEAST_SPARK_STAGING_LOCATION: gs://feast-templocation-kf-feast | ||
FEAST_REDIS_HOST: feast-release-redis-master | ||
FEAST_REDIS_PORT: 6379 | ||
FEAST_JOB_SERVICE_ENABLE_CONTROL_LOOP: False | ||
FEAST_SPARK_INGESTION_JAR: local:///opt/spark/jars/feast-ingestion-spark-${IMAGE_TAG}.jar | ||
|
||
sparkOperator: | ||
enabled: true | ||
jobTemplate: | ||
apiVersion: "sparkoperator.k8s.io/v1beta2" | ||
kind: SparkApplication | ||
spec: | ||
type: Scala | ||
mode: cluster | ||
image: "gcr.io/kf-feast/feast-spark:${IMAGE_TAG}" | ||
hadoopConf: | ||
"fs.gs.project.id": "kf-feast" | ||
"google.cloud.auth.service.account.enable": "true" | ||
"google.cloud.auth.service.account.json.keyfile": "/mnt/secrets/credentials.json" | ||
sparkVersion: "3.0.2" | ||
timeToLiveSeconds: 3600 | ||
pythonVersion: "3" | ||
restartPolicy: | ||
type: Never | ||
driver: | ||
cores: 1 | ||
coreLimit: "1200m" | ||
memory: "600m" | ||
labels: | ||
version: 3.0.2 | ||
javaOptions: "-Dio.netty.tryReflectionSetAccessible=true" | ||
secrets: | ||
- name: feast-gcp-service-account | ||
path: /mnt/secrets | ||
secretType: GCPServiceAccount | ||
executor: | ||
cores: 1 | ||
instances: 1 | ||
memory: "800m" | ||
labels: | ||
version: 3.0.2 | ||
javaOptions: "-Dio.netty.tryReflectionSetAccessible=true" | ||
secrets: | ||
- name: feast-gcp-service-account | ||
path: /mnt/secrets | ||
secretType: GCPServiceAccount | ||
|
This file contains 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 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,69 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
set -e | ||
|
||
pip install "s3fs" "aiobotocore==1.2.2" "boto3" "urllib3>=1.25.4" | ||
export GIT_TAG=${PULL_PULL_SHA:-${PULL_BASE_SHA}} | ||
export GIT_REMOTE_URL=https://github.com/feast-dev/feast-spark.git | ||
export DOCKER_REPOSITORY=gcr.io/kf-feast | ||
export JOBSERVICE_HELM_VALUES=infra/scripts/helm/k8s-jobservice.yaml | ||
|
||
export DISABLE_FEAST_SERVICE_FIXTURES=1 | ||
export DISABLE_SERVICE_FIXTURES=1 | ||
export FEAST_TELEMETRY="False" | ||
test -z ${GCLOUD_PROJECT} && GCLOUD_PROJECT="kf-feast" | ||
test -z ${GCLOUD_REGION} && GCLOUD_REGION="us-central1" | ||
test -z ${GCLOUD_NETWORK} && GCLOUD_NETWORK="default" | ||
test -z ${GCLOUD_SUBNET} && GCLOUD_SUBNET="default" | ||
test -z ${KUBE_CLUSTER} && KUBE_CLUSTER="feast-e2e-dataflow" | ||
|
||
export FEAST_SPARK_K8S_NAMESPACE=sparkop | ||
gcloud auth activate-service-account --key-file ${GOOGLE_APPLICATION_CREDENTIALS} | ||
gcloud -q auth configure-docker | ||
|
||
PYTHONPATH=sdk/python pytest tests/e2e/ \ | ||
--feast-version develop \ | ||
--core-url feast-release-feast-core:6565 \ | ||
--serving-url feast-release-feast-online-serving:6566 \ | ||
--env k8s \ | ||
--staging-path $STAGING_PATH \ | ||
--redis-url feast-release-redis-master.sparkop.svc.cluster.local:6379 \ | ||
--kafka-brokers feast-release-kafka.sparkop.svc.cluster.local:9092 \ | ||
-m "not bq" | ||
gcloud config set project ${GCLOUD_PROJECT} | ||
gcloud config set compute/region ${GCLOUD_REGION} | ||
gcloud config list | ||
|
||
gcloud container clusters get-credentials ${KUBE_CLUSTER} --region ${GCLOUD_REGION} --project ${GCLOUD_PROJECT} | ||
|
||
source infra/scripts/k8s-common-functions.sh | ||
|
||
NAMESPACE="sparkop-e2e" | ||
|
||
k8s_cleanup "feast-release" "$NAMESPACE" | ||
k8s_cleanup "js" "$NAMESPACE" | ||
|
||
kubectl delete sparkapplication --all -n $NAMESPACE | ||
kubectl delete scheduledsparkapplication --all -n $NAMESPACE | ||
|
||
wait_for_image "${DOCKER_REPOSITORY}" feast-jobservice "${GIT_TAG}" | ||
wait_for_image "${DOCKER_REPOSITORY}" feast-spark "${GIT_TAG}" | ||
|
||
sed s/\$\{IMAGE_TAG\}/${JOBSERVICE_GIT_TAG:-$GIT_TAG}/g infra/scripts/helm/k8s-jobservice.tpl.yaml > $JOBSERVICE_HELM_VALUES | ||
|
||
helm_install "js" "${DOCKER_REPOSITORY}" "${GIT_TAG}" "$NAMESPACE" \ | ||
--set 'feast-online-serving.application-override\.yaml.feast.stores[0].type=REDIS' \ | ||
--set 'feast-online-serving.application-override\.yaml.feast.stores[0].name=online' \ | ||
--set 'feast-online-serving.application-override\.yaml.feast.stores[0].config.host=feast-release-redis-master' \ | ||
--set 'feast-online-serving.application-override\.yaml.feast.stores[0].config.port=6379' \ | ||
|
||
CMD=$(printf '%s' \ | ||
"mkdir src && cd src && git clone --recursive ${GIT_REMOTE_URL} && cd feast-spark && " \ | ||
"git config remote.origin.fetch '+refs/pull/*:refs/remotes/origin/pull/*' && " \ | ||
"git fetch -q && git checkout ${GIT_TAG} && " \ | ||
"make install-python && " \ | ||
"python -m pip install -qr tests/requirements.txt && " \ | ||
"pytest -v tests/e2e/ --env k8s " \ | ||
"--staging-path gs://feast-templocation-kf-feast/ " \ | ||
"--core-url feast-release-feast-core:6565 " \ | ||
"--serving-url feast-release-feast-online-serving:6566 " \ | ||
"--job-service-url js-feast-jobservice:6568 " \ | ||
"--kafka-brokers feast-release-kafka-headless:9092 --bq-project kf-feast --feast-version dev") | ||
|
||
# Delete old test running pod if it exists | ||
kubectl delete pod -n "$NAMESPACE" ci-test-runner 2>/dev/null || true | ||
|
||
kubectl run -n "$NAMESPACE" -i ci-test-runner \ | ||
--pod-running-timeout=5m \ | ||
--restart=Never \ | ||
--image="${DOCKER_REPOSITORY}/feast-ci:latest" \ | ||
--env="FEAST_TELEMETRY=false" \ | ||
--env="DISABLE_FEAST_SERVICE_FIXTURES=1" \ | ||
--env="DISABLE_SERVICE_FIXTURES=1" \ | ||
-- bash -c "$CMD" |
This file contains 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