Inject agentw in workspace
What does this MR do and why?
- Save workspaces agent config with workspaces proxy options when agentk requests config for remote development.
- Fix bug in workspace model where workspace_tokens were not getting destroyed when the workspace's desired_state changed from running.
- Create a singleton class to handle workspace url helper.
- Update the workspace tools image to the latest one which contains agentw.
- Inject and start agentw inside workspace if required.
References
Screenshots or screen recordings
Screen_Recording_2025-09-11_at_9.02.44_PM
How to set up and validate locally
-
Setup dnsmasq for pointing
workspaces.gdk.test
and its subdomains to the listen_address (172.16.123.1). There is a separate issue to make this part of GDK itself - GDK: Introduce dnsmasq service (gitlab-development-kit#2694)Click to expand for steps to setup dnsmasq
# Reference - https://allanphilipbarku.medium.com/setup-automatic-local-domains-with-dnsmasq-on-macos-ventura-b4cd460d8cb3 ## Step 1: Install and configure Dnsmasq brew install dnsmasq mkdir -pv $(brew --prefix)/etc/ echo 'address=/workspaces.gdk.test/172.16.123.1' >> $(brew --prefix)/etc/dnsmasq.conf sudo brew services start dnsmasq dig x.workspaces.gdk.test @127.0.0.1 ## Step 2: Create a dns resolver and test setup sudo mkdir -v /etc/resolver sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/workspaces.gdk.test' sudo killall -HUP mDNSResponder ## Step 3: Verify dig x.workspaces.gdk.test
-
Generate certs for workspaces domain in your GDK directory -
mkcert "*.workspaces.gdk.test"
-
Update gdk.yml
--- gitlab_k8s_agent: agent_listen_address: gdk.test:8150 enabled: true k8s_api_listen_address: gdk.test:8154 hostname: gdk.test listen_address: 172.16.123.1 nginx: enabled: true http: enabled: true workspaces: enabled: true
-
gdk reconfigure && gdk restart
-
Create a new workspace. Let's call it w1.
-
Set
remote_development.gitlab_workspaces_proxy.http_enabled: false
in your agentk configuration. -
Create a new workspace using the above agentk. Let's call it w2.
-
Open the workspace URL
-
Verify the URL suffix of workspace w1 is what is set in agentk configuration file's
remote_development.dns_zone
value. -
Verify the URL suffix of workspace w2 is what is set in GitLab's
config/gitlab.yml
file'sworkspaces.host
value.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.