Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

feat: implement the installation of the agent #149

Merged
merged 50 commits into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
80c13fb
chore(ci): enable fleet scenarios in the CI
mdelapenya Jun 29, 2020
bfda258
fix: fail on runtime dependencies startup errors
mdelapenya Jun 29, 2020
e55a894
feat: implement the installation of the agent
mdelapenya Jun 29, 2020
ff96ea3
chore: distinguish between checking process states and process actions
mdelapenya Jun 29, 2020
32f4256
chore: run go modd tidy
mdelapenya Jun 29, 2020
f5d8fde
chore: proper variable names
mdelapenya Jun 30, 2020
81b30d0
chore: tune log output
mdelapenya Jun 30, 2020
82d7d10
chore: export creation of backoff retries instances
mdelapenya Jul 1, 2020
e532103
chore: simplify executing commands in the base fleet image
mdelapenya Jul 1, 2020
5b2b351
fixup simplify
mdelapenya Jul 1, 2020
4cfd207
feat: backoff-wait 10 secs for the agent to be online
mdelapenya Jul 1, 2020
dd1e075
chore: remove getting agent logs after running it until there is a ph…
mdelapenya Jul 1, 2020
a789661
feat: build the download URL for elastic's artifacts dynamically
mdelapenya Jul 1, 2020
c8c484c
feat: backoff-wait 1 min for the datastreams to be present
mdelapenya Jul 1, 2020
9a1ca4f
feat: support Kibana's static encryption key
mdelapenya Jul 1, 2020
2faf743
feat: support using a new token when the agent is enrolled for first …
mdelapenya Jul 1, 2020
debe014
chore: remove step until it's decided its behavior
mdelapenya Jul 1, 2020
aef183b
chore: setup Fleet once, on runtime deps startup
mdelapenya Jul 1, 2020
011c18a
chore: remote end-of-lines in docker output
mdelapenya Jul 2, 2020
c0a7382
chore: use pgrep instead of ps to check for processes in the host
mdelapenya Jul 2, 2020
ae954bd
feat: implement the step for stopping a process in the host
mdelapenya Jul 2, 2020
552f80e
chore: use process name in the feature file
mdelapenya Jul 2, 2020
40703e7
chore: run go mod tidy
mdelapenya Jul 2, 2020
9600a37
Merge branch 'master' into 148-fleet-scenarios
mdelapenya Jul 3, 2020
b8f0008
chore: support running against different versions of the stack
mdelapenya Jul 3, 2020
b98593b
chore: use Observability's Kibana image until a bug is fixed
mdelapenya Jul 3, 2020
8eed9d8
chore: support URL encoding the querystring on cURL
mdelapenya Jul 3, 2020
57ee4f0
feat: support unenrolling agent
mdelapenya Jul 3, 2020
21181b4
chore: rename methods with more clear names
mdelapenya Jul 3, 2020
da2f1c0
chore: remove unused, not implemented step
mdelapenya Jul 3, 2020
3dba46d
feat: support downloading a specific version of the Elastic Agent binary
mdelapenya Jul 6, 2020
691c4ac
chore: remove more unused steps
mdelapenya Jul 6, 2020
7ef9584
chore: use current docker images
mdelapenya Jul 9, 2020
7658c41
feat: implement reenrollment using same token
mdelapenya Jul 9, 2020
22acb27
feat: implement revoking a token
mdelapenya Jul 9, 2020
f49ef40
feat: implement checks for enrolling an agent with a revoked token
mdelapenya Jul 9, 2020
40569d8
fix: use 8.0.0-SNAPSHOT as base
mdelapenya Jul 10, 2020
ebc40ee
Merge branch 'master' into 148-fleet-scenarios
mdelapenya Jul 11, 2020
401b8ac
Merge branch 'master' into 148-fleet-scenarios
mdelapenya Jul 13, 2020
18048f2
Merge branch 'master' into 148-fleet-scenarios
mdelapenya Jul 13, 2020
7d07b25
Merge branch 'master' into 148-fleet-scenarios
mdelapenya Jul 14, 2020
940b147
chore: update kibana config
mdelapenya Jul 15, 2020
e3dc69e
fix: Require insecure flag when enrolling an agent over HTTP
mdelapenya Jul 15, 2020
1ebd183
chore: extract agent deployment to a method to be reused
mdelapenya Jul 16, 2020
94d9d18
Merge branch 'master' into 148-fleet-scenarios
mdelapenya Jul 16, 2020
0f7f28a
Merge branch 'master' into 148-fleet-scenarios
mdelapenya Jul 16, 2020
e6021b9
chore: use UTC for time windows
mdelapenya Jul 16, 2020
d210c6d
fix: update elastic-agent index name
mdelapenya Jul 16, 2020
0ddc132
fix: sanitise container name if needed
mdelapenya Jul 16, 2020
e2edb39
chore: reduce the number of hits needed
mdelapenya Jul 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .ci/.e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ SUITES:
feature: "metricbeat"
- suite: "ingest-manager"
feature: "stand_alone_mode"
- suite: "ingest-manager"
feature: "fleet_mode"
- suite: "metricbeat"
feature: "apache"
- suite: "metricbeat"
Expand Down
6 changes: 6 additions & 0 deletions cli/config/compose/services/centos/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '2.3'
services:
centos:
image: centos:${centosTag:-7}
container_name: ${centosContainerName}
entrypoint: tail -f /dev/null
4 changes: 3 additions & 1 deletion cli/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package docker
import (
"bytes"
"context"
"strings"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
Expand Down Expand Up @@ -92,10 +93,11 @@ func ExecCommandIntoContainer(ctx context.Context, containerName string, user st
"container": containerName,
"command": cmd,
"detach": detach,
"output": output,
"tty": tty,
}).Debug("Command sucessfully executed in container")

output = strings.ReplaceAll(output, "\n", "")

return output, nil
}

Expand Down
2 changes: 2 additions & 0 deletions e2e/_suites/ingest-manager/configurations/kibana.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ elasticsearch.username: elastic
elasticsearch.password: changeme
xpack.monitoring.ui.container.elasticsearch.enabled: true

xpack.encryptedSavedObjects.encryptionKey: "12345678901234567890123456789012"

xpack.ingestManager.enabled: true
xpack.ingestManager.epm.enabled: true
xpack.ingestManager.epm.registryUrl: http://package-registry:8080
Expand Down
17 changes: 7 additions & 10 deletions e2e/_suites/ingest-manager/features/fleet_mode_agent.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,22 @@ Feature: Fleet Mode Agent

@enroll
Scenario: Deploying an agent
Given the "Fleet" Kibana setup has been executed
When an agent is deployed to Fleet
Then the agent is listed in Fleet as online
And system package dashboards are listed in Fleet
And there is data in the index

@start-agent
Scenario: Starting the agent starts backend processes
When an agent is deployed to Fleet
Then the "filebeat" process is "started" on the host
And the "metricbeat" process is "started" on the host
Then the "filebeat" process is in the "started" state on the host
And the "metricbeat" process is in the "started" state on the host

@stop-agent
Scenario: Stopping the agent stops backend processes
Given an agent is deployed to Fleet
When the "agent" process is "stopped" on the host
Then the "filebeat" process is "stopped" on the host
And the "metricbeat" process is "stopped" on the host
When the "elastic-agent" process is "stopped" on the host
Then the "filebeat" process is in the "stopped" state on the host
And the "metricbeat" process is in the "stopped" state on the host

@unenroll
Scenario: Un-enrolling an agent
Expand All @@ -34,11 +32,10 @@ Scenario: Un-enrolling an agent
Scenario: Re-enrolling an agent
Given an agent is deployed to Fleet
And the agent is un-enrolled
And the "agent" process is "stopped" on the host
And the "elastic-agent" process is "stopped" on the host
When the agent is re-enrolled on the host
And the "agent" process is "started" on the host
And the "elastic-agent" process is "started" on the host
Then the agent is listed in Fleet as online
And there is data in the index

@revoke-token
Scenario: Revoking the enrollment token for an agent
Expand Down
4 changes: 2 additions & 2 deletions e2e/_suites/ingest-manager/features/ingest_manager.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Feature: Stand-alone Agent Mode
@start-agent
Scenario: Starting the agent starts backend processes
Given a stand-alone agent is deployed
Then the "filebeat" process is "started" on the host
And the "metricbeat" process is "started" on the host
Then the "filebeat" process is in the "started" state on the host
And the "metricbeat" process is in the "started" state on the host

@deploy-stand-alone
Scenario: Deploying a stand-alone agent
Expand Down
Loading