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

fix: use maintenance branches instead of tags #374

Merged
merged 4 commits into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ pipeline {
booleanParam(name: "forceSkipPresubmit", defaultValue: false, description: "If it's needed to execute the pre-submit tests: unit and precommit.")
booleanParam(name: "notifyOnGreenBuilds", defaultValue: false, description: "If it's needed to notify with green builds.")
string(name: 'SLACK_CHANNEL', defaultValue: 'observablt-bots', description: 'The Slack channel where errors will be posted')
string(name: 'ELASTIC_AGENT_DOWNLOAD_URL', defaultValue: '', description: 'If present, it will override the download URL for the Elastic agent artifact. (I.e. https://staging.elastic.co/7.9.2-9a979774/downloads/beats/elastic-agent/elastic-agent-7.9.2-linux-x86_64.tar.gz')
string(name: 'ELASTIC_AGENT_VERSION', defaultValue: '7.9.2', description: 'SemVer version of the stand-alone elastic-agent to be used for Ingest Manager tests. You can use here the tag of your PR to test your changes')
string(name: 'ELASTIC_AGENT_DOWNLOAD_URL', defaultValue: '', description: 'If present, it will override the download URL for the Elastic agent artifact. (I.e. https://snapshots.elastic.co/7.9.2-9a979774/downloads/beats/elastic-agent/elastic-agent-7.9.2-linux-x86_64.tar.gz')
string(name: 'ELASTIC_AGENT_VERSION', defaultValue: '7.9-SNAPSHOT', description: 'SemVer version of the stand-alone elastic-agent to be used for Ingest Manager tests. You can use here the tag of your PR to test your changes')
booleanParam(name: "ELASTIC_AGENT_USE_CI_SNAPSHOTS", defaultValue: false, description: "If it's needed to use the binary snapshots produced by Beats CI instead of the official releases")
choice(name: 'LOG_LEVEL', choices: ['DEBUG', 'INFO'], description: 'Log level to be used')
choice(name: 'TIMEOUT_FACTOR', choices: ['3', '5', '7', '11'], description: 'Max number of minutes for timeout backoff strategies')
string(name: 'INGEST_MANAGER_STACK_VERSION', defaultValue: '7.9.2', description: 'SemVer version of the stack to be used for Ingest Manager tests.')
string(name: 'METRICBEAT_STACK_VERSION', defaultValue: '7.9.2', description: 'SemVer version of the stack to be used for Metricbeat tests.')
string(name: 'METRICBEAT_VERSION', defaultValue: '7.9.2', description: 'SemVer version of the metricbeat to be used.')
string(name: 'INGEST_MANAGER_STACK_VERSION', defaultValue: '7.9-SNAPSHOT', description: 'SemVer version of the stack to be used for Ingest Manager tests.')
string(name: 'METRICBEAT_STACK_VERSION', defaultValue: '7.9-SNAPSHOT', description: 'SemVer version of the stack to be used for Metricbeat tests.')
string(name: 'METRICBEAT_VERSION', defaultValue: '7.9-SNAPSHOT', description: 'SemVer version of the metricbeat to be used.')
string(name: 'HELM_CHART_VERSION', defaultValue: '7.6.1', description: 'SemVer version of Helm chart to be used.')
string(name: 'HELM_VERSION', defaultValue: '2.16.3', description: 'SemVer version of Helm to be used.')
string(name: 'HELM_KIND_VERSION', defaultValue: '0.8.1', description: 'SemVer version of Kind to be used.')
Expand Down
6 changes: 1 addition & 5 deletions .ci/scripts/clean-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -euxo pipefail
# Build and test the app using the install and test make goals.
#

readonly VERSION="7.9.2"
readonly VERSION="7.9-SNAPSHOT"

main() {
# refresh docker images
Expand All @@ -18,10 +18,6 @@ docker.elastic.co/beats/elastic-agent:${VERSION}
docker.elastic.co/beats/elastic-agent-ubi8:${VERSION}
docker.elastic.co/elasticsearch/elasticsearch:${VERSION}
docker.elastic.co/kibana/kibana:${VERSION}
docker.elastic.co/observability-ci/elastic-agent:${VERSION}
docker.elastic.co/observability-ci/elastic-agent-ubi8:${VERSION}
docker.elastic.co/observability-ci/elasticsearch:${VERSION}
docker.elastic.co/observability-ci/kibana:${VERSION}
EOF

pull_images "$(cat .tmp_images)"
Expand Down
8 changes: 4 additions & 4 deletions .ci/scripts/functional-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ set -euxo pipefail
# Parameters:
# - SUITE - that's the suite to be tested. Default '' which means all of them.
# - TAGS - that's the tags to be tested. Default '' which means all of them.
# - STACK_VERSION - that's the version of the stack to be tested. Default '7.9.0'.
# - METRICBEAT_VERSION - that's the version of the metricbeat to be tested. Default '7.9.0'.
# - STACK_VERSION - that's the version of the stack to be tested. Default '7.9-SNAPSHOT'.
# - METRICBEAT_VERSION - that's the version of the metricbeat to be tested. Default '7.9-SNAPSHOT'.
#

SUITE=${1:-''}
TAGS=${2:-''}
STACK_VERSION=${3:-'7.9.2'}
METRICBEAT_VERSION=${4:-'7.9.2'}
STACK_VERSION=${3:-'7.9-SNAPSHOT'}
METRICBEAT_VERSION=${4:-'7.9-SNAPSHOT'}
TARGET_OS=${GOOS:-linux}
TARGET_ARCH=${GOARCH:-amd64}

Expand Down
4 changes: 2 additions & 2 deletions cli/config/compose/profiles/ingest-manager/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
- xpack.security.authc.api_key.enabled=true
- ELASTIC_USERNAME=elastic
- ELASTIC_PASSWORD=changeme
image: "docker.elastic.co/elasticsearch/elasticsearch:${stackVersion:-7.9.2}"
image: "docker.elastic.co/elasticsearch/elasticsearch:${stackVersion:-7.9-SNAPSHOT}"
ports:
- "9200:9200"
kibana:
Expand All @@ -29,7 +29,7 @@ services:
test: "curl -f http://localhost:5601/login | grep kbn-injected-metadata 2>&1 >/dev/null"
retries: 600
interval: 1s
image: "docker.elastic.co/kibana/kibana:${stackVersion:-7.9.2}"
image: "docker.elastic.co/kibana/kibana:${stackVersion:-7.9-SNAPSHOT}"
ports:
- "5601:5601"
volumes:
Expand Down
2 changes: 1 addition & 1 deletion cli/config/compose/profiles/metricbeat/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ services:
- xpack.monitoring.collection.enabled=true
- ELASTIC_USERNAME=elastic
- ELASTIC_PASSWORD=changeme
image: "docker.elastic.co/observability-ci/elasticsearch:${stackVersion:-7.9.2}"
image: "docker.elastic.co/elasticsearch/elasticsearch:${stackVersion:-7.9-SNAPSHOT}"
ports:
- "9200:9200"
2 changes: 1 addition & 1 deletion cli/config/compose/services/apm-server/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
- setup.kibana.host=http://kibana:5601
- setup.template.settings.index.number_of_replicas=0
- xpack.monitoring.elasticsearch=true
image: "docker.elastic.co/observability-ci/apm-server:${apmServerTag}"
image: "docker.elastic.co/apm/apm-server:${apmServerTag}"
ports:
- "6060:6060"
- "8200:8200"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2.3'
services:
elastic-agent:
image: docker.elastic.co/beats/elastic-agent:${elasticAgentTag:-7.9.2}
image: docker.elastic.co/beats/elastic-agent:${elasticAgentTag:-7.9-SNAPSHOT}
depends_on:
elasticsearch:
condition: service_healthy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
- xpack.monitoring.collection.enabled=true
- ELASTIC_USERNAME=elastic
- ELASTIC_PASSWORD=changeme
image: "docker.elastic.co/observability-ci/elasticsearch:${elasticsearchTag}"
image: "docker.elastic.co/elasticsearch/elasticsearch:${elasticsearchTag}"
ports:
- "9200:9200"
- "9300:9300"
2 changes: 1 addition & 1 deletion cli/config/compose/services/kibana/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ services:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
- ELASTIC_USERNAME=elastic
- ELASTIC_PASSWORD=changeme
image: "docker.elastic.co/observability-ci/kibana:${kibanaTag}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdelapenya can you discuss the differences in build times and availability of images between the observability-ci and main elastic docker images? Will this change prevent us from 'getting' a fix into the test environment faster, presuming the main docker image is built only once or twice a day, and the obs-ci is presumably built much more often?

I was also thinking in a separate issue we should dry this up and up put the version portion of the semVar in a constant.

Copy link
Contributor Author

@mdelapenya mdelapenya Oct 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The observability-ci namespace is refreshed with every merge to master in beats, and for the stack they are updated automatically.

image: "docker.elastic.co/kibana/kibana:${kibanaTag}"
ports:
- "5601:5601"
2 changes: 1 addition & 1 deletion cli/config/compose/services/metricbeat/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
]
environment:
- BEAT_STRICT_PERMS=${beatStricPerms:-false}
image: "docker.elastic.co/observability-ci/metricbeat:${metricbeatTag:-7.9.2}"
image: "docker.elastic.co/beats/metricbeat:${metricbeatTag:-7.9-SNAPSHOT}"
labels:
co.elastic.logs/module: "${serviceName}"
volumes:
Expand Down
6 changes: 3 additions & 3 deletions e2e/_suites/ingest-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ This is an example of the optional configuration:

```shell
# There should be a Docker image for the runtime dependencies (elasticsearch, kibana, package registry)
export STACK_VERSION=7.9.2
export STACK_VERSION=7.9-SNAPSHOT
# (Fleet mode) This environment variable will use a fixed version of the Elastic agent binary, obtained from
# https://artifacts-api.elastic.co/v1/search/7.9.2/elastic-agent
# https://artifacts-api.elastic.co/v1/search/7.9-SNAPSHOT/elastic-agent
export ELASTIC_AGENT_DOWNLOAD_URL="https://staging.elastic.co/7.9.2-9a979774/downloads/beats/elastic-agent/elastic-agent-7.9.2-linux-x86_64.tar.gz"
# (Fleet mode) This environment variable will use the snapshots produced by Beats CI. If the above variable
# is set, this variable will take no effect
export ELASTIC_AGENT_USE_CI_SNAPSHOTS="true"
# (Stand-Alone mode) This environment variable will use the its value as the Docker tag produced by Beats CI (Please look up here: https://container-library.elastic.co/r/observability-ci/elastic-agent). Here you have two examples for tags:
# (Stand-Alone mode) This environment variable will use the its value as the Docker tag produced by Beats CI (Please look up here: https://container-library.elastic.co/r/beats/elastic-agent). Here you have two examples for tags:
export ELASTIC_AGENT_VERSION="pr-20356"
# or
export ELASTIC_AGENT_VERSION="78a762c76080aafa34c52386341b590dac24e2df"
Expand Down
2 changes: 1 addition & 1 deletion e2e/_suites/ingest-manager/ingest-manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const IngestManagerProfileName = "ingest-manager"

// stackVersion is the version of the stack to use
// It can be overriden by STACK_VERSION env var
var stackVersion = "7.9.2"
var stackVersion = "7.9-SNAPSHOT"

// profileEnv is the environment to be applied to any execution
// affecting the runtime dependencies (or profile)
Expand Down
6 changes: 4 additions & 2 deletions e2e/_suites/ingest-manager/stand-alone.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
log "github.com/sirupsen/logrus"
)

const standAloneVersionBase = "7.9.2"
const standAloneVersionBase = "7.9-SNAPSHOT"

// standAloneVersion is the version of the agent to use
// It can be overriden by ELASTIC_AGENT_VERSION env var
Expand Down Expand Up @@ -79,7 +79,9 @@ func (sats *StandAloneTestSuite) aStandaloneAgentIsDeployed() error {
serviceName := ElasticAgentServiceName
containerName := fmt.Sprintf("%s_%s_%d", profile, serviceName, 1)

configurationFileURL := "https://raw.githubusercontent.com/elastic/beats/v" + standAloneVersion + "/x-pack/elastic-agent/elastic-agent.docker.yml"
branch := strings.ReplaceAll(standAloneVersion, "-SNAPSHOT", "")

configurationFileURL := "https://raw.githubusercontent.com/elastic/beats/" + branch + "/x-pack/elastic-agent/elastic-agent.docker.yml"

configurationFilePath, err := e2e.DownloadFile(configurationFileURL)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions e2e/_suites/metricbeat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ This is an example of the optional configuration:

```shell
# There should be a Docker image for the runtime dependencies (elasticsearch, kibana, package registry)
export STACK_VERSION="7.9.2"
export METRICBEAT_VERSION="7.9.2"
export STACK_VERSION="7.9-SNAPSHOT"
export METRICBEAT_VERSION="7.9-SNAPSHOT"
```

3. Define the proper Docker images to be used in tests (Optional).
Expand Down
8 changes: 5 additions & 3 deletions e2e/_suites/metricbeat/metricbeat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
// It can be overriden by the DEVELOPER_MODE env var
var developerMode = false

const metricbeatVersionBase = "8.0.0-SNAPSHOT"
const metricbeatVersionBase = "7.9-SNAPSHOT"

// metricbeatVersion is the version of the metricbeat to use
// It can be overriden by METRICBEAT_VERSION env var
Expand All @@ -41,7 +41,7 @@ var serviceManager services.ServiceManager

// stackVersion is the version of the stack to use
// It can be overriden by STACK_VERSION env var
var stackVersion = "7.9.2"
var stackVersion = "7.9-SNAPSHOT"

func init() {
config.Init()
Expand Down Expand Up @@ -251,7 +251,9 @@ func (mts *MetricbeatTestSuite) installedUsingConfiguration(configuration string
mts.Version = metricbeatVersion
mts.setIndexName()

configurationFileURL := "https://raw.githubusercontent.com/elastic/beats/v" + metricbeatVersion + "/metricbeat/" + configuration + ".yml"
branch := strings.ReplaceAll(metricbeatVersion, "-SNAPSHOT", "")

configurationFileURL := "https://raw.githubusercontent.com/elastic/beats/" + branch + "/metricbeat/" + configuration + ".yml"

configurationFilePath, err := e2e.DownloadFile(configurationFileURL)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions e2e/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func GetExponentialBackOff(elapsedTime time.Duration) *backoff.ExponentialBackOf
// on the desired OS, architecture and file extension:
// 1. Observability CI Storage bucket
// 2. Elastic's artifact repository, building the JSON path query based
// i.e. GetElasticArtifactURL("elastic-agent", "7.9.2", "x86_64", "rpm")
// i.e. GetElasticArtifactURL("elastic-agent", "7.9.2", "amd64", "deb")
// i.e. GetElasticArtifactURL("elastic-agent", "7.9-SNAPSHOT", "x86_64", "rpm")
// i.e. GetElasticArtifactURL("elastic-agent", "7.9-SNAPSHOT", "amd64", "deb")
func GetElasticArtifactURL(artifact string, version string, OS string, arch string, extension string) (string, error) {
exp := GetExponentialBackOff(time.Minute)

Expand Down