relation_ship.py 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #
  2. # Copyright 2019 The FATE Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. from fate_arch.computing import ComputingEngine
  17. from fate_arch.federation import FederationEngine
  18. from fate_arch.storage import StorageEngine
  19. from fate_arch.common.address import StandaloneAddress, EggRollAddress, HDFSAddress, \
  20. MysqlAddress, \
  21. PathAddress, LocalFSAddress, HiveAddress, LinkisHiveAddress, ApiAddress
  22. from fate_arch.common import EngineType
  23. class Relationship(object):
  24. Computing = {
  25. ComputingEngine.STANDALONE: {
  26. EngineType.STORAGE: {
  27. "default": StorageEngine.STANDALONE,
  28. "support": [StorageEngine.STANDALONE]
  29. },
  30. EngineType.FEDERATION: {
  31. "default": FederationEngine.STANDALONE,
  32. "support": [FederationEngine.STANDALONE, FederationEngine.RABBITMQ, FederationEngine.PULSAR]
  33. },
  34. },
  35. ComputingEngine.EGGROLL: {
  36. EngineType.STORAGE: {
  37. "default": StorageEngine.EGGROLL,
  38. "support": [StorageEngine.EGGROLL]
  39. },
  40. EngineType.FEDERATION: {
  41. "default": FederationEngine.EGGROLL,
  42. "support": [FederationEngine.EGGROLL, FederationEngine.RABBITMQ, FederationEngine.PULSAR]
  43. },
  44. },
  45. ComputingEngine.SPARK: {
  46. EngineType.STORAGE: {
  47. "default": StorageEngine.HDFS,
  48. "support": [StorageEngine.HDFS, StorageEngine.HIVE, StorageEngine.LOCALFS]
  49. },
  50. EngineType.FEDERATION: {
  51. "default": FederationEngine.RABBITMQ,
  52. "support": [FederationEngine.PULSAR, FederationEngine.RABBITMQ]
  53. },
  54. },
  55. ComputingEngine.LINKIS_SPARK: {
  56. EngineType.STORAGE: {
  57. "default": StorageEngine.LINKIS_HIVE,
  58. "support": [StorageEngine.LINKIS_HIVE]
  59. },
  60. EngineType.FEDERATION: {
  61. "default": FederationEngine.RABBITMQ,
  62. "support": [FederationEngine.PULSAR, FederationEngine.RABBITMQ]
  63. },
  64. }
  65. }
  66. EngineToAddress = {
  67. StorageEngine.STANDALONE: StandaloneAddress,
  68. StorageEngine.EGGROLL: EggRollAddress,
  69. StorageEngine.HDFS: HDFSAddress,
  70. StorageEngine.MYSQL: MysqlAddress,
  71. StorageEngine.HIVE: HiveAddress,
  72. StorageEngine.LINKIS_HIVE: LinkisHiveAddress,
  73. StorageEngine.LOCALFS: LocalFSAddress,
  74. StorageEngine.PATH: PathAddress,
  75. StorageEngine.API: ApiAddress
  76. }
  77. EngineConfMap = {
  78. "fate_on_standalone": {
  79. EngineType.COMPUTING: [(ComputingEngine.STANDALONE, "standalone")],
  80. EngineType.STORAGE: [(StorageEngine.STANDALONE, "standalone")],
  81. EngineType.FEDERATION: [(FederationEngine.STANDALONE, "standalone")]
  82. },
  83. "fate_on_eggroll": {
  84. EngineType.COMPUTING: [(ComputingEngine.EGGROLL, "clustermanager")],
  85. EngineType.STORAGE: [(StorageEngine.EGGROLL, "clustermanager")],
  86. EngineType.FEDERATION: [(FederationEngine.EGGROLL, "rollsite")],
  87. },
  88. "fate_on_spark": {
  89. EngineType.COMPUTING: [(ComputingEngine.SPARK, "spark"), (ComputingEngine.LINKIS_SPARK, "linkis_spark")],
  90. EngineType.STORAGE: [(StorageEngine.HDFS, "hdfs"), (StorageEngine.HIVE, "hive"),
  91. (StorageEngine.LINKIS_HIVE, "linkis_hive"), (StorageEngine.LOCALFS, "localfs")],
  92. EngineType.FEDERATION: [(FederationEngine.RABBITMQ, "rabbitmq"), (FederationEngine.PULSAR, "pulsar")]
  93. },
  94. }