Hello, I'm having an issue customizing the CPU and...
# ask-community
p
Hello, I'm having an issue customizing the CPU and memory with tags for assets using the ECS launcher (docs). I have a process that I'm trying to set up in Dagster that requires more than my standard amount of memory, so I need to use tags to customize the settings. I first set it up as a job like this:
Copy code
@op
def op_one():
   return foo

@op
def op_two(foo):
    return foo + bar

@job(tags={
        "ecs/cpu": "1024",
        "ecs/memory": "6144",
    },)
def ops_job():
  return op_two(op_one())
This worked fine when triggered from Launchpad or scheduled. I tried setting up the same process as an asset like:
Copy code
@asset
def my_asset(group_name="my_assets"):
    # same logic as the ops
    return foo + bar

define_asset_job(
            name="asset_job",
            selection=AssetSelection.groups("my_assets"),
            tags={"ecs/cpu": "1024", "ecs/memory": "6144"},
        )
I triggered a run using the materialize asset button. The asset job failed at the same point my ops job did before I increased the memory. My assumption is that the launcher is not registering my custom cpu and memory settings for the asset materialization. I encountered a case previously where the materialize asset button just didn't work, but other run triggers did, so I'm wondering if that's also what's happening here or is there a proper way to set up the ECS tags for an asset job? Thanks.
d
Hey paul - if you check the tags on the run from the run page, do they have the values that you would expect?
If so, if you check in the ECS task, are no cpu/memory limits being applied there?
p
The job that worked had the tags with the correct values. The asset run did not.
d
that's surprising - you're sure the code changes that added the tags were picked up before you launched the run?
and that it was specifically that job that you were running?
p
Yes, sure about the job and that the code changes were deployed.
d
I just tried adding tags to a define_asset_job call, launching a run with the job, and clicking on the "View tags and config" button from the run page, and the tags were applied:
if you have a set of steps I can follow that reproduces the tags not appearing on the launched run, i'd be happy to try them
but otherwise I'd triple check that your code is actually being applied
p
Thanks for looking into it! I'll try to create a new similar asset job from scratch and see if the issue recurs. Might just be something weird I'm not catching.
191 Views