Improve workflow for rake tasks and rails console in Auto Devops environments
Problem to solve
When applications are migrated to kubernetes using the Auto Devops workflow, it becomes very difficult to use the usual tools to work with them. Since there is no way to ssh in to a kubernetes pod, it is difficult to run rails console
, rake
tasks, psql
database cli, manual migrations and other things that maintainers of rails apps regularly need to do.
The product's opinion of the proper way is to do it through the web console from the environments page.
The existing workflow is not ideal, but here it is:
- Go to the
Operations / Environments
page and on theproduction
line, click on theTerminal
icon - Type:
/bin/herokuish procfile exec
followed by a command such asrake taskname
orrails console
orpsql
in the terminal - Keep sending keystrokes (spaces or something) every few seconds until the results return.
Note that the timeout on this terminal is ridiculously low. If it times out before the operation completes, you will get no results (hence the keystrokes).
Intended users
- Sasha (Software Developer)
- Devon (DevOps Engineer)
- Sidney (Systems Administrator)
- Simone (Software Engineer in Test)
- Allison (Application Ops)
- Dana (Data Analyst)
User experience goal
The user should be able to manually run (at a minimum) rake
, rails console
, and psql
commands on an application running in an Auto DevOps configuration without arcane knowledge, and without worrying about an excessively short terminal timeout.
Proposal
Further details
Here are a few real world instances of the existing workflow being insufficient:
- gitlab-com/gl-infra/production#2445 (closed)
- https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/8347
Permissions and Security
Ideally, there should be no changes to the existing permissions and security.