gravitino icon indicating copy to clipboard operation
gravitino copied to clipboard

refactor(dev/docker/hive): shrink hive Docker image size by 500MB

Open unknowntpo opened this issue 9 months ago • 3 comments

What changes were proposed in this pull request?

Use multi-stage build to reduce hive image size from 2.27GB to 1.83GB.

I use first stage to download archive file and unzip them, then in the final stage, copied them to destination directory.

Why are the changes needed?

Fix: #3262

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Unit tests.

TODO

  • [ ] @xunliu needs to push new image release to docker hub
  • [ ] @unknowntpo should update changelog

unknowntpo avatar May 05 '24 02:05 unknowntpo

reopen for rerunning ci tests

unknowntpo avatar May 05 '24 05:05 unknowntpo

@mchades Would you like to review this PR ?

unknowntpo avatar May 05 '24 09:05 unknowntpo

I use soft-link approach as @zhoukangcn mentioned at https://github.com/datastrato/gravitino/pull/3268#discussion_r1593426981, because we don't need to maintain lots of env var like JAVA_HOME=/usr/local/jdk at 1st stage and final stage, which is a little bit ugly. c.c. @xunliu , @mchades

unknowntpo avatar May 12 '24 05:05 unknowntpo

hi @unknowntpo thank you for your continue work. Please attach your latest Docker image size screen snapshot in the comments. Use soft link also shrink size by 500MB?

xunliu avatar May 17 '24 06:05 xunliu

@xunliu Shrinked hive Docker image: 1.85 GB (with soft-link)

Original Docker image: 2.27 GB image

It's not 500 MB, but 420 MB 😭

unknowntpo avatar May 17 '24 06:05 unknowntpo

hi @unknowntpo Please fix branch conflicts. Thanks

xunliu avatar May 21 '24 13:05 xunliu

@unknowntpo Could you also modify the change log? please see: https://github.com/datastrato/gravitino/blob/5a4931b1ce6e94e32003cffa17c8e955518039dd/docs/docker-image-details.md?plain=1#L103-L105

yuqi1129 avatar May 22 '24 03:05 yuqi1129

I have released gravitino-ci-hive:0.1.12. Please upgrade it to Gravitino from version 0.1.11 to 0.1.12.

yuqi1129 avatar May 22 '24 03:05 yuqi1129

I have released gravitino-ci-hive:0.1.12. Please upgrade it to Gravitino from version 0.1.11 to 0.1.12.

@yuqi1129 Done.

unknowntpo avatar May 22 '24 05:05 unknowntpo

I have released gravitino-ci-hive:0.1.12. Please upgrade it to Gravitino from version 0.1.11 to 0.1.12.

@yuqi1129 Done.

I mean you need to change the following place:

image

There should be several similar places.

yuqi1129 avatar May 22 '24 05:05 yuqi1129

@yuqi1129 done, the tests has passed.

unknowntpo avatar May 22 '24 06:05 unknowntpo