Comments (8)
Hi! I'm going to move this to prefect-aws
where the ECS implementation lives.
from prefect-aws.
Can you please share an executable example that demonstrates your issue? ECSTask
can be used without flow runs, e.g.
ECSTask(command=["prefect", "version"]).run()
Then share the details of the task definitions present on AWS?
from prefect-aws.
I did a little bit more digging and found the issue. If I add a task definition and change the name from "prefect" to something else the resulting task json will contain two task definitions, same as what I displayed above. If you set the "name:" field to "prefect" everything works fine. You can even specify two different images for both task definitions (see second example).
example 1:
ECSTask(
command=["prefect", "version"],
image = "prefecthq/prefect:2.7.9-python3.11",
task_definition = {"containerDefinitions": [
{
"name": "test_util_ecs_job",
"environment": [{"name": "test, "value": "TEST"}]
}
]}
).run()
example 2:
ECSTask(
command=["prefect", "version"],
image = "prefecthq/prefect:2.7.9-python3.11",
task_definition = {"containerDefinitions": [
{
"name": "test_util_ecs_job",
"image": "prefecthq/prefect:2.7.9-python3.9"
"environment": [{"name": "test", "value": "TEST"}]
}
]}
).run()
"containerDefinitions": [
{
"name": "test_util_ecs_job,
"image": "prefecthq/prefect:2.7.9-python3.9",
"cpu": 0,
"portMappings": [],
"essential": true,
"environment": [
{
"name": "test",
"value": "TEST"
}
],
"mountPoints": [],
"volumesFrom": []
},
{
"name": "prefect",
"image": "prefecthq/prefect:2.7.9-python3.11",
"cpu": 0,
"portMappings": [],
"essential": true,
"environment": [],
"mountPoints": [],
"volumesFrom": []
}
],
from prefect-aws.
I see. Thanks for the additional examples! We have a ticket at #174 to add documentation about this, but we need to know which container definition to set the command
for and it is hard-coded to the one named "prefect". As you've noticed, this means you can run separate containers alongside the one that we are managing! We just need to know the name of the one we are supposed to manage. Does that clear things up?
from prefect-aws.
@madkinsz yea it does clear up things for me.
I am not fan of the current implementation would it be feasible to change the behaviour so that it selects user's inputted name and only default to prefect if no name is added.
from prefect-aws.
@rjhawar that could be a breaking change. Why do you care what the container is named?
from prefect-aws.
@madkinsz My concern was more with the behaviour and how strange and non-intuitive it feels:
For instance this is another case where you can potentially run into a problem:
If you were to create your own task definition in AWS and then use the task ARN for your block. If the container definition name wasn't set to "prefect" then you would encounter the same issue.
from prefect-aws.
Hm. Let me poke around and see if there's a reasonable way we can get the behavior you're looking for.
from prefect-aws.
Related Issues (20)
- allow define only aws region name through AwsCredentials HOT 1
- Rate limiting on task registration using ECS Workpools
- Add a Lambda function block HOT 1
- Accept `None` as an argument to Launch Type for ECSTask with `publish_as_work_pool` HOT 1
- Make credentials optional for S3Bucket block HOT 2
- Task definition caching does not work if the task definitions come from separate deployments. HOT 2
- Error in version 0.4.8: TypeError: unhashable type: 'dict' HOT 3
- Feature Request: Support for ExtraArgs on S3Bucket
- Credential use examples are in correct in documentation HOT 6
- Add distinct style to links in docs
- ECS Works Pools Should Support Specifying Volumes for Flow Runs HOT 1
- `S3Bucket.copy_object`: Only resolve target path with self if `to_bucket` is not defined
- ECSTask block `publish_as_work_pool` does not set `network_configuration` HOT 2
- Worker mistakenly marks flow runs as Crashed HOT 1
- Improvement to ECS worker setup guide
- ECS worker: Updating family setting to template flow name/deployment
- External luanch type not supported
- Change logging prefix to avoid unnecessary task definition registrations
- Add Python 3.12 to test matrix
- ECS task definition ephemaralStorage overrides do not work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prefect-aws.