Skip to content

Fix blocking SSH connections

Safwan Ahmed requested to merge saf-fix-ssh-hang-on-login into main

Issue: SSH feature hangs on attempted login (#15 - closed)

What does this MR do and why?

This MR fixes the reported issue where SSH login hangs.

Steps to test

  • Make sure you already have workspaces setup locally with GDK
  • I found the current local setup not perfect for me so I made this script for easy in-cluster testing:
#!/usr/bin/env bash


# TODO: Look into DRYing up this boilerplate: https://gitlab.com/gitlab-org/gitlab-web-ide-vscode-fork/-/issues/7
# See https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
set -o errexit  # AKA -e - exit immediately on errors (http://mywiki.wooledge.org/BashFAQ/105)
set -o xtrace   # AKA -x - get bash "stacktraces" and see where this script failed
set -o pipefail # fail when pipelines contain an error (see http://www.gnu.org/software/bash/manual/html_node/Pipelines.html)


# Repackage workspaces-proxy chart locally and build new image 
IMAGE_VERSION="dev-$(TZ=UTC date '+%Y%m%d%H%M%S')"
IMAGE_NAME="registry.gitlab.com/gitlab-org/workspaces/gitlab-workspaces-proxy:${IMAGE_VERSION}" 
nerdctl --namespace k8s.io  build -t $IMAGE_NAME .
HELM_CHART_VERSION="0.0.1+dev$(TZ=UTC date '+%Y%m%d%H%M%S')"
echo "Packaging helm chart"
rm -rf ./localdev
mkdir -p ./localdev/localbuild
echo "Using ${HELM_CHART_VERSION} as helm chart version"
echo "Using ${IMAGE_VERSION} as app version"
yq e ".appVersion = \"${IMAGE_VERSION}\"" -i ./helm/chart.yaml
yq e ".version = \"${HELM_CHART_VERSION}\"" -i ./helm/chart.yaml
helm package ./helm --destination ./localdev/localbuild

git checkout -- helm/Chart.yaml


# Dump running config
helm get values gitlab-workspaces-proxy --namespace gitlab-workspaces > ./localdev/localbuild/config.yaml

# Run new chart with dumped config
helm upgrade gitlab-workspaces-proxy ./localdev/localbuild/gitlab-workspaces-proxy-${HELM_CHART_VERSION}.tgz -n gitlab-workspaces -f ./localdev/localbuild/config.yaml

NOTE you can revert to your OG release by running the following:

helm upgrade gitlab-workspaces-proxy gitlab-workspaces-proxy/gitlab-workspaces-proxy --version=$(yq eval ".version" ./helm/Chart.yaml) -f ./localdev/localbuild/config.yaml -n gitlab-workspaces
  • Create a workspace in GDK
  • Mint a PAT for your user
  • SSH into the created workspace by running ssh ${WORKSPACE_NAME}@${LOAD_BALANCER_IP} and using the PAT as the password
  • Observation Successful ssh into workspace
Edited by Safwan Ahmed

Merge request reports

Loading