Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/github.com/elastic/ela…
Browse files Browse the repository at this point in the history
…stic-agent-autodiscover-0.7.0
  • Loading branch information
michalpristas authored Jun 5, 2024
2 parents 5236f18 + 3500a81 commit 4ec05ca
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 48 deletions.
11 changes: 6 additions & 5 deletions .buildkite/pull-requests.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"jobs": [
{
"enabled": true,
"enabled": true,
"pipelineSlug": "elastic-agent",
"allow_org_users": true,
"allowed_repo_permissions": ["admin", "write"],
Expand All @@ -11,13 +11,14 @@
"build_on_comment": true,
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$",
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$",
"skip_ci_labels": [ ],
"skip_ci_labels": [ "skip-ci" ],
"skip_target_branches": [ ],
"skip_ci_on_only_changed": [ "changelog", "docs", "README.md", "sonar-project.properties", "docker-compose.yml", ".pre-commit-config.yaml", "skaffold.yaml", "Dockerfile.skaffold", "Dockerfile"],
"skip_ci_on_only_changed": [ "^.ci/", "^.github/", "^changelog", "^docs/", "\\.md$", "^docker-compose.yml", "^.pre-commit-config.yaml", "skaffold.yaml", "^Dockerfile.skaffold", "^Dockerfile"],
"always_require_ci_on_changed": [ ]
},
{
"enabled": true,
"build_drafts": false,
"pipelineSlug": "elastic-agent-extended-testing",
"allow_org_users": true,
"allowed_repo_permissions": ["admin", "write"],
Expand All @@ -27,9 +28,9 @@
"build_on_comment": true,
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:extended))|^/test extended$",
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:extended))|^/test extended$",
"skip_ci_labels": [ ],
"skip_ci_labels": [ "skip-ci", "skip-it" ],
"skip_target_branches": [ ],
"skip_ci_on_only_changed": [ "changelog", "docs", "README.md", "sonar-project.properties", "docker-compose.yml", ".pre-commit-config.yaml", "skaffold.yaml", "Dockerfile.skaffold", "Dockerfile"],
"skip_ci_on_only_changed": [ "^.ci/", "^.github/", "^changelog", "^docs/", "\\.md$", "^sonar-project.properties", "^docker-compose.yml", "^.pre-commit-config.yaml", "skaffold.yaml", "^Dockerfile.skaffold", "^Dockerfile"],
"always_require_ci_on_changed": [ ]
},
{
Expand Down
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,13 @@ Link related issues below. Insert the issue link or reference after the word "Cl
- How are we going to debug this?
- What are the metrics I should take care of?
- ...

<!-- CI Cheatsheet
Trigger comments:
/test (Or `buildkite test this|it`) Triggers unit test pipeline
/test extended (Or `buildkite test extended`) Triggers integration test pipeline
PR labels:
skip-ci Skips unit and integration tests
skip-it Skips integration tests
-->
32 changes: 32 additions & 0 deletions changelog/fragments/1717523676-Add-benchmark-input.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Kind can be one of:
# - breaking-change: a change to previously-documented behavior
# - deprecation: functionality that is being removed in a later release
# - bug-fix: fixes a problem in a previous version
# - enhancement: extends functionality but does not break or fix existing behavior
# - feature: new functionality
# - known-issue: problems that we are aware of in a given version
# - security: impacts on the security of a product or a user’s deployment.
# - upgrade: important information for someone upgrading from a prior version
# - other: does not fit into any of the other categories
kind: enhancement

# Change summary; a 80ish characters long description of the change.
summary: Add benchmark input

# Long description; in case the summary is not enough to describe the change
# this field accommodate a description without length limits.
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
#description:

# Affected component; a word indicating the component this changeset affects.
component: elastic-agent

# PR URL; optional; the PR number that added the changeset.
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
# Please provide it if you are adding a fragment for a different PR.
pr: https://github.com/elastic/beats/pull/39789

# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
# If not present is automatically filled by the tooling with the issue linked to the PR number.
#issue: https://github.com/owner/repo/1234
14 changes: 6 additions & 8 deletions pkg/testing/ess/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"context"
_ "embed"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -251,20 +252,19 @@ func (c *Client) DeploymentIsReady(ctx context.Context, deploymentID string, tic
ticker := time.NewTicker(tick)
defer ticker.Stop()

var errs error
statusCh := make(chan DeploymentStatus, 1)
errCh := make(chan error)

for {
select {
case <-ctx.Done():
return false, ctx.Err()
return false, errors.Join(errs, ctx.Err())
case <-ticker.C:
statusCtx, statusCancel := context.WithTimeout(ctx, tick)
defer statusCancel()
go func() {
statusCtx, statusCancel := context.WithTimeout(ctx, tick)
defer statusCancel()
status, err := c.DeploymentStatus(statusCtx, deploymentID)
if err != nil {
errCh <- err
errs = errors.Join(errs, err)
return
}
statusCh <- status.Overall
Expand All @@ -273,8 +273,6 @@ func (c *Client) DeploymentIsReady(ctx context.Context, deploymentID string, tic
if status == DeploymentStatusStarted {
return true, nil
}
case err := <-errCh:
return false, err
}
}
}
Expand Down
73 changes: 38 additions & 35 deletions pkg/testing/ogc/supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var ogcSupported = []LayoutOS{
Version: "22.04",
},
Provider: Google,
InstanceSize: "e2-standard-2", // 2 amd64 cpus
InstanceSize: "e2-standard-2", // 2 amd64 cpus, 8 GB RAM
RunsOn: "ubuntu-2204-lts",
Username: "ubuntu",
RemotePath: "/home/ubuntu/agent",
Expand All @@ -41,37 +41,40 @@ var ogcSupported = []LayoutOS{
Version: "20.04",
},
Provider: Google,
InstanceSize: "e2-standard-2", // 2 amd64 cpus
InstanceSize: "e2-standard-2", // 2 amd64 cpus, 8 GB RAM
RunsOn: "ubuntu-2004-lts",
Username: "ubuntu",
RemotePath: "/home/ubuntu/agent",
},
{
OS: define.OS{
Type: define.Linux,
Arch: define.ARM64,
Distro: runner.Ubuntu,
Version: "22.04",
},
Provider: Google,
InstanceSize: "t2a-standard-2", // 2 arm64 cpus
RunsOn: "ubuntu-2204-lts-arm64",
Username: "ubuntu",
RemotePath: "/home/ubuntu/agent",
},
{
OS: define.OS{
Type: define.Linux,
Arch: define.ARM64,
Distro: runner.Ubuntu,
Version: "20.04",
},
Provider: Google,
InstanceSize: "t2a-standard-2", // 2 arm64 cpus
RunsOn: "ubuntu-2004-lts-arm64",
Username: "ubuntu",
RemotePath: "/home/ubuntu/agent",
},
// These instance types are experimental on Google Cloud and very unstable
// We will wait until Google introduces new ARM instance types
// https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu
// {
// OS: define.OS{
// Type: define.Linux,
// Arch: define.ARM64,
// Distro: runner.Ubuntu,
// Version: "22.04",
// },
// Provider: Google,
// InstanceSize: "t2a-standard-4", // 4 arm64 cpus, 16 GB RAM
// RunsOn: "ubuntu-2204-lts-arm64",
// Username: "ubuntu",
// RemotePath: "/home/ubuntu/agent",
// },
// {
// OS: define.OS{
// Type: define.Linux,
// Arch: define.ARM64,
// Distro: runner.Ubuntu,
// Version: "20.04",
// },
// Provider: Google,
// InstanceSize: "t2a-standard-4", // 4 arm64 cpus, 16 GB RAM
// RunsOn: "ubuntu-2004-lts-arm64",
// Username: "ubuntu",
// RemotePath: "/home/ubuntu/agent",
// },
{
OS: define.OS{
Type: define.Linux,
Expand All @@ -80,7 +83,7 @@ var ogcSupported = []LayoutOS{
Version: "8",
},
Provider: Google,
InstanceSize: "e2-standard-2", // 2 amd64 cpus
InstanceSize: "e2-standard-2", // 2 amd64 cpus, 8 GB RAM
RunsOn: "rhel-8",
Username: "rhel",
RemotePath: "/home/rhel/agent",
Expand All @@ -92,7 +95,7 @@ var ogcSupported = []LayoutOS{
Version: "2022",
},
Provider: Google,
InstanceSize: "e2-standard-4", // 4 amd64 cpus
InstanceSize: "e2-standard-4", // 4 amd64 cpus, 16 GB RAM
RunsOn: "windows-2022",
Username: "windows",
RemotePath: "C:\\Users\\windows\\agent",
Expand All @@ -104,7 +107,7 @@ var ogcSupported = []LayoutOS{
Version: "2022-core",
},
Provider: Google,
InstanceSize: "e2-standard-4", // 4 amd64 cpus
InstanceSize: "e2-standard-4", // 4 amd64 cpus, 16 GB RAM
RunsOn: "windows-2022-core",
Username: "windows",
RemotePath: "C:\\Users\\windows\\agent",
Expand All @@ -116,7 +119,7 @@ var ogcSupported = []LayoutOS{
Version: "2019",
},
Provider: Google,
InstanceSize: "e2-standard-4", // 4 amd64 cpus
InstanceSize: "e2-standard-4", // 4 amd64 cpus, 16 GB RAM
RunsOn: "windows-2019",
Username: "windows",
RemotePath: "C:\\Users\\windows\\agent",
Expand All @@ -128,7 +131,7 @@ var ogcSupported = []LayoutOS{
Version: "2019-core",
},
Provider: Google,
InstanceSize: "e2-standard-4", // 4 amd64 cpus
InstanceSize: "e2-standard-4", // 4 amd64 cpus, 16 GB RAM
RunsOn: "windows-2019-core",
Username: "windows",
RemotePath: "C:\\Users\\windows\\agent",
Expand All @@ -140,7 +143,7 @@ var ogcSupported = []LayoutOS{
Version: "2016",
},
Provider: Google,
InstanceSize: "e2-standard-4", // 4 amd64 cpus
InstanceSize: "e2-standard-4", // 4 amd64 cpus, 16 GB RAM
RunsOn: "windows-2016",
Username: "windows",
RemotePath: "C:\\Users\\windows\\agent",
Expand All @@ -152,7 +155,7 @@ var ogcSupported = []LayoutOS{
Version: "2016-core",
},
Provider: Google,
InstanceSize: "e2-standard-4", // 4 amd64 cpus
InstanceSize: "e2-standard-4", // 4 amd64 cpus, 16 GB RAM
RunsOn: "windows-2016-core",
Username: "windows",
RemotePath: "C:\\Users\\windows\\agent",
Expand Down

0 comments on commit 4ec05ca

Please sign in to comment.