diff --git a/.github/workflow/unit-tests.yaml b/.github/workflow/unit-tests.yaml new file mode 100644 index 00000000000..8ff5128acac --- /dev/null +++ b/.github/workflow/unit-tests.yaml @@ -0,0 +1,15 @@ +name: unit tests + +on: [push, pull_request] + +jobs: + unit-test-python: + runs-on: ubuntu-latest + container: gcr.io/kf-feast/feast-ci:latest + name: unit test python + steps: + - uses: actions/checkout@v1 + - name: install python + run: make install-python + - name: test python + run: make test-python \ No newline at end of file diff --git a/Makefile b/Makefile index de61fe2892f..4e84e4d440b 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,22 @@ build-cli: build-java: mvn clean verify +# Python SDK + +install-python-ci-dependencies: + pip install -r sdk/python/requirements-ci.txt + +compile-protos-python: install-python-ci-dependencies + @$(foreach dir,$(PROTO_TYPE_SUBDIRS),cd ${ROOT_DIR}/protos; python -m grpc_tools.protoc -I. --python_out=../sdk/python/ --mypy_out=../sdk/python/ feast/$(dir)/*.proto;) + @$(foreach dir,$(PROTO_SERVICE_SUBDIRS),cd ${ROOT_DIR}/protos; python -m grpc_tools.protoc -I. --grpc_python_out=../sdk/python/ feast/$(dir)/*.proto;) + cd ${ROOT_DIR}/protos; python -m grpc_tools.protoc -I. --python_out=../sdk/python/ --mypy_out=../sdk/python/ + +install-python: compile-protos-python + pip install -e sdk/python --upgrade + +test-python: + pytest --verbose --color=yes sdk/python/tests + build-docker: docker build -t $(REGISTRY)/feast-core:$(VERSION) -f infra/docker/core/Dockerfile . docker build -t $(REGISTRY)/feast-serving:$(VERSION) -f infra/docker/serving/Dockerfile . diff --git a/.prow/scripts/download-maven-cache.sh b/infra/scripts/download-maven-cache.sh similarity index 100% rename from .prow/scripts/download-maven-cache.sh rename to infra/scripts/download-maven-cache.sh diff --git a/.prow/scripts/install-google-cloud-sdk.sh b/infra/scripts/install-google-cloud-sdk.sh similarity index 100% rename from .prow/scripts/install-google-cloud-sdk.sh rename to infra/scripts/install-google-cloud-sdk.sh diff --git a/.prow/scripts/publish-docker-image.sh b/infra/scripts/publish-docker-image.sh similarity index 100% rename from .prow/scripts/publish-docker-image.sh rename to infra/scripts/publish-docker-image.sh diff --git a/.prow/scripts/publish-java-sdk.sh b/infra/scripts/publish-java-sdk.sh similarity index 100% rename from .prow/scripts/publish-java-sdk.sh rename to infra/scripts/publish-java-sdk.sh diff --git a/.prow/scripts/publish-python-sdk.sh b/infra/scripts/publish-python-sdk.sh similarity index 100% rename from .prow/scripts/publish-python-sdk.sh rename to infra/scripts/publish-python-sdk.sh diff --git a/.prow/scripts/sync-helm-charts.sh b/infra/scripts/sync-helm-charts.sh similarity index 100% rename from .prow/scripts/sync-helm-charts.sh rename to infra/scripts/sync-helm-charts.sh diff --git a/.prow/scripts/test-core-ingestion.sh b/infra/scripts/test-core-ingestion.sh similarity index 95% rename from .prow/scripts/test-core-ingestion.sh rename to infra/scripts/test-core-ingestion.sh index 98a47ca68c9..b7ec1d814b8 100755 --- a/.prow/scripts/test-core-ingestion.sh +++ b/infra/scripts/test-core-ingestion.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -.prow/scripts/download-maven-cache.sh \ +infra/scripts/download-maven-cache.sh \ --archive-uri gs://feast-templocation-kf-feast/.m2.2019-10-24.tar \ --output-dir /root/ diff --git a/.prow/scripts/test-end-to-end-batch.sh b/infra/scripts/test-end-to-end-batch.sh similarity index 99% rename from .prow/scripts/test-end-to-end-batch.sh rename to infra/scripts/test-end-to-end-batch.sh index 268bd248c17..100e7479268 100755 --- a/.prow/scripts/test-end-to-end-batch.sh +++ b/infra/scripts/test-end-to-end-batch.sh @@ -90,7 +90,7 @@ if [[ ${SKIP_BUILD_JARS} != "true" ]]; then ============================================================ " - .prow/scripts/download-maven-cache.sh \ + infra/scripts/download-maven-cache.sh \ --archive-uri gs://feast-templocation-kf-feast/.m2.2019-10-24.tar \ --output-dir /root/ diff --git a/.prow/scripts/test-end-to-end.sh b/infra/scripts/test-end-to-end.sh similarity index 99% rename from .prow/scripts/test-end-to-end.sh rename to infra/scripts/test-end-to-end.sh index c436d2f6905..3b9eb8c8c56 100755 --- a/.prow/scripts/test-end-to-end.sh +++ b/infra/scripts/test-end-to-end.sh @@ -73,7 +73,7 @@ if [[ ${SKIP_BUILD_JARS} != "true" ]]; then ============================================================ " - .prow/scripts/download-maven-cache.sh \ + infra/scripts/download-maven-cache.sh \ --archive-uri gs://feast-templocation-kf-feast/.m2.2019-10-24.tar \ --output-dir /root/ diff --git a/.prow/scripts/test-golang-sdk.sh b/infra/scripts/test-golang-sdk.sh similarity index 100% rename from .prow/scripts/test-golang-sdk.sh rename to infra/scripts/test-golang-sdk.sh diff --git a/.prow/scripts/test-java-sdk.sh b/infra/scripts/test-java-sdk.sh similarity index 100% rename from .prow/scripts/test-java-sdk.sh rename to infra/scripts/test-java-sdk.sh diff --git a/.prow/scripts/test-python-sdk.sh b/infra/scripts/test-python-sdk.sh similarity index 100% rename from .prow/scripts/test-python-sdk.sh rename to infra/scripts/test-python-sdk.sh diff --git a/.prow/scripts/test-serving.sh b/infra/scripts/test-serving.sh similarity index 90% rename from .prow/scripts/test-serving.sh rename to infra/scripts/test-serving.sh index b56001619b3..ce9dc0a8162 100755 --- a/.prow/scripts/test-serving.sh +++ b/infra/scripts/test-serving.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -.prow/scripts/download-maven-cache.sh \ +infra/scripts/download-maven-cache.sh \ --archive-uri gs://feast-templocation-kf-feast/.m2.2019-10-24.tar \ --output-dir /root/