Skip to content

Commit

Permalink
Merge pull request PelicanPlatform#806 from matyasselmeci/pr/xrootd-rpm
Browse files Browse the repository at this point in the history
Rebuild OSG's xrootd RPM from source inside the dev container
  • Loading branch information
haoming29 authored Feb 20, 2024
2 parents 4610b3a + 77b8dd1 commit 3644e28
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,5 @@ jobs:
tags: "${{ steps.generate-tag-list.outputs.taglist }}"
build-args: |
IS_PR_BUILD=${{ github.event_name == 'pull_request' }}
cache-from: type=registry,ref=hub.opensciencegrid.org/pelican_platform/pelican:buildcache
cache-to: type=registry,ref=hub.opensciencegrid.org/pelican_platform/pelican:buildcache,mode=max,ignore-error=true
4 changes: 2 additions & 2 deletions .github/workflows/publish-dev-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ jobs:
file: ./images/dev.Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=registry,ref=hub.opensciencegrid.org/pelican_platform/pelican-dev:buildcache
cache-to: type=registry,ref=hub.opensciencegrid.org/pelican_platform/pelican-dev:buildcache,mode=max,ignore-error=true
36 changes: 35 additions & 1 deletion images/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,50 @@ ENV GOFLAGS="-buildvcs=false"
RUN groupadd -o -g 10940 xrootd
RUN useradd -o -u 10940 -g 10940 -s /bin/sh xrootd

RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \
/usr/bin/crb enable && \
# ^^ crb enables the Code Ready Builder repository (EL9) or PowerTools (EL8), needed for some of our dependencies \
yum clean all

# Get goreleaser
# NOTE: If using podman to build, you must pass --format=docker for the SHELL command to work
SHELL ["/bin/bash", "-c"]
RUN echo $'[goreleaser] \n\
name=GoReleaser \n\
baseurl=https://repo.goreleaser.com/yum/ \n\
enabled=1 \n\
gpgcheck=0' > /etc/yum.repos.d/goreleaser.repo

RUN echo '%_topdir /usr/local/src/rpmbuild' > $HOME/.rpmmacros

# Download OSG's XRootD SRPM and rebuild it. Create a yum repository to put the results in.
RUN yum install -y yum-utils createrepo https://repo.opensciencegrid.org/osg/23-main/osg-23-main-el8-release-latest.rpm && \
yum-config-manager --setopt=install_weak_deps=False --save && \
# ^^ save some space by not installing weak dependencies \
yum-config-manager --disable osg --save && \
# ^^ disable the OSG _binary_ repos, they may not be available for our arch \
yum install -y rpm-build && \
mkdir -p /usr/local/src/rpmbuild/SRPMS && \
cd /usr/local/src/rpmbuild/SRPMS && \
yumdownloader --source xrootd --disablerepo=\* --enablerepo=osg-development-source && \
yum-builddep -y xrootd-*.osg*.src.rpm && \
rpmbuild --define 'osg 1' \
--define 'dist .osg.el8' \
--without compat \
--without doc \
--nocheck \
--rebuild \
-bb xrootd-*.osg*.src.rpm && \
createrepo /usr/local/src/rpmbuild/RPMS && \
yum clean all

RUN echo $'[local] \n\
name=Local \n\
baseurl=file:///usr/local/src/rpmbuild/RPMS/ \n\
enabled=1 \n\
priority=1 \n\
gpgcheck=0' > /etc/yum.repos.d/local.repo

# Install goreleaser and various other packages we need
RUN yum install -y goreleaser npm xrootd-devel xrootd-server-devel xrootd-client-devel nano xrootd-scitokens \
xrootd-voms xrdcl-http jq procps docker make curl-devel java-17-openjdk-headless git cmake3 gcc-c++ openssl-devel \
Expand Down

0 comments on commit 3644e28

Please sign in to comment.