Add `meta.args` for command line argument access. Add command line argument support for shard number. Add shard count to config file. Add `meta.sharding` exposing shard properties. Add shard number to logging methods. Add shard number to data appid.
20 lines
567 B
Python
20 lines
567 B
Python
import argparse
|
|
|
|
from constants import CONFIG_FILE
|
|
|
|
# ------------------------------
|
|
# Parsed commandline arguments
|
|
# ------------------------------
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument('--conf',
|
|
dest='config',
|
|
default=CONFIG_FILE,
|
|
help="Path to configuration file.")
|
|
parser.add_argument('--shard',
|
|
dest='shard',
|
|
default=None,
|
|
type=int,
|
|
help="Shard number to run, if applicable.")
|
|
|
|
args = parser.parse_args()
|