Skip to content

Commit

Permalink
Merge pull request #1568 from d-ylee/update-wmcore-dev
Browse files Browse the repository at this point in the history
Update wmcore-dev
  • Loading branch information
d-ylee authored Dec 12, 2024
2 parents 36e30a0 + 1738c4f commit d1eb8a7
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 25 deletions.
5 changes: 4 additions & 1 deletion docker/pypi/wmcore-dev/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
contents/
ContainerScripts/LatestUnitTests
.DS_Store
examples

# virtualenvs
*/**/venv
requirements.txt
.venv
9 changes: 4 additions & 5 deletions docker/pypi/wmcore-dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# FROM --platform=linux/amd64 registry.cern.ch/cmsweb/alma-base:alma9-20240305
FROM --platform=linux/amd64 registry.cern.ch/cmsweb/cmsweb-alma9-base:20240530

LABEL version="0.2.0"

# Install cern repo
RUN dnf install -y 'dnf-command(config-manager)' && \
dnf config-manager --add-repo https://linuxsoft.cern.ch/cern/alma/9/devel/x86_64/os
Expand Down Expand Up @@ -40,6 +41,8 @@ RUN dnf install -y \
voms-clients-cpp && \
dnf clean all

# Create the working directory
RUN mkdir -p /home/cmsbld
WORKDIR /home/cmsbld

# get requirements.txt and remove gfal2 to use RPM gfal2
Expand All @@ -52,11 +55,7 @@ RUN curl -O https://raw.githubusercontent.com/dmwm/WMCore/master/requirements.tx

RUN pip3 install --no-cache-dir --upgrade pip setuptools wheel && \
pip3 install --no-cache-dir --ignore-installed -r /home/cmsbld/requirements-dev.txt
# pip3 install --no-cache-dir --ignore-installed -r /home/cmsbld/WMCore/requirements-dev.txt

ADD TestScripts /home/cmsbld/TestScripts
ADD ContainerScripts /home/cmsbld/ContainerScripts
ADD etc /home/cmsbld/etc
ADD entrypoint.sh /entrypoint.sh

ENV X509_HOST_CERT=/data/certs/servicecert.pem
Expand Down
23 changes: 23 additions & 0 deletions docker/pypi/wmcore-dev/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
VERSION=0.2.0
DATE := $(shell date +%Y%m%d)
#DATE = 20241202

build:
docker buildx build --platform=linux/amd64 --tag registry.cern.ch/cmsweb/wmcore-dev .

build-no-cache:
docker buildx build --no-cache --platform=linux/amd64 --tag registry.cern.ch/cmsweb/wmcore-dev .

push:
docker tag registry.cern.ch/cmsweb/wmcore-dev registry.cern.ch/cmsweb/wmcore-dev:$(DATE)
docker push registry.cern.ch/cmsweb/wmcore-dev:$(DATE)
docker tag registry.cern.ch/cmsweb/wmcore-dev registry.cern.ch/cmsweb/wmcore-dev:latest
docker push registry.cern.ch/cmsweb/wmcore-dev:latest

push-preprod:
docker tag registry.cern.ch/cmsweb/wmcore-dev registry.cern.ch/cmsweb/wmcore-dev:$(VERSION)
docker push registry.cern.ch/cmsweb/wmcore-dev:$(VERSION)

push-stable:
docker tag registry.cern.ch/cmsweb/wmcore-dev registry.cern.ch/cmsweb/wmcore-dev:$(VERSION)-stable
docker push registry.cern.ch/cmsweb/wmcore-dev:$(VERSION)-stable
17 changes: 17 additions & 0 deletions docker/pypi/wmcore-dev/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# wmcore-dev: WMCore development image

## Overview
This image is used for running unit tests and linting for the [WMCore](https://github.com/dmwm/WMCore) repository. This image is currently used by the Jenkins CI/CD pipelines defined in [WMCore-Jenkins](https://github.com/dmwm/WMCore-Jenkins).

## Usage
1. To build the image, run `make build`
2. Push to the CERN registry with `make push`, `make push-preprod`, or `make push-stable`
* Special account privileges are needed to push to the CERN registry.
* `*-stable` tagged releases are not automatically cleared from the registry.
* Currently, the date is used as a tag for `make push`, while `make push-preprod` and `make push-stable` uses a version number.
* `make push-preprod`: Pushes the current version
* `make push-stable`: Pushes the current version, appended with `-stable`

## Maintainers
[@d-ylee](https://github.com/d-ylee)
[@khurtado](https://github.com/khurtado)
3 changes: 3 additions & 0 deletions docker/pypi/wmcore-dev/TestScripts/test-wmcorepy3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ echo "Sourcing a python3 unittest environment"
# load wmagent secrets
. /data/admin/wmagent/WMAgent.secrets

# Load CMS environment from CVMFS
source /cvmfs/cms.cern.ch/cmsset_default.sh

# This is what the production wmagent-mariadb image defines (via WMA_DATABASE) has as of 2024/07/15
# TODO: We should either make an option in the mariadb image to define the default WMA_DATABASE or make a custom test mariadb image
MDB_UNITTEST_DB=wmagent
Expand Down
3 changes: 0 additions & 3 deletions docker/pypi/wmcore-dev/build.sh

This file was deleted.

29 changes: 17 additions & 12 deletions docker/pypi/wmcore-dev/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,28 @@

# add WMCore repository, if in Jenkins
if [[ -z "${BUILD_ID}" ]]; then
echo "No BUILD_ID set"
echo "No BUILD_ID set, we in dev mode"
else
echo "BUILD_ID set, cloning dmwm/WMCore"
git clone https://github.com/dmwm/WMCore

echo "BUILD_ID set, setting up for CI/CD"
# give proper permissions to home directory
chown -R ${MY_ID}:${MY_GROUP} /home/cmsbld
#chown -R ${MY_ID}:${MY_GROUP} /home/cmsbld

USERN=$(id -un ${MY_ID})
#USERN=$(id -un ${MY_ID})

su - $USERN
fi
pushd /home/cmsbld

pushd /home/cmsbld
# clone main repo
git clone https://github.com/dmwm/WMCore

# clone jenkins-test scripts
git clone https://github.com/d-ylee/jenkins-test
popd
# clone jenkins-test scripts
git clone https://github.com/dmwm/WMCore-Jenkins

# TODO: Move scripts to a more sensible location in WMCore-Jenkins
cp -r WMCore-Jenkins/docker/wmcore-dev/TestScripts .
cp -r WMCore-Jenkins/docker/wmcore-dev/ContainerScripts .
cp -r WMCore-Jenkins/docker/wmcore-dev/etc .
popd

fi

$@
4 changes: 0 additions & 4 deletions docker/pypi/wmcore-dev/push.sh

This file was deleted.

0 comments on commit d1eb8a7

Please sign in to comment.