GithubHelp home page GithubHelp logo

kreczko / siteadmintoolkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cmscompops/siteadmintoolkit

0.0 2.0 0.0 134 KB

Home Page: http://cms-comp-ops-tools.readthedocs.io/en/latest/siteadmintoolkit.html

Python 68.10% Shell 2.11% Perl 29.79%

siteadmintoolkit's Introduction

Site Admin Toolkit

build

This package contains useful tools for Site Admins to maintain their site. These are generally scripts designed to be run from within the directory they are stored after some configuration for a given site.

Note

This documentation is new, so it does not describe all of the tools in SiteAdminToolkit repository. Anything that is frequently used should be added to the repository README to be useful to future admins.

The repository is maintained and tested assuming that admins are using Python 2.6. Any earlier version of Python will not work with some tools. Since the contents of this repository is currently scripts that do not depend on the centralized :ref:`toolbox-ref`, installation can simply be done by cloning the repository:

git clone https://github.com/CMSCompOps/SiteAdminToolkit.git

However, if you wish to run the test suites at your site, you should install SiteAdminToolkit through the :ref:`OpsSpace installer <setup-ref>`.

The Unmerged Cleaner tool is used to clean unprotected files from a site's unmerged directory. This is usually the LFN /store/unmerged. Other possibilities exist, such as /store/dcachetests/unmerged, so this can be configured between separate runs, as described under :ref:`listdel-config-ref`. There are three main steps to the deletion, which are also described in more detail later:

  1. Create a configuration file. A default configuration file is created the very first time you run unmerged-cleaner/ListDeletable.py. The script tries to import a config.py. If it fails, config.py is generated. Make sure you do not have some existing config module that your Python installation will load instead. Then edit the variables described under :ref:`listdel-config-ref`.
  2. List the directories or files (configurable) inside the unmerged directory that can be deleted. Directories that can be considered for deletion are ones that are not listed as protected by Unified, are not too new (configurable), and are not in the logs or SAM directories (configurable). An optimized tool, :ref:`unmerged-list-ref`, has been created to do this step.
  3. Delete the directories. After creating a list of directories or files that can be deleted, it is the admin's responsibility to remove them. Available tools are described under :ref:`unmerged-delete-ref`. Feel free to contribute scripts used for your own site by creating a pull request at the CMSCompOps repository.
.. automodule:: ListDeletable

If you are going to use one of the available deletion tools on your site, it is recommended that you run the unmerged cleaner unit test.

.. automodule:: test_unmerged_cleaner

Currently, there are two deletion tool available. One is integrated into ListDeletable.py, and the other is a Perl script that is used on Hadoop systems.

ListDeletable.py can be used to directly delete listed directories or files.

After creating and reviewing the list of directories or files to delete, ListDelete.py --delete reads your deletion file and removes the directories listed. This is done via the :py:func:`ListDeletable.do_delete` function. Please check the function documentation for any existing caveats.

This --delete flag will only work after the deletion file is created. It is not possible to list and remove directories with an unmodified ListDeletable.py at the same time. Any listed file or directory without /unmerged/ in the path will cause the script to quit.

Warning

Currently untested. Serves as a template to be rewritten for a given site.

.. autoanysrc:: phony
   :src: ../SiteAdminToolkit/unmerged-cleaner/HadoopDelete.pl
   :analyzer: perl-script

Here are documented members of the :ref:`unmerged-ref`, mostly for people interested in adding some feature.

This documentation for ListDeletable does not have all members because the module docstring is used to generate :ref:`unmerged-list-ref`. This should be enough to get a contributor or advanced user started though.

.. autoclass:: ListDeletable.DataNode
   :members:

.. autofunction:: ListDeletable.do_delete

.. autofunction:: ListDeletable.filter_protected

.. autofunction:: ListDeletable.get_file_size

.. autofunction:: ListDeletable.get_mtime

.. autofunction:: ListDeletable.get_protected

.. autofunction:: ListDeletable.get_unmerged_files

.. autofunction:: ListDeletable.lfn_to_pfn

.. autofunction:: ListDeletable.list_folder

.. autofunction:: ListDeletable.main

The unmerged cleaner also makes use of the local module defined in ConfigTools.py.

.. automodule:: ConfigTools
   :members:

If you have a fork with automated build tests set up (see :ref:`tests-ref`), then feel free to add your badge here for easy viewing.

dabercro: build-dabercro

siteadmintoolkit's People

Contributors

dabercro avatar cpausmit avatar

Watchers

James Cloos avatar Luke Kreczko avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.