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

Switch xrootd-s3-http plugin to be built from source #1974

Merged
merged 1 commit into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,29 @@ RUN yum -y update \
###############################
FROM dependency-build AS xrootd-plugin-builder
# Install necessary build dependencies
RUN yum install -y --enablerepo=osg-testing curl-devel openssl-devel git cmake3 gcc-c++ sqlite-devel
RUN yum install -y --enablerepo=osg-testing curl-devel openssl-devel git cmake3 gcc-c++ sqlite-devel xrootd-server-devel tinyxml2-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
ENV JSON_VERSION="v3.11.3" \
ENV XROOTD_S3_HTTP_VERSION="0.2.1" \
JSON_VERSION="v3.11.3" \
JSON_SCHEMA_VALIDATOR_VERSION="2.3.0" \
LOTMAN_VERSION="v0.0.4"

ADD https://api.github.com/repos/nlohmann/json/git/refs/tags/${JSON_VERSION} /tmp/hash-json
ADD https://api.github.com/repos/pboettch/json-schema-validator/git/refs/tags/${JSON_SCHEMA_VALIDATOR_VERSION} /tmp/hash-json
ADD https://api.github.com/repos/PelicanPlatform/lotman/git/refs/tags/${LOTMAN_VERSION} /tmp/hash-json

RUN \
git clone https://github.com/PelicanPlatform/xrootd-s3-http.git && \
cd xrootd-s3-http && \
mkdir -p ~/rpmbuild/SOURCES/ && \
curl -L https://github.com/PelicanPlatform/xrootd-s3-http/archive/refs/tags/v${XROOTD_S3_HTTP_VERSION}/xrootd-s3-http-${XROOTD_S3_HTTP_VERSION}.tar.gz > ~/rpmbuild/SOURCES/xrootd-s3-http-${XROOTD_S3_HTTP_VERSION}.tar.gz && \
git checkout v${XROOTD_S3_HTTP_VERSION} && \
rpmbuild -ba rpm/xrootd-s3-http.spec && \
cp ~/rpmbuild/RPMS/*/xrootd-s3-http-${XROOTD_S3_HTTP_VERSION}*.rpm /root/xrootd-s3-http.rpm

# LotMan Installation
# First install dependencies
RUN git clone https://github.com/nlohmann/json.git && \
Expand All @@ -126,7 +136,6 @@ FROM dependency-build AS final-stage
# should go here. Installation in a previous section may result in the packages being
# installed only in the intermediate builder containers!
RUN yum install -y --enablerepo=osg-testing sssd-client xrdcl-pelican xrootd-multiuser
RUN yum install -y --enablerepo=epel-testing xrootd-s3-http

WORKDIR /pelican

Expand Down Expand Up @@ -196,6 +205,8 @@ COPY --from=xrootd-plugin-builder /usr/lib64/libLotMan.so /usr/lib64/
COPY --from=xrootd-plugin-builder /usr/include/nlohmann /usr/include/nlohmann
# Copy the JSON schema validator library
COPY --from=xrootd-plugin-builder /usr/lib64/libnlohmann_json_schema_validator.a /usr/lib64/
# Copy the xrootd-s3-http plugin RPM and install it
COPY --from=xrootd-plugin-builder /root/xrootd-s3-http.rpm /usr/lib64

COPY images/entrypoint.sh /entrypoint.sh

Expand All @@ -204,7 +215,9 @@ COPY --from=pelican-build /pelican/dist/linux_amd64/pelican_linux_amd64_v1/pelic
COPY --from=pelican-build /pelican/dist/linux_amd64/pelican_linux_amd64_v1/pelican /usr/local/bin/osdf
RUN chmod +x /usr/local/bin/pelican \
&& chmod +x /usr/local/bin/osdf \
&& chmod +x /entrypoint.sh
&& chmod +x /entrypoint.sh \
&& rpm -Uhv /usr/lib64/xrootd-s3-http.rpm \
&& rm /usr/lib64/xrootd-s3-http.rpm

######################
# Pelican base stage #
Expand Down
2 changes: 1 addition & 1 deletion images/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ ADD https://api.github.com/repos/PelicanPlatform/xrootd-s3-http/git/refs/heads/m
RUN \
git clone https://github.com/PelicanPlatform/xrootd-s3-http.git && \
cd xrootd-s3-http && \
git checkout v0.1.8 && \
git checkout v0.2.1 && \
git submodule update --init --recursive && \
mkdir build && cd build && \
cmake -DLIB_INSTALL_DIR=/usr/lib64 .. && \
Expand Down
Loading