Skip to content

Commit

Permalink
Update logrotate config, README
Browse files Browse the repository at this point in the history
  • Loading branch information
nothingface0 committed Nov 28, 2023
1 parent 8e83565 commit 982b6e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 71 deletions.
71 changes: 4 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ It aims to replace the existing one (`Deploy`), found in [`dmwm/deployment`](htt
1. Download all the external resources needed (e.g. python packages from PyPI, github repositories) and compress them. This is done automatically with GitHub actions, and you can download a package ready to install [here](https://github.com/cms-DQM/dqmgui_prod_deployment/actions/workflows/build_installation_package.yaml).
2. Copy the archives to the P5 machine and extract, then build from source (hence takes longer to deploy).

> **Warning**
> [!WARNING]
> This deployment script should *not* be run as a sudo user.
## Requirements
Expand All @@ -18,70 +18,7 @@ It aims to replace the existing one (`Deploy`), found in [`dmwm/deployment`](htt
- `sudo` permissions:
- To install the system-wide packages (listed below).
- Python 3.8
- Several system packages, installed via `yum`:
<details>
<summary>Package list</summary>

- unzip
- bzip2
- libglvnd-opengl
- libX11-devel
- libXext-devel
- libXft-devel
- libXpm-devel
- mesa-libGLU
- mesa-libGLU-devel
- perl-Env
- perl-Switch
- perl-Thread-Queue
- glibc-headers
- libidn
- libXcursor
- libXi
- libXinerama
- libXrandr
- perl
- perl-Digest-MD5
- tcsh
- zsh
- epel-release
- libcurl-devel
- python38
- python38-devel
- boost-python3-devel
- protobuf-devel
- jemalloc-devel
- pcre-devel
- boost-devel
- lzo-devel
- cmake
- xz-devel
- openssl-devel
- libjpeg-turbo-devel
- libpng-devel
- gcc-c++
- gcc
- binutils
- gcc-gfortran
- mesa-libGL-devel
- mesa-libGLU-devel
- glew-devel
- ftgl-devel
- fftw-devel
- cfitsio-devel
- graphviz-devel
- libuuid-devel
- avahi-compat-libdns_sd-devel
- openldap-devel
- python3-numpy
- libxml2-devel
- gsl-devel
- readline-devel
- R-devel
- R-Rcpp-devel
- R-RInside-devel
- xrootd-client
</details>
- Several system packages, installed via `yum` (see below).

## Deploying [Legacy] DQMGUI

Expand All @@ -95,7 +32,7 @@ This procedure has been tested on a RHEL8 Openstack VM. Instructions below are p
```
OR
* Download all the required files yourself (this is useful if you need specific versions of DMQM/deployment or DQMGUI, change them in `config.sh`):
> **Warning**
> [!WARNING]
> You will need to have the same python version with the machine you will be installing to! Configure that in `config.sh`, with the `PYTHON_VERSION` variable.
```bash
git clone --depth 1 https://github.com/cms-DQM/dqmgui_prod_deployment && cd dqmgui_prod_deployment
Expand Down Expand Up @@ -182,7 +119,7 @@ bash deploy_dqmgui.sh do_preliminary_checks=0 do_check_dependencies=0
A useful combination that can be used when you've already installed and built all steps once, but you only want to re-compile the DQMGUI part for testing:

```bash
bash deploy_dqmgui.sh do_preliminary_checks=0 do_check_dependencies=0 do_create_directories=1 do_install_boost_gil=0 do_install_gil_numeric=0 do_install_rotoglup=0 do_install_classlib=0 do_compile_classlib=0 do_install_dmwm=0 do_install_root=0 do_compile_root=0 do_install_dqmgui=0 do_compile_dqmgui=1 do_install_yui=0 do_install_extjs=0 do_install_d3=0 do_install_jsroot=0
bash deploy_dqmgui.sh do_preliminary_checks=0 do_check_dependencies=0 do_create_directories=1 do_install_boost_gil=0 do_install_gil_numeric=0 do_install_rotoglup=0 do_install_classlib=0 do_compile_classlib=0 do_install_dmwm=0 do_install_root=0 do_compile_root=0 do_install_dqmgui=0 do_compile_dqmgui=1 do_install_yui=0 do_install_extjs=0 do_install_d3=0 do_install_jsroot=0 do_clean_crontab=0 do_install_crontab=0
```

## Download script
Expand Down
13 changes: 9 additions & 4 deletions deploy_dqmgui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ check_dependencies() {
clean_crontab() {
# Filter cronjobs starting in $INSTALLATION_DIR/current/dqmgui and
# replace crontabs
crontab -l 2>/dev/null | grep -v "$INSTALLATION_DIR/current/config/dqmgui" | crontab -
crontab -l 2>/dev/null | grep -v "$INSTALLATION_DIR/current/config/dqmgui" | grep -vE "$INSTALLATION_DIR/current.+logrotate.conf" | crontab -
}

# Install DQMGUI cronjobs
Expand All @@ -131,7 +131,7 @@ install_crontab() {
crontab -l # Get existing crontabs
echo "17 2 * * * $INSTALLATION_DIR/current/config/dqmgui/daily"
echo "@reboot $INSTALLATION_DIR/current/config/dqmgui/manage sysboot"
echo "0 3 * * * logrotate $INSTALLATION_DIR/$DMWM_GIT_TAG/sw/cms/dqmgui/$DQMGUI_GIT_TAG/128/etc/logrotate.conf --state $INSTALLATION_DIR/state/logrotate.state"
echo "0 3 * * * logrotate $INSTALLATION_DIR/current/sw/cms/dqmgui/$DQMGUI_GIT_TAG/128/etc/logrotate.conf --state $INSTALLATION_DIR/state/logrotate.state"
) | crontab -
}

Expand Down Expand Up @@ -291,10 +291,15 @@ _create_logrotate_conf() {
echo "# DQMGUI logrotate configuration file
# Automagically generated, please do not edit.
# Make daily compressed rotations in the same directory, keep up to
# 1 year of logs. Do not remove the rotated logs, instead copy the
# contents and truncate them to 0.
$INSTALLATION_DIR/logs/dqmgui/*/*.log {
compress
rotate -1
daily
compress
copytruncate
rotate 365
maxage 365
noolddir
nomail
}
Expand Down

0 comments on commit 982b6e0

Please sign in to comment.