Agent docker image

19 views
Skip to first unread message

Satya Elipe

unread,
Nov 10, 2023, 11:00:38 AM11/10/23
to go...@googlegroups.com
Hi All

Any recommendation for go-agent docker image like we have for go-server (gocd/go-server:v22.3.0) ?

We are dockerizing a stand-alone g-server runs as an ec2 at the moment but would like to move it to ECS.

any inputs will be appreciated.

Many thanks
Satya

Sriram Narayanan

unread,
Nov 10, 2023, 11:31:16 AM11/10/23
to go...@googlegroups.com
Are you planning to run the go server as an ECS instance and The go agent as a ECS instance? 

You should start by understanding the following:
-  how the containerised server and agent work
- auto registration of the agent
- scaling ECS instances ( for the agent)
- addressing a server instance via an ALB
- the security group settings needed to enable the agent ECS cluster to connect to the server on port 8153.
- using RDS for the server data ( including migrating from the H2DB to RDS)
- storing files on EFS and making available to the go server instance ( artifacts, configuration, logs)
- sending logs to cloud watch

You could also consider using the Elastic Agent support to use EKS based agents instead of ECS. See: 

— Sriram



Many thanks
Satya

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CADKEDRrGqba1Oi3Wcu7%2BTJEuKMENkWOc-JbMcKb2XG1Px6BJGQ%40mail.gmail.com.

Satya Elipe

unread,
Nov 14, 2023, 12:27:54 PM11/14/23
to go...@googlegroups.com
Thank you Sriram. 
My comments inline please. 

Are you planning to run the go server as an ECS instance and The go agent as a ECS instance? 
Satya] Yes, server will be part of ECS (ECS instance) and it will launch the agents dynamically when theres a job to perform and once the job is done the agent is terminated

You should start by understanding the following:
-  how the containerised server and agent work
Satya] If Im not wrong, this goes with docker elastic plugin, configuring cluster and agent profiles, setting up agentAutoRegisterKey in cruise-config.yml and the below configuration in the cruise-config.yml.

Agent: this would go into agent container
```<property>
          <key>ec2_user_data</key>
          <value>echo "agent.auto.register.environments=production,sandbox" &gt;&gt; /var/lib/go-agent/config/autoregister.properties</value>
        </property>```

So, we should have this file updated with the required details including the agentAutoRegisterKey (as given here ), so agent would know what server it is working with, correct me if I am wrong please. 

- auto registration of the agent
Satya] as mentioned above. 

- scaling ECS instances ( for the agent)
- addressing a server instance via an ALB
- the security group settings needed to enable the agent ECS cluster to connect to the server on port 8153.
- using RDS for the server data ( including migrating from the H2DB to RDS)
- storing files on EFS and making available to the go server instance ( artifacts, configuration, logs)
- sending logs to cloud watch

Satya] Yes, mostly set up is the same, but just that whether H2DB or RDS . 

Thank you 
Satya

Chad Wilson

unread,
Nov 14, 2023, 3:33:00 PM11/14/23
to go...@googlegroups.com
The default go-server docker image is Alpine based, so the equivalent image would be https://hub.docker.com/r/gocd/gocd-agent-alpine-3.18

Having said this, most folks find they end up building their own agent image using a GoCD official image as base image, so they can add on required tooling of their own which they want to be available to jobs.

If you are moving from running builds directly on your EC2 instances you might want to consider picking a base image closer to your normal Linux ecosystem or package manager, especially if you do native compiles or things like that which require a C/C++ compiler toolchain inside agents. Your choices right now are Alpine, Debian, Ubuntu, CentOS Stream (other than building your own) https://www.gocd.org/download/#docker

-Chad

Reply all
Reply to author
Forward
0 new messages