Docker Elastic agent plugin .jar location (to run it in the ECS)

15 views
Skip to first unread message

Satya Elipe

unread,
Nov 13, 2023, 4:50:00 PM11/13/23
to go...@googlegroups.com
Hi All

Im containerizing my standalone GoCD server v22.3.0 with elastic agents, and looking for the elastic agents plugin jar file location for the version that works with server version v22.3.0 and use it in the container something like:

docker run -d -p 8153:8153 -p 8154:8154 \
  -v /etc/go:/etc/go \
  -v /var/lib/go-server:/var/lib/go-server \
  -e GOCD_PLUGIN_INSTALL_docker-elastic-agents=https://github.com/gocd-contrib/docker-elastic-agents/releases/download/v2.2.0-218/docker-elastic-agents-2.2.0-218.jar \
  --name gocd-server \
  gocd/gocd-server:v22.3.0

The above command fails with the below error:
```$ mkdir -p /godata/plugins/external
$ curl --silent --location --fail --retry 3 https://github.com/gocd-contrib/docker-elastic-agents/releases/download/v2.2.0-218/docker-elastic-agents-2.2.0-218.jar --output /godata/plugins/external/docker-elastic-agents.jar
/usr/local/sbin/install-gocd-plugins: cannot curl --silent --location --fail --retry 3 https://github.com/gocd-contrib/docker-elastic-agents/releases/download/v2.2.0-218/docker-elastic-agents-2.2.0-218.jar --output /godata/plugins/external/docker-elastic-agents.jar```


I see the documentation available for the same, my bad that I couldn't locate the jar file: 

Any inputs will be of great help.

Many thanks
Satya

[P.S: Right now the server runs as a standalone ec2 on AWS, plan is to run it as part of ECS.]



Chad Wilson

unread,
Nov 13, 2023, 6:08:00 PM11/13/23
to go...@googlegroups.com
There's no such release. You should use a non-experimental release from https://github.com/gocd-contrib/docker-elastic-agents-plugin/releases and find the link to the main jar file within that release.

There should be no reason you cannot use the most recent release: https://github.com/gocd-contrib/docker-elastic-agents-plugin/releases/download/v3.2.3-399/docker-elastic-agents-3.2.3-399.jar

-Chad

--
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/CADKEDRpTctJDBtWXSJWoEW81ryUwL7cAzeePbuZd4wi7LDmQFg%40mail.gmail.com.

Satya Elipe

unread,
Nov 14, 2023, 10:16:53 AM11/14/23
to go...@googlegroups.com
Thank you Chad, as suggested I have used v3.2.3 in the container and it appears in the console.

Im now into configuring cluster and agents profiles and trying to build them in cruise-config.xml (attached the code snippet), but doesn't seem to be working as those profiles doesn't appear on the Admin->Elastic Agents Configurations tab, but its asking for a fresh configuration, wonder what am I missing? Also, is it still a valid way of configuration ?

Regards
Satya


cruise-config.xml-1.png
cruise-config.xml-2.png
elastic-agents-dashboard.png

Chad Wilson

unread,
Nov 14, 2023, 3:18:52 PM11/14/23
to go...@googlegroups.com
The pluginId in that cluster profile fragment refers to a completely different ec2 elastic agent plugin so not sure what you're trying to show us there 😅

Personally, I don't think it's a good idea to be directly configuring cruise-config.xml especially for plugin-oriented config, since it necessarily cannot be schema validated. Elastic agent config is typically complex with validation rules implemented in the plugin. If automation is the goal, using the APIs for automation is likely a better experience than cruise-config.xml hacking.

If you really want to control cruise config directly, start with a working UI-driven configuration and work backwards to the required cruise-config XML fragment.

Otherwise you'll need to look at the logs and there's no guarantee as to how friendly the error messages will be, as you are shortcutting all of the UI-based validation assistance with that approach.

-Chad

Satya Elipe

unread,
Nov 14, 2023, 4:14:57 PM11/14/23
to go...@googlegroups.com
Thank you Chad, so what's the best approach to add the profiles, server console/UI ? 

Also, I'm trying to understand this:
I see v3.2.3 on the console () and the container shows the old version that's 2.2.0 (ec2 plugin and not docker)
Attached are the screenshots for both, am I missing something ? 

This is how I run the container and volume mounts are from the original backed-up server to the container.
```

docker run -d -p 8153:8153 -p 8154:8154 \
  -v /etc/go:/etc/go \
  -v /var/lib/go-server:/var/lib/go-server \
  -e GOCD_PLUGIN_INSTALL_docker-elastic-agents=https://github.com/gocd-contrib/docker-elastic-agents-plugin/releases/download/v3.2.3-399/docker-elastic-agents-3.2.3-399.jar \
  --name gocd-server \
  gocd/gocd-server:v22.3.0```

Sorry about cruise-config.xml, looks like I have sent the old config.

Best
Satya


console-version.png
container-version.png

Chad Wilson

unread,
Nov 14, 2023, 6:37:00 PM11/14/23
to go...@googlegroups.com
While getting a new plugin initially configured, I would use the UI to begin with, yes.

Your `ls` command starts with 'gocd-' so is filtering out plugins that don't start with the same (such as the docker elastic agent plugin). If the version and list of plugins is correct on the admin > plugins list, you can rely on that.

Your other thread mentions an intention to use ECS containers as agents. Note that there is a different ECS-specific plugin to use if you want to use ECS and have GoCD manage instances for agents to run on. The docker elastic agent plugin will run agent instances as containers on an existing individual local or remote host but is not intended for ECS usage which require specific API usage to create task definitions etc. Just to be clear.

-Chad

Reply all
Reply to author
Forward
0 new messages