Add an optional parameter `--config` for all sub commands
Why: this makes it easier to run multiple Dagu servers on a single instance.
Should merge admin-configuration, env、admin config、global config into one config file, and the config file can specify by --config?
I think this way is clearer to config server or scheduler and easy to organize multiple instances's data.
By the way, we can remove the rely of the $HOME path. Dagu's work dir can specify in the config file.
Make dagu's execution environment don't rely on some sys environment. It is useful to run dagu on cloud or container platform. User can run dagu multi-instance or multi-tenancy.
https://github.com/yohamta/dagu/discussions/200
Thanks for the great suggestions!
Should merge admin-configuration, env、admin config、global config into one config file, and the config file can specify by --config?
I think this way is clearer to config server or scheduler and easy to organize multiple instances's data.
I agree 100%. Good idea.
By the way, we can remove the rely of the $HOME path. Dagu's work dir can specify in the config file.
Yes, I was thinking of adding a config option home and DAGU__ADMIN_HOME env like $AIRFLOW_HOME in Airflow's config. What do you think?
I think config have a single entry is important. Currently admin's config some in admin.yaml, some in env. I am confused about it. After review code, i found three type config.
- For admin(server&scheduler) config.
- For operator(start/stop...) and dag config.
- For both admin and operator.
It's a little messy now :) and some code is coupling.
My idea:
- env config is base, like $AIRFLOW_HOME, just about
home、databasebasic config, for admin and operator but no business configuration. - admin config and global config should merge.
- about dag config, it can understand not is config, it is dag object spec, should it is independent.
refer to kubernetes:
kubectl --kubeconfig ~/.kube/my-kube-config apply deployment-spec.yaml
dagu can as:
dagu --config my-dagu-config [start/stop/server] [dag-spec.yaml]
Thanks for sharing the great idea!
I think config have a single entry is important. Currently admin's config some in admin.yaml, some in env. I am confused about it.
Yeah, let's make it to a single entry for config. I think it's best to have only env for basic config. Only home env is necessary for operator(start/stop/...) commands to find the admin config, for now, I think.
admin config and global config should merge.
How about having a new admin field baseConfig as below and eliminating the concept of global config? The baseConfig is for common settings shared among all DAGs such as env or mailOn etc.
baseConfig: <path/to/global-config-yaml>
For the other idea, I agree 100% :)
Follow this pattern:
dagu --config my-dagu-config [start/stop/server] [dag-spec.yaml]
I think env is for dagu's basic work, link save database、logs、suspend eg. Some default configs value can use default env value to set default value, link data path eg. But it is not use to find config, it is use to dagu self work, like save state、cache eg.
Only home env is necessary for operator(start/stop/...) commands to find the admin config, for now, I think.
--config can tell all components where to find config file. For now default value, can point to default value ($home[~/.dagu]/admin.yaml), this behavior is compatible fallback.
baseConfig is a good idea for common settings among all DAGs, it's default value can be ($home[~/.dagu]/config.yaml) for compatible fallback, i agree about it 👍 .
Fantastic! I agree completely 👍 .
done!