Skip to content

Commit

Permalink
moved everything from env/ into gymlib/
Browse files Browse the repository at this point in the history
  • Loading branch information
wangpatrick57 committed Dec 30, 2024
1 parent efdd802 commit 0c01d07
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 24 deletions.
Empty file removed env/__init__.py
Empty file.
Empty file removed env/tests/__init__.py
Empty file.
File renamed without changes.
8 changes: 4 additions & 4 deletions env/replay.py → gymlib_package/gymlib/replay.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from collections import defaultdict
from pathlib import Path

from gymlib.pg_conn import PostgresConn
from gymlib.tuning_artifacts import TuningArtifactsReader
from gymlib.workload import Workload
from gymlib.workspace import DBGymWorkspace

from env.pg_conn import PostgresConn
from env.tuning_artifacts import TuningArtifactsReader
from env.workload import Workload
from util.pg import DEFAULT_POSTGRES_PORT
from dbms.postgres.cli import DEFAULT_POSTGRES_PORT


def replay(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
get_workload_suffix,
get_workload_symlink_path,
)
from gymlib.tuning_artifacts import TuningMetadata
from gymlib.workspace import (
DBGymWorkspace,
fully_resolve_path,
get_tmp_path_from_workspace_path,
get_workspace_path_from_config,
)

from benchmark.tpch.constants import DEFAULT_TPCH_SEED
from env.tuning_artifacts import TuningMetadata


class GymlibIntegtestManager:
Expand All @@ -34,7 +33,9 @@ class GymlibIntegtestManager:
# These constants are also used by _set_up_gymlib_integtest_workspace.sh.
BENCHMARK = "tpch"
SCALE_FACTOR = 0.01
DBGYM_CONFIG_PATH = Path("env/tests/gymlib_integtest_dbgym_config.yaml")
DBGYM_CONFIG_PATH = Path(
"gymlib_package/gymlib/tests/gymlib_integtest_dbgym_config.yaml"
)
WORKSPACE_PATH: Optional[Path] = None

@staticmethod
Expand All @@ -50,7 +51,7 @@ def set_up_workspace() -> None:
# This if statement prevents us from setting up the workspace twice, which saves time.
if not GymlibIntegtestManager.WORKSPACE_PATH.exists():
subprocess.run(
["./env/tests/_set_up_gymlib_integtest_workspace.sh"],
["./gymlib_package/gymlib/tests/_set_up_gymlib_integtest_workspace.sh"],
env={
"BENCHMARK": GymlibIntegtestManager.BENCHMARK,
"SCALE_FACTOR": str(GymlibIntegtestManager.SCALE_FACTOR),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import unittest

import psycopg
from gymlib.pg_conn import PostgresConn
from gymlib.tests.gymlib_integtest_util import GymlibIntegtestManager
from gymlib.workspace import DBGymWorkspace

from env.pg_conn import PostgresConn
from env.tests.gymlib_integtest_util import GymlibIntegtestManager
from util.pg import (
from dbms.postgres.cli import (
DEFAULT_POSTGRES_PORT,
get_is_postgres_running,
get_running_postgres_ports,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import unittest

from gymlib.workspace import DBGymWorkspace

from benchmark.tpch.constants import DEFAULT_TPCH_SEED
from env.replay import replay
from env.tests.gymlib_integtest_util import GymlibIntegtestManager
from env.tuning_artifacts import (
from gymlib.replay import replay
from gymlib.tests.gymlib_integtest_util import GymlibIntegtestManager
from gymlib.tuning_artifacts import (
DBMSConfigDelta,
IndexesDelta,
QueryKnobsDelta,
SysKnobsDelta,
TuningArtifactsWriter,
)
from gymlib.workspace import DBGymWorkspace

from benchmark.tpch.constants import DEFAULT_TPCH_SEED


class ReplayTests(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import unittest

from gymlib.workspace import DBGymWorkspace

from env.tests.gymlib_integtest_util import GymlibIntegtestManager
from env.tuning_artifacts import (
from gymlib.tests.gymlib_integtest_util import GymlibIntegtestManager
from gymlib.tuning_artifacts import (
DBMSConfigDelta,
IndexesDelta,
QueryKnobsDelta,
SysKnobsDelta,
TuningArtifactsReader,
TuningArtifactsWriter,
)
from gymlib.workspace import DBGymWorkspace


class PostgresConnTests(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import unittest

from gymlib.tests.gymlib_integtest_util import GymlibIntegtestManager
from gymlib.workload import Workload
from gymlib.workspace import DBGymWorkspace

from benchmark.tpch.constants import DEFAULT_TPCH_SEED, NUM_TPCH_QUERIES
from env.tests.gymlib_integtest_util import GymlibIntegtestManager
from env.workload import Workload


class WorkloadTests(unittest.TestCase):
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion gymlib_package/gymlib/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ def make_standard_dbgym_workspace() -> DBGymWorkspace:
default path of dbgym_config.yaml.
"""
dbgym_config_path = Path(os.getenv("DBGYM_CONFIG_PATH", "dbgym_config.yaml"))
assert dbgym_config_path == Path("env/tests/gymlib_integtest_dbgym_config.yaml")
assert dbgym_config_path == Path(
"gymlib_package/gymlib/tests/gymlib_integtest_dbgym_config.yaml"
)
dbgym_workspace_path = get_workspace_path_from_config(dbgym_config_path)
dbgym_workspace = DBGymWorkspace(dbgym_workspace_path)
return dbgym_workspace
Expand Down

0 comments on commit 0c01d07

Please sign in to comment.