Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build docker image for elasticsearch snapshot #70482

Merged
merged 6 commits into from
Jul 2, 2020

Conversation

liza-mae
Copy link
Contributor

@liza-mae liza-mae commented Jul 1, 2020

Relates to #70021. Build a docker image and post in it in the archives from the Kibana ES snapshots job.

@liza-mae liza-mae requested a review from a team as a code owner July 1, 2020 16:50
@liza-mae liza-mae self-assigned this Jul 1, 2020
@liza-mae liza-mae added release_note:skip Skip the PR/issue when compiling release notes v7.8.1 v7.9.0 v8.0.0 labels Jul 1, 2020
@liza-mae liza-mae requested a review from pugnascotia July 1, 2020 20:04
@liza-mae
Copy link
Contributor Author

liza-mae commented Jul 1, 2020

Spoke to @tylersmalley about his review comments, we were unable to get those to work as we expected, but I had already tried different approaches and had slack threads with both Maxime and Rory, +Elasticsearch team to try to match the output of release manager docker image, without a clear answer, so I just did it using docker save CLI.

Main slack thread: https://elastic.slack.com/archives/C0D8ST60Y/p1593206321450800

Adding @pugnascotia as a reviewer to guide us.

@liza-mae
Copy link
Contributor Author

liza-mae commented Jul 1, 2020

@pugnascotia, for context we aren't pushing the image to a docker registry, we just are going to post the docker image .tar.gz with the archives the Kibana team is putting in GCP bucket with other distributables similar to release manager. Although if it is better/faster to post it to a docker registry I can set that up too.

@liza-mae
Copy link
Contributor Author

liza-mae commented Jul 1, 2020

I am thinking it might be best to push the image to a docker registry, thoughts?

@tylersmalley
Copy link
Contributor

The docker registry would create other issues and another place to manage these images, let's stick to the archives.

@liza-mae
Copy link
Contributor Author

liza-mae commented Jul 1, 2020

FYI.. release manager does both and it would be needed if we expand testing to ECK. Just thinking ahead. We can stick with the archives for now.

@pugnascotia
Copy link
Contributor

Some context:

While the ES build does support exporting Docker images to disk, right now it only happens when you call a particular target, because it's only used for a very specific test case. It also only exports the elasticsearch:test image tag, which probably isn't very helpful.

I believe release-manager does its own exporting to disk due to the Tekton pipeline that it uses for pushing images to a registry.

I'm wondering if we can push this exporting logic into the ES build itself, for both Kibana and Infra to use, but that will involve a bit of fiddling around. In the meantime, if you're only interested in the x86 non-OSS image, you could just run:

./gradlew distribution:docker:buildDockerImage

...then do the save as you already have it, although you could gzip the exports images directory to their final locations:

docker images "docker.elastic.co/elasticsearch/elasticsearch" --format "{{.Tag}}" | xargs -n1 bash -c \
  'docker save docker.elastic.co/elasticsearch/elasticsearch:${0} | gzip > ${destination}/elasticsearch-${0}-docker-image.tar.gz'

@pugnascotia
Copy link
Contributor

For interest, here's where the release manager does its docker save:

https://github.com/elastic/infra/blob/master/cd/release/release-manager/buildSrc/src/main/groovy/org/elastic/gradle/StackProject.groovy#L965

@liza-mae
Copy link
Contributor Author

liza-mae commented Jul 2, 2020

Thanks @pugnascotia! It is good to know I was on the right track :)

@liza-mae
Copy link
Contributor Author

liza-mae commented Jul 2, 2020

@elasticmachine merge upstream

@liza-mae
Copy link
Contributor Author

liza-mae commented Jul 2, 2020

@tylersmalley @brianseeders can I get this reviewed please?

Copy link
Contributor

@brianseeders brianseeders left a comment

Choose a reason for hiding this comment

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

Can you also change node(workers.label('s')) { on line 28 to node(workers.label('l')) {?

We need a larger machine.. with all of the docker stuff, the small worker is running out of space.

.ci/es-snapshots/Jenkinsfile_build_es Outdated Show resolved Hide resolved
.ci/es-snapshots/Jenkinsfile_build_es Outdated Show resolved Hide resolved
.ci/es-snapshots/Jenkinsfile_build_es Outdated Show resolved Hide resolved
liza-mae and others added 3 commits July 2, 2020 12:23
Copy link
Contributor

@brianseeders brianseeders left a comment

Choose a reason for hiding this comment

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

Tested on my sandbox, looks good now.

@liza-mae liza-mae merged commit 52f8d3a into elastic:master Jul 2, 2020
@liza-mae liza-mae deleted the liza/add-docker-es-snapshot branch July 2, 2020 19:41
liza-mae added a commit to liza-mae/kibana that referenced this pull request Jul 2, 2020
* Build docker image for elasticsearch snapshot

* Consolidate statements

* Update .ci/es-snapshots/Jenkinsfile_build_es

Co-authored-by: Brian Seeders <seeders@gmail.com>

* Update find

* Use larger worker

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Brian Seeders <seeders@gmail.com>
liza-mae added a commit to liza-mae/kibana that referenced this pull request Jul 2, 2020
* Build docker image for elasticsearch snapshot

* Consolidate statements

* Update .ci/es-snapshots/Jenkinsfile_build_es

Co-authored-by: Brian Seeders <seeders@gmail.com>

* Update find

* Use larger worker

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Brian Seeders <seeders@gmail.com>
liza-mae added a commit that referenced this pull request Jul 3, 2020
* Build docker image for elasticsearch snapshot

* Consolidate statements

* Update .ci/es-snapshots/Jenkinsfile_build_es

Co-authored-by: Brian Seeders <seeders@gmail.com>

* Update find

* Use larger worker

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Brian Seeders <seeders@gmail.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Brian Seeders <seeders@gmail.com>
liza-mae added a commit that referenced this pull request Jul 3, 2020
* Build docker image for elasticsearch snapshot

* Consolidate statements

* Update .ci/es-snapshots/Jenkinsfile_build_es

Co-authored-by: Brian Seeders <seeders@gmail.com>

* Update find

* Use larger worker

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Brian Seeders <seeders@gmail.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Brian Seeders <seeders@gmail.com>
liza-mae added a commit that referenced this pull request Jul 3, 2020
* Build docker image for elasticsearch snapshot

* Consolidate statements

* Update .ci/es-snapshots/Jenkinsfile_build_es

Co-authored-by: Brian Seeders <seeders@gmail.com>

* Update find

* Use larger worker

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Brian Seeders <seeders@gmail.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Brian Seeders <seeders@gmail.com>
mistic added a commit to mistic/kibana that referenced this pull request Jul 6, 2020
tylersmalley pushed a commit to tylersmalley/kibana that referenced this pull request Jul 6, 2020
The change introduced a pattern which would only match for when there is
a version qualifier used to build Elasticsearch.

Since we're using docker to export an image, there also isn't a reason
why we need to update the find command to also include
`distributions/docker`

Partial revert of elastic#70482

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v6.8.11 v7.8.1 v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants