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

Fix WMAgent rpm dcoker image #1362

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 5 additions & 4 deletions docker/wmagent/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM cmssw/cmsweb:20221130-stable
FROM registry.cern.ch/cmsweb/cmsweb:20221130-stable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have a more recent cmsweb image. I'd suggest to update it to the latest.


RUN echo "Adding the AFS cmst1:zh user"
RUN groupadd -g 1399 zh
Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does WMA_TAG come from? Shouldn't this be using the ENV keyword instead of ARG?

ENV WDIR=/data

# Add install script
Expand All @@ -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"]
11 changes: 6 additions & 5 deletions docker/wmagent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
19 changes: 13 additions & 6 deletions docker/wmagent/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@

### 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
###
### It simply deploys the agent based on WMAgent version tag. Patches can be
### 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"

Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todor, if I pass master as the DEPLOY_TAG, this line seems to work just fine. And so it does for an old HG tag. Do we really need to change this github url?

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
Expand All @@ -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
Expand Down