terraform-aws-gitlab-runner icon indicating copy to clipboard operation
terraform-aws-gitlab-runner copied to clipboard

feat: Add support for session server

Open kayman-mk opened this issue 3 years ago • 17 comments
trafficstars

Description

This feature allows you to open an interactive web terminal from your Gitlab job and run one-off commands in your CI pipeline. See Interactive Web Terminals.

The connection can be established via an EIP (use enable_eip = true) only.

Closes #92

Migrations required

No.

Verification

still missing

with no session_server

Gitlab Runner still working

with session_server

config.toml is valid There is a listener on the Gitlab Runner it is possible to connect to the specified port from localhost able to execute jobs from Gitlab

kayman-mk avatar Jan 15 '22 22:01 kayman-mk

@kayman-mk I am not using this feature, can you give some direction to for testing / setting up. Or even provide an example. Great work!!!

npalm avatar Jan 27 '22 23:01 npalm

I will, yes. But yesterday I discovered some problems with the Runner when enabling the session_server. So I have to do some more checks before it is ready

By the way: Now it makes sense to place runners and executors in different subnets: Runners in public and Executors in a private one as Gitlab needs to establish a communication to the Runner.

kayman-mk avatar Jan 28 '22 07:01 kayman-mk

Not sure what's going on here. Deployed this branch, but if I place the Runner in my public subnet I am not able to connect via SSM and I do not see any logs in Cloudwatch. Really strange. May be there are some company restrictions in place. I have to check. Placing the Runner in a private subnet works. Configuration looks good and Gitlab shows the "Debug" button if a job is selected. Seems to be fine.

kayman-mk avatar Feb 07 '22 19:02 kayman-mk

@npalm If you deploy this branch, make sure that the Runner is placed in a public subnet and it's reachable from the Gitlab instance. Set the following variables

  enable_eip = true
  session_server = {
    timeout           = 1800
    port              = 8093
    gitlab_cidr_block = ["0.0.0.0/0"]
  }

If a job is assigned by this Runner you will notice a "Debug" button on the Gitlab job page. Pressing this button opens a terminal and you are connected to the Executor running the job.

kayman-mk avatar Feb 07 '22 19:02 kayman-mk

Changes looks goot, tried to run a test but not working so far. Did not got the runners up on the public subnet. Need a bit more time to run some checks

npalm avatar Feb 10 '22 23:02 npalm

@kayman-mk sorry for the late replies, will check the PR this weekend.

npalm avatar Feb 24 '22 22:02 npalm

@kayman-mk should it be still in draft?

npalm avatar Feb 25 '22 14:02 npalm

As I have no idea what's wrong here, let's leave it in draft mode. I'll try to check with my AWS experts what's wrong with our subnets.

From my point of view the development is done here. Just need to check the deployed module.

kayman-mk avatar Feb 27 '22 14:02 kayman-mk

Did you got it working?

npalm avatar Nov 27 '22 12:11 npalm

Still not working, but on my list ...

kayman-mk avatar Jan 03 '23 10:01 kayman-mk

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar Mar 17 '23 02:03 github-actions[bot]

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar May 17 '23 02:05 github-actions[bot]

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar Jul 18 '23 03:07 github-actions[bot]

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar Sep 26 '23 02:09 github-actions[bot]

This PR was closed because it has been stalled for 15 days with no activity.

github-actions[bot] avatar Oct 12 '23 02:10 github-actions[bot]

It seems that the session server can't be used with all executors. It might be the case that it is not working for docker+machine. Saw some comments on Stackoverflow.

kayman-mk avatar Nov 12 '23 15:11 kayman-mk

and just another ocmment: If you are using a reverse proxy with your GitLab instance, web terminals need to be enabled

kayman-mk avatar Nov 12 '23 15:11 kayman-mk