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

Add target to build images from supported-versions.yml file #14587

Merged

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Nov 18, 2019

Add mage targets intended to be used mostly by CI to prebuild
and push images used by integration and E2E tests. It leverages
existing docker compose scenarios, and build all the images in
the docker-compose.yml file associated to each
supported-versions.yml file.

To find the associated docker-compose.yml file, it follows similar
behaviour we have in other places, it starts descending directories
till it finds a directory with a docker-compose.yml file.

Usage example:

$ mage compose:buildSupportedVersions
2019/11/18 17:10:31 Found Elastic Beats dir at /home/jaime/gocode/src/github.com/elastic/beats
>> compose: Building docker images for supported versions
>> compose: Using compose file module/mysql/docker-compose.yml
>> compose: Building images for variant map[MYSQL_VARIANT:mysql MYSQL_VERSION:5.7.12]
>> compose: Building images for variant map[MYSQL_VARIANT:mysql MYSQL_VERSION:8.0.13]
>> compose: Building images for variant map[MYSQL_VARIANT:percona MYSQL_VERSION:5.7.24]
>> compose: Building images for variant map[MYSQL_VARIANT:percona MYSQL_VERSION:8.0.13-4]
>> compose: Building images for variant map[MYSQL_VARIANT:mariadb MYSQL_VERSION:10.2.23]
>> compose: Building images for variant map[MYSQL_VARIANT:mariadb MYSQL_VERSION:10.3.14]
>> compose: Building images for variant map[MYSQL_VARIANT:mariadb MYSQL_VERSION:10.4.4]
>> compose: OK

For push:

$ mage compose:pushSupportedVersions
2019/11/18 17:15:30 Found Elastic Beats dir at /home/jaime/gocode/src/github.com/elastic/beats
>> compose: Pushing docker images for supported versions
>> compose: Using compose file module/mysql/docker-compose.yml
>> compose: Pushing images for variant map[MYSQL_VARIANT:mysql MYSQL_VERSION:5.7.12]
...

Related to #14520 and #14355.

@jsoriano jsoriano self-assigned this Nov 18, 2019
@jsoriano jsoriano force-pushed the mage-build-images-supported-versions branch from 143dd7f to d1858d5 Compare November 18, 2019 16:21
@mdelapenya
Copy link
Contributor

Just started reviewing :)

:octocat: Sent from GH.

Copy link
Contributor

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM 👍

I'd see convenient to add a mageg target per service, so that it's possible to build one single service. wdyt?

image

@jsoriano
Copy link
Member Author

I'd see convenient to add a mageg target per service, so that it's possible to build one single service. wdyt?

SUPPORTED_VERSIONS_FILE environment variable can be used to build only the variants defined in a specific file.

@mdelapenya
Copy link
Contributor

mdelapenya commented Nov 18, 2019

I'd see convenient to add a mageg target per service, so that it's possible to build one single service. wdyt?

SUPPORTED_VERSIONS_FILE environment variable can be used to build only the variants defined in a specific file.

Wouldn't it be better for CI, instead of generating a file on the fly, having a target to do that? 🤔
Now I get it: the file already exists and the environment variable configures which one to build. Thanks!

@jsoriano jsoriano marked this pull request as ready for review November 19, 2019 09:40
@jsoriano jsoriano requested a review from a team as a code owner November 19, 2019 09:40
Copy link
Contributor

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM 👍

image

@jsoriano
Copy link
Member Author

jenkins, test this again please

1 similar comment
@jsoriano
Copy link
Member Author

jenkins, test this again please

@jsoriano
Copy link
Member Author

I don't think failures in CI are related, merging this.

@jsoriano jsoriano merged commit 5cbda9f into elastic:master Nov 20, 2019
@jsoriano jsoriano deleted the mage-build-images-supported-versions branch November 20, 2019 15:06
@mdelapenya
Copy link
Contributor

@jsoriano could we document how to run this command, and its main purpose?

@jsoriano
Copy link
Member Author

@jsoriano could we document how to run this command, and its main purpose?

Yes, we have to revamp the developer guides, and we should include these targets in some explanation of the supported-versions.yml file. I don't think we have a place to document mage targets now.

In the meantime, do you need some clarification about these commands?

jsoriano added a commit to jsoriano/beats that referenced this pull request Nov 20, 2019
…14587)

Add mage targets intended to be used mostly by CI to prebuild
and push images used by integration and E2E tests. It leverages
existing docker compose scenarios, and build all the images in
the docker-compose.yml file associated to each
supported-versions.yml file.

To find the associated docker-compose.yml file, it follows similar
behaviour we have in other places, it starts descending directories
till it finds a directory with a docker-compose.yml file.

(cherry picked from commit 5cbda9f)
jsoriano added a commit that referenced this pull request Nov 20, 2019
…14659)

Add mage targets intended to be used mostly by CI to prebuild
and push images used by integration and E2E tests. It leverages
existing docker compose scenarios, and build all the images in
the docker-compose.yml file associated to each
supported-versions.yml file.

To find the associated docker-compose.yml file, it follows similar
behaviour we have in other places, it starts descending directories
till it finds a directory with a docker-compose.yml file.

(cherry picked from commit 5cbda9f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants