Sign inSign up

estuaryoss/agent

By estuaryoss

•Updated over 5 years ago

Image
0

1.2K

estuaryoss/agent repository overview

Testing as a service with Docker

Support project:

⁠Estuary agent

Estuary agent is a service that exposes your cli commands/app via REST API.

⁠Coverage and code quality

Coverage Status Codacy Badge Maintainability

⁠Linux status

Build Status

⁠Windows status

CircleCI

⁠Docker Hub

alpine⁠
centos⁠

⁠Api docs

4.0.8⁠

⁠Postman collection

Postman⁠

⁠Katacoda playground

estuary-agent⁠

⁠General use cases:

  • remote command executor
  • exposing CLI app through REST API
  • controlling the test automation framework (maven/python, etc)
  • integration testing by controlling and configuring the SUT

⁠Testing use cases:

Some use cases are documented in wiki⁠

⁠Service run

⁠Docker compose
docker-compose up
⁠Docker run
docker run  
-d 
-p 8080:8080
estuaryoss/agent:<tag>

⁠Kubernetes
kubectl apply -f k8sdeployment.yml
⁠Eureka registration

To have all your estuary-agent instances in a central location, Netflix Eureka is used. This means your client will discover all services used for your test and then spread the tests across all.

Start Eureka server with docker:

docker run -p 8080:8080 estuaryoss/netflix-eureka:1.9.25

Start your containers by specifying the full hostname or ip of the host machine on where your agent service resides. Optionally you can define the WORKSPACE (default=/tmp)or PORT (default=8080).

docker run \
-e EUREKA_SERVER=http://10.10.15.30:8080/eureka/v2 -> the eureka server
-e APP_IP_PORT=10.10.15.28:8081 -> the ip and port of the app
-e WORKSPACE=/tmp/ -> optional;for multiplatform set it to your needs;default is /tmp/;E.g /workspace/
-p 8081:8080
estuaryoss/agent:<tag>
⁠Fluentd logging

Please consult Fluentd⁠ for logging setup.
Agent tags all logs in format estuary-agent.**

Matcher example:

<match estuary*.**>
    @type stdout
</match>

Run example:

docker run \
-e FLUENTD_IP_PORT=10.10.15.28:24224
-p 8080:8080
estuaryoss/agent:<tag>
⁠Authentication

For auth set HTTP_AUTH_TOKEN env variable.

Run example:

docker run \
-e HTTP_AUTH_TOKEN=mysecret
-p 8080:8080
estuaryoss/agent:<tag>

Then, access the Http Api. Call example:

curl -i -H 'Token:mysecret' http:localhost:8080/about

⁠Environment variables injection

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.

  • call POST on /env endpoint. The body will contain the env vars in JSON format. E.g. {"FOO1":"BAR1"}
  • create an environment.properties file with the extra env vars needed and place it in the same path as the JAR. Example in this repo.

! All environment variables described above can also be set using environment.properties.

⁠Example output

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"
}

⁠Estuary stack

Estuary deployer⁠
Estuary agent⁠
Estuary discovery⁠
Estuary viewer⁠

⁠Templating service

Jinja2Docker⁠

Tag summary

Content type

Image

Digest

Size

362.6 MB

Last updated

over 5 years ago

docker pull estuaryoss/agent