run-gp
Run local workspaces using the .gitpod.yml
run-gp
is a CLI tool for running workspaces based on a .gitpod.yml
file locally on your machine. Using a local working copy it produces a workspace image, and starts that workspace. This provides an experience akin to a regular Gitpod workspace.
Warning This is an experiment. When you find an issue, please report it so that we can improve this project.
Note
run-gp
is not the "real Gitpod experience". Gitpod offers remote development environments which sport many benefits compared to running things locally. Head over to https://www.gitpod.io to find out more.
Features
-
✅ Image Build:run-gp
produces a workspace image based on theimage
section in the.gitpod.yml
. If no such section exists,gitpod/workspace-full:latest
is used. -
✅ Browser Access: by default we'll start Open VS Code server to provide an experience akin to a regular Gitpod workspace. This means that arun-gp
workspace is accessible from your browser. -
✅ SSH Access: if your user has an SSH key (~/.ssh/id_rsa.pub
file) present, the run-gp workspace will sport an SSH server with an appropriate entry in authorized_keys. This means that you can just SSH into therun-gp
workspace, e.g. from a terminal or using VS Code. -
✅ VS Code extension installation: VS Code extensions specified in the.gitpod.yml
will be installed when the workspace starts up. Those extensions are downloaded from Open VSX, much like on gitpod.io. -
✅ Tasks configured in the.gitpod.yml
will run automatically on startup. -
✅ Ports configured in the.gitpod.yml
will be made available on startup. There is no dynamic port exposure you might expect from a Gitpod workspace. -
✅ Airgapped startup so that other the image that's configured for the workspace no external assets need to be downloaded. It's all in therun-gp
binary. -
✅ Auto-Update which keepsrun-gp
up to date without you having to worry about it. This can be disabled - see the Config section below. -
⚠️ Docker-in-Docker depends on the environment you userun-gp
in. It does not work yet on MacOS and whenrun-gp
is used from within a Gitpod workspace. -
⚠️ JetBrains Gateway support also depends on the environmentrun-gp
is used in. It is known NOT to work on arm64 MacOS. -
⏳ gp
CLI is coming in a future release. -
❌ Gitpod Prebuilds are unsupported because this tool is completely disconnected from gitpod.io. -
❌ Gitpod Backups are unsupported because this tool is completely disconnected from gitpod.io.
Getting Started
- Download the [latest release](https://github.com/gitpod-io/run-gp/releases/latest).
If you're on MacOS you'll need to jump through hoops because the run-gp releases are not signed.
MacOS requires that binaries downloaded using a browser must be [signed and notarized](https://developer.apple.com/developer-id/). Otherwise you won't be able to just execute the `run-gp` command. If you download the release using `curl` in a terminal, MacOS will just let you execute the binary. Alternatively, you can head over to the `Security` system settings and allow the binary to run once MacOS denied this on the first attempt. -
In a terminal navigate to a directory containing a
.gitpod.yml
file, e.g. a Git working copy of a repository, then executerun-gp
.git clone https://github.com/gitpod-io/go-gin-app cd go-gin-app run-gp
Note: The
run-gp
command will use the current working directory as context. To point it to a different directory, use the-w
option. - Once the workspace is ready, open the URL displayed in the terminal.
Configuration
run-gp
does not have a lot of configuration settings, as most thinsg are determined by the .gitpod.yml
. You can find the location of the configuration file using
run-gp config path
Auto Update behaviour
By default run-gp
will automatically update itself to the latest version. It does that by checking the GitHub releases of the run-gp repository for a new release. To disable this behaviour run:
run-gp config set autoUpdate.enabled false
Telemetry
By default run-gp
will send anonymous telemetry. We never send identifiable details such as usernames, URLs or the like. You can review all data ever being transmitted in the sources. To disable telemetry run:
run-gp config set telemetry.enabled false
run-gp
respects Console Do Not Track, i.e. export DO_NOT_TRACK=1
will also disable telemetry.
Frequently Asked Questions
-
This readme refers to
run-gp
as experiment. What does that mean?This means that
run-gp
is not a polished product. Instead it's an attempt to ship a🛹 , i.e. an MVP that explores how local Gitpod-like workspaces would look like. This repository is not backed by a regular product team, but instead a product exploration effort. -
The performacne on my M1 Mac is terrible, what can I do?
Until the release of MacOS 13, Docker Desktop (and any other Linux VM) will be rather slow on arm64 hardware. It's unlikely we'll produce an arm64 version of Gitpod before (if ever) MacOS 13 comes out. Your best chance is to find an x86 machine, or wait for the release of MacOS 13.
Messy but effective option to just build the image.
Description
Added CLI option to not start the image once built.
Related Issue(s)
use the tool to allow automated creation of docker images which can then be transfered into an airgapped environment.
Fixes #
How to test
use the badge to start run-gp in gitpod ./run-gp run --do-not-run docker images see that the image was created but that you are still in your original gitpod environment.
Release Notes
```CLI Option
--do-not-start
created to stop after image creationGetting started fails on Windows 11
Describe the bug
Following Getting Started with v0.1.5 on Windows 11 output the following error message
To Reproduce Steps to reproduce the behavior:
.gitpod.yml
run-gp_0.1.5_Windows_amd64.exe
from the release pagerun-gp_0.1.5_Windows_amd64.exe
in the local clone folderrun-gp_0.1.5_Windows_amd64.exe
Expected behavior Once the workspace is ready, a URL should be displayed in the terminal.
Desktop (please complete the following information):
Additional context Docker version 20.10.16, build aa7e414
Make MacOS binaries easier to execute
Is your feature request related to a problem? Please describe. The
run-gp
binary isn't signed which means that users need to go through several steps (which they need to discover themselves) beforerun-gp
works for them. That's far from smooth.Describe the solution you'd like Several ways we could solve this (ordered by expected effort):
curl
in the binary to circumvent the issue, and offering a loom on how to navigate the security settings.[Experimental] Improvements on docker + logs
Description
This PR adds:
preflight
, this is useful when the go program fails to stop the docker containerRelated Issue(s)
Fixes #
How to test
Release Notes
Documentation
Make auto-update behaviour clearer
Description
Related Issue(s)
Fixes #25
How to test
Release Notes
Documentation
Post auto-update behaviour is unclear
Describe the bug I.e. if the new version is used right away, or if a restart is required.
Expected behavior The new version should be used right away.
Remove local/ suffix from docker tag name
Description
local/ suffix fails on Windows with invalid argument "local\workspace-image:latest" for "-t, --tag" flag: invalid reference format
Related Issue(s)
Fixes #22
How to test
Follow Getting started from the README on a Windows 11 machine
Release Notes
Documentation
Support starting a workspace from directories without a .gitpod.yml
Is your feature request related to a problem? Please describe. Today the workdir needs to have a
.gitpod.yml
for run-gp to work.Describe the solution you'd like Calling
run-gp
on a directory without a.gitpod.yml
could search up the directory tree for such a file. If it doesn't find one, we'd start with an "empty" default config.[docs] The workdir flag may be confusing
Is your feature request related to a problem? Please describe. Today one needs to know of the workdir concept, and that
run-gp
implicitly uses the current directory - much likeyarn
orgo
. If that workdir needs to be changed, one can do that with-w
. This is not always clear to users as exemplified here:Describe the solution you'd like We should provide clear documentation as to the behaviour of
run-gp
. Considering that the directory is not mandatory, it makes sense to keep it as a flag.Wrong workspace folder when no `checkoutLocation` is specified
Describe the bug Logged workspace location of run-gp is not correct (always http://localhost:8080/?folder=/workspace, but we need http://localhost:8080/?folder=/workspace/<folder_name>
To Reproduce Steps to reproduce the behaviour:
/workspace/run-gp
instead of/workspace
Write a readme
which explains
Fix #40
Description
This keeps track of the allocated host ports in the
docker run
command and reports conflicts with (as best it can) where they came from. Related to that, in actually checks that theport:
value in.gitpod.yml
is in fact anint
rather than just assuming it so. Finally, it also stops swallowing err from the actual Start Workspace invocationRelated Issue(s)
Fixes #40
How to test
main
.gitpod.yml
Release Notes
Documentation
lax port management causes confusing error messages
Describe the bug
Because the
docker run
uses multiple host ports, including potentially user-declared ones from.gitpod.yml
, it can easily get into a situation where they conflict. However, the reported error to the user iswithout any context of why that happened or what action the user can take to resolve it
To Reproduce Steps to reproduce the behavior:
.gitpod.yml
run-gp
(optionally with a bunch of--verbose
to see what's up)docker run -p 8080:22999 ... -p 8080:8080 workspace-image:latest
(it could have happened with the SSHPort, also, it just happened that the getting-started repo and the default IDEPort collidedExpected behavior
My patched version emits:
because:
StartWorkspace
func keeps track of host port allocation and asserts they do not collideRunE go func stops swallowing err
docker run
command to even start to investigate this bugScreenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context As mentioned, I have a potential fix for this, and will try to open a PR for it later but wanted to type this up while I had all the context in front of me
Add shell script for easy install
Description
Adds a POSIX compliant shell script to be used from terminal in combination with
curl
andwget
pipe to easily installrun-gp
. Porting over from this bash script 😛Related Issue(s)
Fixes #
How to test
Release Notes
Documentation
Clarification needed on plans to support D-in-D & IntelliJ on Macs (incl arm64)
Hi,
This FR is about the following two known limitations:
⚠️ Docker-in-Docker depends on the environment you use run-gp in. It does not work yet on MacOS and when run-gp is used from within a Gitpod workspace. ⚠️ JetBrains Gateway support also depends on the environment run-gp is used in. It is known NOT to work on arm64 MacOS.
Can you please help us better understand the reasons of these limitations, as well as future plans to overcome / fix them?
Update: I ran a project with "run-gp" and I see all processes are running with QEMU x86-64, which makes things slower and I guess the IntelliJ agent is incompatible. I also saw the Docker-in-Docker issue, docker cli in the workspace cannot connect to the host's docker socket.
Asking since these limitations affect almost 100% of our use-cases:
Is there a way to have git user name/email automatically set?
Every time we open a new instance of run-gp,
git config user.name
andgit config user.email
are empty, preventing us from committing changes before setting them up.Is there currently a way to have them set automatically?
If not, it could do one of these things:
$(run-gp config path)
).run-gp
.GITPOD_ENV_SET_
.Feature Request: Allow passing a repository with dotfiles
Is your feature request related to a problem? Please describe the solution you'd like.
It would be great to have dotfiles installed automatically like we can do on gitpod.io.
Screenshot from https://gitpod.io/preferences:
Maybe we could pass the repo as an argument for
run-gp
.Describe alternatives you've considered
We can manually clone the dotfiles repo and execute the install script once we're in the environment. But if we could automate it and save some time,
run-gp
would be even better!