Sorry, your browser cannot access this site
This page requires browser support (enable) JavaScript
Learn more >

After using devpod for a short while, I realized that I still needed a tool that could automatically install VS Code on a remote host via SSH without relying on containers, and then forward the port back to my local machine. So I started using Copilot to help me understand devpod’s code…

After interrogating Copilot for a while, I began to feel as frustrated as my former roommate – the explanations it gave were rarely correct, and the runnable examples it provided didn’t work at all… Eventually, I went back to the basics: giving it a file and having it explain bit by bit what objects were inside, what methods were available, and how I could use them (just without me copying the code into the chat box myself)…

After spending several weekends reading through the code, I once again realized that indeed everyone has ideas; it just depends on who has the ability to execute them…

Before I found devpod, when I wanted to write a program from scratch to quickly install VS Code, I outlined the features I needed to implement:

  1. The program should log in to a remote machine via SSH, check whether VS Code is already installed, and download it if not.
  2. Since executing commands via SSH to accomplish step 1 is cumbersome, I planned to write those functions into the main program and give the program the ability to upload itself to the remote machine, then verify the MD5 checksum.
  3. Because remote machines could be x86 or ARM, the project would need to compile executable files for all architectures at once, making it easy to transfer them from local to remote.
  4. The program should be able to forward remote machine ports to the local side. Using the host’s SSH program might cause compatibility issues, so I would need to use Golang’s SSH implementation.

Then I discovered that devpod had already done everything I thought of…

  1. VS Code installation support: devpod not only supports open‑vscode but also all common web IDEs, including RStudio.
  2. Self‑upload to remote: devpod places a copy of its own executable on the remote host and inside container workspaces, receives sub‑commands from the client, and executes various tasks through the agent sub‑command.
  3. Multi‑architecture support for remote machines: It doesn’t keep different architecture executables locally, but instead detects the remote host’s architecture and downloads the corresponding devpod binary.
  4. Using Golang’s SSH implementation: The port‑forwarding part uses golang.org/x/crypto/ssh.

Of course, even though devpod already provides so many ready‑made interfaces and examples, building on top of it for secondary development is not a simple task for me…

The biggest obstacle is that Go, as a statically‑typed language, still feels quite unfamiliar to me. After all, the languages I use daily are all weakly‑typed, script‑oriented languages, and many Go concepts are really hard for me to grasp…

Moreover, its syntax is quite different from the languages I’m used to… I even feel the gap is larger than between C# and Python. Much of it can’t be guessed, and with AI often being unhelpful, understanding the code is still quite slow… (and probably accompanied by many misunderstandings).

I hope I can persist until I have a basic demo. Wish me luck…

Comments

Please leave your comments here