From 650862e684e56498292c4edf69aec06e62572727 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 14 Jan 2025 16:57:20 +0000 Subject: [PATCH 01/11] update docs to note that status can apply to experiments as well --- mlos_bench/mlos_bench/environments/status.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mlos_bench/mlos_bench/environments/status.py b/mlos_bench/mlos_bench/environments/status.py index f3e0d0ea377..b6fd625a17e 100644 --- a/mlos_bench/mlos_bench/environments/status.py +++ b/mlos_bench/mlos_bench/environments/status.py @@ -2,13 +2,14 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # -"""Enum for the status of the benchmark/environment.""" +"""Enum for the status of the benchmark/environment Trial or Experiment. +""" import enum class Status(enum.Enum): - """Enum for the status of the benchmark/environment.""" + """Enum for the status of the benchmark/environment Trial or Experiment.""" UNKNOWN = 0 PENDING = 1 @@ -29,7 +30,7 @@ def is_good(self) -> bool: } def is_completed(self) -> bool: - """Check if the status of the benchmark/environment is one of {SUCCEEDED, + """Check if the status of the benchmark/environment Trial or Experiment is one of {SUCCEEDED, CANCELED, FAILED, TIMED_OUT}. """ return self in { @@ -40,25 +41,25 @@ def is_completed(self) -> bool: } def is_pending(self) -> bool: - """Check if the status of the benchmark/environment is PENDING.""" + """Check if the status of the benchmark/environment Trial or Experiment is PENDING.""" return self == Status.PENDING def is_ready(self) -> bool: - """Check if the status of the benchmark/environment is READY.""" + """Check if the status of the benchmark/environment Trial or Experiment is READY.""" return self == Status.READY def is_succeeded(self) -> bool: - """Check if the status of the benchmark/environment is SUCCEEDED.""" + """Check if the status of the benchmark/environment Trial or Experiment is SUCCEEDED.""" return self == Status.SUCCEEDED def is_failed(self) -> bool: - """Check if the status of the benchmark/environment is FAILED.""" + """Check if the status of the benchmark/environment Trial or Experiment is FAILED.""" return self == Status.FAILED def is_canceled(self) -> bool: - """Check if the status of the benchmark/environment is CANCELED.""" + """Check if the status of the benchmark/environment Trial or Experiment is CANCELED.""" return self == Status.CANCELED def is_timed_out(self) -> bool: - """Check if the status of the benchmark/environment is TIMED_OUT.""" + """Check if the status of the benchmark/environment Trial or Experiment is TIMED_OUT.""" return self == Status.FAILED From bdb5de14e09090d50a8f3d2ee2ab860c5268d384 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 14 Jan 2025 17:02:31 +0000 Subject: [PATCH 02/11] Adding additional columns to help support mlos_benchd_service - See #732 --- mlos_bench/mlos_bench/storage/sql/schema.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mlos_bench/mlos_bench/storage/sql/schema.py b/mlos_bench/mlos_bench/storage/sql/schema.py index e79c602131a..cdfdf293a6e 100644 --- a/mlos_bench/mlos_bench/storage/sql/schema.py +++ b/mlos_bench/mlos_bench/storage/sql/schema.py @@ -103,6 +103,16 @@ def __init__(self, engine: Engine | None): Column("root_env_config", String(1024), nullable=False), Column("git_repo", String(1024), nullable=False), Column("git_commit", String(40), nullable=False), + Column("ts_start", DateTime, nullable=False), + Column("ts_end", DateTime), + # Should match the text IDs of `mlos_bench.environments.Status` enum: + Column("status", String(self._STATUS_LEN), nullable=False), + # There may be more than one mlos_benchd_service running on different hosts. + # This column stores the hostname of the worker that picked up the experiment. + # They should use a transaction to update it to their own hostname when + # they start if and only if its NULL. + Column("experiment_worker_name", String(40), nullable=True, comment="Worker Hostname"), + Column("experiment_worker_id", Integer, nullable=True, comment="Worker Process ID"), PrimaryKeyConstraint("exp_id"), ) """The Table storing From 97a322b18daafba50aabc503d5581f89c8e60043 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 14 Jan 2025 17:05:56 +0000 Subject: [PATCH 03/11] format --- mlos_bench/mlos_bench/environments/status.py | 31 +++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/mlos_bench/mlos_bench/environments/status.py b/mlos_bench/mlos_bench/environments/status.py index b6fd625a17e..ca35b3473da 100644 --- a/mlos_bench/mlos_bench/environments/status.py +++ b/mlos_bench/mlos_bench/environments/status.py @@ -2,8 +2,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # -"""Enum for the status of the benchmark/environment Trial or Experiment. -""" +"""Enum for the status of the benchmark/environment Trial or Experiment.""" import enum @@ -30,8 +29,8 @@ def is_good(self) -> bool: } def is_completed(self) -> bool: - """Check if the status of the benchmark/environment Trial or Experiment is one of {SUCCEEDED, - CANCELED, FAILED, TIMED_OUT}. + """Check if the status of the benchmark/environment Trial or Experiment is one + of {SUCCEEDED, CANCELED, FAILED, TIMED_OUT}. """ return self in { Status.SUCCEEDED, @@ -41,25 +40,37 @@ def is_completed(self) -> bool: } def is_pending(self) -> bool: - """Check if the status of the benchmark/environment Trial or Experiment is PENDING.""" + """Check if the status of the benchmark/environment Trial or Experiment is + PENDING. + """ return self == Status.PENDING def is_ready(self) -> bool: - """Check if the status of the benchmark/environment Trial or Experiment is READY.""" + """Check if the status of the benchmark/environment Trial or Experiment is + READY. + """ return self == Status.READY def is_succeeded(self) -> bool: - """Check if the status of the benchmark/environment Trial or Experiment is SUCCEEDED.""" + """Check if the status of the benchmark/environment Trial or Experiment is + SUCCEEDED. + """ return self == Status.SUCCEEDED def is_failed(self) -> bool: - """Check if the status of the benchmark/environment Trial or Experiment is FAILED.""" + """Check if the status of the benchmark/environment Trial or Experiment is + FAILED. + """ return self == Status.FAILED def is_canceled(self) -> bool: - """Check if the status of the benchmark/environment Trial or Experiment is CANCELED.""" + """Check if the status of the benchmark/environment Trial or Experiment is + CANCELED. + """ return self == Status.CANCELED def is_timed_out(self) -> bool: - """Check if the status of the benchmark/environment Trial or Experiment is TIMED_OUT.""" + """Check if the status of the benchmark/environment Trial or Experiment is + TIMED_OUT. + """ return self == Status.FAILED From 978766c513c86cea7c14729d8a1f22abb70f74b8 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 14 Jan 2025 17:07:28 +0000 Subject: [PATCH 04/11] Add the alembic generated schema change script --- ...15b_adding_experiment_table_columns_to_.py | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py diff --git a/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py b/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py new file mode 100644 index 00000000000..9873a3ca842 --- /dev/null +++ b/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py @@ -0,0 +1,46 @@ +# +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +"""Adding Experiment table columns to support mlos_benchd service - See #732 + +Revision ID: 8928a401115b +Revises: f83fb8ae7fc4 +Create Date: 2025-01-14 17:06:36.181503+00:00 + +""" +# pylint: disable=no-member + +from collections.abc import Sequence + +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision: str = '8928a401115b' +down_revision: str | None = 'f83fb8ae7fc4' +branch_labels: str | Sequence[str] | None = None +depends_on: str | Sequence[str] | None = None + + +def upgrade() -> None: + """The schema upgrade script for this revision.""" + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('experiment', sa.Column('ts_start', sa.DateTime(), nullable=False)) + op.add_column('experiment', sa.Column('ts_end', sa.DateTime(), nullable=True)) + op.add_column('experiment', sa.Column('status', sa.String(length=16), nullable=False)) + op.add_column('experiment', sa.Column('experiment_worker_name', sa.String(length=40), nullable=True, comment='Worker Hostname')) + op.add_column('experiment', sa.Column('experiment_worker_id', sa.Integer(), nullable=True, comment='Worker Process ID')) + # ### end Alembic commands ### + + +def downgrade() -> None: + """The schema downgrade script for this revision.""" + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('experiment', 'experiment_worker_id') + op.drop_column('experiment', 'experiment_worker_name') + op.drop_column('experiment', 'status') + op.drop_column('experiment', 'ts_end') + op.drop_column('experiment', 'ts_start') + # ### end Alembic commands ### From bdd846277e463915cd7bd6aed5c7acd0ccd6e71d Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 14 Jan 2025 17:08:08 +0000 Subject: [PATCH 05/11] format --- ...15b_adding_experiment_table_columns_to_.py | 40 ++++++++++++------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py b/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py index 9873a3ca842..ce40d233e79 100644 --- a/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py +++ b/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py @@ -13,13 +13,12 @@ from collections.abc import Sequence -from alembic import op import sqlalchemy as sa - +from alembic import op # revision identifiers, used by Alembic. -revision: str = '8928a401115b' -down_revision: str | None = 'f83fb8ae7fc4' +revision: str = "8928a401115b" +down_revision: str | None = "f83fb8ae7fc4" branch_labels: str | Sequence[str] | None = None depends_on: str | Sequence[str] | None = None @@ -27,20 +26,33 @@ def upgrade() -> None: """The schema upgrade script for this revision.""" # ### commands auto generated by Alembic - please adjust! ### - op.add_column('experiment', sa.Column('ts_start', sa.DateTime(), nullable=False)) - op.add_column('experiment', sa.Column('ts_end', sa.DateTime(), nullable=True)) - op.add_column('experiment', sa.Column('status', sa.String(length=16), nullable=False)) - op.add_column('experiment', sa.Column('experiment_worker_name', sa.String(length=40), nullable=True, comment='Worker Hostname')) - op.add_column('experiment', sa.Column('experiment_worker_id', sa.Integer(), nullable=True, comment='Worker Process ID')) + op.add_column("experiment", sa.Column("ts_start", sa.DateTime(), nullable=False)) + op.add_column("experiment", sa.Column("ts_end", sa.DateTime(), nullable=True)) + op.add_column("experiment", sa.Column("status", sa.String(length=16), nullable=False)) + op.add_column( + "experiment", + sa.Column( + "experiment_worker_name", + sa.String(length=40), + nullable=True, + comment="Worker Hostname", + ), + ) + op.add_column( + "experiment", + sa.Column( + "experiment_worker_id", sa.Integer(), nullable=True, comment="Worker Process ID" + ), + ) # ### end Alembic commands ### def downgrade() -> None: """The schema downgrade script for this revision.""" # ### commands auto generated by Alembic - please adjust! ### - op.drop_column('experiment', 'experiment_worker_id') - op.drop_column('experiment', 'experiment_worker_name') - op.drop_column('experiment', 'status') - op.drop_column('experiment', 'ts_end') - op.drop_column('experiment', 'ts_start') + op.drop_column("experiment", "experiment_worker_id") + op.drop_column("experiment", "experiment_worker_name") + op.drop_column("experiment", "status") + op.drop_column("experiment", "ts_end") + op.drop_column("experiment", "ts_start") # ### end Alembic commands ### From 4486423469f0017e9790a907007f7aa30f3c9da8 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 14 Jan 2025 17:11:35 +0000 Subject: [PATCH 06/11] Improve docs --- mlos_bench/mlos_bench/storage/sql/alembic/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mlos_bench/mlos_bench/storage/sql/alembic/README.md b/mlos_bench/mlos_bench/storage/sql/alembic/README.md index dbd7271a207..ec35eb70f64 100644 --- a/mlos_bench/mlos_bench/storage/sql/alembic/README.md +++ b/mlos_bench/mlos_bench/storage/sql/alembic/README.md @@ -36,6 +36,13 @@ This document contains some notes on how to use [`alembic`](https://alembic.sqla > Normally this would be done with `alembic upgrade head`, but this command is convenient to ensure if will work with the `mlos_bench` command line interface as well. + Examine the results using something like: + + ```sh + sqlite3 mlos_bench.sqlite .schema + sqlite3 mlos_bench.sqlite "SELECT * FROM alembic_version;" + ``` + 1. If the migration script works, commit the changes to the [`mlos_bench/storage/sql/schema.py`](../schema.py) and [`mlos_bench/storage/sql/alembic/versions`](./versions/) files. > Be sure to update the latest version in the [`test_storage_schemas.py`](../../../tests/storage/test_storage_schemas.py) file as well. From eae33b656c40568624c273f90ac0280805f95fe0 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 14 Jan 2025 17:12:43 +0000 Subject: [PATCH 07/11] Update version in test file --- mlos_bench/mlos_bench/tests/storage/test_storage_schemas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlos_bench/mlos_bench/tests/storage/test_storage_schemas.py b/mlos_bench/mlos_bench/tests/storage/test_storage_schemas.py index e11ff8613d9..8a6c36e6bb3 100644 --- a/mlos_bench/mlos_bench/tests/storage/test_storage_schemas.py +++ b/mlos_bench/mlos_bench/tests/storage/test_storage_schemas.py @@ -12,7 +12,7 @@ # NOTE: This value is hardcoded to the latest revision in the alembic versions directory. # It could also be obtained programmatically using the "alembic heads" command or heads() API. # See Also: schema.py for an example of programmatic alembic config access. -CURRENT_ALEMBIC_HEAD = "f83fb8ae7fc4" +CURRENT_ALEMBIC_HEAD = "8928a401115b" def test_storage_schemas(storage: SqlStorage) -> None: From ea9b065c013a6898bcd3622a58aa1332d4547c12 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 14 Jan 2025 17:33:50 +0000 Subject: [PATCH 08/11] rename columns --- ...928a401115b_adding_experiment_table_columns_to_.py | 11 ++--------- mlos_bench/mlos_bench/storage/sql/schema.py | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py b/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py index ce40d233e79..ab1ed6bbe86 100644 --- a/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py +++ b/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py @@ -31,18 +31,11 @@ def upgrade() -> None: op.add_column("experiment", sa.Column("status", sa.String(length=16), nullable=False)) op.add_column( "experiment", - sa.Column( - "experiment_worker_name", - sa.String(length=40), - nullable=True, - comment="Worker Hostname", - ), + sa.Column("worker_name", sa.String(length=40), nullable=True, comment="Worker Hostname"), ) op.add_column( "experiment", - sa.Column( - "experiment_worker_id", sa.Integer(), nullable=True, comment="Worker Process ID" - ), + sa.Column("worker_pid", sa.Integer(), nullable=True, comment="Worker Process ID"), ) # ### end Alembic commands ### diff --git a/mlos_bench/mlos_bench/storage/sql/schema.py b/mlos_bench/mlos_bench/storage/sql/schema.py index cdfdf293a6e..864bf1f8144 100644 --- a/mlos_bench/mlos_bench/storage/sql/schema.py +++ b/mlos_bench/mlos_bench/storage/sql/schema.py @@ -111,8 +111,8 @@ def __init__(self, engine: Engine | None): # This column stores the hostname of the worker that picked up the experiment. # They should use a transaction to update it to their own hostname when # they start if and only if its NULL. - Column("experiment_worker_name", String(40), nullable=True, comment="Worker Hostname"), - Column("experiment_worker_id", Integer, nullable=True, comment="Worker Process ID"), + Column("worker_name", String(40), nullable=True, comment="Worker Hostname"), + Column("worker_pid", Integer, nullable=True, comment="Worker Process ID"), PrimaryKeyConstraint("exp_id"), ) """The Table storing From 2cc4c5dc9d4cf9312b84ae2dbba0bea2e1875393 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 14 Jan 2025 17:36:39 +0000 Subject: [PATCH 09/11] finish rename --- .../8928a401115b_adding_experiment_table_columns_to_.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py b/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py index ab1ed6bbe86..124401607a5 100644 --- a/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py +++ b/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py @@ -43,8 +43,8 @@ def upgrade() -> None: def downgrade() -> None: """The schema downgrade script for this revision.""" # ### commands auto generated by Alembic - please adjust! ### - op.drop_column("experiment", "experiment_worker_id") - op.drop_column("experiment", "experiment_worker_name") + op.drop_column("experiment", "worker_pid") + op.drop_column("experiment", "worker_name") op.drop_column("experiment", "status") op.drop_column("experiment", "ts_end") op.drop_column("experiment", "ts_start") From 65d746f0acb053260f8669d4ec1ea0a017f11879 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Tue, 14 Jan 2025 17:36:57 +0000 Subject: [PATCH 10/11] need to make new columns nullable by default --- ...8928a401115b_adding_experiment_table_columns_to_.py | 4 ++-- mlos_bench/mlos_bench/storage/sql/schema.py | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py b/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py index 124401607a5..51bbfaf60f6 100644 --- a/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py +++ b/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py @@ -26,9 +26,9 @@ def upgrade() -> None: """The schema upgrade script for this revision.""" # ### commands auto generated by Alembic - please adjust! ### - op.add_column("experiment", sa.Column("ts_start", sa.DateTime(), nullable=False)) + op.add_column("experiment", sa.Column("ts_start", sa.DateTime(), nullable=True)) op.add_column("experiment", sa.Column("ts_end", sa.DateTime(), nullable=True)) - op.add_column("experiment", sa.Column("status", sa.String(length=16), nullable=False)) + op.add_column("experiment", sa.Column("status", sa.String(length=16), nullable=True)) op.add_column( "experiment", sa.Column("worker_name", sa.String(length=40), nullable=True, comment="Worker Hostname"), diff --git a/mlos_bench/mlos_bench/storage/sql/schema.py b/mlos_bench/mlos_bench/storage/sql/schema.py index 864bf1f8144..eb5f12f0783 100644 --- a/mlos_bench/mlos_bench/storage/sql/schema.py +++ b/mlos_bench/mlos_bench/storage/sql/schema.py @@ -103,16 +103,18 @@ def __init__(self, engine: Engine | None): Column("root_env_config", String(1024), nullable=False), Column("git_repo", String(1024), nullable=False), Column("git_commit", String(40), nullable=False), - Column("ts_start", DateTime, nullable=False), + # For backwards compatibility, we allow NULL for ts_start. + Column("ts_start", DateTime), Column("ts_end", DateTime), # Should match the text IDs of `mlos_bench.environments.Status` enum: - Column("status", String(self._STATUS_LEN), nullable=False), + # For backwards compatibility, we allow NULL for status. + Column("status", String(self._STATUS_LEN)), # There may be more than one mlos_benchd_service running on different hosts. # This column stores the hostname of the worker that picked up the experiment. # They should use a transaction to update it to their own hostname when # they start if and only if its NULL. - Column("worker_name", String(40), nullable=True, comment="Worker Hostname"), - Column("worker_pid", Integer, nullable=True, comment="Worker Process ID"), + Column("worker_name", String(40), comment="Worker Hostname"), + Column("worker_pid", Integer, comment="Worker Process ID"), PrimaryKeyConstraint("exp_id"), ) """The Table storing From 5cb2bdb6545712e63485b9b1ec7222a1512b8e2d Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 16 Jan 2025 17:15:27 -0600 Subject: [PATCH 11/11] rename columns --- ...8a401115b_adding_experiment_table_columns_to_.py | 13 +++++++++---- mlos_bench/mlos_bench/storage/sql/schema.py | 7 ++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py b/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py index 51bbfaf60f6..40e8f97d8e9 100644 --- a/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py +++ b/mlos_bench/mlos_bench/storage/sql/alembic/versions/8928a401115b_adding_experiment_table_columns_to_.py @@ -31,11 +31,16 @@ def upgrade() -> None: op.add_column("experiment", sa.Column("status", sa.String(length=16), nullable=True)) op.add_column( "experiment", - sa.Column("worker_name", sa.String(length=40), nullable=True, comment="Worker Hostname"), + sa.Column( + "driver_name", + sa.String(length=40), + nullable=True, + comment="Driver Host/Container Name", + ), ) op.add_column( "experiment", - sa.Column("worker_pid", sa.Integer(), nullable=True, comment="Worker Process ID"), + sa.Column("driver_pid", sa.Integer(), nullable=True, comment="Driver Process ID"), ) # ### end Alembic commands ### @@ -43,8 +48,8 @@ def upgrade() -> None: def downgrade() -> None: """The schema downgrade script for this revision.""" # ### commands auto generated by Alembic - please adjust! ### - op.drop_column("experiment", "worker_pid") - op.drop_column("experiment", "worker_name") + op.drop_column("experiment", "driver_pid") + op.drop_column("experiment", "driver_name") op.drop_column("experiment", "status") op.drop_column("experiment", "ts_end") op.drop_column("experiment", "ts_start") diff --git a/mlos_bench/mlos_bench/storage/sql/schema.py b/mlos_bench/mlos_bench/storage/sql/schema.py index eb5f12f0783..2bc00f00825 100644 --- a/mlos_bench/mlos_bench/storage/sql/schema.py +++ b/mlos_bench/mlos_bench/storage/sql/schema.py @@ -110,11 +110,12 @@ def __init__(self, engine: Engine | None): # For backwards compatibility, we allow NULL for status. Column("status", String(self._STATUS_LEN)), # There may be more than one mlos_benchd_service running on different hosts. - # This column stores the hostname of the worker that picked up the experiment. + # This column stores the host/container name of the driver that + # picked up the experiment. # They should use a transaction to update it to their own hostname when # they start if and only if its NULL. - Column("worker_name", String(40), comment="Worker Hostname"), - Column("worker_pid", Integer, comment="Worker Process ID"), + Column("driver_name", String(40), comment="Driver Host/Container Name"), + Column("driver_pid", Integer, comment="Driver Process ID"), PrimaryKeyConstraint("exp_id"), ) """The Table storing