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

[DO_NOT_MERGE][INFRA] test dockerfile #41918

Closed
wants to merge 2 commits into from

Conversation

zhengruifeng
Copy link
Contributor

What changes were proposed in this pull request?

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

@github-actions github-actions bot added the BUILD label Jul 10, 2023
@@ -55,10 +55,9 @@ RUN $APT_INSTALL r-base libcurl4-openssl-dev qpdf libssl-dev zlib1g-dev
RUN Rscript -e "install.packages(c('knitr', 'markdown', 'rmarkdown', 'testthat', 'devtools', 'e1071', 'survival', 'arrow', 'roxygen2', 'xml2'), repos='https://cloud.r-project.org/')"

# See more in SPARK-39959, roxygen2 < 7.2.1
RUN apt-get install -y libcurl4-openssl-dev libgit2-dev libssl-dev libxml2-dev \
RUN apt-get install -y libgit2-dev libssl-dev libxml2-dev \
Copy link
Member

Choose a reason for hiding this comment

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

We need to add apt update in here:

  • L1-L57 are using cache layers
  • L58 changed, so that will reinstall but still use the old apt update results (L37), so CI failed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks let me have a try.

But if we add apt update here, does it means that the cache will be disabled from L58?

Copy link
Member

Choose a reason for hiding this comment

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

The cache will be invalidated if you change the line. the apt update is only to refresh ubuntu package list (local copy).

@zhengruifeng zhengruifeng deleted the test_docker_file branch August 10, 2023 01:58
zhengruifeng added a commit that referenced this pull request Sep 13, 2023
### What changes were proposed in this pull request?
follow the [Best practices for writing Dockerfiles](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get) :

> Always combine RUN apt-get update with apt-get install in the same RUN statement.

### Why are the changes needed?
1, to address #42253 (comment)
2, when I attempted to change the apt-get install in #41918, the behavior was confusing. By following the best practices, further changes should work immediately.

### Does this PR introduce _any_ user-facing change?
NO, dev-only

### How was this patch tested?
CI

### Was this patch authored or co-authored using generative AI tooling?
NO

Closes #42842 from zhengruifeng/infra_docker_file_opt.

Authored-by: Ruifeng Zheng <[email protected]>
Signed-off-by: Ruifeng Zheng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants