Skip to content

Commit

Permalink
Merge pull request #923 from haoming29/smarter-build-cache
Browse files Browse the repository at this point in the history
Hash external repository to invalidate build cache when there's an update
  • Loading branch information
haoming29 authored Mar 12, 2024
2 parents b9cc955 + 0c9a336 commit 1fedfec
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
13 changes: 13 additions & 0 deletions images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,22 @@ RUN yum -y update \
FROM dependency-build AS xrootd-plugin-builder
# Install necessary build dependencies
RUN yum install -y xrootd-devel xrootd-server-devel xrootd-client-devel curl-devel openssl-devel git cmake3 gcc-c++ sqlite-devel

# The ADD command with a api.github.com URL in the next couple of sections
# are for cache-hashing of the external repository that we rely on to build
# the image
ADD https://api.github.com/repos/PelicanPlatform/xrdcl-pelican/git/refs/heads/main /tmp/hash-xrdcl-pelican

# Install xrdcl-pelican plugin and replace the xrdcl-http plugin
RUN \
git clone https://github.com/PelicanPlatform/xrdcl-pelican.git && \
cd xrdcl-pelican && \
mkdir build && cd build && \
cmake -DLIB_INSTALL_DIR=/usr/lib64 .. && \
make && make install

ADD https://api.github.com/repos/PelicanPlatform/xrootd-s3-http/git/refs/heads/main /tmp/hash-xrootd-s3-http

# Install the S3 and HTTP server plugins for XRootD. For now we do this from source
# until we can sort out the RPMs.
RUN \
Expand All @@ -84,6 +93,10 @@ RUN \
cmake -DLIB_INSTALL_DIR=/usr/lib64 .. && \
make install

ADD https://api.github.com/repos/nlohmann/json/git/refs/heads/master /tmp/hash-json
ADD https://api.github.com/repos/pboettch/json-schema-validator/git/refs/heads/master /tmp/hash-json
ADD https://api.github.com/repos/PelicanPlatform/lotman/git/refs/heads/main /tmp/hash-json

# LotMan Installation
# First install dependencies
RUN git clone https://github.com/nlohmann/json.git && \
Expand Down
12 changes: 12 additions & 0 deletions images/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,21 @@ RUN yum install -y goreleaser npm xrootd-devel xrootd-server-devel xrootd-client
xrootd-voms xrdcl-http jq procps docker make curl-devel java-17-openjdk-headless git cmake3 gcc-c++ openssl-devel sqlite-devel \
&& yum clean all

# The ADD command with a api.github.com URL in the next couple of sections
# are for cache-hashing of the external repository that we rely on to build
# the image
ADD https://api.github.com/repos/PelicanPlatform/xrdcl-pelican/git/refs/heads/main /tmp/hash-xrdcl-pelican

# Install xrdcl-pelican plugin and replace the xrdcl-http plugin
RUN \
git clone https://github.com/PelicanPlatform/xrdcl-pelican.git && \
cd xrdcl-pelican && \
mkdir build && cd build && \
cmake -DLIB_INSTALL_DIR=/usr/lib64 .. && \
make && make install

ADD https://api.github.com/repos/PelicanPlatform/xrootd-s3-http/git/refs/heads/main /tmp/hash-xrootd-s3-http

# Install the S3 and HTTP server plugins for XRootD. For now we do this from source
# until we can sort out the RPMs.
RUN \
Expand All @@ -97,6 +105,10 @@ RUN \
cmake -DLIB_INSTALL_DIR=/usr/lib64 .. && \
make install

ADD https://api.github.com/repos/nlohmann/json/git/refs/heads/master /tmp/hash-json
ADD https://api.github.com/repos/pboettch/json-schema-validator/git/refs/heads/master /tmp/hash-json
ADD https://api.github.com/repos/PelicanPlatform/lotman/git/refs/heads/main /tmp/hash-json

# LotMan Installation
# First install dependencies
RUN git clone https://github.com/nlohmann/json.git && \
Expand Down

0 comments on commit 1fedfec

Please sign in to comment.