Skip to content

workspace-mysql slows down bash startup, hence .gitpod.yml task execution #946

Open
@axonasif

Description

@axonasif

Bug description

.gitpod.yml task(s) shell-commands starts to execute very late. Some .bashrc.d script that is included with tool-mysql chunk is probably slowing it down.

Steps to reproduce

  • Use the following .gitpod.yml contents:
image: gitpod/workspace-mysql:latest

tasks:
  - name: tailscaled
    command: |
      if [ -n "${TAILSCALE_STATE_GITPOD_TESTREPO}" ]; then
        # restore the tailscale state from gitpod user's env vars
        sudo mkdir -p /var/lib/tailscale
        echo "${TAILSCALE_STATE_GITPOD_TESTREPO}" | sudo tee /var/lib/tailscale/tailscaled.state > /dev/null
      fi
      sudo tailscaled
- name: tailscale
    command: |
      if [ -n "${TAILSCALE_STATE_GITPOD_TESTREPO}" ]; 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_GITPOD_TESTREPO="$(sudo cat /var/lib/tailscale/tailscaled.state)"
      fi
- name: Start application
    before: |
      if [ ! -f ".env" ]; then
        cp .env.gitpod .env
      fi
init: |
      eval $(gp env -e)
      npm install
command: |
      API_BASE_URL=3000-$GITPOD_WORKSPACE_ID.$GITPOD_WORKSPACE_CLUSTER_HOST npm run start:dev
  • Observe that the task(s) shell-commands are being executed late.

Expected behavior

  • bash shell startup should be fast.

Example repository

Open in Gitpod: https://gitlab.com/damiendawreck/gitpod-testrepo/-/commit/c6c02421f74b6a7d880e61901bae959ec57c79b6

Anything else?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions