[ 
https://issues.apache.org/jira/browse/HADOOP-19896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18152864#comment-18152864
 ] 

ASF GitHub Bot commented on HADOOP-19896:
-----------------------------------------

adoroszlai opened a new pull request, #9070:
URL: https://github.com/apache/hadoop/pull/9070

   ## What changes were proposed in this pull request?
   
   - Reuse `build_image` and `build_image_url` actions (added by HADOOP-19877) 
in `tmpl_build_and_test.yml`.
   - Add and use new action `image/exists` to check for existing image given a 
tag pattern (which it passes to `docker/metadata-action`) to generate the value.
     - Lookup is performed first in the current repo, and also in 
`apache/hadoop` if running in fork.
   - Change `build_image` action to build only if image does not exist yet.  
The image is identified by the hash of files under `dev-support/docker` (using 
GitHub Actions built-in `hashFiles` function).  This way a commit changing 
docker definitions gets a new ID, and thus triggers new image build, while 
later commits can reuse that image.
   - User-specific docker imager (the small overlay on top of the base image) 
is always built, since UID may be different.
   
   https://issues.apache.org/jira/browse/HADOOP-19896
   
   ## How was this patch tested?
   
   Test runs:
   - image found: 
https://github.com/adoroszlai/hadoop/actions/runs/46428345421/job/141881270235#step:3:275
   - new image built: 
https://github.com/adoroszlai/hadoop/actions/runs/46430086384/job/141887411735#step:3:451
   




> ci: improve performance of toolchain image building
> ---------------------------------------------------
>
>                 Key: HADOOP-19896
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19896
>             Project: Hadoop Common
>          Issue Type: Sub-task
>            Reporter: Aaron Fabbri
>            Assignee: Attila Doroszlai
>            Priority: Minor
>
> Our hadoop CI first builds a "toolchain" container image, based off of 
> `dev_support/docker` files. In then uses this container to build our code, 
> and also to run some tests.
> Our initial github workflows (inspired by Apache Spark) always build a 
> container image on each workflow trigger, relying on container build caching 
> to reduce runtime.
> I propose we try a more efficient approach, and see whether or not it is an 
> improvement:
> 1. Build and publish toolchain images whenever we push to trunk, and those 
> changes affect any definitions that influence the toolchain image (i.e. we 
> need to refresh).
> 2. (extra credit) Also trigger this toolchain build workflow on a 
> schedule–just to ensure that we are still updating the toolchain images if 
> for some reason no changes are made to trunk for some "max age" time (e.g. 
> weekly).
> 3. PRs that don't make toolchain changes just download the latest trunk 
> toolchain build. PRs that do make toolchain changes can A. fall back to 
> current behavior automatically, or B. change a workflow variable to force 
> this behavior. (A seems preferrable).



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to