Skip to content

Commit 7adceb1

Browse files
committed
Spell out the script name; people are gonna run this, like, once; also various text tweaks and doc fixes
1 parent 998560e commit 7adceb1

File tree

3 files changed

+38
-43
lines changed

3 files changed

+38
-43
lines changed

README.md

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -477,30 +477,30 @@ This section is contained in `/etc/osg/config.d/40-siteinfo.ini` which is provid
477477
| **resource\_group** | String | The resource\_group of this CE as registered in Topology. |
478478

479479

480-
OSG Resource Catalog Generator
481-
==============================
480+
OSG CE Attributes Generator
481+
===========================
482482

483-
The Resource Catalog Generator is a standalone tool to create resource catalog attributes for a CE, that will be uploaded to the CE collector.
483+
The CE Attributes Generator is a standalone tool to create resource catalog attributes for a CE, that will be uploaded to the CE collector.
484484
It is a lightweight alternative to OSG-Configure, and it prints the attributes instead of modifying your CE's config files.
485485

486-
It uses `*.ini` files from osg-configure as the source of the data.
486+
It uses `*.ini` files from OSG-Configure as the source of the data.
487487

488488
Installation
489489
------------
490490

491-
The Resource Catalog Generator is typically installed via RPMs from the OSG repositories.
491+
The CE Attributes Generator is typically installed via RPMs from the OSG repositories.
492492
See [OSG documentation for how to enable the repositories](https://opensciencegrid.org/docs/common/yum/);
493493
once the repos are enabled, install by running
494494

495-
yum install osg-resource-catalog-generator
495+
yum install osg-ce-attributes-generator
496496

497-
Note: osg-resource-catalog-generator is not available in the OSG 3.5 series.
497+
Note: `osg-ce-attributes-generator` is not available in the OSG 3.5 series.
498498

499499

500500
Configuration
501501
-------------
502502

503-
The Resource Catalog Generator uses the same config files that OSG-Configure uses.
503+
The CE Attributes Generator uses the same config files that OSG-Configure uses.
504504
See the [31-cluster.ini](#31-clusterini--subcluster-and-resource-entry-sections),
505505
[35-pilot.ini](#35-pilotini--pilot) for attributes.
506506

@@ -509,49 +509,45 @@ You will also need `resource` and `resource_group` from the `Site Information` s
509509
You can also use `--resource` and `--resource-group` on the command line to specify these.
510510

511511
In addition, you should also have at least one batch system section with the attribute `enabled=True`, e.g.
512-
```
512+
```ini
513513
[Condor]
514514
enabled=True
515515
```
516516
The recognized batch systems are "Condor", "LSF", "PBS", "SGE", and "SLURM".
517+
If you are using BOSCO, specify your batch system in `20-bosco.ini`.
517518

518519
Alternatively, you can specify a comma-separated list with `--batch-systems` on the command line.
519520

520521

521522
Invocation
522523
----------
523524

524-
osg-resource-catalog-generator [options]
525-
526-
If invoked without any options, will read config from `/etc/osg/config.d/*.ini` and output to STDOUT.
527-
528-
### Options
529-
530-
- `-c FILE_OR_DIRECTORY`, `--config FILE_OR_DIRECTORY`
525+
osg-ce-attributes-generator [<options>] [<config_location>] [<output>]
531526

532-
Where to load configuration from; can be specified multiple times.
527+
- `config_location` is a file or directory to load configuration from.
528+
If this is a directory, load every `*.ini` file in that directory.
529+
If `-`, read from STDIN. The default is to read `/etc/osg/config.d`,
530+
same as `osg-configure`.
533531

534-
If this is a directory, will load every `*.ini` file in that directory.
532+
- `output` is a file to write attributes to.
533+
If `-` or unspecified, write to STDOUT.
535534

536-
If not specified, `/etc/osg/config.d` is used.
537535

538-
If `-`, will read from STDIN. STDIN will always be read last.
539-
540-
- `-o FILE`, `--output FILE`
541-
542-
Write output to this file instead of STDOUT.
536+
### Options
543537

544538
- `--resource RESOURCE_NAME`
545539

546540
The Resource name to use, which should match your Topology registration.
547-
This is an alternative to specifying `Site Information.resource` in the config files.
541+
Equivalent to `resource` in the `Site Information` section.
548542

549543
- `--resource-group RESOURCE_GROUP_NAME`
550544

551545
The Resource Group name to use, which should match your Topology registration.
552-
This is an alternative to specifying `Site Information.resource_group` in the config files.
553-
546+
Equivalent to `resource_group` in the `Site Information` section.
547+
554548
- `--batch-systems BATCH_SYSTEMS_LIST`
555549

556550
A comma-separated list of batch systems used by the resource.
557-
Recognized batch systems are: "Condor", "LSF", "PBS", "SGE", "SLURM".
551+
Recognized batch systems are: `Condor`, `LSF`, `PBS`, `SGE`, and `SLURM`.
552+
Equivalent to enabling the batch system sections in the
553+
`20-*.ini` files, or, if using BOSCO, setting `batch` in the `BOSCO` section.

scripts/osg-ce-attribs-gen renamed to scripts/osg-ce-attributes-generator

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
"""
4-
osg-ce-attribs-gen
5-
6-
OSG CA Attributes File Generator
7-
8-
Standalone script to generate a condor config file for advertising a CE resource to the CE Collector.
4+
OSG CE Attributes Generator:
5+
a standalone script to generate a condor config file for advertising
6+
a CE resource to the CE Collector.
97
"""
108

119
from argparse import ArgumentParser
@@ -50,24 +48,22 @@ def load_configs(config_location: str) -> ConfigParser:
5048

5149
def get_options(args):
5250
"""Parse, validate, and transform command-line options."""
53-
parser = ArgumentParser(prog="osg-ca-attrib-gen", description=__doc__)
51+
parser = ArgumentParser(prog="osg-ce-attributes-generator", description=__doc__)
5452
parser.add_argument("--version", action="version", version="%(prog)s " + __version__)
5553
parser.add_argument(
5654
"config_location",
5755
nargs="?",
5856
default="/etc/osg/config.d",
59-
metavar="FILE_OR_DIRECTORY",
60-
help="Where to load configuration from. "
61-
"If this is a directory, will load every *.ini file in that directory. "
62-
"Default: %(default)s. "
63-
"If '-', will read from STDIN.",
57+
help="A file or directory to load configuration from. "
58+
"If this is a directory, load every *.ini file in that directory. "
59+
"If '-', read from STDIN. "
60+
"Default: %(default)s.",
6461
)
6562
parser.add_argument(
6663
"output",
6764
nargs="?",
6865
default="-",
69-
metavar="FILE",
70-
help="Write output to this file. If '-' or unspecified, will write to STDOUT.",
66+
help="A file to write attributes to. If '-' or unspecified, write to STDOUT.",
7167
)
7268
parser.add_argument(
7369
"--resource",
@@ -90,7 +86,7 @@ def get_options(args):
9086
help="A comma-separated list of batch systems used by the resource. "
9187
f'Recognized batch systems are: {", ".join(BATCH_SYSTEMS)}. '
9288
"Equivalent to enabling the batch system sections in the 20-*.ini files, "
93-
"or, if using Bosco, setting 'batch_system' in the 'Bosco' section."
89+
"or, if using BOSCO, setting 'batch' in the 'BOSCO' section."
9490
)
9591

9692
return parser.parse_args(args)
@@ -103,11 +99,14 @@ def main(argv):
10399
config = load_configs(options.config_location)
104100
if "Site Information" not in config:
105101
config.add_section("Site Information")
102+
# Override config values with values from the command line
106103
if options.resource is not None:
107104
config["Site Information"]["resource"] = options.resource
108105
if options.resource_group is not None:
109106
config["Site Information"]["resource_group"] = options.resource_group
110107
if options.batch_systems is not None:
108+
# hack since there's no (documented) Site Information.batch_systems option
109+
# but I can still use it for passing a parameter
111110
config["Site Information"]["batch_systems"] = options.batch_systems
112111
output_str = get_ce_attributes_str(config)
113112
if options.output and options.output != "-":

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def get_data_files():
4444
maintainer_email='[email protected]',
4545
url='http://www.opensciencegrid.org',
4646
packages=['osg_configure', 'osg_configure.modules', 'osg_configure.configure_modules'],
47-
scripts=['scripts/osg-configure', 'scripts/osg-ce-attribs-gen'],
47+
scripts=['scripts/osg-configure', 'scripts/osg-ce-attributes-generator'],
4848
data_files=get_data_files(),
4949
classifiers=[
5050
"Development Status :: 6 - Mature",

0 commit comments

Comments
 (0)