Skip to content

Commit 0d5cb8d

Browse files
authored
Use RedisKeyV2 as key serializer and java murmur implementation in Redis Sink (feast-dev#1064)
1 parent 112e94d commit 0d5cb8d

18 files changed

Lines changed: 216 additions & 56 deletions

File tree

.github/workflows/complete.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,31 @@ jobs:
143143
path: load-test-output/
144144

145145
tests-docker-compose:
146-
needs: build-push-docker-images
146+
needs:
147+
- build-push-docker-images
148+
- publish-ingestion-jar
147149
runs-on: ubuntu-latest
148150
steps:
149151
- uses: actions/checkout@v2
150152
- name: Test docker compose
151153
run: ./infra/scripts/test-docker-compose.sh ${GITHUB_SHA}
154+
155+
publish-ingestion-jar:
156+
runs-on: [self-hosted]
157+
steps:
158+
- uses: actions/checkout@v2
159+
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
160+
with:
161+
version: '290.0.1'
162+
export_default_credentials: true
163+
- uses: actions/setup-java@v1
164+
with:
165+
java-version: '11'
166+
- uses: stCarolas/setup-maven@v3
167+
with:
168+
maven-version: 3.6.3
169+
- name: build-jar
170+
run: make build-java-no-tests REVISION=${GITHUB_SHA}
171+
- name: copy to gs
172+
run: gsutil cp ./spark/ingestion/target/feast-ingestion-spark-${GITHUB_SHA}.jar gs://feast-jobs/spark/ingestion/
173+

.github/workflows/master_only.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,28 @@ jobs:
6262
docker push gcr.io/kf-feast/feast-${{ matrix.component }}:latest
6363
fi
6464
fi
65+
66+
publish-ingestion-jar:
67+
runs-on: [ self-hosted ]
68+
env:
69+
PUBLISH_BUCKET: feast-jobs
70+
steps:
71+
- uses: actions/checkout@v2
72+
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
73+
with:
74+
version: '290.0.1'
75+
export_default_credentials: true
76+
- uses: actions/setup-java@v1
77+
with:
78+
java-version: '11'
79+
- uses: stCarolas/setup-maven@v3
80+
with:
81+
maven-version: 3.6.3
82+
- name: build-jar
83+
run: |
84+
SEMVER_REGEX='^v[0-9]+\.[0-9]+\.[0-9]+(-([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?$'
85+
if echo "${RELEASE_VERSION}" | grep -P "$SEMVER_REGEX" &>/dev/null ; then
86+
VERSION=${RELEASE_VERSION:1}
87+
make build-java-no-tests REVISION=${VERSION}
88+
gsutil cp ./spark/ingestion/target/feast-ingestion-spark-${VERSION}.jar gs://${PUBLISH_BUCKET}/spark/ingestion/
89+
fi

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ test-java-with-coverage:
5555
build-java:
5656
mvn clean verify
5757

58+
build-java-no-tests:
59+
mvn --no-transfer-progress -Dmaven.javadoc.skip=true -Dgpg.skip -DskipUTs=true -Drevision=${REVISION} clean package
60+
5861
# Python SDK
5962

6063
install-python-ci-dependencies:

infra/docker/jupyter/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM jupyter/minimal-notebook:619e9cc2fc07
1+
FROM jupyter/pyspark-notebook:ae5f7e104dd5
22

33
USER root
44
WORKDIR /feast

infra/scripts/test-docker-compose.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,5 @@ export FEAST_ONLINE_SERVING_CONTAINER_IP_ADDRESS=$(docker inspect -f '{{range .N
6363
${PROJECT_ROOT_DIR}/infra/scripts/wait-for-it.sh ${FEAST_ONLINE_SERVING_CONTAINER_IP_ADDRESS}:6566 --timeout=120
6464

6565
# Run e2e tests for Redis
66-
docker exec feast_jupyter_1 bash -c 'cd /feast/tests/e2e && pytest *.py -m "not bq" --core_url core:6565 --serving_url=online_serving:6566 --kafka_brokers=kafka:9092'
66+
docker exec -e FEAST_VERSION=${FEAST_VERSION} feast_jupyter_1 bash \
67+
-c 'cd /feast/tests/e2e && unset GOOGLE_APPLICATION_CREDENTIALS && pytest *.py -m "not bq" --ingestion-jar gs://feast-jobs/spark/ingestion/feast-ingestion-spark-${FEAST_VERSION}.jar --redis-url redis:6379 --core_url core:6565 --serving_url=online_serving:6566 --kafka_brokers=kafka:9092'

infra/scripts/test-end-to-end-redis-cluster.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ cd tests/e2e
103103

104104
set +e
105105
CORE_NO=$(nproc --all)
106-
pytest *.py -n ${CORE_NO} --dist=loadscope --junitxml=${LOGS_ARTIFACT_PATH}/python-sdk-test-report.xml
106+
pytest *.py -n ${CORE_NO} --redis-url localhost:7000 \
107+
--dist=loadscope --junitxml=${LOGS_ARTIFACT_PATH}/python-sdk-test-report.xml
107108
TEST_EXIT_CODE=$?
108109

109110
if [[ ${TEST_EXIT_CODE} != 0 ]]; then

sdk/python/feast/client.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,16 @@ def _get_feature_tables_from_feature_refs(
889889
def start_offline_to_online_ingestion(
890890
self, feature_table: FeatureTable, start: datetime, end: datetime,
891891
) -> SparkJob:
892-
return start_offline_to_online_ingestion(feature_table, start, end, self) # type: ignore
892+
"""
893+
894+
Launch Ingestion Job from Batch Source to Online Store for given featureTable
895+
896+
:param feature_table: FeatureTable which will be ingested
897+
:param start: lower datetime boundary
898+
:param end: upper datetime boundary
899+
:return: Spark Job Proxy object
900+
"""
901+
return start_offline_to_online_ingestion(feature_table, start, end, self)
893902

894903
def start_stream_to_online_ingestion(
895904
self, feature_table: FeatureTable, extra_jars: Optional[List[str]] = None,

sdk/python/feast/config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ def _init_config(path: str):
4747
config_dir = os.path.dirname(path)
4848
config_dir = config_dir.rstrip("/") + "/"
4949

50-
if not os.path.exists(os.path.dirname(config_dir)):
51-
os.makedirs(os.path.dirname(config_dir))
50+
os.makedirs(os.path.dirname(config_dir), exist_ok=True)
5251

5352
# Create the configuration file itself
5453
config = ConfigParser(defaults=DEFAULTS)

sdk/python/feast/constants.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,7 @@ class AuthProvider(Enum):
124124
CONFIG_AUTH_PROVIDER: "google",
125125
CONFIG_SPARK_LAUNCHER: "dataproc",
126126
CONFIG_SPARK_INGESTION_JOB_JAR: "gs://feast-jobs/feast-ingestion-spark-0.8-SNAPSHOT.jar",
127+
CONFIG_REDIS_HOST: "localhost",
128+
CONFIG_REDIS_PORT: "6379",
129+
CONFIG_REDIS_SSL: "False",
127130
}

sdk/python/feast/staging/storage_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
from typing.io import IO
2323
from urllib.parse import ParseResult
2424

25+
from google.auth.exceptions import DefaultCredentialsError
26+
2527
GS = "gs"
2628
S3 = "s3"
2729
LOCAL_FILE = "file"
@@ -73,7 +75,10 @@ def __init__(self):
7375
"Install package google-cloud-storage==1.20.* for gcs staging support"
7476
"run ```pip install google-cloud-storage==1.20.*```"
7577
)
76-
self.gcs_client = storage.Client(project=None)
78+
try:
79+
self.gcs_client = storage.Client(project=None)
80+
except DefaultCredentialsError:
81+
self.gcs_client = storage.Client.create_anonymous_client()
7782

7883
def download_file(self, uri: ParseResult) -> IO[bytes]:
7984
"""

0 commit comments

Comments
 (0)