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

[native] Update dockerfiles to use Centos9 #22909

Merged
merged 1 commit into from
Jun 15, 2024

Conversation

czentgr
Copy link
Contributor

@czentgr czentgr commented Jun 3, 2024

Upgrade to use Centos9 as build and runtime.

Resolves: #22901

Description

Motivation and Context

Impact

Test Plan

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== NO RELEASE NOTE ==

@czentgr czentgr marked this pull request as ready for review June 13, 2024 06:00
@czentgr czentgr requested a review from a team as a code owner June 13, 2024 06:00
@@ -10,11 +10,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM quay.io/centos/centos:stream8
FROM quay.io/centos/centos:stream9
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe I should rename the file to centos-dependency.dockerfile to remove the version? This would match a similar change for the dockerfile in Velox from centos-8-stream.dockerfile to centos.dockerfile.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's do this.

@czentgr
Copy link
Contributor Author

czentgr commented Jun 13, 2024

@majetideepak FYI.

@@ -27,6 +27,7 @@ RUN mkdir -p /prestissimo /runtime-libraries
COPY . /prestissimo/
RUN EXTRA_CMAKE_FLAGS=${EXTRA_CMAKE_FLAGS} \
make -j${NUM_THREADS} --directory="/prestissimo/" cmake-and-build BUILD_TYPE=${BUILD_TYPE} BUILD_DIR=${BUILD_DIR} BUILD_BASE_DIR=${BUILD_BASE_DIR}
RUN echo "/usr/local/lib" >> /etc/ld.so.conf.d/prestissimo.conf && echo "/usr/local/lib64" >> /etc/ld.so.conf.d/prestissimo.conf && ldconfig
RUN ldd /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server | awk 'NF == 4 { system("cp " $3 " /runtime-libraries") }'
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel we should ideally avoid ldconfig since a package installation usually should not depend on it.
If we copy the libraries to the corresponding lib or lib64, will that work?

Copy link
Collaborator

@majetideepak majetideepak Jun 13, 2024

Choose a reason for hiding this comment

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

To clarify, we modify | awk 'NF == 4 { system("cp " $3 " /runtime-libraries") }' to install to lib and lib64 and copy them out as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, we can try to copy them to /usr/lib and see if that also fixes the problem.

@czentgr czentgr force-pushed the cz_update_to_centos9 branch 3 times, most recently from 00ab322 to 761d91d Compare June 15, 2024 00:29
@@ -27,7 +27,8 @@ RUN mkdir -p /prestissimo /runtime-libraries
COPY . /prestissimo/
RUN EXTRA_CMAKE_FLAGS=${EXTRA_CMAKE_FLAGS} \
make -j${NUM_THREADS} --directory="/prestissimo/" cmake-and-build BUILD_TYPE=${BUILD_TYPE} BUILD_DIR=${BUILD_DIR} BUILD_BASE_DIR=${BUILD_BASE_DIR}
RUN ldd /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server | awk 'NF == 4 { system("cp " $3 " /runtime-libraries") }'
RUN LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64 ldd /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server > /tmp/dynamic_libs.txt && ! grep "not found" /tmp/dynamic_libs.txt
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can pipe to grep and check. No need to write to a file.

!(LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64 ldd /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server  | grep "not found")

We should also combine both to avoid an extra RUN step.
I see some approaches here

RUN test -d /app/bin -a ... \
 && mkdir /app/control/bin

https://stackoverflow.com/questions/53096984/how-to-stop-building-when-i-use-dockerfile-build-image

Upgrade to use Centos9 as build and runtime.
Copy link
Collaborator

@majetideepak majetideepak left a comment

Choose a reason for hiding this comment

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

Thanks, @czentgr

@majetideepak majetideepak merged commit 7164087 into prestodb:master Jun 15, 2024
58 of 59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[native] Move to Centos9 Stream as Centos8 Stream went EOL 2024-05-31
2 participants