Let's connect
Let's connect

Pros and Cons of Cloud IDE: We gave it a try. Here’s how it went.

Picture of Marcin Aman, Team Leader

Marcin Aman

Team Leader
Picture of Michał Wiącek, Software Developer

Michał Wiącek

Software Developer

14 minutes read

blog_infographic_virtus-IDE

bash

FROM gitpod/workspace-java-11:latest

USER root
RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list \
    curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add \
    curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/focal.gpg | sudo apt-key add - \
    curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/focal.list | sudo tee /etc/apt/sources.list.d/tailscale.list \
    curl -s --compressed "https://virtuslab.github.io/scala-cli-packages/KEY.gpg" | sudo apt-key add - \
    sudo curl -s --compressed -o /etc/apt/sources.list.d/scala_cli_packages.list "https://virtuslab.github.io/scala-cli-packages/debian/scala_cli_packages.list" \
    apt-get update \
    DEBIAN_FRONTEND=noninteractive apt-get install -y tailscale sbt \
       libxtst6 libx11-6 libxrender1 xvfb openssh-server python3 \
       python3-pip libssl-dev pkg-config x11-apps imagemagick xorg scala-cli \
    echo "nohup /usr/bin/Xvfb :0.0 -screen 0 1024x768x24 &" > /etc/init.d/xvfb \
    echo "nohup /usr/sbin/tailscaled &" > /etc/init.d/tailscaled \
    sudo update-rc.d xvfb defaults \
    sudo update-rc.d tailscaled defaults-disabled

console

image:
  file: .gitpod.Dockerfile

jetbrains:
  intellij:
    plugins:
      - org.intellij.scala

tasks:
  - name: base init
    init: |
      set -e
      gp env IDEPROBE_DISPLAY=xvfb
      sbt "Test / compile"
      /ide-desktop/backend/bin/remote-dev-server.sh warm-up /workspace/ide-probe
      set +e
  - name: tailscaled
    command: |
      if [ -n "${TAILSCALE_STATE_MYPROJECT}" ]; then
        # restore the tailscale state from gitpod user's env vars
        sudo mkdir -p /var/lib/tailscale
        echo "${TAILSCALE_STATE_MYPROJECT}" | sudo tee /var/lib/tailscale/tailscaled.state > /dev/null
      fi
      service tailscaled start
      service tailscaled status
  - name: tailscale
    command: |
      if [ -n "${TAILSCALE_STATE_MYPROJECT}" ]; then
        sudo -E tailscale up
      else
        sudo -E tailscale up --hostname "gitpod-${GITPOD_GIT_USER_NAME// /-}-$(echo ${GITPOD_WORKSPACE_CONTEXT} | jq -r .repository.name)"
        # store the tailscale state into gitpod user
        gp env TAILSCALE_STATE_MYPROJECT="$(sudo cat /var/lib/tailscale/tailscaled.state)"
      fi

Curated by

Sebastian Synowiec

Liked the article?

Share it with others!

explore more on

Take the first step to a sustained competitive edge for your business

Get your free consultation

VirtusLab's work has met the mark several times over, and their latest project is no exception. The team is efficient, hard-working, and trustworthy. Customers can expect a proactive team that drives results.

Stephen Rooke
Stephen RookeDirector of Software Development @ Extreme Reach

VirtusLab's engineers are truly Strapi extensions experts. Their knowledge and expertise in the area of Strapi plugins gave us the opportunity to lift our multi-brand CMS implementation to a different level.

facile logo
Leonardo PoddaEngineering Manager @ Facile.it

VirtusLab has been an incredible partner since the early development of Scala 3, essential to a mature and stable Scala 3 ecosystem.

Martin_Odersky
Martin OderskyHead of Programming Research Group @ EPFL

The VirtusLab team's in-depth knowledge, understanding, and experience of technology have been invaluable to us in developing our product. The team is professional and delivers on time – we greatly appreciated this efficiency when working with them.

Michael_Grant
Michael GrantDirector of Development @ Cyber Sec Company