IDE / editor with a local editor via mirroring / sync
So far online IDE's have not been very popular. The team members of GitLab prefer to use their existing local editor, even when working on a remote development environment.
Instead of putting the online editor first https://gitlab.com/gitlab-org/gitlab-ce/issues/22863 we can alterntively have the local editor as the primary use case.
The advantage of a local editor and a remote development environment over a completely local environment using docker are:
- Use a similar environment as production
- Quickly switch between projects (no need to boot them, they are running already)
- Use less RAM
- Use less CPU
- Use less battery
- Have more horsepower available (mostly RAM)
- Easy to share the same edits in realtime with a team member
When using a VM the advantages are not as big. It takes time to spin up and is commonly as powerful as a laptop. Only now that we have container schedulers the load can be spread among machines. Apart from running faster it can also make tests and builds faster by parallelizing them. An 'online IDE' is not about online editing nor about a special development environment. It is about running your environment in the cloud. But the editor can be local and it should resemble production instead of a special development environment. Also see https://gitlab.com/gitlab-org/gitlab-ce/issues/23966
The requirements are:
- Sync with the remote filesystem
- Easy to set up
- Boring technology
- Reusable for the online editor
- Preferably no unfamiliar client on my system
I propose to use unison, a proven, familiar, and popular cross-platform file synching solution. It is easy to install on many platforms, for example on MacOS it as a homebrew formula.
We show the user a list of commands to set up unison and a mirrored directory.
- Remote usage requires an ssh connection http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html to the container
- Probably we'll have to establish a tunnel https://github.com/koding/tunnel to reach the container
- You have to monitor the filesystem with something like fswatch (inspired by https://github.com/leighmcculloch/docker-unison ) to run unison
It seems that Koding already solved these problems so maybe we can reuse the kd client. The Koding KD client as detailed on http://www.koding.com/docs/connect-your-machine is something I can't find the source code of. I tried following https://kodi.ng/d/kd to https://koding-kd.s3.amazonaws.com but https://github.com/koding/kd seems to be something different (a UI framework) as does https://github.com/koding/broker-client
- Only offer an online IDE
- Use the terminal solution for executing commands on the docker container to start and sync unison
- Run the web editor web server on the container itself