Skip to content

Enable SSH into the ov container #4828

Open

Description

Problem

It is possible to set up IDEs like VSCode to a remote host, where you can run plugins and use the remote host's language tools for IDE extensions. This is useful, for example, to enable using the VSCode python plugin with the Python installation inside the ov container, including autocompletion, and go to definition for libraries, without needing to also run pdm install on your host system.

Description

I have just tried this on my computer and it works well, but there's a bit of setup involved. It would be good to have the setup and configuration automated in the root ov bash script. To get this working, the minimum requirements are:

  1. Install the openssh-server package: dnf install openssh-server.
  2. For Linux hosts, add a user with a login shell in the container matching the host user. For macOS hosts, they will log into the container as root, so SSHd needs to be configured to allow root logins (set PermitRootLogin yes in /etc/ssh/sshd_config in the ov container). Also change the port to 2200, and consider changing the permitted host to prevent access outside the docker network.
  3. Run ssh-keygen in the container
  4. If the host has an SSH key, copy the public key into the authorised keys file in ov. Alternatively, we can add a password to the user in ov (see step 2 for choosing the user) and set it to openverse or something.

That should make it possible to SSH into the ov container. In VSCode, you can take advantage of this using the remote SSH plugin. VSCode has a proprietary one, and this one works perfectly for vscodium. Once inside VSCode, you can install plugins in the ov container and things work just like they would on the host machine.

It looks like JetBrains IDEs have a similar kind of setup that would enable using the interpreters inside the container. IIRC @AetherUnbound you mentioned wanting to look into this. Did you ever get a chance to do so/do you know if any additional setup would be needed for PyCharm? At a glance it looks like the requirements are just having SSH, like VSCode's requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    🌟 goal: additionAddition of new feature🟩 priority: lowLow priority and doesn't need to be rushed🤖 aspect: dxConcerns developers' experience with the codebase🧱 stack: infraRelated to the Terraform config and other infrastructure

    Type

    No type

    Projects

    • Status

      📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions