dbt-platform-helper 13.1.1__py3-none-any.whl → 13.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dbt-platform-helper might be problematic. Click here for more details.
- dbt_platform_helper/commands/application.py +3 -5
- dbt_platform_helper/commands/codebase.py +2 -4
- dbt_platform_helper/commands/conduit.py +2 -4
- dbt_platform_helper/commands/config.py +19 -17
- dbt_platform_helper/commands/copilot.py +13 -390
- dbt_platform_helper/commands/environment.py +6 -6
- dbt_platform_helper/commands/generate.py +2 -3
- dbt_platform_helper/commands/notify.py +2 -4
- dbt_platform_helper/commands/pipeline.py +2 -4
- dbt_platform_helper/commands/secrets.py +2 -4
- dbt_platform_helper/commands/version.py +2 -2
- dbt_platform_helper/domain/codebase.py +14 -11
- dbt_platform_helper/domain/copilot.py +397 -0
- dbt_platform_helper/domain/copilot_environment.py +6 -6
- dbt_platform_helper/domain/maintenance_page.py +227 -431
- dbt_platform_helper/domain/pipelines.py +1 -1
- dbt_platform_helper/domain/terraform_environment.py +1 -1
- dbt_platform_helper/domain/versioning.py +157 -0
- dbt_platform_helper/providers/aws/interfaces.py +13 -0
- dbt_platform_helper/providers/aws/opensearch.py +23 -0
- dbt_platform_helper/providers/aws/redis.py +21 -0
- dbt_platform_helper/providers/cache.py +40 -4
- dbt_platform_helper/providers/config_validator.py +15 -14
- dbt_platform_helper/providers/copilot.py +1 -1
- dbt_platform_helper/providers/io.py +17 -0
- dbt_platform_helper/providers/kms.py +22 -0
- dbt_platform_helper/providers/load_balancers.py +269 -43
- dbt_platform_helper/providers/semantic_version.py +33 -10
- dbt_platform_helper/providers/version.py +42 -0
- dbt_platform_helper/providers/yaml_file.py +0 -1
- dbt_platform_helper/utils/application.py +14 -0
- dbt_platform_helper/utils/aws.py +27 -4
- dbt_platform_helper/utils/tool_versioning.py +96 -0
- {dbt_platform_helper-13.1.1.dist-info → dbt_platform_helper-13.2.0.dist-info}/METADATA +3 -4
- {dbt_platform_helper-13.1.1.dist-info → dbt_platform_helper-13.2.0.dist-info}/RECORD +39 -35
- dbt_platform_helper/providers/opensearch.py +0 -36
- dbt_platform_helper/providers/redis.py +0 -34
- dbt_platform_helper/utils/versioning.py +0 -238
- /dbt_platform_helper/providers/{aws.py → aws/exceptions.py} +0 -0
- {dbt_platform_helper-13.1.1.dist-info → dbt_platform_helper-13.2.0.dist-info}/LICENSE +0 -0
- {dbt_platform_helper-13.1.1.dist-info → dbt_platform_helper-13.2.0.dist-info}/WHEEL +0 -0
- {dbt_platform_helper-13.1.1.dist-info → dbt_platform_helper-13.2.0.dist-info}/entry_points.txt +0 -0
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: dbt-platform-helper
|
|
3
|
-
Version: 13.
|
|
3
|
+
Version: 13.2.0
|
|
4
4
|
Summary: Set of tools to help transfer applications/services from GOV.UK PaaS to DBT PaaS augmenting AWS Copilot.
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Department for Business and Trade Platform Team
|
|
7
7
|
Author-email: sre-team@digital.trade.gov.uk
|
|
8
|
-
Requires-Python: >=3.9
|
|
8
|
+
Requires-Python: >=3.9, !=2.7.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*, !=3.8.*
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -25,7 +24,7 @@ Requires-Dist: cfn-lint (>=1.4.2,<2.0.0)
|
|
|
25
24
|
Requires-Dist: checkov (>=3.1.67,<4.0.0)
|
|
26
25
|
Requires-Dist: click (>=8.1.3,<9.0.0)
|
|
27
26
|
Requires-Dist: cloudfoundry-client (==1.35.2)
|
|
28
|
-
Requires-Dist: cryptography (>=
|
|
27
|
+
Requires-Dist: cryptography (>=44.0.1,<45)
|
|
29
28
|
Requires-Dist: jinja2-simple-tags (>=0.5.0,<0.6.0)
|
|
30
29
|
Requires-Dist: jsonschema (>=4.17.0,<4.18.0)
|
|
31
30
|
Requires-Dist: mypy-boto3-codebuild (>=1.26.0.post1,<2.0.0)
|
|
@@ -3,52 +3,56 @@ dbt_platform_helper/README.md,sha256=B0qN2_u_ASqqgkGDWY2iwNGZt_9tUgMb9XqtaTuzYjw
|
|
|
3
3
|
dbt_platform_helper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
dbt_platform_helper/addon-plans.yml,sha256=O46a_ODsGG9KXmQY_1XbSGqrpSaHSLDe-SdROzHx8Go,4545
|
|
5
5
|
dbt_platform_helper/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
dbt_platform_helper/commands/application.py,sha256=
|
|
7
|
-
dbt_platform_helper/commands/codebase.py,sha256=
|
|
8
|
-
dbt_platform_helper/commands/conduit.py,sha256=
|
|
9
|
-
dbt_platform_helper/commands/config.py,sha256=
|
|
10
|
-
dbt_platform_helper/commands/copilot.py,sha256=
|
|
6
|
+
dbt_platform_helper/commands/application.py,sha256=OUQsahXXHSEKxmXAmK8fSy_bTLNwM_TdLuv6CvffRPk,10126
|
|
7
|
+
dbt_platform_helper/commands/codebase.py,sha256=Hl1QW1_9WbgRtcyfN3iN9OXl0pVzD78k9czT2graRyo,2355
|
|
8
|
+
dbt_platform_helper/commands/conduit.py,sha256=v5geTJzRHkOnbFfOqmjO6b57HXhs4YxTo_zJgDEYB0A,2300
|
|
9
|
+
dbt_platform_helper/commands/config.py,sha256=hyOPbLkO-DEh_gcNbpYq-J2zo7e_FAMUZws3lknmYbg,11791
|
|
10
|
+
dbt_platform_helper/commands/copilot.py,sha256=YYYcS-PHJ8IQ_aCyqTzcswwx745gd8OQH9OSssljILs,1521
|
|
11
11
|
dbt_platform_helper/commands/database.py,sha256=aG3zcMHL5PE96b7LSAu0FGCbgcycQej3AGRcd-bpXUo,4115
|
|
12
|
-
dbt_platform_helper/commands/environment.py,sha256=
|
|
13
|
-
dbt_platform_helper/commands/generate.py,sha256=
|
|
14
|
-
dbt_platform_helper/commands/notify.py,sha256=
|
|
15
|
-
dbt_platform_helper/commands/pipeline.py,sha256=
|
|
16
|
-
dbt_platform_helper/commands/secrets.py,sha256=
|
|
17
|
-
dbt_platform_helper/commands/version.py,sha256=
|
|
12
|
+
dbt_platform_helper/commands/environment.py,sha256=kOmS6NQnl2X21eYpEhajvAIBeg5KyQ5Mm81SaOBkjqE,4003
|
|
13
|
+
dbt_platform_helper/commands/generate.py,sha256=4M0ZiGN2w-bwgPMxeItFfT6vA7sOMjuceHEN7RAYkhc,735
|
|
14
|
+
dbt_platform_helper/commands/notify.py,sha256=MWVlNalASSq0WghE5LjMrM6C7cGv8QosbmU5iXuI2bo,3864
|
|
15
|
+
dbt_platform_helper/commands/pipeline.py,sha256=tw6pE429FVGj8JoAvDnrpkJzC-qi6JJch7PDz2cKBvM,2983
|
|
16
|
+
dbt_platform_helper/commands/secrets.py,sha256=ommqp__Vus_OaJAJYzUdC-08xpomx01deyT0NljsTNs,3974
|
|
17
|
+
dbt_platform_helper/commands/version.py,sha256=gRQkmcFTz90SbYhO1L-j727AuZ_gnjQfcnsNN7CzBs4,1376
|
|
18
18
|
dbt_platform_helper/constants.py,sha256=DpHGG54lwjw3XGp2TKCEGNmzaz083lAWMGkEabujDrw,1050
|
|
19
19
|
dbt_platform_helper/default-extensions.yml,sha256=SU1ZitskbuEBpvE7efc3s56eAUF11j70brhj_XrNMMo,493
|
|
20
20
|
dbt_platform_helper/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
|
-
dbt_platform_helper/domain/codebase.py,sha256=
|
|
21
|
+
dbt_platform_helper/domain/codebase.py,sha256=sdQ9qL-HZ5NbVEXWCqyDhlRsDrJsoO_CdFE0Yf97a1A,10808
|
|
22
22
|
dbt_platform_helper/domain/conduit.py,sha256=5C5GnF5jssJ1rFFCY6qaKgvLjYUkyytRJE4tHlanYa0,4370
|
|
23
|
-
dbt_platform_helper/domain/
|
|
23
|
+
dbt_platform_helper/domain/copilot.py,sha256=K6nw3BvZ0DyFHQCBTl3BRqMB4Iu5zjFdEOcmA2sMLdo,14648
|
|
24
|
+
dbt_platform_helper/domain/copilot_environment.py,sha256=yPt6ZarOvFPo06XwY1sU5MOQsoV7TEsKSQHyM-G8aGc,9058
|
|
24
25
|
dbt_platform_helper/domain/database_copy.py,sha256=CKvI9LsHyowg0bPT9jImk07w4TyQLPoInQoU2TUDiJQ,9485
|
|
25
|
-
dbt_platform_helper/domain/maintenance_page.py,sha256=
|
|
26
|
-
dbt_platform_helper/domain/pipelines.py,sha256=
|
|
27
|
-
dbt_platform_helper/domain/terraform_environment.py,sha256=
|
|
26
|
+
dbt_platform_helper/domain/maintenance_page.py,sha256=h7uYlUi4rlaDV9DvdElb2yD4H6Nz7dHMx3RIQfjHFZw,14258
|
|
27
|
+
dbt_platform_helper/domain/pipelines.py,sha256=mUvGaNMtBAUemsb-fHDcpWV-9LfqGoSogI2LwDnvt0I,6503
|
|
28
|
+
dbt_platform_helper/domain/terraform_environment.py,sha256=7ZKLZ8Zk6-V_IPaCDUP8eYTRudqDjHxvFnbG6LIlLO4,1759
|
|
29
|
+
dbt_platform_helper/domain/versioning.py,sha256=JLIvonvZvjdaTdBF6bt9Tbrhu4GE8gHg8o9u3b6Djsg,6154
|
|
28
30
|
dbt_platform_helper/jinja2_tags.py,sha256=hKG6RS3zlxJHQ-Op9r2U2-MhWp4s3lZir4Ihe24ApJ0,540
|
|
29
31
|
dbt_platform_helper/platform_exception.py,sha256=bheZV9lqGvrCVTNT92349dVntNDEDWTEwciZgC83WzE,187
|
|
30
32
|
dbt_platform_helper/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
-
dbt_platform_helper/providers/aws.py,sha256=mlorH0fni6m8aUpm1x2jQPhaI3T0QsDMWpoGiSURBcI,1387
|
|
32
|
-
dbt_platform_helper/providers/
|
|
33
|
+
dbt_platform_helper/providers/aws/exceptions.py,sha256=mlorH0fni6m8aUpm1x2jQPhaI3T0QsDMWpoGiSURBcI,1387
|
|
34
|
+
dbt_platform_helper/providers/aws/interfaces.py,sha256=0JFggcUTJ8zERdxNVVpIiKvaaZeT2c-VECDG--MOi8E,285
|
|
35
|
+
dbt_platform_helper/providers/aws/opensearch.py,sha256=Qne2SoPllmacVSc7AxtjBlEbSBsRMbR_ySEkEymSF9k,581
|
|
36
|
+
dbt_platform_helper/providers/aws/redis.py,sha256=i3Kb00_BdqssjQg1wgZ-8GRXcEWQiORWnIEq6qkAXjQ,551
|
|
37
|
+
dbt_platform_helper/providers/cache.py,sha256=1hEwp0y9WYbEfgsp-RU9MyzIgCt1-4BxApgd_0uVweE,3615
|
|
33
38
|
dbt_platform_helper/providers/cloudformation.py,sha256=SvCZgEVqxdpKfQMRAG3KzFQ43YeOEDqMm2tKmFGtacY,5347
|
|
34
39
|
dbt_platform_helper/providers/config.py,sha256=nGpL2_-ko94Dd4YM5vDEpME_8IGEhWpFcLQqKkb_h8E,4145
|
|
35
|
-
dbt_platform_helper/providers/config_validator.py,sha256=
|
|
36
|
-
dbt_platform_helper/providers/copilot.py,sha256=
|
|
40
|
+
dbt_platform_helper/providers/config_validator.py,sha256=o67poy69XeCujefUodvRIz5FWTGcBNepuvBivP0IidQ,11139
|
|
41
|
+
dbt_platform_helper/providers/copilot.py,sha256=Pgdh1JS-so2thT7Jqipol5aVkA_CgU6doUmy3YjYSXs,5328
|
|
37
42
|
dbt_platform_helper/providers/ecr.py,sha256=lmLKGR5OQT8EyGsX-9M7oO0DHIyoMqgchBAVQBeoBZs,639
|
|
38
43
|
dbt_platform_helper/providers/ecs.py,sha256=XlQHYhZiLGrqR-1ZWMagGH2R2Hy7mCP6676eZL3YbNQ,3842
|
|
39
44
|
dbt_platform_helper/providers/files.py,sha256=cJdOV6Eupi-COmGUMxZMF10BZnMi3MCCipTVUnE_NPA,857
|
|
40
|
-
dbt_platform_helper/providers/io.py,sha256=
|
|
41
|
-
dbt_platform_helper/providers/
|
|
42
|
-
dbt_platform_helper/providers/
|
|
45
|
+
dbt_platform_helper/providers/io.py,sha256=KurX_2yfst8IzWkKaeUe3TG612Jy7OamIJHQzcsLERU,1344
|
|
46
|
+
dbt_platform_helper/providers/kms.py,sha256=JR2EU3icXePoJCtr7QnqDPj1wWbyn5Uf9CRFq3_4lRs,647
|
|
47
|
+
dbt_platform_helper/providers/load_balancers.py,sha256=KTsdpNttdUay_2d_IfC6oWbC8rWfs4Oh2eSgGMyK1Ag,10572
|
|
43
48
|
dbt_platform_helper/providers/platform_config_schema.py,sha256=1PjqzdOnhSncyX3BPpewl0be9xOBauCfnLLHOW40f2c,26972
|
|
44
|
-
dbt_platform_helper/providers/redis.py,sha256=aj8pitxG9IKrMkL3fIYayQhcHPPzApdaXq0Uq_0yblg,1217
|
|
45
49
|
dbt_platform_helper/providers/secrets.py,sha256=6cYIR15dLdHmqxtWQpM6R71e0_Xgsg9V291HBG-0LV0,5272
|
|
46
|
-
dbt_platform_helper/providers/semantic_version.py,sha256=
|
|
50
|
+
dbt_platform_helper/providers/semantic_version.py,sha256=slUKfSgHbLSQP-vqcfaTzZCw6EIGc8yIlmEvh0Qx6zo,5266
|
|
47
51
|
dbt_platform_helper/providers/terraform_manifest.py,sha256=hrCjkuQIV0Ymt5MPLkh-BfXHtuAScXhWwNkVEp9K5Jg,9354
|
|
48
52
|
dbt_platform_helper/providers/validation.py,sha256=i2g-Mrd4hy_fGIfGa6ZQy4vTJ40OM44Fe_XpEifGWxs,126
|
|
49
|
-
dbt_platform_helper/providers/version.py,sha256=
|
|
53
|
+
dbt_platform_helper/providers/version.py,sha256=qdwoRi5_EHvDG2dKOWgNPQ_sZtsAuGmu9DCbarbtxs0,2888
|
|
50
54
|
dbt_platform_helper/providers/vpc.py,sha256=EIjjD71K1Ry3V1jyaAkAjZwlwu_FSTn-AS7kiJFiipA,2953
|
|
51
|
-
dbt_platform_helper/providers/yaml_file.py,sha256=
|
|
55
|
+
dbt_platform_helper/providers/yaml_file.py,sha256=q-1DWtuG9bfR24lOYzwCwzgOpGPwDaoJpLUB1DtdEmE,2179
|
|
52
56
|
dbt_platform_helper/templates/.copilot/config.yml,sha256=J_bA9sCtBdCPBRImpCBRnYvhQd4vpLYIXIU-lq9vbkA,158
|
|
53
57
|
dbt_platform_helper/templates/.copilot/image_build_run.sh,sha256=adYucYXEB-kAgZNjTQo0T6EIAY8sh_xCEvVhWKKQ8mw,164
|
|
54
58
|
dbt_platform_helper/templates/.copilot/phases/build.sh,sha256=umKXePcRvx4XyrRY0fAWIyYFtNjqBI2L8vIJk-V7C60,121
|
|
@@ -76,9 +80,9 @@ dbt_platform_helper/templates/svc/manifest-backend.yml,sha256=aAD9ndkbXnF7JBAKS2
|
|
|
76
80
|
dbt_platform_helper/templates/svc/manifest-public.yml,sha256=6NHVR_onBu5hbwynLrB6roDRce7JcylSc0qeYvzlPdI,3664
|
|
77
81
|
dbt_platform_helper/templates/svc/overrides/cfn.patches.yml,sha256=W7-d017akuUq9kda64DQxazavcRcCPDjaAik6t1EZqM,742
|
|
78
82
|
dbt_platform_helper/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
79
|
-
dbt_platform_helper/utils/application.py,sha256=
|
|
83
|
+
dbt_platform_helper/utils/application.py,sha256=_O2ywJRYYdWfBVz4LzD07PLO9hSPJf7FylE6toH19KM,5448
|
|
80
84
|
dbt_platform_helper/utils/arn_parser.py,sha256=BaXzIxSOLdFmP_IfAxRq-0j-0Re1iCN7L4j2Zi5-CRQ,1304
|
|
81
|
-
dbt_platform_helper/utils/aws.py,sha256=
|
|
85
|
+
dbt_platform_helper/utils/aws.py,sha256=2QqONqwivHTLa18p5DlpnYO-5ZspzhuhmXE4iusRSn4,17767
|
|
82
86
|
dbt_platform_helper/utils/click.py,sha256=Fx4y4bbve1zypvog_sgK7tJtCocmzheoEFLBRv1lfdM,2943
|
|
83
87
|
dbt_platform_helper/utils/cloudfoundry.py,sha256=GnQ4fVLnDfOdNSrsJjI6ElZHqpgwINeoPn77cUH2UFY,484
|
|
84
88
|
dbt_platform_helper/utils/files.py,sha256=adQtG2E1IQHDKfeX06l6j1B7UTYukwBuR_uhJHaoi5M,1873
|
|
@@ -86,11 +90,11 @@ dbt_platform_helper/utils/git.py,sha256=7JGZMaI8-cU6-GjXIXjOlsYfKu_RppLOGyAicBd4
|
|
|
86
90
|
dbt_platform_helper/utils/manifests.py,sha256=ji3UYHCxq9tTpkm4MlRa2y0-JOYYqq1pWZ2h_zpj0UU,507
|
|
87
91
|
dbt_platform_helper/utils/messages.py,sha256=nWA7BWLb7ND0WH5TejDN4OQUJSKYBxU4tyCzteCrfT0,142
|
|
88
92
|
dbt_platform_helper/utils/template.py,sha256=g-Db-0I6a6diOHkgK1nYA0IxJSO4TRrjqOvlyeOR32o,950
|
|
93
|
+
dbt_platform_helper/utils/tool_versioning.py,sha256=iepmQJkiXS2jPDnJcoR1T4PYrRbt3OIdvddJcG3ZVOU,4206
|
|
89
94
|
dbt_platform_helper/utils/validation.py,sha256=coN7WsKW_nPGW9EU23AInBkAuvUl1NfQvc2bjVtgs14,1188
|
|
90
|
-
dbt_platform_helper/utils/versioning.py,sha256=QCvDUizLNNYbt3iLRqcWxgOP_PMfLIZARUZ5dW542fI,9056
|
|
91
95
|
platform_helper.py,sha256=lUGBsVgsGGJSDXxRvtvZCo2ybRAWuJXosbzfTzkIxU8,1892
|
|
92
|
-
dbt_platform_helper-13.
|
|
93
|
-
dbt_platform_helper-13.
|
|
94
|
-
dbt_platform_helper-13.
|
|
95
|
-
dbt_platform_helper-13.
|
|
96
|
-
dbt_platform_helper-13.
|
|
96
|
+
dbt_platform_helper-13.2.0.dist-info/LICENSE,sha256=dP79lN73--7LMApnankTGLqDbImXg8iYFqWgnExGkGk,1090
|
|
97
|
+
dbt_platform_helper-13.2.0.dist-info/METADATA,sha256=jtiVbjA6HBJYRorbDd_aHvMwq-zcMN00UnXsIOiAE2Y,3243
|
|
98
|
+
dbt_platform_helper-13.2.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
99
|
+
dbt_platform_helper-13.2.0.dist-info/entry_points.txt,sha256=QhbY8F434A-onsg0-FsdMd2U6HKh6Q7yCFFZrGUh5-M,67
|
|
100
|
+
dbt_platform_helper-13.2.0.dist-info/RECORD,,
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
from dbt_platform_helper.providers.cache import CacheProvider
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class OpensearchProvider:
|
|
5
|
-
|
|
6
|
-
def __init__(self, opensearch_client):
|
|
7
|
-
self.opensearch_client = opensearch_client
|
|
8
|
-
|
|
9
|
-
def get_supported_opensearch_versions(self) -> list[str]:
|
|
10
|
-
|
|
11
|
-
cache_provider = self.__get_cache_provider()
|
|
12
|
-
|
|
13
|
-
if cache_provider.cache_refresh_required("opensearch"):
|
|
14
|
-
|
|
15
|
-
response = self.opensearch_client.list_versions()
|
|
16
|
-
all_versions = response["Versions"]
|
|
17
|
-
|
|
18
|
-
opensearch_versions = [
|
|
19
|
-
version for version in all_versions if not version.startswith("Elasticsearch_")
|
|
20
|
-
]
|
|
21
|
-
supported_versions = [
|
|
22
|
-
version.removeprefix("OpenSearch_") for version in opensearch_versions
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
cache_provider.update_cache("opensearch", supported_versions)
|
|
26
|
-
|
|
27
|
-
return supported_versions
|
|
28
|
-
|
|
29
|
-
else:
|
|
30
|
-
return cache_provider.read_supported_versions_from_cache("opensearch")
|
|
31
|
-
|
|
32
|
-
# TODO - cache provider instantiated here rather than via dependancy injection since it will likely only be used in the get_supported_opensearch_versions method.
|
|
33
|
-
# If another method is added which needs a CacheProvider, it should be injected into the constructor instead.
|
|
34
|
-
@staticmethod
|
|
35
|
-
def __get_cache_provider():
|
|
36
|
-
return CacheProvider()
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
from dbt_platform_helper.providers.cache import CacheProvider
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class RedisProvider:
|
|
5
|
-
def __init__(self, elasticache_client):
|
|
6
|
-
self.elasticache_client = elasticache_client
|
|
7
|
-
|
|
8
|
-
def get_supported_redis_versions(self):
|
|
9
|
-
|
|
10
|
-
cache_provider = self.__get_cache_provider()
|
|
11
|
-
|
|
12
|
-
if cache_provider.cache_refresh_required("redis"):
|
|
13
|
-
|
|
14
|
-
supported_versions_response = self.elasticache_client.describe_cache_engine_versions(
|
|
15
|
-
Engine="redis"
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
supported_versions = [
|
|
19
|
-
version["EngineVersion"]
|
|
20
|
-
for version in supported_versions_response["CacheEngineVersions"]
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
cache_provider.update_cache("redis", supported_versions)
|
|
24
|
-
|
|
25
|
-
return supported_versions
|
|
26
|
-
|
|
27
|
-
else:
|
|
28
|
-
return cache_provider.read_supported_versions_from_cache("redis")
|
|
29
|
-
|
|
30
|
-
# TODO - cache provider instantiated here rather than via dependancy injection since it will likely only be used in the get_supported_redis_versions method.
|
|
31
|
-
# If another method is added which needs a CacheProvider, it should be injected into the constructor instead.
|
|
32
|
-
@staticmethod
|
|
33
|
-
def __get_cache_provider():
|
|
34
|
-
return CacheProvider()
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import re
|
|
3
|
-
import subprocess
|
|
4
|
-
from importlib.metadata import PackageNotFoundError
|
|
5
|
-
from importlib.metadata import version
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
|
|
8
|
-
from dbt_platform_helper.constants import DEFAULT_TERRAFORM_PLATFORM_MODULES_VERSION
|
|
9
|
-
from dbt_platform_helper.constants import PLATFORM_HELPER_VERSION_FILE
|
|
10
|
-
from dbt_platform_helper.platform_exception import PlatformException
|
|
11
|
-
from dbt_platform_helper.providers.config import ConfigProvider
|
|
12
|
-
from dbt_platform_helper.providers.io import ClickIOProvider
|
|
13
|
-
from dbt_platform_helper.providers.semantic_version import (
|
|
14
|
-
IncompatibleMajorVersionException,
|
|
15
|
-
)
|
|
16
|
-
from dbt_platform_helper.providers.semantic_version import (
|
|
17
|
-
IncompatibleMinorVersionException,
|
|
18
|
-
)
|
|
19
|
-
from dbt_platform_helper.providers.semantic_version import PlatformHelperVersionStatus
|
|
20
|
-
from dbt_platform_helper.providers.semantic_version import SemanticVersion
|
|
21
|
-
from dbt_platform_helper.providers.semantic_version import VersionStatus
|
|
22
|
-
from dbt_platform_helper.providers.validation import ValidationException
|
|
23
|
-
from dbt_platform_helper.providers.version import GithubVersionProvider
|
|
24
|
-
from dbt_platform_helper.providers.version import PyPiVersionProvider
|
|
25
|
-
from dbt_platform_helper.providers.yaml_file import FileProviderException
|
|
26
|
-
from dbt_platform_helper.providers.yaml_file import YamlFileProvider
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class PlatformHelperVersionNotFoundException(PlatformException):
|
|
30
|
-
def __init__(self):
|
|
31
|
-
super().__init__(f"""Platform helper version could not be resolved.""")
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
class RequiredVersion:
|
|
35
|
-
def __init__(self, io=None):
|
|
36
|
-
self.io = io or ClickIOProvider()
|
|
37
|
-
|
|
38
|
-
def get_required_platform_helper_version(
|
|
39
|
-
self, pipeline: str = None, versions: PlatformHelperVersionStatus = None
|
|
40
|
-
) -> str:
|
|
41
|
-
if not versions:
|
|
42
|
-
versions = get_platform_helper_versions()
|
|
43
|
-
pipeline_version = versions.pipeline_overrides.get(pipeline)
|
|
44
|
-
version_precedence = [
|
|
45
|
-
pipeline_version,
|
|
46
|
-
versions.platform_config_default,
|
|
47
|
-
versions.deprecated_version_file,
|
|
48
|
-
]
|
|
49
|
-
non_null_version_precedence = [
|
|
50
|
-
f"{v}" if isinstance(v, SemanticVersion) else v for v in version_precedence if v
|
|
51
|
-
]
|
|
52
|
-
|
|
53
|
-
out = non_null_version_precedence[0] if non_null_version_precedence else None
|
|
54
|
-
|
|
55
|
-
if not out:
|
|
56
|
-
raise PlatformHelperVersionNotFoundException
|
|
57
|
-
|
|
58
|
-
return out
|
|
59
|
-
|
|
60
|
-
def get_required_version(self, pipeline=None):
|
|
61
|
-
version = self.get_required_platform_helper_version(pipeline)
|
|
62
|
-
self.io.info(version)
|
|
63
|
-
return version
|
|
64
|
-
|
|
65
|
-
# Used in the generate command
|
|
66
|
-
def check_platform_helper_version_mismatch(self):
|
|
67
|
-
if not running_as_installed_package():
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
versions = get_platform_helper_versions()
|
|
71
|
-
platform_helper_file_version = SemanticVersion.from_string(
|
|
72
|
-
self.get_required_platform_helper_version(versions=versions)
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
if not versions.local == platform_helper_file_version:
|
|
76
|
-
message = (
|
|
77
|
-
f"WARNING: You are running platform-helper v{versions.local} against "
|
|
78
|
-
f"v{platform_helper_file_version} specified by {PLATFORM_HELPER_VERSION_FILE}."
|
|
79
|
-
)
|
|
80
|
-
self.io.warn(message)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
# Resolves all the versions from pypi, config and locally installed version
|
|
84
|
-
# echos warnings if anything is incompatible
|
|
85
|
-
def get_platform_helper_versions(
|
|
86
|
-
include_project_versions=True, yaml_provider=YamlFileProvider
|
|
87
|
-
) -> PlatformHelperVersionStatus:
|
|
88
|
-
try:
|
|
89
|
-
locally_installed_version = SemanticVersion.from_string(version("dbt-platform-helper"))
|
|
90
|
-
except PackageNotFoundError:
|
|
91
|
-
locally_installed_version = None
|
|
92
|
-
|
|
93
|
-
latest_release = PyPiVersionProvider.get_latest_version("dbt-platform-helper")
|
|
94
|
-
|
|
95
|
-
if not include_project_versions:
|
|
96
|
-
return PlatformHelperVersionStatus(
|
|
97
|
-
local=locally_installed_version,
|
|
98
|
-
latest=latest_release,
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
deprecated_version_file = Path(PLATFORM_HELPER_VERSION_FILE)
|
|
102
|
-
try:
|
|
103
|
-
loaded_version = yaml_provider.load(deprecated_version_file)
|
|
104
|
-
version_from_file = SemanticVersion.from_string(loaded_version)
|
|
105
|
-
except FileProviderException:
|
|
106
|
-
version_from_file = None
|
|
107
|
-
|
|
108
|
-
platform_config_default, pipeline_overrides = None, {}
|
|
109
|
-
|
|
110
|
-
config = ConfigProvider()
|
|
111
|
-
platform_config = config.load_unvalidated_config_file()
|
|
112
|
-
|
|
113
|
-
if platform_config:
|
|
114
|
-
platform_config_default = SemanticVersion.from_string(
|
|
115
|
-
platform_config.get("default_versions", {}).get("platform-helper")
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
pipeline_overrides = {
|
|
119
|
-
name: pipeline.get("versions", {}).get("platform-helper")
|
|
120
|
-
for name, pipeline in platform_config.get("environment_pipelines", {}).items()
|
|
121
|
-
if pipeline.get("versions", {}).get("platform-helper")
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
out = PlatformHelperVersionStatus(
|
|
125
|
-
local=locally_installed_version,
|
|
126
|
-
latest=latest_release,
|
|
127
|
-
deprecated_version_file=version_from_file,
|
|
128
|
-
platform_config_default=platform_config_default,
|
|
129
|
-
pipeline_overrides=pipeline_overrides,
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
_process_version_file_warnings(out)
|
|
133
|
-
|
|
134
|
-
return out
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
# Validates the returned PlatformHelperVersionStatus and echos useful warnings
|
|
138
|
-
# Could return ValidationMessages (warnings and errors) which are output elsewhere
|
|
139
|
-
def _process_version_file_warnings(versions: PlatformHelperVersionStatus, io=ClickIOProvider()):
|
|
140
|
-
messages = versions.warn()
|
|
141
|
-
|
|
142
|
-
if messages.get("errors"):
|
|
143
|
-
io.error("\n".join(messages["errors"]))
|
|
144
|
-
|
|
145
|
-
if messages.get("warnings"):
|
|
146
|
-
io.warn("\n".join(messages["warnings"]))
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
# TODO called at the beginning of every command. This is platform-version base functionality
|
|
150
|
-
def check_platform_helper_version_needs_update(io=ClickIOProvider()):
|
|
151
|
-
if not running_as_installed_package() or "PLATFORM_TOOLS_SKIP_VERSION_CHECK" in os.environ:
|
|
152
|
-
return
|
|
153
|
-
versions = get_platform_helper_versions(include_project_versions=False)
|
|
154
|
-
local_version = versions.local
|
|
155
|
-
latest_release = versions.latest
|
|
156
|
-
message = (
|
|
157
|
-
f"You are running platform-helper v{local_version}, upgrade to "
|
|
158
|
-
f"v{latest_release} by running run `pip install "
|
|
159
|
-
"--upgrade dbt-platform-helper`."
|
|
160
|
-
)
|
|
161
|
-
try:
|
|
162
|
-
local_version.validate_compatibility_with(latest_release)
|
|
163
|
-
except IncompatibleMajorVersionException:
|
|
164
|
-
io.error(message)
|
|
165
|
-
except IncompatibleMinorVersionException:
|
|
166
|
-
io.warn(message)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
# TODO can stay as utility for now
|
|
170
|
-
def running_as_installed_package():
|
|
171
|
-
return "site-packages" in __file__
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
def get_required_terraform_platform_modules_version(
|
|
175
|
-
cli_terraform_platform_modules_version, platform_config_terraform_modules_default_version
|
|
176
|
-
):
|
|
177
|
-
version_preference_order = [
|
|
178
|
-
cli_terraform_platform_modules_version,
|
|
179
|
-
platform_config_terraform_modules_default_version,
|
|
180
|
-
DEFAULT_TERRAFORM_PLATFORM_MODULES_VERSION,
|
|
181
|
-
]
|
|
182
|
-
return [version for version in version_preference_order if version][0]
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
#########################################
|
|
186
|
-
# Only used in Config domain
|
|
187
|
-
# TODO to be relocated along with tests
|
|
188
|
-
#########################################
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
# Getting version from the "Generated by" comment in a file that was generated from a template
|
|
192
|
-
# TODO where does this belong? It sort of belongs to our platform-helper templating
|
|
193
|
-
def get_template_generated_with_version(template_file_path: str) -> SemanticVersion:
|
|
194
|
-
try:
|
|
195
|
-
template_contents = Path(template_file_path).read_text()
|
|
196
|
-
template_version = re.match(
|
|
197
|
-
r"# Generated by platform-helper ([v.\-0-9]+)", template_contents
|
|
198
|
-
).group(1)
|
|
199
|
-
return SemanticVersion.from_string(template_version)
|
|
200
|
-
except (IndexError, AttributeError):
|
|
201
|
-
raise ValidationException(f"Template {template_file_path} has no version information")
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
def validate_template_version(app_version: SemanticVersion, template_file_path: str):
|
|
205
|
-
app_version.validate_compatibility_with(get_template_generated_with_version(template_file_path))
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
# Local version and latest release of tool.
|
|
209
|
-
# Used only in config command.
|
|
210
|
-
# TODO Move to config domain
|
|
211
|
-
def get_copilot_versions() -> VersionStatus:
|
|
212
|
-
copilot_version = None
|
|
213
|
-
|
|
214
|
-
try:
|
|
215
|
-
response = subprocess.run("copilot --version", capture_output=True, shell=True)
|
|
216
|
-
[copilot_version] = re.findall(r"[0-9.]+", response.stdout.decode("utf8"))
|
|
217
|
-
except ValueError:
|
|
218
|
-
pass
|
|
219
|
-
|
|
220
|
-
return VersionStatus(
|
|
221
|
-
SemanticVersion.from_string(copilot_version),
|
|
222
|
-
GithubVersionProvider.get_latest_version("aws/copilot-cli"),
|
|
223
|
-
)
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
# Local version and latest release of tool.
|
|
227
|
-
# Used only in config command.
|
|
228
|
-
# TODO Move to config domain
|
|
229
|
-
def get_aws_versions() -> VersionStatus:
|
|
230
|
-
aws_version = None
|
|
231
|
-
try:
|
|
232
|
-
response = subprocess.run("aws --version", capture_output=True, shell=True)
|
|
233
|
-
matched = re.match(r"aws-cli/([0-9.]+)", response.stdout.decode("utf8"))
|
|
234
|
-
aws_version = SemanticVersion.from_string(matched.group(1))
|
|
235
|
-
except ValueError:
|
|
236
|
-
pass
|
|
237
|
-
|
|
238
|
-
return VersionStatus(aws_version, GithubVersionProvider.get_latest_version("aws/aws-cli", True))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-13.1.1.dist-info → dbt_platform_helper-13.2.0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|