-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add string representation for config and config override #390
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good if you could tweak the arg names across all the commands.
Also, weren't these passed in via environment variables before? Is the goal to not support those anymore?
tilequeue/command.py
Outdated
@@ -2468,6 +2468,27 @@ def command_fn(cfg, args): | |||
help='Tile coordinate as "z/x/y".') | |||
subparser.add_argument('--run_id', required=False, | |||
help='optional run_id used for logging') | |||
subparser.add_argument('--postgresql_host', required=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a list, this param should be called postgresql_hosts
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a list, this param should be called
postgresql_hosts
?
yup I will change to plural form, I just mimic the existing environment variable naming.
subparser.add_argument('--store_name', required=False, | ||
help='optional string of a list of tile store ' | ||
'names e.g. `["my-meta-tiles-us-east-1"]`') | ||
subparser.add_argument('--store_date_prefix', required=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we've been trying to change "date_prefix" to "build_id" elsewhere because they don't have to be date-related.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we've been trying to change "date_prefix" to "build_id" elsewhere because they don't have to be date-related.
we can probably change that to "build_id" in a separate PR since the renaming may require more changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good if you could tweak the arg names across all the commands.
I am not sure whether other command need them, shall we add them on a as-need basis later?
Also, weren't these passed in via environment variables before? Is the goal to not support those anymore?
These were passed in via environment variables and will continue to work. It is just that for the Go service with shelling out to python, we cannot use environment variables since that will have race condition.
tilequeue/command.py
Outdated
@@ -2468,6 +2468,27 @@ def command_fn(cfg, args): | |||
help='Tile coordinate as "z/x/y".') | |||
subparser.add_argument('--run_id', required=False, | |||
help='optional run_id used for logging') | |||
subparser.add_argument('--postgresql_host', required=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a list, this param should be called
postgresql_hosts
?
yup I will change to plural form, I just mimic the existing environment variable naming.
subparser.add_argument('--store_name', required=False, | ||
help='optional string of a list of tile store ' | ||
'names e.g. `["my-meta-tiles-us-east-1"]`') | ||
subparser.add_argument('--store_date_prefix', required=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we've been trying to change "date_prefix" to "build_id" elsewhere because they don't have to be date-related.
we can probably change that to "build_id" in a separate PR since the renaming may require more changes.
Background
In order to better debug what's inside the config, add a string repr for the Configuration object.
Also in order to provide a way to override certain config values from triggering time, add a few arguments to some tile commands so that those config values can be provided by the trigger.
Test steps
Temporarily modify the tilequeue_main to print out the
cfg
variable after make_config_from_argparse call. Then in local virtual env dopip install -e .
Then trigger the command by
then I got the config printed out correctly: