Skip to content

Commit

Permalink
Merge branch 'dmwm:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
arooshap authored Mar 18, 2024
2 parents 0760f1b + abeb082 commit 6a24a43
Show file tree
Hide file tree
Showing 15 changed files with 352 additions and 139 deletions.
6 changes: 6 additions & 0 deletions docker/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ RUN crontab /data/crontab.txt
ADD run.sh $WDIR/run.sh
ADD monitor.sh $WDIR/monitor.sh
ADD alerts.sh $WDIR/alerts.sh
COPY authmap-prod.cron /tmp/authmap-prod.cron
COPY authmap-preprod.cron /tmp/data/tools/authmap-preprod.cron
COPY authmap-test.cron /tmp/authmap-test.cron
COPY copy_cron.sh $WDIR/copy_cron.sh



ENV PATH="${WDIR}/cmsweb/bin:${WDIR}:${WDIR}/gopath/bin:${PATH}"

Expand Down
2 changes: 2 additions & 0 deletions docker/frontend/authmap-preprod.cron
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*/15 * * * * sleep $((RANDOM % 601)); /data/srv/current/config/frontend/mkauthmap -c /data/srv/current/config/frontend/mkauth.conf -o /data/srv/state/frontend/etc/authmap.json --cert /etc/robots/robotcert.pem --key /etc/robots/robotkey.pem --ca-cert /etc/ssl/certs/CERN-bundle.pem ; [ $? -ne 0 ] && /bin/bash /data/alerts.sh

2 changes: 2 additions & 0 deletions docker/frontend/authmap-prod.cron
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*/15 * * * * sleep $((RANDOM % 601)); /data/srv/current/config/frontend/mkauthmap -c /data/srv/current/config/frontend/mkauth.conf -o /data/srv/state/frontend/etc/authmap.json --cert /etc/robots/robotcert.pem --key /etc/robots/robotkey.pem --ca-cert /etc/ssl/certs/CERN-bundle.pem ; [ $? -ne 0 ] && /bin/bash /data/alerts.sh

2 changes: 2 additions & 0 deletions docker/frontend/authmap-test.cron
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*/30 * * * * sleep $((RANDOM % 901)); /data/srv/current/config/frontend/mkauthmap -c /data/srv/current/config/frontend/mkauth.conf -o /data/srv/state/frontend/etc/authmap.json --cert /etc/robots/robotcert.pem --key /etc/robots/robotkey.pem --ca-cert /etc/ssl/certs/CERN-bundle.pem ; [ $? -ne 0 ] && /bin/bash /data/alerts.sh

17 changes: 17 additions & 0 deletions docker/frontend/copy_cron.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
if [ "$ENVIRONMENT" = "k8s-prod" ]; then
# Copy the production cron file
echo "Copying authmap-prod.cron"
cp /tmp/authmap-prod.cron /tmp/authmap.cron
elif [ "$ENVIRONMENT" = "k8s-preprod" ]; then
# Copy the development cron file
echo "Copying authmap-preprod.cron"
cp /tmp/authmap-preprod.cron /tmp/authmap.cron
elif [[ "$ENVIRONMENT" == k8s-test* ]]; then
# Copy the test cron file
echo "Copying authmap-test.cron"
cp /tmp/authmap-test.cron /tmp/authmap.cron

else
echo "Unsupported environment: $ENVIRONMENT"
exit 1
fi
3 changes: 3 additions & 0 deletions docker/frontend/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,8 @@ crontab -l | \
# add proxy generation via robot certificate
crontab -l | egrep -v "reboot|ProxyRenew|LogArchive|ServerMonitor" > /tmp/mycron
echo "0 0 * * * sudo /usr/sbin/fetch-crl" >> /tmp/mycron
sed -i '/mkauthmap/d' /tmp/mycron
chmod +x copy_cron.sh && ./copy_cron.sh && cat /tmp/authmap.cron >> /tmp/mycron

crontab /tmp/mycron
rm /tmp/mycron
9 changes: 7 additions & 2 deletions docker/pypi/wmagent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ENV WMA_LOG_DIR=$WMA_CURRENT_DIR/logs
ENV WMA_DEPLOY_DIR=/usr/local
ENV WMA_ENV_FILE=$WMA_DEPLOY_DIR/deploy/env.sh
ENV WMA_SECRETS_FILE=$WMA_ADMIN_DIR/WMAgent.secrets
ENV ORACLE_PATH=$WMA_DEPLOY_DIR/etc/oracle


# Setting up users and previleges
Expand Down Expand Up @@ -62,5 +63,9 @@ WORKDIR ${WMA_ROOT_DIR}
USER ${WMA_USER}
ENV USER=$WMA_USER

# Define the entrypoint.
ENTRYPOINT ["./run.sh"]
# Define the entrypoint (Using exec Form):
ENTRYPOINT ["./run.sh", "2>&1"]

# # Define the entrypoint (Using shell Form):
# SHELL ["/bin/bash", "-c"]
# ENTRYPOINT /data/run.sh 2>&1
4 changes: 2 additions & 2 deletions docker/pypi/wmagent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ They are set at different moments along the process: i.e. at `buildtime` - when

* **List of variables set at `configtime` defined in $WMAgent.secrets file:**

* MYSQL_USER=*****
* MYSQL_PASS=*****
* MDB_USER=*****
* MDB_PASS=*****

or

Expand Down
Loading

0 comments on commit 6a24a43

Please sign in to comment.