Dev Desktops - Rust Forge
Keyboard shortcuts Press ← or → to navigate between chapters Press S or / to search in the book Press ? to show this help Press Esc to hide this help Rust Forge Dev Desktops The dev desktops provide maintainers and contributors to the Rust Project with free access to high-powered cloud compute. They are part of the Cloud Compute Program by the Rust Foundation . Machine Architecture Perf enabled Location dev-desktop-eu-1 aarch64 Yes Germany dev-desktop-us-1 aarch64 Yes N.
Virginia, US dev-desktop-eu-2 amd64 No Belgium dev-desktop-us-2 amd64 No Iowa, US How to apply to the program At this time, access to the program and the compute instances is selectively granted, primarily to Project maintainers and contributors from open-source programs like Google Summer of Code. While the program is under development, it is limited to certain teams . If you are in one of these teams, you should automatically have access.
If you feel like your work on the Rust project would be significantly improved by access to a powerful build machine, open a pull request in the team repo , where you add yourself to the cloud-compute team. Include a short description of how you would use and benefit from the dev desktops. You can find an example of such a PR here . If a maintainer from one of the Rust project teams is happy to vouch for your contributions, the Infra team is generally happy to accept the request as per the endorsement.
Otherwise, the Infra team will evaluate the access request on a case-by-case basis. How to connect to a dev desktop Each user has their own account on the dev desktops. The account is named after the user’s GitHub handle, with gh- as a prefix. For example, a user with the GitHub handle user will have a user account with the name gh-user on the dev desktop. Note that the GitHub handle is case-sensitive, so gh-User and gh-user are treated as distinct accounts.
Users can connect to the dev desktop with SSH. The dev desktops use public key authentication, and automatically fetch the user’s public keys from GitHub. You can connect to the instance with the following command: ssh gh-<your-username>@<name>.infra.rust-lang.org Replace <name> with the machine name from the table at the top of the page. For example, connect to dev-desktop-eu-1 using the hostname dev-desktop-eu-1.infra.rust-lang.org .
If you don’t have a public key on GitHub, read the following guides that explain how to create an SSH key and add it to your GitHub account. It might take a few minutes after the key has been added before the dev desktops get updated. Generating a new SSH key and adding it to the ssh-agent Adding a new SSH key to your GitHub account To make the command easier, you can configure an alias in your ~/.ssh/config like so: Host rustvm User gh-<your-username> HostName <name>.infra.rust-lang.org Then you can connect with ssh rustvm .
SSH host key fingerprints When connecting to a dev desktop for the first time, you should verify the SSH host key fingerprint. The following fingerprints are used by the dev desktops. Machine ED25519 dev-desktop-eu-1 SHA256:QPuC8ODm+no9wjAtrSMCuqj+iGXsFI5ZGR3C+nX7Im0 dev-desktop-us-1 SHA256:UOZn6OKFrCRt+CLPl5fHZd93Tym4ckBrr8rgfgEPT5g dev-desktop-eu-2 SHA256:biz6c8LJ6cdb6Ku9mlELzl1qh8sODZWtpNfAJPxBi2I dev-desktop-us-2 SHA256:57s6k2sgArca2rlrYiDUMjumVMiL7PF68zkjmYwD3bI You can verify the fingerprint by running this script and compare the output with the table above: ssh-keygen -lf <(ssh-keyscan -t ed25519 <name>.infra.rust-lang.org 2>/dev/null | grep -v '^#') For convenience, the host keys are also available as known_hosts entries: dev-desktop-eu-1.infra.rust-lang.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAIIWlDvWkMEX8XIu6lxvd4cFOxeFUpH4ZReKuyS3h9l dev-desktop-us-1.infra.rust-lang.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEj0DZ/r/Sq5GdK8j80rNjCs6ctwptcHnFvP3bdjhv/5 dev-desktop-eu-2.infra.rust-lang.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOmnv10fXAimjPPfwiutVmJifRS+85rmN/zyIP/QNby6 dev-desktop-us-2.infra.rust-lang.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFp7jUvbqkGIswNRDaVy+eb2cHDJHJG7aCs1omwjpEm+ How to set up your account When connecting to the machine for the first time, there are a few things you might want to do.
First, check that your Git username and email are configured correctly. git config -l --global You can configure your username and email address with: git config --global user.name "Your name" git config --global user.email "your-email" How to customize your shell You can set your default shell on the dev desktops by adding yourself to a configuration file in the rust-lang/simpleinfra repository. Open ansible/roles/dev-desktop/defaults/main.yml , look for the variable vars_user_config , and add yourself to the list. vars_user_config: - username: gh-jdno shell: /usr/bin/zsh - username: gh-WaffleLapkin shell: /usr/bin/fish Open a pull request and request a review from @rust-lang/infra (or ping us in #t-infra on Zulip).
After the pull request is merged, an infrastructure admin has to deploy the new configuration to the dev desktops. Only after that will your default shell be changed. How to install a Rust toolchain The dev desktops don’t have Rust pre-installed, but instead make it easy to install a specific toolchain from a local repository or worktree. First, you want to run the following command to install rustup : /usr/local/bin/init.sh If you don’t want or need to work with your own version of Rust, you can skip the next section and start working.
If you haven’t done so yet, open the rust-lang/rust repository on GitHub and create a fork in your personal account. Then connect to the dev desktop and run the following script: /usr/local/bin/setup_rust.sh The script will clone your personal fork to the dev desktop, check out the latest version from rust-lang/rust , and compile it. Once that’s done, it will link the stages so that you can work with them locally.
The directory contains more scripts to manage worktrees and Rust versions. Run help.sh to get a list and a short description of them. How to interact with GitHub The dev desktops are designed to work with repositories on GitHub that belong to your user account. A GitHub App is used to protect your credentials and give you granular control over the repositories that the dev desktops can access. First, go to https://github.com/apps/rust-cloud-vms to give the app access to your repositories.
It’s recommended to only grant access to the repositories that you want to use on the dev desktop, e.g. your fork of rust-lang/rust . Then connect to the dev desktop and clone the repository that you want to work on with HTTPS. From there, you can work with the repository like you would normally do. Under the hood, the GitHub App acts as a credentials helper for Git and generates temporary access tokens that are scoped to the permissions that you have granted the application.
If you get an error, review the permissions and ensure that the app is allowed to access your repository. How to set up remote development in Visual Studio Code Most modern code editors provide support for remote development via SSH. This can be used to write code locally, but execute it inside the dev desktop. While the configuration will differ slightly, the following example for Visual Studio Code should be applicable to other editors as well.
Setting up remote development with VS Code is pretty straightforward, and is described in detail in VS Code’s documentation: Remote Development using SSH . In summary: SSH into the dev desktop and clone the repository that you want to work on to a local folder Then open VS Code on your machine and install the Remote Development Extension Pack Open the command palette and search for “Remote-SSH: Connect to host” Enter your username and the instance name ( gh-<your-username>@<instance> ) Select the path for the cloned repository from step 1 Install any extensions that you want to run on the server (e.g. rust-analyzer) Use VS Code to run or debug the code
The rest of this page is on the live site.