Skip to content
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

Add missing project SSH key to on-prem instances #1716

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

un-def
Copy link
Collaborator

@un-def un-def commented Sep 23, 2024

Fixes: #1640

@r4victor
Copy link
Collaborator

It'd be nice to refactor the code to use project.ssh_private_key when connecting to remote instances such as here:

server_ssh_private_key = project.ssh_private_key
if (
job_model.instance is not None
and job_model.instance.remote_connection_info is not None
and job_provisioning_data.dockerized
):
remote_conn_info: RemoteConnectionInfo = RemoteConnectionInfo.__response__.parse_raw(
job_model.instance.remote_connection_info
)
server_ssh_private_key = remote_conn_info.ssh_keys[0].private

It may not be ideal doing in this release since it may break connecting to old instances. @un-def, maybe leave TODOs for that?

@jvstme
Copy link
Collaborator

jvstme commented Sep 24, 2024

This may also mean that other project users cannot use the on-prem instance for any runs but it needs to be verified.

@un-def, if this is still the case, please also add a new issue to fix it later by using the project key for remote instance connections from server and CLI.

@un-def
Copy link
Collaborator Author

un-def commented Sep 24, 2024

@jvstme, it is not and was not the case, when a run is submitted to the shim, the user's public key (either provided by the user or generated by dstack), which is a part of the submitted task body, is dynamically added to authorized_keys.

The project key, as far as I understand, it's not even available to the user.

@un-def un-def merged commit fe272d3 into master Sep 24, 2024
23 checks passed
@un-def un-def deleted the issue_1640_fix_gateway_on_prem_instance_ssh_key branch September 24, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Cannot run services on on-prem instances
3 participants