Question about the ECS Launcher (which I know is a...
# announcements
d
Question about the ECS Launcher (which I know is a work in progress) and launchers more generally.
I’m trying to use the ECS Launcher. In my
dagster.yaml
I have the launcher setup like below
Copy code
run_launcher:
  module: dagster_aws.ecs.launcher
  class: ECSRunLauncher
  config:
    key_id:
      env: AWS_ACCESS_KEY_ID
    access_key:
      env: AWS_SECRET_ACCESS_KEY
    region_name:
      env: AWS_DEFAULT_REGION
    imagename:
      env: ECR_IMAGE
    family: dagit
    memory: 256
    cpu: 512
    grab_logs: False
I’m running into this error
Error 1: Invalid scalar at the root. Value "FARGATE" of type "<class 'str'>" is not valid for expected type "Bool".
which I’m guessing is due to the default for grab_logs is a string rather than a boolean. https://github.com/dagster-io/dagster/blob/master/python_modules/libraries/dagster-aws/dagster_aws/ecs/launcher.py#L140 That minor issue aside I’m not sure when I run
dagit
it picks up I want to use a non standard launcher but isn’t overriding the default value since I have that set.
a
you have the full stack trace? we may just error out eagerly - in an attempt to prevent invalid default_values from being set (didnt work here apparently)
ya … the construction path isn’t test in master at all - ill get a fix in for the release on thursday
d
Cool thanks
a
actually this appears to be very much a work in progress -from what i can gather its not actually usable even without this invalid default_value cc @max
d
I was going to ask. I know this isn’t yet in the documentation and wasn’t sure if anyone uses the ECS launcher yet or if for the time being I should just try and put together my own simple custom launcher
a
how are you hoping to have your runs launched?
d
I just want every pipeline to be launched as it’s own ECS fargate task separate from the dagit service
a
ECSRunLauncher
is actually pretty close - the
ECSClient
its built on is under test, the remaining issue aside from the config is generating the right
dagster api execute_run_with_structured_logs
command instead of having command be part of the config
d
Ok. So aside from the minor config default issue it’s just that the run metadata aren’t tracked. Well if you ever need someone to help test out the ECS launcher. I’m really excited about it
Question. I saw that you pushed some changes for the
ECSRunLauncher
. If I update to 0.9.15 would this be enough for this to be working or as the commit suggests is this just a step
a
ya i had a few minutes so i tried to just fix the config schema problem - then observed the other issues so slapped some prospective fixes in but haven’t had time to actually test anything due to other fires i am fighting
if you have time you could try it out and report back any errors - it will go out in the release tomorrow but you could also just make a local copy to load from or pip install from git hash or something @max was hoping to get some time early next week to get it over the line
d
Fair enough. When 0.9.15 comes out I’ll try it out and see what happens. I was trying to hack together a custom launcher but was getting stuck on correctly generating the command but glad that is no longer a required field
Thanks again for the ECS launcher updates in 0.9.15. I made a few tweaks and got it to launch Fargate tasks (I still need to work out some AWS permissions for them to run correctly). However I’m getting this error that I’m less sure how to deal with
Copy code
AttributeError: 'NoneType' object has no attribute 'run_id'
  File "/Users/dennishume/code/dagster/env/lib/python3.7/site-packages/dagster_graphql/implementation/utils.py", line 14, in _fn
    return fn(*args, **kwargs)
  File "/Users/dennishume/code/dagster/env/lib/python3.7/site-packages/dagster_graphql/implementation/execution/launch_execution.py", line 19, in launch_pipeline_execution
    return _launch_pipeline_execution(graphene_info, execution_params)
  File "/Users/dennishume/code/dagster/env/lib/python3.7/site-packages/dagster_graphql/implementation/execution/launch_execution.py", line 52, in _launch_pipeline_execution
    run=graphene_info.schema.type_named("PipelineRun")(run)
  File "/Users/dennishume/code/dagster/env/lib/python3.7/site-packages/dagster_graphql/schema/runs.py", line 131, in __init__
    runId=pipeline_run.run_id, status=pipeline_run.status, mode=pipeline_run.mode
Also is this something better suited for Github discussions?
a
eh this is pretty in the weeds so i think this thread is fine
ahh ok i think i know whats going on here - so
the scheme is that it is assumed that the launch destination and source are using the same dagster instance - have access to the same database
so in your launch destination - the far gate task container - needs to have
DAGSTER_HOME
&
dagster.yaml
set up to point at the same instance you are launching form - configured to use an RDS database or whatever
d
Ok. So since I’m running
dagit
locally while testing this, the the task launches in AWS and is using RDS, I need to configure my local
dagster.yaml
to also be configured for that RDS instance in the
run_storage
and
event_log_storage
. Right now my local yaml is only configured for the
run_launcher
a
i think thatll do it
d
Thanks. I’ll try
a
what i do is have
~/data/dagster
as my default
DAGSTER_HOME
then have a
~/data/dagster-remote
for one with instance configured for RDS
any luck?
d
I got distracted by other things. I will give an update early next week
👍 1