This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree 3 files changed +34
-2
lines changed
3 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
+ DEPRECATION WARNING:
3
+
4
+ This module is deprecated as of March 2024 and will not be available after September 2024.
5
+ It has been replaced by the ECS worker, which offers enhanced functionality and better performance.
6
+
7
+ For upgrade instructions, see https://docs.prefect.io/latest/guides/upgrade-guide-agents-to-workers/.
8
+
2
9
Integrations with the Amazon Elastic Container Service.
3
10
4
11
Examples:
102
109
],
103
110
)
104
111
```
105
- """
112
+ """ # noqa
113
+
106
114
import copy
107
115
import difflib
108
116
import json
118
126
import yaml
119
127
from anyio .abc import TaskStatus
120
128
from jsonpointer import JsonPointerException
129
+ from prefect ._internal .compatibility .deprecated import deprecated_class
121
130
from prefect .blocks .core import BlockNotSavedError
122
131
from prefect .exceptions import InfrastructureNotAvailable , InfrastructureNotFound
123
132
from prefect .infrastructure .base import Infrastructure , InfrastructureResult
@@ -205,6 +214,14 @@ def _pretty_diff(d1: dict, d2: dict) -> str:
205
214
)
206
215
207
216
217
+ @deprecated_class (
218
+ start_date = "Mar 2024" ,
219
+ help = (
220
+ "Use the ECS worker instead."
221
+ " Refer to the upgrade guide for more information:"
222
+ " https://docs.prefect.io/latest/guides/upgrade-guide-agents-to-workers/."
223
+ ),
224
+ )
208
225
class ECSTask (Infrastructure ):
209
226
"""
210
227
Run a command as an ECS task.
Original file line number Diff line number Diff line change @@ -2,5 +2,5 @@ boto3>=1.24.53
2
2
botocore >= 1.27.53
3
3
mypy_boto3_s3 >= 1.24.94
4
4
mypy_boto3_secretsmanager >= 1.26.49
5
- prefect >= 2.14.10
5
+ prefect >= 2.16.4
6
6
tenacity >= 8.0.0
Original file line number Diff line number Diff line change 12
12
from botocore .exceptions import ClientError
13
13
from moto import mock_ec2 , mock_ecs , mock_logs
14
14
from moto .ec2 .utils import generate_instance_identity_document
15
+ from prefect ._internal .compatibility .deprecated import PrefectDeprecationWarning
15
16
from prefect .exceptions import InfrastructureNotAvailable , InfrastructureNotFound
16
17
from prefect .logging .configuration import setup_logging
17
18
from prefect .server .schemas .core import Deployment , Flow , FlowRun
35
36
parse_task_identifier ,
36
37
)
37
38
39
+
40
+ def test_ecs_task_emits_deprecation_warning ():
41
+ with pytest .warns (
42
+ PrefectDeprecationWarning ,
43
+ match = (
44
+ "prefect_aws.ecs.ECSTask has been deprecated."
45
+ " It will not be available after Sep 2024."
46
+ " Use the ECS worker instead."
47
+ " Refer to the upgrade guide for more information"
48
+ ),
49
+ ):
50
+ ECSTask ()
51
+
52
+
38
53
setup_logging ()
39
54
40
55
You can’t perform that action at this time.
0 commit comments