config.rst 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. .. Licensed to the Apache Software Foundation (ASF) under one
  2. or more contributor license agreements. See the NOTICE file
  3. distributed with this work for additional information
  4. regarding copyright ownership. The ASF licenses this file
  5. to you under the Apache License, Version 2.0 (the
  6. "License"); you may not use this file except in compliance
  7. with the License. You may obtain a copy of the License at
  8. .. http://www.apache.org/licenses/LICENSE-2.0
  9. .. Unless required by applicable law or agreed to in writing,
  10. software distributed under the License is distributed on an
  11. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  12. KIND, either express or implied. See the License for the
  13. specific language governing permissions and limitations
  14. under the License.
  15. Configuration
  16. =============
  17. Export Configuration File
  18. -------------------------
  19. pydolphinscheduler allows you to change the built-in configurations via CLI or editor you like. pydolphinscheduler
  20. integrated built-in configurations in its package, but you could also export it locally by CLI
  21. .. code-block:: bash
  22. $ pydolphinscheduler config --init
  23. And it will create a new YAML file in the path `~/pydolphinscheduler/config.yaml` by default. If you want to export
  24. it to another path, you should set `PYDOLPHINSCHEDULER_HOME` before you run command :code:`pydolphinscheduler config --init`.
  25. .. code-block:: bash
  26. $ export PYDOLPHINSCHEDULER_HOME=<CUSTOM_PATH>
  27. $ pydolphinscheduler config --init
  28. After that, your configuration file will export into `<CUSTOM_PATH>/config.yaml` instead of the default path.
  29. Change Configuration
  30. --------------------
  31. In section `export configuration file`_ you export the configuration file locally, and as a local file, you could
  32. edit it with any editor you like. After you save your change in your editor, the latest configuration will work
  33. when you run your workflow code.
  34. You could also query or change the configuration via CLI :code:`config --get <config>` or :code:`config --get <config> <val>`.
  35. Both `--get` and `--set` could be call one or more times in single command, and you could only set the leaf
  36. node of the configuration but could get the parent configuration, there are simple examples below:
  37. .. code-block:: bash
  38. # Get single configuration in the leaf node
  39. $ pydolphinscheduler config --get java_gateway.address
  40. The configuration query as below:
  41. java_gateway.address = 127.0.0.1
  42. # Get multiple configuration in the leaf node
  43. $ pydolphinscheduler config --get java_gateway.address --get java_gateway.port
  44. The configuration query as below:
  45. java_gateway.address = 127.0.0.1
  46. java_gateway.port = 25333
  47. # Get parent configuration which contain multiple leaf nodes
  48. $ pydolphinscheduler config --get java_gateway
  49. The configuration query as below:
  50. java_gateway = ordereddict([('address', '127.0.0.1'), ('port', 25333), ('auto_convert', True)])
  51. # Set single configuration
  52. $ pydolphinscheduler config --set java_gateway.address 192.168.1.1
  53. Set configuration done.
  54. # Set multiple configuration
  55. $ pydolphinscheduler config --set java_gateway.address 192.168.1.1 --set java_gateway.port 25334
  56. Set configuration done.
  57. # Set configuration not in leaf node will fail
  58. $ pydolphinscheduler config --set java_gateway 192.168.1.1,25334,True
  59. Raise error.
  60. For more information about our CLI, you could see document :doc:`cli`.
  61. All Configurations
  62. ------------------
  63. Here are all our configurations for pydolphinscheduler.
  64. .. literalinclude:: ../../src/pydolphinscheduler/core/default_config.yaml
  65. :language: yaml
  66. :lines: 18-