CRAB Logo

Deployment of CRAB Publisher

Complete: 5 | Go to SWGuideCrab |

All questions about Publisher and deploying it on private machine should go to hn-cms-crabDevelopment@cernNOSPAMPLEASE.ch

For production and pre-production: Local service account used to deploy, run and operate the service is crab3.

Introduction

The Standalone Publisher now comes packaged toghether with the TasKWorker and requires identical setup.

First step is to setup and configure a VM as a TaskWorker and install a recen version, i.e. follow CMSCrabTaskWorker.

You may decide not to have a TaskWorler running on the same machine as the Publisher, but should make sure that you have a working TaskWorker to validate your setup before trying the Publisher/

This twiki explains how to deploy the CRAB server backend (a.k.a. the CRAB Publisher or Publisher). It will guide you through the steps required to:

  1. Get a virtual machine (VM) with the right architecture from the CERN OpenStack Cloud Infrastructure.
  2. Install the required software on the machine.
  3. Configure the machine.

Note: Legend of colors for the examples:

Commands to execute
Output sample of the executed commands
Configuration files
Other files

Installation

Switch to the service user crab3 and prepare the directory structure:

sudo su crab3
cd /data/srv
mkdir -p Publisher
cd Publisher
mkdir -p logs/tasks

Configuration

Create a Publisher configuration template file /data/srv/Publisher/PublisherConfig.py with this content

(or you can also copy it from /data/srv/TaskManager/current/slc7_amd64_gcc630/cms/crabtaskworker/*/lib/python2.7/site-packages/Publisher/PublisherConfig.py and modify it to be like below )

"""
Configuration file for CRAB standalone Publisher
"""
from __future__ import division
from WMCore.Configuration import Configuration

config = Configuration()
config.section_('General')

config.General.asoworker = 'asoless'
config.General.isOracle = True
config.General.oracleDB = 'cmsweb-testbed.cern.ch'
config.General.oracleFileTrans = '/crabserver/preprod/filetransfers'
config.General.oracleUserTrans = '/crabserver/preprod/fileusertransfers'
config.General.logLevel = 'INFO'
config.General.pollInterval = 1800
config.General.publish_dbs_url = 'https://cmsweb.cern.ch/dbs/prod/phys03/DBSWriter'
config.General.block_closure_timeout = 9400
config.General.cache_area = 'https://cmsweb-testbed.cern.ch/crabserver/preprod/filemetadata'
#config.General.cache_area = 'https://cmsweb.cern.ch/crabserver/prod/filemetadata'
config.General.workflow_expiration_time = 3
config.General.serviceCert = '/data/certs/hostcert.pem'
config.General.serviceKey = '/data/certs/hostkey.pem'
config.General.logMsgFormat = '%(asctime)s:%(levelname)s:%(module)s:%(name)s: %(message)s'
config.General.max_files_per_block = 100
config.General.opsCert = '/data/certs/servicecert.pem'
config.General.opsKey = '/data/certs/servicekey.pem'
config.General.cache_path = '/crabserver/preprod/filemetadata'
config.General.task_path = '/crabserver/preprod/task'

config.section_('Publisher')
config.Publisher.logMsgFormat = '%(asctime)s:%(levelname)s: %(message)s'

The parameters that you have to change are (TO BE COMPLTED , FILLED, AND ALSO REVIEW CONF TO MAKE IT CLEANER AND CLEARER)

Parameter Type Explanation
oracleDB string the hostname where the CrabServer REST to use runs


The latest versions of all the configuration files for the Publisher instances in Prod & PreProd & Dev are uploaded in the same git repository as the CRAB3Rest config: https://gitlab.cern.ch/crab3/CRAB3ServerConfig/tree/master/Taskworker/config

Start/stop the Publisher

create a symbolic link to the current version of the code, analogouse as to what done for TaskWorker:

cd /data/srv/Pubisher
ln -s /data/srv/TaskManager/current /data/srv/Publisher/current
Create a file (/data/srv/Publisher/env.sh) that you will source to set the Publisher environment:
export PUBLISHERAREA=/data/srv/Publisher  # where we run the Publisher
source $PUBLISHERAREA/current/slc7_amd64_gcc630/cms/crabtaskworker/*/etc/profile.d/init.sh
export CRABTASKWORKER_ROOT
export CONDOR_CONFIG=/data/srv/condor_config

Create a file (/data/srv/Publisher/start.sh) that you will source to start the Publisher (this runs the MasterPublisher from the installed Publisher, but you can change it to run instead the MasterPublisher from your local CRABServer repository):

for prod and preprod instance:

USER=$(/usr/bin/id -u)

if [[ "$USER" = '100001' ]]; then
  echo starting
  nohup python $PUBLISHERAREA/current/slc6_amd64_gcc493/cms/crabtaskworker/*/lib/python2.7/site-packages/Publisher/MasterWorker.py --config $PUBLISHERAREA/PublisherConfig.py --debug &
else
  echo $USER
  echo 'Please change to CRAB3 user, TW cannot run as root'
fi

for private installations:

wd=$PWD
cd $PUBLISHERAREA
nohup python $MYTESTAREA/slc6_amd64_gcc493/cms/crabtaskworker/*/lib/python2.7/site-packages/Publisher/MasterPublisher.py --config $PUBLISHERAREA/PublisherConfig.py --debug &
cd $wd

  • Environment setup for starting the service:
source /data/srv/Publisher/env.sh

  • Starting the service (need to have the Publisher environment):
sh /data/srv/Publisher/start.sh

which will write $PUBLISHERAREA/nohup.out, empty if start is successful, with error messages if not.

  • Stopping the service on non production TW:
pkill -f Publisher

  • Stopping the service on production Publisher:

first of all identify the pid of the master process: and then kill only the master process and wait until all slaves finish

Publisher log files

The Publisher log files are in the logs subdirectory of the current directory from where the service is started. This subdirectory is created by the Publisher process if needed. If you started the service following the instructions above, the logs subdirectory should be in $PUBLISHERAREA/logs/. The main log file is twlog.log. There are also other log entries in the subdirectories logs/processes and logs/tasks. The twlog.log is automatically rotated every day by the service.

Install Publisher via Puppet

TBD
Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r11 - 2019-04-23 - LeonardoCristella
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback