-
Notifications
You must be signed in to change notification settings - Fork 424
cache docker image in github ci #2929
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
Closed
kevinjqliu
wants to merge
3
commits into
apache:main
from
kevinjqliu:kevinjqliu/add-docker-image-caching-in-github-ci
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same logic, just reordered |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,10 +18,10 @@ ARG BASE_IMAGE_SPARK_VERSION=4.0.1 | |
| FROM apache/spark:${BASE_IMAGE_SPARK_VERSION} | ||
|
|
||
| # Dependency versions - keep these compatible | ||
| # Changing these will invalidate the JAR download cache layer | ||
| ARG ICEBERG_VERSION=1.10.1 | ||
| ARG ICEBERG_SPARK_RUNTIME_VERSION=4.0_2.13 | ||
| ARG HADOOP_VERSION=3.4.1 | ||
| ARG SCALA_VERSION=2.13 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unreferenced, so removing |
||
| ARG AWS_SDK_VERSION=2.24.6 | ||
| ARG MAVEN_MIRROR=https://repo.maven.apache.org/maven2 | ||
|
|
||
|
|
@@ -31,26 +31,23 @@ WORKDIR ${SPARK_HOME} | |
| # Install curl for JAR downloads | ||
| RUN apt-get update && \ | ||
| apt-get install -y --no-install-recommends curl && \ | ||
| apt-get clean && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Copy configuration (early for better caching) | ||
| COPY --chown=spark:spark spark-defaults.conf ${SPARK_HOME}/conf/ | ||
|
|
||
| # Create event log directory | ||
| # Create directories (separate layer) | ||
| RUN mkdir -p /home/iceberg/spark-events && \ | ||
| chown -R spark:spark /home/iceberg | ||
|
|
||
| # Required JAR dependencies | ||
| ENV JARS_TO_DOWNLOAD="\ | ||
| org/apache/iceberg/iceberg-spark-runtime-${ICEBERG_SPARK_RUNTIME_VERSION}/${ICEBERG_VERSION}/iceberg-spark-runtime-${ICEBERG_SPARK_RUNTIME_VERSION}-${ICEBERG_VERSION}.jar \ | ||
| org/apache/iceberg/iceberg-aws-bundle/${ICEBERG_VERSION}/iceberg-aws-bundle-${ICEBERG_VERSION}.jar \ | ||
| org/apache/hadoop/hadoop-aws/${HADOOP_VERSION}/hadoop-aws-${HADOOP_VERSION}.jar \ | ||
| software/amazon/awssdk/bundle/${AWS_SDK_VERSION}/bundle-${AWS_SDK_VERSION}.jar" | ||
|
|
||
| # Download JARs with retry logic | ||
| # Download JARs with retry logic (most cacheable - only changes when versions change) | ||
| # This is the slowest step, so we do it before copying config files | ||
| RUN set -e && \ | ||
| cd "${SPARK_HOME}/jars" && \ | ||
| for jar_path in ${JARS_TO_DOWNLOAD}; do \ | ||
| for jar_path in \ | ||
| "org/apache/iceberg/iceberg-spark-runtime-${ICEBERG_SPARK_RUNTIME_VERSION}/${ICEBERG_VERSION}/iceberg-spark-runtime-${ICEBERG_SPARK_RUNTIME_VERSION}-${ICEBERG_VERSION}.jar" \ | ||
| "org/apache/iceberg/iceberg-aws-bundle/${ICEBERG_VERSION}/iceberg-aws-bundle-${ICEBERG_VERSION}.jar" \ | ||
| "org/apache/hadoop/hadoop-aws/${HADOOP_VERSION}/hadoop-aws-${HADOOP_VERSION}.jar" \ | ||
| "software/amazon/awssdk/bundle/${AWS_SDK_VERSION}/bundle-${AWS_SDK_VERSION}.jar"; \ | ||
| do \ | ||
| jar_name=$(basename "${jar_path}") && \ | ||
| echo "Downloading ${jar_name}..." && \ | ||
| curl -fsSL --retry 3 --retry-delay 5 \ | ||
|
|
@@ -60,6 +57,9 @@ RUN set -e && \ | |
| done && \ | ||
| chown -R spark:spark "${SPARK_HOME}/jars" | ||
|
|
||
| # Copy configuration last (changes more frequently than JARs) | ||
| COPY --chown=spark:spark spark-defaults.conf ${SPARK_HOME}/conf/ | ||
|
|
||
| USER spark | ||
| WORKDIR ${SPARK_HOME} | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same logic, just reordered