-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] Remove backward compatibility code for 0.6.0 & 0.7.0 #4175
Conversation
I pushed a commit that should cover the 0.7.0 removals. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sky/serve/serve_state.py
Outdated
@@ -34,7 +34,7 @@ def _get_db_path() -> str: | |||
def create_table(cursor: 'sqlite3.Cursor', conn: 'sqlite3.Connection') -> None: | |||
"""Creates the service and replica tables if they do not exist.""" | |||
|
|||
# auto_restart column is deprecated. | |||
# auto_restart adn requested_resources column is deprecated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also remove the auto_restart
and requested_resources
columns when creating the table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would break the logic here:
skypilot/sky/serve/serve_state.py
Lines 324 to 348 in ee708e7
def _get_service_from_row(row) -> Dict[str, Any]: | |
(current_version, name, controller_job_id, controller_port, | |
load_balancer_port, status, uptime, policy, _, requested_resources, | |
requested_resources_str, _, active_versions) = row[:13] | |
return { | |
'name': name, | |
'controller_job_id': controller_job_id, | |
'controller_port': controller_port, | |
'load_balancer_port': load_balancer_port, | |
'status': ServiceStatus[status], | |
'uptime': uptime, | |
'policy': policy, | |
# The version of the autoscaler/replica manager are on. It can be larger | |
# than the active versions as the load balancer may not consider the | |
# latest version to be active for serving traffic. | |
'version': current_version, | |
# The versions that is active for the load balancer. This is a list of | |
# integers in json format. This is mainly for display purpose. | |
'active_versions': json.loads(active_versions), | |
# TODO(tian): Backward compatibility. | |
# Remove after 2 minor release, 0.6.0. | |
'requested_resources': pickle.loads(requested_resources) | |
if requested_resources is not None else None, | |
'requested_resources_str': requested_resources_str, | |
} |
I think managed spot also keeps those columns for similar reasons:
Lines 41 to 69 in ee708e7
# === Database schema === | |
# `spot` table contains all the finest-grained tasks, including all the | |
# tasks of a managed job (called spot for legacy reason, as it is generalized | |
# from the previous managed spot jobs). All tasks of the same job will have the | |
# same `spot_job_id`. | |
# The `job_name` column is now deprecated. It now holds the task's name, i.e., | |
# the same content as the `task_name` column. | |
# The `job_id` is now not really a job id, but a only a unique | |
# identifier/primary key for all the tasks. We will use `spot_job_id` | |
# to identify the spot job. | |
# TODO(zhwu): schema migration may be needed. | |
_CURSOR.execute("""\ | |
CREATE TABLE IF NOT EXISTS spot ( | |
job_id INTEGER PRIMARY KEY AUTOINCREMENT, | |
job_name TEXT, | |
resources TEXT, | |
submitted_at FLOAT, | |
status TEXT, | |
run_timestamp TEXT CANDIDATE KEY, | |
start_at FLOAT DEFAULT NULL, | |
end_at FLOAT DEFAULT NULL, | |
last_recovered_at FLOAT DEFAULT -1, | |
recovery_count INTEGER DEFAULT 0, | |
job_duration FLOAT DEFAULT 0, | |
failure_reason TEXT, | |
spot_job_id INTEGER, | |
task_id INTEGER DEFAULT 0, | |
task_name TEXT)""") | |
_CONN.commit() |
Co-authored-by: Romil Bhardwaj <romil.bhardwaj@berkeley.edu>
Also removed several other backward compatibility items. PTAL. Running tests now |
@cblmemo I did not remove the ones that said "after 0.7.0" since I assume that meant they should be kept in for 0.7.0 and removed for the next release. @Michaelvll @romilbhardwaj what did you intend here? |
Thanks @cblmemo and @cg505. I think it's fine to remove those which said "after 0.7.0" - the intent was "in 0.7.0". We should be more specific in our comments in the future. One quick note @cblmemo - for using facing APIs that we are removing ( |
SG! QQ: Does those error messages also need to be removed after 2 minor release, eg. 0.9.0? |
Probably not after 2 minor releases - removal messages should stay for some time. If we can have them tracked in a dictionary (e.g., something like |
Oh actually, those serve related interface have been disabled for 2 minor versions (and suggested to change to other API), and the part of code I removed is exactly those "quick error message", so I think it is the time to remove those quick error msg now? Not sure about the instance tags though. |
We could discuss on whether to remove those API or not in this release :) |
I tried backward compatibility tests and found an error on latest master - issued in #4179. |
TODO: revert instance_tag and move to 0.8.0 |
This reverts commit 34c28e9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @romilbhardwaj ! The backward compatibility test just passed. Do you think we need smoke test as well? |
After an offline discussion we determined to merging now 🫡 |
Try to remve backward compatibility code for 0.6.0 & 0.7.0
Tested (run the relevant ones):
bash format.sh
pytest tests/test_smoke.py
pytest tests/test_smoke.py::test_fill_in_the_name
conda deactivate; bash -i tests/backward_compatibility_tests.sh