debian-mirror-gitlab/doc/ci/interactive_web_terminal/index.md

75 lines
3.3 KiB
Markdown
Raw Normal View History

2019-09-04 21:01:54 +05:30
---
2020-06-23 00:09:42 +05:30
stage: Verify
group: Runner
2021-02-22 17:27:13 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2019-09-04 21:01:54 +05:30
type: reference
---
2019-03-02 22:35:43 +05:30
# Interactive Web Terminals
2018-11-20 20:47:30 +05:30
2020-06-23 00:09:42 +05:30
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/50144) in GitLab 11.3.
2018-11-20 20:47:30 +05:30
Interactive web terminals give the user access to a terminal in GitLab for
2019-03-02 22:35:43 +05:30
running one-off commands for their CI pipeline. Since this is giving the user
2019-09-30 21:07:59 +05:30
shell access to the environment where [GitLab Runner](https://docs.gitlab.com/runner/)
2019-03-02 22:35:43 +05:30
is deployed, some [security precautions](../../administration/integration/terminal.md#security) were
taken to protect the users.
2018-11-20 20:47:30 +05:30
2021-02-22 17:27:13 +05:30
NOTE:
2021-01-29 00:20:46 +05:30
[Shared runners on GitLab.com](../runners/README.md#shared-runners) do not
2019-03-02 22:35:43 +05:30
provide an interactive web terminal. Follow [this
2020-04-08 14:13:33 +05:30
issue](https://gitlab.com/gitlab-org/gitlab/-/issues/24674) for progress on
2019-03-02 22:35:43 +05:30
adding support. For groups and projects hosted on GitLab.com, interactive web
terminals are available when using your own group or project runner.
2018-11-20 20:47:30 +05:30
## Configuration
Two things need to be configured for the interactive web terminal to work:
2020-11-24 15:15:51 +05:30
- The runner needs to have [`[session_server]` configured
2019-02-15 15:39:39 +05:30
properly](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-session_server-section)
2018-12-05 23:21:45 +05:30
- If you are using a reverse proxy with your GitLab instance, web terminals need to be
2018-11-20 20:47:30 +05:30
[enabled](../../administration/integration/terminal.md#enabling-and-disabling-terminal-support)
2021-02-22 17:27:13 +05:30
NOTE:
2019-12-04 20:38:33 +05:30
Interactive web terminals are not yet supported by
2019-12-21 20:55:43 +05:30
[`gitlab-runner` Helm chart](https://docs.gitlab.com/charts/charts/gitlab/gitlab-runner/index.html),
2020-06-23 00:09:42 +05:30
but support [is planned](https://gitlab.com/gitlab-org/charts/gitlab-runner/-/issues/79).
2019-12-04 20:38:33 +05:30
2018-11-20 20:47:30 +05:30
## Debugging a running job
2021-02-22 17:27:13 +05:30
NOTE:
2020-07-28 23:09:34 +05:30
Not all executors are
2018-11-20 20:47:30 +05:30
[supported](https://docs.gitlab.com/runner/executors/#compatibility-chart).
2021-02-22 17:27:13 +05:30
NOTE:
2020-07-28 23:09:34 +05:30
The `docker` executor does not keep running
2021-02-22 17:27:13 +05:30
after the build script is finished. At that point, the terminal automatically
disconnects and does not wait for the user to finish. Please follow [this
2020-06-23 00:09:42 +05:30
issue](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/3605) for updates on
2018-12-05 23:21:45 +05:30
improving this behavior.
2018-11-20 20:47:30 +05:30
Sometimes, when a job is running, things don't go as you would expect, and it
would be helpful if one can have a shell to aid debugging. When a job is
2021-02-22 17:27:13 +05:30
running, on the right panel you can see a button `debug` that opens the terminal
2018-11-20 20:47:30 +05:30
for the current job.
![Example of job running with terminal
available](img/interactive_web_terminal_running_job.png)
2021-02-22 17:27:13 +05:30
When clicked, a new tab opens to the terminal page where you can access
2018-11-20 20:47:30 +05:30
the terminal and type commands like a normal shell.
![terminal of the job](img/interactive_web_terminal_page.png)
If you have the terminal open and the job has finished with its tasks, the
2021-02-22 17:27:13 +05:30
terminal blocks the job from finishing for the duration configured in
2019-12-26 22:10:19 +05:30
[`[session_server].session_timeout`](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-session_server-section) until you
2018-11-20 20:47:30 +05:30
close the terminal window.
![finished job with terminal open](img/finished_job_with_terminal_open.png)
2019-07-31 22:56:46 +05:30
2020-07-28 23:09:34 +05:30
## Interactive Web Terminals for the Web IDE
2019-07-31 22:56:46 +05:30
2020-07-28 23:09:34 +05:30
Read the Web IDE docs to learn how to run [Interactive Terminals through the Web IDE](../../user/project/web_ide/index.md#interactive-web-terminals-for-the-web-ide).