From 8b5698fefa965fc08fdb5e07d739d0ca276a3522 Mon Sep 17 00:00:00 2001 From: lokeshrangineni Date: Thu, 25 Apr 2024 12:26:18 -0400 Subject: [PATCH] fix: Changed the code the way mysql container is initialized. (#4140) * chore: Move feast install to docker build in java it tests (#4126) * chore: Move feast install to docker build in java it tests Signed-off-by: tokoko * remove commented out lines in compose file Signed-off-by: tokoko * make local compose mode default Signed-off-by: tokoko * limit COPY contents Signed-off-by: tokoko * remove requirements.txt from java tests docker image Signed-off-by: tokoko * include pyproject.toml in dockerfile Signed-off-by: tokoko * change links to depends_on Signed-off-by: tokoko * try updating setup-python to v5 Signed-off-by: tokoko * pin macos image to macos-12 Signed-off-by: tokoko * force rerun Signed-off-by: tokoko --------- Signed-off-by: tokoko Signed-off-by: Lokesh Rangineni * chore: Incorporate release 0.37.1 to master (#4127) * chore(release): release 0.37.1 ## [0.37.1](https://github.com/feast-dev/feast/compare/v0.37.0...v0.37.1) (2024-04-17) ### Bug Fixes * Pgvector patch ([#4108](https://github.com/feast-dev/feast/issues/4108)) ([1a1f0b1](https://github.com/feast-dev/feast/commit/1a1f0b1c56aa2ac00b1e1aa1e21cc200ea659334)) ### Reverts * Reverts "fix: Using version args to install the correct feast version" ([#4112](https://github.com/feast-dev/feast/issues/4112)) ([d5ded69](https://github.com/feast-dev/feast/commit/d5ded69dea9af3a363feaa948cd3d2dcf10fb80c)), closes [#3953](https://github.com/feast-dev/feast/issues/3953) * chore: Move feast install to docker build in java it tests (#4126) * chore: Move feast install to docker build in java it tests Signed-off-by: tokoko * remove commented out lines in compose file Signed-off-by: tokoko * make local compose mode default Signed-off-by: tokoko * limit COPY contents Signed-off-by: tokoko * remove requirements.txt from java tests docker image Signed-off-by: tokoko * include pyproject.toml in dockerfile Signed-off-by: tokoko * change links to depends_on Signed-off-by: tokoko * try updating setup-python to v5 Signed-off-by: tokoko * pin macos image to macos-12 Signed-off-by: tokoko * force rerun Signed-off-by: tokoko --------- Signed-off-by: tokoko --------- Signed-off-by: tokoko Co-authored-by: feast-ci-bot Co-authored-by: Tornike Gurgenidze Signed-off-by: Lokesh Rangineni * chore: Install python dependencies with uv in workflows (#4086) * install dependencies in unit-tests with uv Signed-off-by: tokoko * install dependencies in unit-tests with uv Signed-off-by: tokoko * enable caching, change linter job Signed-off-by: tokoko * change local integration tests to uv Signed-off-by: tokoko * change all installs to uv Signed-off-by: tokoko * try adding uv cache Signed-off-by: tokoko * fix lambda cache step name Signed-off-by: tokoko * reenable caches for uv Signed-off-by: tokoko * remove dangling cache step Signed-off-by: tokoko --------- Signed-off-by: tokoko Signed-off-by: Lokesh Rangineni * feat: Make arrow primary interchange for online ODFV execution (#4143) * rewrite online flow to use transform_arrow Signed-off-by: tokoko * fix transformation server Signed-off-by: tokoko --------- Signed-off-by: tokoko Signed-off-by: Lokesh Rangineni * feat: Feast/IKV online store documentation (#4146) * feat: Feast/IKV online store documentation Signed-off-by: Pushkar Gupta * functionality matric Signed-off-by: Pushkar Gupta * more changes Signed-off-by: Pushkar Gupta * mount dir Signed-off-by: Pushkar Gupta --------- Signed-off-by: Pushkar Gupta Signed-off-by: Lokesh Rangineni * fix: Default value is not set in Redis connection string using environment variable (#4136) Removed documentation of Redis connection string supporting default values when using environment variables as it isn't supported Fixes #3669 Signed-off-by: Theodor Mihalache Signed-off-by: Lokesh Rangineni * fix: Make sure schema is used when calling `get_table_query_string` method for Snowflake datasource (#4131) * Fix get_table_query_string method for Snowflake datasource Signed-off-by: TomSteenbergen * Add quotes to table string Signed-off-by: TomSteenbergen --------- Signed-off-by: TomSteenbergen Signed-off-by: Lokesh Rangineni * fix: Change checkout action back to v3 from v5 which isn't released yet (#4147) Signed-off-by: Jeremy Ary Signed-off-by: Lokesh Rangineni * changed the code the way mysql container is initialized. Trying to fix the issue - https://github.com/feast-dev/feast/issues/4128 Also going to check if this change will be resolved in the github actions as well. Signed-off-by: Lokesh Rangineni * reformatted the file to resolve lint error. Signed-off-by: Lokesh Rangineni * reformatted the file to resolve lint error. Signed-off-by: Lokesh Rangineni --------- Signed-off-by: tokoko Signed-off-by: Lokesh Rangineni Signed-off-by: Pushkar Gupta Signed-off-by: Theodor Mihalache Signed-off-by: TomSteenbergen Signed-off-by: Jeremy Ary Co-authored-by: Tornike Gurgenidze Co-authored-by: Jeremy Ary Co-authored-by: feast-ci-bot Co-authored-by: Pushkar Gupta Co-authored-by: Theodor Mihalache <84387487+tmihalac@users.noreply.github.com> Co-authored-by: Tom Steenbergen <41334387+TomSteenbergen@users.noreply.github.com> --- sdk/python/tests/unit/test_sql_registry.py | 30 +++++++--------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/sdk/python/tests/unit/test_sql_registry.py b/sdk/python/tests/unit/test_sql_registry.py index 094b8967c1..a1460663ae 100644 --- a/sdk/python/tests/unit/test_sql_registry.py +++ b/sdk/python/tests/unit/test_sql_registry.py @@ -21,6 +21,7 @@ from pytest_lazyfixture import lazy_fixture from testcontainers.core.container import DockerContainer from testcontainers.core.waiting_utils import wait_for_logs +from testcontainers.mysql import MySqlContainer from feast import FileSource, RequestSource from feast.data_format import ParquetFormat @@ -41,7 +42,6 @@ POSTGRES_PASSWORD = "test" POSTGRES_DB = "test" - logger = logging.getLogger(__name__) @@ -81,32 +81,20 @@ def pg_registry(): @pytest.fixture(scope="session") def mysql_registry(): - container = ( - DockerContainer("mysql:latest") - .with_exposed_ports(3306) - .with_env("MYSQL_RANDOM_ROOT_PASSWORD", "true") - .with_env("MYSQL_USER", POSTGRES_USER) - .with_env("MYSQL_PASSWORD", POSTGRES_PASSWORD) - .with_env("MYSQL_DATABASE", POSTGRES_DB) - ) - + container = MySqlContainer("mysql:latest") container.start() - # The log string uses '8.0.*' since the version might be changed as new Docker images are pushed. - log_string_to_wait_for = "/usr/sbin/mysqld: ready for connections. Version: '(\\d+(\\.\\d+){1,2})' socket: '/var/run/mysqld/mysqld.sock' port: 3306" # noqa: W605 - waited = wait_for_logs( - container=container, - predicate=log_string_to_wait_for, - timeout=60, - interval=10, + # testing for the database to exist and ready to connect and start testing. + import sqlalchemy + + engine = sqlalchemy.create_engine( + container.get_connection_url(), pool_pre_ping=True ) - logger.info("Waited for %s seconds until mysql container was up", waited) - container_port = container.get_exposed_port(3306) - container_host = container.get_container_host_ip() + engine.connect() registry_config = RegistryConfig( registry_type="sql", - path=f"mysql+pymysql://{POSTGRES_USER}:{POSTGRES_PASSWORD}@{container_host}:{container_port}/{POSTGRES_DB}", + path=container.get_connection_url(), sqlalchemy_config_kwargs={"echo": False, "pool_pre_ping": True}, )