Commit graph

16 commits

Author SHA1 Message Date
github-actions[bot]
7f9b477bad
Support ironbank docker build (#14298) (#14306)
This commit adds a rake task `rake artifact:dockerfile_ironbank` to generate ironbank docker build context for automatic release.
The output can be found in build/logstash-ironbank-$VERSION-docker-build-context.tar.gz

Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
(cherry picked from commit dfb109843d)

Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>
2022-06-28 19:14:05 +01:00
github-actions[bot]
c9b3046f3c
make retries in pip and go get extra shell compatible (#14282) (#14294)
the use of ranges (e.g. {0..5}) or seq (e.g. $(seq 0 5)) may not
correctly in some systems, so let's just have a plain list of elements
for the loop to go through.

(cherry picked from commit ce27e08eac)

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2022-06-24 12:31:23 +01:00
github-actions[bot]
054f53edd3
improve resiliency of make venv and golang Dockerfile with retries (#14239) (#14277)
This helps with transient network problems by not failing at the first try.

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
(cherry picked from commit ff9f1e5a7f)

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2022-06-24 12:29:54 +01:00
Rob Bavey
3b3f116e76
Backport PR#13014 to 7.16: Docker integration tests stability improvements (#13446)
Backport PR#13014 to 7.16 branch. Original message:

* Docker integration tests stability improvements

This commit contains numerous fixes to improve the stability of the docker integration tests

* Patch Excon::UnixSocket

Socket.new running on arm64 on Ubuntu 18.04, causes an immediate SIGSEGV error and crash on
that OS, and, as far as I can tell, only that OS. `TCPSocket.new`,`UDPSocket.new` and
`UNIXSocket.new` do not. This commit patches the UnixSocket of the Excon library to
do the absolute simplest thing possible to avoid this error.

* Ensure that container is deleted even if #kill fails

* Add extra waits to handle the incremental way the payload returned by the monitoring
API increases as logstash starts up and pipelines load.

* Use pyenv to ensure the same version of python is used across different jenkins workers

* Add container logs to help diagnose failed test.

* Update the pipeline definition on multi-pipeline integration test

This was causing a pipeline to halt after startup causing intermittent test failures.

* Remove `;` to ensure failures are propagated appropriately

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2021-11-24 09:53:26 +00:00
Rob Bavey
44fa849852
[7x backport] Fix docker image metadata (#12450)
Clean backport of #12447, #12452

This commit fixes two issues with the docker metadata:

Removes non-OCI compliant freeform metadata labels
Uses a consistent build date for all the docker images and dockerfiles

Additionally, this commit adds a `build_docker_ubi8` rake task to enable
`ci/docker_acceptance_tests.sh` to run with no options to build all
docker images for the architecture.

Removing the freeform description labels left the container metadata
without a description label. This commit adds a description under the
"org.opencontainers.image.description" label
2020-11-18 16:10:48 -05:00
Rob Bavey
ccbc5691cb
Docker Build: Add ability to detect/set build architecture (#12303)
Clean backport of #12302

This commit adds the ability for the docker build to build artifacts for multiple architectures.
By default, the target architecture is inferred from the architecture of the machine the build is being
run from - running the build from an aarch64 machine will build an aarch64 docker image, while building
from an x86_64 machine will build an x86_64 docker image.

This can be overridden by setting the environment variable DOCKER_ARCHITECTURE to either `x86_64` or
`aarch64`.

This commit also updates the integration tests to test against the architecture from the machine the test
is being run on, and includes the target architecture in the test description.
2020-10-05 13:38:09 -04:00
Julien Mailleret
713fbfbf14 fix ubi8 docker build context
This commit fixes a typo in the name of the docker build context for ubi8 images.
2020-08-26 15:16:50 +00:00
Rob Bavey
0772e72fa8 Minor fixes to acceptance and docker test scripts 2020-08-20 14:35:48 +00:00
Rob Bavey
ef1352ef53 Add UBI8 docker image to artifacts
This commit adds the rake docker_ubi8 rake task, and associated
changes to the docker template and makefiles.

This commit also refactors the acceptance tests to extract xpack tests
into a helper class to allow the same tests to be used in both 'full'
and 'ubi8' docker image tests
2020-08-20 14:35:48 +00:00
Rob Bavey
e8385738c5
7x Introduce integration tests for docker images (#12157)
Clean backport of #12135

This commit adds integration tests for the Logstash docker images. Previous
integration tests were removed in https://github.com/elastic/logstash/pull/10693,
due to the tests being non functional.

The commit adds image and container tests. The image tests check the contents and the
metadata of the image; the container tests check the logstash process, and includes tests
ensuring that logstash runs, and is configurable.

This test also adds a ci script to allow the tests to be run on jenkins, and to split the
running of these tests up based on the image type and includes updates to the rake tasks to
support this.
2020-08-03 09:43:09 -04:00
Rob Bavey
702f872eff Fix docker image labels
Prior to this commit, the value of `org.label-schema.license` and
the values in `org.opencontainers.image.*` were not set, and therefore
would be inherited from the base OS image.
2020-07-23 19:48:58 +00:00
Rob Bavey
b846a0fdb8 Removes UBI7 docker code
Removal of code (#11335) to generate UBI7 based docker images, as this is not
being used for now

Fixes #11489
2020-01-14 14:04:54 +00:00
Rob Bavey
bd66db544a Add UBI based docker images
This commit adds support for images based on UBI7 base image

Closes #11265

Fixes #11335
2019-12-03 13:51:49 +00:00
Joao Duarte
089f369033 generate tarballs for docker images
Fixes #10819
2019-05-24 15:09:27 +00:00
Joao Duarte
71d7b7c1fb
rake task to generate dockerfile
* dont include docker tasks in artifact:all
* don't rebuild tar/zip if source hasn't changed
* allow SKIP_PREPARE to avoid tar creation if no modifications
* don't need a tarball to generate the dockerfile
* remove docker tests as they weren't working anymore

This commit adds a task to produce all necessary files to generate a docker image.

```
% RELEASE=1 rake artifact:dockerfile
....
Dockerfile created in /tmp/elastic/logstash/build/docker
% tree /tmp/elastic/logstash/build/docker
/tmp/elastic/logstash/build/docker
├── Dockerfile
├── bin
│   └── docker-entrypoint
├── config
│   ├── log4j2.properties
│   ├── logstash-full.yml
│   └── pipelines.yml
├── env2yaml
│   └── env2yaml
└── pipeline
    └── default.conf
% docker build --rm .
.....
Step 19/20 : LABEL org.label-schema.schema-version="1.0"   org.label-schema.vendor="Elastic"   org.label-schema.name="logstash"   org.label-schema.version="7.0.0"   org.label-schema.url="https://www.elastic.co/products/logstash"   org.label-schema.vcs-url="https://github.com/elastic/logstash" license="Elastic License"
 ---> Using cache
 ---> f622d7555220
Step 20/20 : ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]
 ---> Using cache
 ---> b6feba7f4934
Successfully built b6feba7f4934
```

This task works only for releases (not snapshots).

This commit also adds a few tweaks to the artifacts building:

Using `SKIP_PREPARE=1` in `rake artifact:tar` or `rake artifact:tar_oss` will make a check to not rebuild the tarball if there are no code modifications.

These two changes are made since docker image build is new and we want to keep it out of artifact:all for a while. And if we're running these separately, we want to ensure the tarball built is used in the docker image (versus building a new one for each `rake artifact:tar` )

This means that, to generate all artifacts including docker images and dockerfile, it's necessary to run:

```
RELEASE=1 rake artifact:all
SKIP_PREPARE=1 RELEASE=1 rake artifact:docker
SKIP_PREPARE=1 RELEASE=1 rake artifact:docker_oss
RELEASE=1 rake artifact:dockerfile
```
2019-04-22 22:57:55 +01:00
João Duarte
0921798a71
build docker images from logstash repo (#10603)
introduces two rake tasks: `rake artifact:docker_oss` and `rake artifact:docker`, which will create the docker images of the OSS and non OSS packages. These tasks depend on the tar artifacts being built.

Also `rake artifact:all` has been modified to also call these two tasks.

most code was moved from https://github.com/elastic/logstash-docker/
2019-04-04 11:27:31 +01:00