
Agent written in Java (SpringBoot) as part of estuary stack.
The advantage of this implementation is that java libraries can be integrated within, rather than executing the logic through cli commands pointing to a main class in a jar, as per the original python implementation.
Set the following env vars:
Example:
export APP_IP=192.168.0.4
export PORT=8081
java -jar \
-Deureka.client.serviceUrl.defaultZone=http://192.168.0.100:8080/eureka/v2 \
-Deureka.client.enabled=true agent-4.0.9-SNAPSHOT-exec.jar
User defined environment variables will be stored in a 'virtual' environment. The extra env vars will be used by the process that executes system commands.
There are two ways to inject user defined environment variables.
! All environment variables described above can also be set using environment.properties. However, the vars set through application.yml can't be set: PORT, APP_IP, EUREKA_SERVER.
This service acts with small differences as the original python implementation.
All the documentation should be matched, minus some differences in terms how this service registers to eureka.
curl -X POST -d 'ls -lrt' http://localhost:8080/command
{
"code": 1000,
"message": "Success",
"description": {
"finished": true,
"started": false,
"startedat": "2020-08-15 19:38:16.138962",
"finishedat": "2020-08-15 19:38:16.151067",
"duration": 0.012,
"pid": 2315,
"id": "none",
"commands": {
"ls -lrt": {
"status": "finished",
"details": {
"out": "total 371436\n-rwxr-xr-x 1 dinuta qa 13258464 Jun 24 09:25 main-linux\ndrwxr-xr-x 4 dinuta qa 40 Jul 1 11:42 tmp\n-rw-r--r-- 1 dinuta qa 77707265 Jul 25 19:38 testrunner-linux.zip\n-rw------- 1 dinuta qa 4911271 Aug 14 10:00 nohup.out\n",
"err": "",
"code": 0,
"pid": 6803,
"args": [
"/bin/sh",
"-c",
"ls -lrt"
]
},
"startedat": "2020-08-15 19:38:16.138970",
"finishedat": "2020-08-15 19:38:16.150976",
"duration": 0.012
}
}
},
"timestamp": "2020-08-15 19:38:16.151113",
"path": "/command?",
"name": "estuary-agent",
"version": "4.0.8"
}
The underlying library integrating swagger to SpringBoot is springfox
Start your server as an simple java application
You can view the api documentation in swagger-ui by pointing to
http://localhost:8080/
Change default port value in application.properties
Get this dependency:
<dependency>
<groupId>com.github.dinuta.estuary</groupId>
<artifactId>agent</artifactId>
<version>4.0.8</version>
</dependency>
<dependency>
<groupId>com.github.dinuta.estuary</groupId>
<artifactId>agent</artifactId>
<version>4.0.9-SNAPSHOT</version>
</dependency>
To use a snapshot version, set the oss.sonatype.org repo in settings.xml:
<repository>
<id>snaphosts4</id>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<name>all-external8</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
Content type
Image
Digest
Size
242.6 MB
Last updated
almost 5 years ago
docker pull estuaryoss/agent-java