Skip to content

Commit

Permalink
Update remote development instructions
Browse files Browse the repository at this point in the history
Change-Id: Ie11b3d6dde0618607dbd399d89847178001179ac
  • Loading branch information
Leo committed Dec 1, 2021
1 parent fc63d57 commit d6b6e0b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
24 changes: 19 additions & 5 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ Install Git first:

sudo apt-get install -y git

First, create an SSH key in your shell:
First, create an SSH key on the VM:

ssh-keygen -t ed25519
cat .ssh/id_ed25519.pub

You can then [add your public key on Gerrit](https://forge.certus.one/settings/#SSHKeys) and [clone the repository](https://forge.certus.one/admin/repos/wormhole) in your shell. The clone command should look like this:
You can then [add your public key on Gerrit](https://forge.certus.one/settings/#SSHKeys) and [clone the repository](https://forge.certus.one/admin/repos/wormhole). The clone command should look like this:

```shell
# don't copy this - copy it from Gerrit instead
Expand All @@ -94,13 +94,14 @@ Configure your Git identity to match your Gerrit name and email:
*If you are a Jump Crypto employee, make sure to log into Gerrit using Azure SSO using your
jumptrading.com email address and request Gerrit review permissions in #wormhole-dev on Slack.*

You can then use our regular Git and Gerrit workflow as detailed in [Submit change for review](./CONTRIBUTING.md#Submit change for review).
You can then use our regular Git and Gerrit workflow as detailed in [Submit change for review](CONTRIBUTING.md#submit-change-for-review).

### Set up devnet on the VM

After cloning the repo, run the setup script:
After cloning the repo, run the setup script. It expects to run as a regular user account with sudo permissions.
It installs Go, Minikube, Tilt and any other dependencies required for Wormhole development:

scripts/devnet-setup.sh
scripts/dev-setup.sh

You then need to close and re-open your session to apply the new environment.
If you use persistent SSH sessions, make sure to kill the session before reconnecting.
Expand All @@ -116,6 +117,19 @@ of your choice to control access:

tilt up --host=0.0.0.0 --port=8080

If something breaks, just run `minikube delete` and start from scratch by running `start-recommended-minikube`.

### VSCode remote development

VSCode's SSH remote development plugin is known to work well with the workflow described above.

### IntelliJ remote development

IntelliJ's [remote development backend](https://www.jetbrains.com/remote-development/gateway/) is reported to work as well. Just install Jetbrains Gateway on your local machine, connect it to your remote VM via SSH, and pick the latest IntelliJ release. Your local license, keymap and theme - if any - will be used automatically.

[Projector](https://lp.jetbrains.com/projector/) should also work for clients that can't run the native UI locally
(if you want to code on your VR headset, smart toaster or Chromebook - this is the way!).

## Tips and tricks

### Post messages
Expand Down
24 changes: 18 additions & 6 deletions scripts/dev-setup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
#
# This script provisions a working Wormhole dev environment on a blank Debian VM.
# It expects to run as a user without root permissions.
Expand Down Expand Up @@ -32,10 +33,10 @@ fi

# Upgrade everything
# (this ensures that an existing Docker CE installation is up to date before continuing)
sudo apt-get upgrade -y
sudo apt-get update && sudo apt-get upgrade -y

# Install dependencies
sudo apt-get update && sudo apt-get -y install bash-completion git git-review vim
sudo apt-get -y install bash-completion git git-review vim

# Install Go
ARCH=amd64
Expand Down Expand Up @@ -63,16 +64,26 @@ GO=1.17.3

# Install Docker and add ourselves to Docker group
if [[ ! -d /var/lib/docker ]]; then
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
TMP=$(mktemp -d)
(
cd "$TMP"
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
)
rm -rf "$TMP"
sudo gpasswd -a $USER docker
fi

sudo systemctl enable --now docker

# Install Minikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
sudo dpkg -i minikube_latest_amd64.deb
TMP=$(mktemp -d)
(
cd "$TMP"
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
sudo dpkg -i minikube_latest_amd64.deb
)
rm -rf "$TMP"

# Install tilt
curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | sudo bash
Expand All @@ -97,6 +108,7 @@ alias start-recommended-minikube="minikube start --driver=docker --kubernetes-ve
EOF

cat <<EOF
┍━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑
│ │
│ SUCCESS │
Expand Down

0 comments on commit d6b6e0b

Please sign in to comment.