Skip to content

Commit

Permalink
Merge pull request #2578 from garlick/boot_conf
Browse files Browse the repository at this point in the history
broker: new format for [bootstrap] configuration
  • Loading branch information
mergify[bot] authored Dec 23, 2019
2 parents 8e0fc6c + 54ff0c1 commit f9780be
Show file tree
Hide file tree
Showing 49 changed files with 1,627 additions and 436 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ AC_CONFIG_FILES( \
doc/Makefile \
doc/man1/Makefile \
doc/man3/Makefile \
doc/man5/Makefile \
doc/man7/Makefile \
doc/test/Makefile \
t/Makefile \
Expand Down
2 changes: 1 addition & 1 deletion doc/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SUBDIRS = man1 man3 man7 test
SUBDIRS = man1 man3 man5 man7 test
4 changes: 4 additions & 0 deletions doc/man5/COPYRIGHT.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Copyright 2014 Lawrence Livermore National Security, LLC
and Flux developers.

SPDX-License-Identifier: LGPL-3.0
27 changes: 27 additions & 0 deletions doc/man5/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
MAN5_FILES = \
flux-config-bootstrap.5

ADOC_FILES = $(MAN5_FILES:%.7=%.adoc)
XML_FILES = $(MAN5_FILES:%.7=%.xml)

if ENABLE_DOCS
dist_man_MANS = $(MAN5_FILES)
$(MAN5_FILES): COPYRIGHT.adoc
endif

SUFFIXES = .adoc .5

STDERR_DEVNULL = $(stderr_devnull_$(V))
stderr_devnull_ = $(stderr_devnull_$(AM_DEFAULT_VERBOSITY))
stderr_devnull_0 = 2>/dev/null

.adoc.5:
$(AM_V_GEN)$(ADOC) --attribute mansource=$(PACKAGE_NAME) \
--attribute manversion=$(PACKAGE_VERSION) \
--attribute manmanual="Flux Miscellaneous Reference" \
--destination-dir $(builddir) \
--doctype manpage $(ADOC_FORMAT_OPT) manpage $< $(STDERR_DEVNULL)

EXTRA_DIST = $(ADOC_FILES) COPYRIGHT.adoc

CLEANFILES = $(MAN5_FILES) $(XML_FILES)
121 changes: 121 additions & 0 deletions doc/man5/flux-config-bootstrap.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
flux-config-bootstrap(5)
========================
:doctype: manpage


NAME
----
flux-config-bootstrap - configure Flux instance bootstrap


DESCRIPTION
-----------

The broker discovers the size of the Flux instance, the broker's rank,
and overlay network wireup information either dynamically using a PMI
service, such as when being launched by Flux or another resource manager,
or statically using the `bootstrap` section of the Flux configuration,
such as when being launched by systemd.

The default bootstrap mode is PMI. The Flux systemd unit file forces the
broker to use the config method by specifying `--setattr=boot.method=config`
on the broker command line.

CONFIG FILES
------------

Flux uses the TOML configuration file format. The broker normally
parses `/etc/flux/conf.d/*.toml`. The actual path is dependent on
`configure` command line options used to build flux, and can be
overridden with the FLUX_CONF_DIR environment variable.

The `bootstrap` section is a TOML table containing the following
keys. Each node in a cluster is expected to bootstrap from an
identical config file.

KEYWORDS
--------

default_port::
(optional) The value is an integer port number that is substituted
for the token `%p` in the other keys.

default_bind::
(optional) The value is a ZeroMQ endpoint URI that is used for host
entries that do not explicitly set a bind address. The tokens
`%p` and `%h` are replaced with the default port and the host
for the current host entry.

default_connect::
(optional) The value is a ZeroMQ endpoint URI that is used for host
entries that do not explicitly set a connect address. The tokens
`%p` and `%h` are replaced with the default port and the host
for the current host entry.

hosts::
(optional) A rank-ordered array of host entries. Each host entry is
a TOML table containing at minimum the `host` key. The broker determines
its rank by matching its hostname in the hosts array and taking the array
index. An empty or missing hosts array implies a standalone (single
broker) instance. The entry for a broker with downstream peers must
either assign the `bind` key to a ZeroMQ endpoint URI, or the `default_bind`
URI described above is used. The entry for a broker with downstream peers
must also either assign the `connect` key to a ZeroMQ endpoint URI, or
the `default_connect` URI described above is used. The same `%h` and `%p`
substitutions work here as well.

COMPACT HOSTS
-------------

Since it would be tedious to repeat host entries for every compute node in
a large cluster, the `hosts` array may be abbreviated using bracketed
"idset" notation in `host` keys.

An idset is an unordered set of non-negative integers that may be expressed
as a comma-separated list including hyphenated ranges. For example
the set 0, 1, 2, 3, 4, 18, 20 may be represented as "0-4,18,20".

A `host` key may include one or more bracketed idsets. For example,
"foo[0-1023]" represents the hosts "foo0, foo1, ..., foo1023", or
"rack[0-1]node[0-1]" represents the hosts "rack0node0, rack0node1,
rack1node0, rack1node1".

EXAMPLE
-------

....
[bootstrap]
default_port = 8050
default_bind = "tcp://en0:%p"
default_connect = "tcp://e%h:%p"
hosts = [
{
host="fluke0",
bind="tcp://en4:9001",
connect="tcp://fluke-mgmt:9001"
},
{ host = "fluke[1-1023]" },
]
....


AUTHOR
------
This page is maintained by the Flux community.


RESOURCES
---------
Github: <http://github.com/flux-framework>


COPYRIGHT
---------
include::COPYRIGHT.adoc[]


SEE ALSO
--------
flux-getattr(1), flux_attr_get(3)
4 changes: 4 additions & 0 deletions doc/test/spell.en.pws
Original file line number Diff line number Diff line change
Expand Up @@ -466,3 +466,7 @@ FSD
enqueues
cpus
gpu
idsets
systemd
toml
unordered
3 changes: 2 additions & 1 deletion etc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
systemdsystemunit_DATA = flux.service
#endif

dist_fluxcf_DATA = conf.d/boot.toml
dist_fluxcf_DATA = \
conf.d/bootstrap.toml

noinst_DATA = \
flux/curve
Expand Down
7 changes: 0 additions & 7 deletions etc/conf.d/boot.toml

This file was deleted.

9 changes: 9 additions & 0 deletions etc/conf.d/bootstrap.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# This bootstrap configuration is for a single-node
# (i.e. workstation) Flux system configuration.
#
# See flux-config-bootstrap(5) for more information on this
# configuration section.
#

[bootstrap]
2 changes: 1 addition & 1 deletion etc/flux.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Description=Flux message broker

[Service]
Environment=FLUX_USERDB_OPTIONS=--default-rolemask=user
ExecStart=@X_BINDIR@/flux broker -Srundir=@X_RUNSTATEDIR@/flux -Sboot.method=config sleep inf
ExecStart=@X_BINDIR@/flux broker -Srundir=@X_RUNSTATEDIR@/flux -Slocal-uri=local://@X_RUNSTATEDIR@/flux/local -Sboot.method=config sleep inf
User=flux
Group=flux
RuntimeDirectory=flux
Expand Down
7 changes: 6 additions & 1 deletion src/broker/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ TESTS = test_shutdown.t \
test_service.t \
test_reduce.t \
test_liblist.t \
test_pmiutil.t
test_pmiutil.t \
test_boot_config.t

test_ldadd = \
$(builddir)/libbroker.la \
Expand Down Expand Up @@ -127,3 +128,7 @@ test_liblist_t_LDADD = $(test_ldadd)
test_pmiutil_t_SOURCES = test/pmiutil.c
test_pmiutil_t_CPPFLAGS = $(test_cppflags)
test_pmiutil_t_LDADD = $(test_ldadd)

test_boot_config_t_SOURCES = test/boot_config.c
test_boot_config_t_CPPFLAGS = $(test_cppflags)
test_boot_config_t_LDADD = $(test_ldadd)
Loading

0 comments on commit f9780be

Please sign in to comment.