Story #9759
closed[Crunch] arvados-docker-cleaner supports configuration from a file
0%
Description
Today, the only way to configure arvados-docker-cleaner is through its command line arguments. It should support configuration through /etc/arvados/docker-cleaner/config.???
(format and extension TBD) so that we can ship a useful systemd unit file for it.
Existing deployments rely on command line switches for configuration, so the implementation must continue to support those in addition to the new file configuration.
Updated by Brett Smith over 8 years ago
One implementation option: Python's argparse module can read arguments from a file, if you build your ArgumentParser with "fromfile_prefix_chars":https://docs.python.org/2/library/argparse.html#fromfile-prefix-chars
. If we turned that on, we could ship a systemd service file that runs the command python3 -m arvados_docker.cleaner @/etc/arvados/docker-cleaner/config
.
It's not especially elegant, but it would be the cheapest implementation, since it builds on the configuration we already have, already implements well-defined rules for if an option is specified in both a file and the command line, etc.