Skip to content

Commit

Permalink
Adding a workspace to build RPMs
Browse files Browse the repository at this point in the history
  • Loading branch information
mambelli committed Nov 21, 2024
1 parent e86cee9 commit 3a1164d
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/workspaces_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,22 @@ jobs:
#cache-from: type=gha
#cache-to: type=gha,mode=max

- name: Build and push build-workspace
id: docker_build_build_workspace
uses: docker/build-push-action@v6
with:
push: true
platforms: ${{env.DH_PLATFORMS}}
context: workspaces
file: workspaces/build-workspace/Dockerfile
tags: glideinwms/build-workspace:${{env.DH_PREFIX}}${{env.DH_LABEL}}
build-args: |
BUILD_SHA=${{env.GITHUB_SHA}}
BUILD_HASH=${{env.GITHUB_HASH}}
BUILD_REF=${{env.GITHUB_REF}}
BUILD_DATE=${{env.BUILD_DATE}}
GWMS_VERSION=${{env.DH_PREFIX}}${{env.DH_LABEL}}
- name: Build and push ce-workspace
id: docker_build_ce_workspace
uses: docker/build-push-action@v6
Expand Down
60 changes: 60 additions & 0 deletions workspaces/build-workspace/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# SPDX-FileCopyrightText: 2020 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0

# Parameter to allow builds for EL7/9
ARG GWMS_VERSION=latest
ARG IMAGE_NAMESPACE=glideinwms
FROM $IMAGE_NAMESPACE/gwms-workspace:$GWMS_VERSION
# NOTE: if you need GWMS_VERSION after FROM, you need to repeat it
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG BUILD_VERSION=dev
ARG BUILD_REF
ARG BUILD_HASH
ARG BUILD_SHA
ARG BUILD_DATE
# MAINTAINER is deprecated but it is needed to set Author in the image attributes
MAINTAINER GlideinWMS Team <[email protected]>
LABEL name="Devcontainer to build the GlideinWMS packages on EL7/9" \
org.opencontainers.image.authors="GlideinWMS Team [email protected]" \
org.opencontainers.image.title="GWMS Factory Workspace" \
org.opencontainers.image.description="Devcontainer to build the GlideinWMS packages on EL7/9" \
org.opencontainers.image.url="https://glideinwms.fnal.gov/" \
org.opencontainers.image.documentation="https://glideinwms.fnal.gov/" \
org.opencontainers.image.source="https://github.com/glideinWMS/containers/tree/main/workspaces" \
org.opencontainers.image.vendor="The GlideinWMS Team" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.revision="$BUILD_HASH" \
org.opencontainers.image.ref.name="$BUILD_REF" \
org.opencontainers.image.created="$BUILD_DATE"\
org.glideinwms.image.version="$GWMS_VERSION"
# Declaring ports: webserver, htcondor(shared port)
EXPOSE 80 443 9618

RUN echo "Building the release building dev image ($BUILD_SHA/$BUILD_DATE) on $BUILDPLATFORM, for $TARGETPLATFORM"

# See gwms-workspace for the repos setup and base packages

# Install Fermilab repo and packages, RPM and OSG dev packages
RUN yum -y install https://linux-mirrors.fnal.gov/linux/fermilab/almalinux/9/yum-conf-fermilab.rpm
RUN yum -y fermilab-util_kx509 install svn rpmbuild koji osg-build

# This must be after all dnf/yum and pip commands
# Cleaning YUM and DNF all caches (including disabled repos) and pip caches to reduce size of image
RUN rm -rf /var/cache/yum/* /var/cache/dnf/* /root/.cache/pip/*

RUN mkdir -p /opt/osg/svnrepo && \
cd /opt/osg && git clone https://github.com/opensciencegrid/osg-build.git ; \
cd /opt/osg/svnrepo && \
for i in osg-3.6_glideinwms 23-main_glideinwms 23-upcoming_glideinwms 24-main_glideinwms 24-upcoming_glideinwms; \
do mkdir "$i"; pushd "$i"; \
svn co https://vdt.cs.wisc.edu/svn/native/redhat/branches/${i%_glideinwms}/glideinwms; \
popd; done && \
chown -R abc: /opt/osg

# Default entry point
CMD ["/bin/bash"]

# build info
RUN echo "Source: fermilab/build-workspace" > /image-source-info.txt
RUN echo "Timestamp: $(date -u +'%Y-%m-%dT%H:%M:%SZ')" | tee /image-build-info.txt

0 comments on commit 3a1164d

Please sign in to comment.