Skip to content

Commit

Permalink
rename columns
Browse files Browse the repository at this point in the history
  • Loading branch information
bpkroth committed Jan 16, 2025
1 parent 65d746f commit 5cb2bdb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,25 @@ 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 ###


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")
Expand Down
7 changes: 4 additions & 3 deletions mlos_bench/mlos_bench/storage/sql/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5cb2bdb

Please sign in to comment.