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] Add support for centos ARM builds #84831

Merged
merged 41 commits into from
Jan 28, 2021

Conversation

jbudz
Copy link
Member

@jbudz jbudz commented Dec 2, 2020

This adds support for passing an architecture flag to the docker
builder, enabling centos ARM package builds on native machines. The
changes here include:

  1. Output files now include the architecture, e.g.
    kibana-8.0.0-SNAPSHOT-docker-image.tar.gz -> kibana-8.0.0-SNAPSHOT-arm64-docker-image.tar.gz
  2. nss is installed instead of libnss3.so. libnss3.so was not
    available.

On an arm64 host, generating the image can be done with yarn build. On an x64 host, only the build context will be generated.

Closes #72884

Release note:
Adds docker images for ARM64 based operating systems

This adds support for passing an architecture flag to the docker
builder, enabling centos ARM package builds on native machines.  The
changes here include:
1) Output files now include the architecture, e.g.
kibana-8.0.0-SNAPSHOT-docker-image.tar.gz -> kibana-8.0.0-SNAPSHOT-arm64-docker-image.tar.gz
2) nss is installed instead of libnss3.so.  libnss3.so was not
available.

Because this requires an ARM build machine, it's off by default.
Building can be done with `yarn build --skip-os-packages --docker-arm`
@jbudz jbudz added the Team:Operations Team label for Operations Team label Dec 2, 2020
@jbudz
Copy link
Member Author

jbudz commented Dec 2, 2020

https://s3-us-west-1.amazonaws.com/kibana.budzenski.com/84831/f604e34/kibana-8.0.0-SNAPSHOT-arm64-docker-image.tar.gz

I tested a basic install with reporting - so far we're functioning.

@jbudz jbudz marked this pull request as ready for review December 2, 2020 21:51
@jbudz jbudz requested a review from a team as a code owner December 2, 2020 21:51
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@tylersmalley
Copy link
Contributor

Chatted with @jbudz, he is going to change the docker builds to always build the context. This will allow us to use a downstream job to build the actual image artifact on an ARM machine.

@jbudz
Copy link
Member Author

jbudz commented Dec 7, 2020

Chatted with @jbudz, he is going to change the docker builds to always build the context. This will allow us to use a downstream job to build the actual image artifact on an ARM machine.

Pushed with c10c26d. Removed the docker ARM specific flag, it'll generate all docker contexts and build the image corresponding to the host.

@jbudz
Copy link
Member Author

jbudz commented Dec 8, 2020

@elasticmachine merge upstream

@jbudz
Copy link
Member Author

jbudz commented Dec 8, 2020

I'm doing a secondary full integration sweep. ARM is fine so far. All bundle contexts were generated. amd64 image will be up shortly, but otherwise this LGTM for reviews.

ubuntu@ip-172-31-26-157:~/kibana$ docker load --input target/kibana-8.0.0-SNAPSHOT-arm64-docker-image.tar.gz
Loaded image: docker.elastic.co/kibana/kibana:8.0.0-SNAPSHOT-arm64
ubuntu@ip-172-31-26-157:~/kibana$ docker run -it docker.elastic.co/kibana/kibana:8.0.0-SNAPSHOT-arm64
  log   [20:25:29.436] [info][plugins-service] Plugin "visTypeXy" is disabled.

https://s3-us-west-1.amazonaws.com/kibana.budzenski.com/84831/353a305/kibana-8.0.0-SNAPSHOT-arm64-docker-image.tar.gz
https://s3-us-west-1.amazonaws.com/kibana.budzenski.com/84831/353a305/kibana-8.0.0-SNAPSHOT-arm64-docker-build-context.tar.gz
https://s3-us-west-1.amazonaws.com/kibana.budzenski.com/84831/353a305/kibana-8.0.0-SNAPSHOT-amd64-docker-build-context.tar.gz


async run(config, log, build) {
// Builds Docker targets for default and oss
await runDockerGenerator(config, log, build);
await runDockerGenerator(config, log, build, false, 'amd64');
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use x64 and aarch64 to maintain consistency with Node the the build?

https://github.com/elastic/kibana/blob/master/src/dev/build/lib/platform.ts#L59-L64

Copy link
Member Author

Choose a reason for hiding this comment

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

Added with 4cccd58 and the few followup commits for fixes.

@jbudz
Copy link
Member Author

jbudz commented Dec 14, 2020

@elasticmachine merge upstream

@jmlrt
Copy link
Member

jmlrt commented Jan 21, 2021

docker-build-context-aarch64 should use ARM dependencies

@jbudz, sorry I misread this, thanks @tylersmalley for noticing it, the requirements are not to create a new docker-build-context-aarch64 but to update the existing context to support both architecture like in ES context.

@jbudz
Copy link
Member Author

jbudz commented Jan 21, 2021

^ pushed with 034d478

@jbudz
Copy link
Member Author

jbudz commented Jan 21, 2021

@elasticmachine merge upstream

@jbudz
Copy link
Member Author

jbudz commented Jan 25, 2021

@elasticmachine merge upstream

@tylersmalley
Copy link
Contributor

tylersmalley commented Jan 27, 2021

kibana-8.0.0-SNAPSHOT-docker-build-context.tar.gz

Testing:

mkdir test; cd test
wget https://tsmalley-elastic.s3-us-west-2.amazonaws.com/pr-84831/kibana-8.0.0-SNAPSHOT-docker-build-context.tar.gz
tar -xzf kibana-8.0.0-SNAPSHOT-docker-build-context.tar.gz
// update line 18 of Dockerfile to reference https://tsmalley-elastic.s3-us-west-2.amazonaws.com/pr-84831
docker build . -t docker.elastic.co/kibana/kibana:8.0.0-SNAPSHOT-aarch64
curl -L https://snapshots.elastic.co/8.0.0-e2ce6361/downloads/elasticsearch/elasticsearch-8.0.0-SNAPSHOT-docker-image-aarch64.tar.gz | docker load`
docker network create elastic
docker run -it --network="elastic" --name=elasticsearch -e discovery.type="single-node" docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT
docker run -it --network="elastic" -e "ELASTICSEARCH_HOSTS=http://elasticsearch:9200" -e "ELASTICSEARCH_USERNAME=kibana_system" -e "ELASTICSEARCH_PASSWORD=changeme" -p 5601:5601 docker.elastic.co/kibana/kibana:8.0.0-SNAPSHOT-aarch64

@tylersmalley
Copy link
Contributor

So far this looks good, however I am blocked from fully testing this against a snapshot build of Elasticsearch. I have pinged Core. cc @rudolf

  log   [20:00:51.028] [error][savedobjects-service] [.kibana_task_manager] [invalid_index_name_exception]: Invalid index name [.kibana_task_manager_8.0.0-SNAPSHOT_001], must be lowercase
  log   [20:00:51.029] [error][savedobjects-service] [.kibana_task_manager] migration failed, dumping execution log:
  log   [20:00:51.030] [info][savedobjects-service] [.kibana_task_manager] INIT RESPONSE
  log   [20:00:51.031] [info][savedobjects-service] [.kibana_task_manager] INIT -> CREATE_NEW_TARGET
  log   [20:00:51.034] [fatal][root] Error: Unable to complete saved object migrations for the [.kibana_task_manager] index. Please check the health of your Elasticsearch cluster and try again. ResponseError: invalid_index_name_exception
    at migrationStateActionMachine (/usr/share/kibana/src/core/server/saved_objects/migrationsv2/migrations_state_action_machine.js:141:11)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Promise.all (index 1)
    at SavedObjectsService.start (/usr/share/kibana/src/core/server/saved_objects/saved_objects_service.js:163:7)
    at Server.start (/usr/share/kibana/src/core/server/server.js:283:31)
    at Root.start (/usr/share/kibana/src/core/server/root/index.js:58:14)
    at bootstrap (/usr/share/kibana/src/core/server/bootstrap.js:100:5)
    at Command.<anonymous> (/usr/share/kibana/src/cli/serve/serve.js:169:5)
  log   [20:00:51.040] [info][plugins-system] Stopping all plugins.

Copy link
Contributor

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

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

LGTM - fully tested by disabling migrations v2.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jbudz jbudz merged commit 2572cd2 into elastic:master Jan 28, 2021
@jbudz jbudz deleted the docker/architecture branch January 28, 2021 00:25
jbudz added a commit that referenced this pull request Jan 28, 2021
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tyler Smalley <tyler.smalley@elastic.co>
@jbudz
Copy link
Member Author

jbudz commented Jan 28, 2021

Spoke with tylersmalley about the most recent commit fix, had a slack approval.

7.x: 77a3d5c

jloleysens added a commit to jloleysens/kibana that referenced this pull request Jan 28, 2021
…y-tests

* 'master' of github.com:elastic/kibana: (31 commits)
  [Discover] Add grid flyout jest test (elastic#89088)
  [Search Sessions] Improve session restoration back button (elastic#87635)
  [TSVB] Remove vis_type_timeseries_enhanced plugin (elastic#89274)
  [Security Solution] Init Osquery plugin (elastic#87109)
  [Fleet] Do not defined aliases inside datastream template (elastic#89512)
  skip flaky suite (elastic#86950)
  chore(NA): bazel machinery installation on kbn bootstrap (elastic#89469)
  [build/docker] Add support for centos ARM builds (elastic#84831)
  Convert default_watch.json to a JS object in order to avoid TS complaints (elastic#89488)
  [CI] Decrease number of Jest workers (elastic#89504)
  [Maps] remove maps_oss TS project (elastic#89502)
  Adds migration settings to Docker (elastic#89501)
  [Lens] Fix crash in transition from unique count to last value (elastic#88916)
  [kbn-es] Always use bundled JDK when starting Elasticsearch (elastic#89437)
  unskip getting_started/shakespeare test elasticsearch 64016 (elastic#89346)
  [Maps] migrate maps, maps_file_upload, and maps_legacy_licensing to TS projects (elastic#89439)
  skip flaky suite (elastic#89478)
  skip flaky suite (elastic#89476)
  skip flaky suite (elastic#89477)
  skip flaky suite (elastic#89475)
  ...

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/cold_phase/cold_phase.tsx
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jan 28, 2021
…updates-and-timeline-cleanup

* 'master' of github.com:elastic/kibana: (44 commits)
  [Discover] Add grid flyout jest test (elastic#89088)
  [Search Sessions] Improve session restoration back button (elastic#87635)
  [TSVB] Remove vis_type_timeseries_enhanced plugin (elastic#89274)
  [Security Solution] Init Osquery plugin (elastic#87109)
  [Fleet] Do not defined aliases inside datastream template (elastic#89512)
  skip flaky suite (elastic#86950)
  chore(NA): bazel machinery installation on kbn bootstrap (elastic#89469)
  [build/docker] Add support for centos ARM builds (elastic#84831)
  Convert default_watch.json to a JS object in order to avoid TS complaints (elastic#89488)
  [CI] Decrease number of Jest workers (elastic#89504)
  [Maps] remove maps_oss TS project (elastic#89502)
  Adds migration settings to Docker (elastic#89501)
  [Lens] Fix crash in transition from unique count to last value (elastic#88916)
  [kbn-es] Always use bundled JDK when starting Elasticsearch (elastic#89437)
  unskip getting_started/shakespeare test elasticsearch 64016 (elastic#89346)
  [Maps] migrate maps, maps_file_upload, and maps_legacy_licensing to TS projects (elastic#89439)
  skip flaky suite (elastic#89478)
  skip flaky suite (elastic#89476)
  skip flaky suite (elastic#89477)
  skip flaky suite (elastic#89475)
  ...

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/lib/absolute_timing_to_relative_timing.ts
@odidev
Copy link

odidev commented Feb 19, 2021

It will be very helpful if an ARM64 image is released. May I know when you are planning to release a stable ARM64 image?

@jbudz
Copy link
Member Author

jbudz commented Feb 24, 2021

We're targeting 7.13 for this. The necessary changes on the Kibana side are in 7.12 (here) with the release publishing in a separate repo. I'm swapping the the 7.12 label with 7.13 so this doesn't get picked up the release notes for 7.12.

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.

[build] Support for Docker aarch64
7 participants