const.py 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. from __future__ import absolute_import
  2. from __future__ import unicode_literals
  3. import sys
  4. from .version import ComposeVersion
  5. DEFAULT_TIMEOUT = 10
  6. HTTP_TIMEOUT = 60
  7. IS_WINDOWS_PLATFORM = (sys.platform == "win32")
  8. LABEL_CONTAINER_NUMBER = 'com.docker.compose.container-number'
  9. LABEL_ONE_OFF = 'com.docker.compose.oneoff'
  10. LABEL_PROJECT = 'com.docker.compose.project'
  11. LABEL_SERVICE = 'com.docker.compose.service'
  12. LABEL_NETWORK = 'com.docker.compose.network'
  13. LABEL_VERSION = 'com.docker.compose.version'
  14. LABEL_SLUG = 'com.docker.compose.slug'
  15. LABEL_VOLUME = 'com.docker.compose.volume'
  16. LABEL_CONFIG_HASH = 'com.docker.compose.config-hash'
  17. NANOCPUS_SCALE = 1000000000
  18. PARALLEL_LIMIT = 64
  19. SECRETS_PATH = '/run/secrets'
  20. WINDOWS_LONGPATH_PREFIX = '\\\\?\\'
  21. COMPOSEFILE_V1 = ComposeVersion('1')
  22. COMPOSEFILE_V2_0 = ComposeVersion('2.0')
  23. COMPOSEFILE_V2_1 = ComposeVersion('2.1')
  24. COMPOSEFILE_V2_2 = ComposeVersion('2.2')
  25. COMPOSEFILE_V2_3 = ComposeVersion('2.3')
  26. COMPOSEFILE_V2_4 = ComposeVersion('2.4')
  27. COMPOSEFILE_V3_0 = ComposeVersion('3.0')
  28. COMPOSEFILE_V3_1 = ComposeVersion('3.1')
  29. COMPOSEFILE_V3_2 = ComposeVersion('3.2')
  30. COMPOSEFILE_V3_3 = ComposeVersion('3.3')
  31. COMPOSEFILE_V3_4 = ComposeVersion('3.4')
  32. COMPOSEFILE_V3_5 = ComposeVersion('3.5')
  33. COMPOSEFILE_V3_6 = ComposeVersion('3.6')
  34. COMPOSEFILE_V3_7 = ComposeVersion('3.7')
  35. API_VERSIONS = {
  36. COMPOSEFILE_V1: '1.21',
  37. COMPOSEFILE_V2_0: '1.22',
  38. COMPOSEFILE_V2_1: '1.24',
  39. COMPOSEFILE_V2_2: '1.25',
  40. COMPOSEFILE_V2_3: '1.30',
  41. COMPOSEFILE_V2_4: '1.35',
  42. COMPOSEFILE_V3_0: '1.25',
  43. COMPOSEFILE_V3_1: '1.25',
  44. COMPOSEFILE_V3_2: '1.25',
  45. COMPOSEFILE_V3_3: '1.30',
  46. COMPOSEFILE_V3_4: '1.30',
  47. COMPOSEFILE_V3_5: '1.30',
  48. COMPOSEFILE_V3_6: '1.36',
  49. COMPOSEFILE_V3_7: '1.38',
  50. }
  51. API_VERSION_TO_ENGINE_VERSION = {
  52. API_VERSIONS[COMPOSEFILE_V1]: '1.9.0',
  53. API_VERSIONS[COMPOSEFILE_V2_0]: '1.10.0',
  54. API_VERSIONS[COMPOSEFILE_V2_1]: '1.12.0',
  55. API_VERSIONS[COMPOSEFILE_V2_2]: '1.13.0',
  56. API_VERSIONS[COMPOSEFILE_V2_3]: '17.06.0',
  57. API_VERSIONS[COMPOSEFILE_V2_4]: '17.12.0',
  58. API_VERSIONS[COMPOSEFILE_V3_0]: '1.13.0',
  59. API_VERSIONS[COMPOSEFILE_V3_1]: '1.13.0',
  60. API_VERSIONS[COMPOSEFILE_V3_2]: '1.13.0',
  61. API_VERSIONS[COMPOSEFILE_V3_3]: '17.06.0',
  62. API_VERSIONS[COMPOSEFILE_V3_4]: '17.06.0',
  63. API_VERSIONS[COMPOSEFILE_V3_5]: '17.06.0',
  64. API_VERSIONS[COMPOSEFILE_V3_6]: '18.02.0',
  65. API_VERSIONS[COMPOSEFILE_V3_7]: '18.06.0',
  66. }