diff --git a/docker/wmagent/Dockerfile b/docker/wmagent/Dockerfile index ba0aa5f70..80d8fce00 100644 --- a/docker/wmagent/Dockerfile +++ b/docker/wmagent/Dockerfile @@ -1,4 +1,4 @@ -FROM cmssw/cmsweb:20221130-stable +FROM registry.cern.ch/cmsweb/cmsweb:20221130-stable RUN echo "Adding the AFS cmst1:zh user" RUN groupadd -g 1399 zh @@ -8,6 +8,7 @@ RUN adduser -u 31961 -g 1399 cmst1 RUN install -o cmst1 -g 1399 -d /data/srv /data/admin /data/certs RUN chown root:1399 /data +ARG WMA_TAG=None ENV WDIR=/data # Add install script @@ -22,10 +23,10 @@ USER cmst1 WORKDIR ${WDIR} -RUN ${WDIR}/install.sh +RUN ${WDIR}/install.sh ${WMA_TAG} RUN echo "Installation completed!" # commenting this out for testing -#CMD ["./run.sh"] -CMD ["/bin/bash", "-l"] +#ENTRYPOINT ["./run.sh"] +ENTRYPOINT ["/bin/bash", "-l"] diff --git a/docker/wmagent/README.md b/docker/wmagent/README.md index abb4f8e9f..aaf96a106 100644 --- a/docker/wmagent/README.md +++ b/docker/wmagent/README.md @@ -4,16 +4,16 @@ Requires Docker to be installed an agent VM (vocmsXXXX) running a schedd. Default build options are defined in `install.sh`. Builds a Docker image via standard deployment scripts. The image only contains things common to all agents. ``` -WMA_TAG=1.2.8 -DEPLOY_TAG=HG1909e +WMA_TAG=2.2.0.2 +DEPLOY_TAG=master WMA_ARCH=slc7_amd64_gcc630 REPO="comp=comp" ``` Run options are defined in `run.sh`. A JobSubmitter patch from PR 9453 is required if you want to run workflows. Configures things unique to an agent running in a container, initializes the agent config and databases ``` -WMA_TAG=1.2.8 -DEPLOY_TAG=HG1909e +WMA_TAG=2.2.0.2 +DEPLOY_TAG=master TEAMNAME=testbed-erik CENTRAL_SERVICES=esg-dmwm-dev1.cern.ch AG_NUM=0 @@ -25,7 +25,8 @@ PATCHES="9453" Building the image ``` -docker build --network=host . +WMA_TAG=2.2.0.2 +docker build --network=host --build-arg WMA_TAG=$WMA_TAG -t wmagent:$WMA_TAG . ``` Running a WMAgent container diff --git a/docker/wmagent/install.sh b/docker/wmagent/install.sh index 59d09031e..04b6e18ea 100755 --- a/docker/wmagent/install.sh +++ b/docker/wmagent/install.sh @@ -2,7 +2,7 @@ ### This script is used to create a WMAgent Docker image and is based ### on deploy-wmagent.sh. -### +### ### It downloads a CMSWEB deployment tag and then uses the Deploy script ### with the arguments provided in the command line to create the image ### @@ -10,11 +10,16 @@ ### applied when the agent container is started. Configuration changes are made ### when the container is started with run.sh. ### +### Have a single parameter, taken as a first argument at runtime - The WMA_TAG +### set -x -WMA_TAG=1.2.8 -DEPLOY_TAG=HG1909e +WMA_TAG=$1 +WMA_TAG_REG="^[0-9]+\.[0-9]+\.[0-9]{1,2}(\.[0-9]{1,2})?$" +[[ $WMA_TAG =~ $WMA_TAG_REG ]] || { echo "WMA_TAG: $WMA_TAG does not match requered expression: $WMA_TAG_REG"; echo "EXIT with Error 1" ; exit 1 ;} + +DEPLOY_TAG=master WMA_ARCH=slc7_amd64_gcc630 REPO="comp=comp" @@ -51,8 +56,8 @@ mkdir -p $DEPLOY_DIR || true cd $BASE_DIR rm -rf deployment deployment.zip deployment-${DEPLOY_TAG}; -set -e -wget -nv -O deployment.zip --no-check-certificate https://github.com/dmwm/deployment/archive/$DEPLOY_TAG.zip +set -e +wget -nv -O deployment.zip --no-check-certificate https://github.com/dmwm/deployment/archive/refs/heads/${DEPLOY_TAG}.zip unzip -q deployment.zip cd deployment-$DEPLOY_TAG set +e @@ -79,8 +84,10 @@ echo "Done!" && echo ### echo "*** Downloading utilitarian scripts ***" cd /data/admin/wmagent -wget -nv https://raw.githubusercontent.com/amaltaro/scripts/master/checkProxy.py -O checkProxy.py +wget -nv https://raw.githubusercontent.com/dmwm/WMCore/master/deploy/checkProxy.py -O checkProxy.py wget -nv https://raw.githubusercontent.com/dmwm/WMCore/master/deploy/restartComponent.sh -O restartComponent.sh +wget -nv https://raw.githubusercontent.com/dmwm/WMCore/master/deploy/renew_proxy.sh -O renew_proxy.sh +chmod +x renew_proxy.sh restartComponent.sh echo "Done!" && echo # remove the "install" subdirs, these will be mounted from the host