Mitchell Hynes
01/27/2023, 7:12 PMN
deployments of docker-compose.sandbox.yaml
• User Code
dagster.yaml
run_launcher:
module: dagster_aws.ecs
class: EcsRunLauncher
config:
container_name: "user_code"
Task definition defined by docker-compose.sandbox.yaml
{
"taskDefinitionArn": "arn:aws:ecs:ca-central-1:<ACCOUNT>:task-definition/dagster-mitch-user_code:7",
"containerDefinitions": [
{
"name": "Usercode_Secrets_InitContainer",
"image": "docker/ecs-secrets-sidecar:1.0",
...
},
{
"name": "Usercode_ResolvConf_InitContainer",
"image": "docker/ecs-searchdomain-sidecar:1.0",
...
},
{
"name": "user_code",
"image": "<ACCOUNT>.dkr.ecr.<REGION>.<http://amazonaws.com/deploy_ecs/user_code:latest@sha256:<HASH|amazonaws.com/deploy_ecs/user_code:latest@sha256:<HASH>>",
...
},
]
}
Everything works fine! But when I try to launch a run I get this:
dagster._check.ParameterCheckError: Param "image" is not a str. Got None which is type <class 'NoneType'>.
File "/usr/local/lib/python3.10/site-packages/dagster/_daemon/run_coordinator/queued_run_coordinator_daemon.py", line 335, in _dequeue_run
instance.run_launcher.launch_run(
File "/usr/local/lib/python3.10/site-packages/dagster_aws/ecs/launcher.py", line 330, in launch_run
run_task_kwargs = self._run_task_kwargs(run, image, container_context)
File "/usr/local/lib/python3.10/site-packages/dagster_aws/ecs/launcher.py", line 513, in _run_task_kwargs
task_definition_config = DagsterEcsTaskDefinitionConfig.from_task_definition_dict(
File "/usr/local/lib/python3.10/site-packages/dagster_aws/ecs/tasks.py", line 120, in from_task_definition_dict
return DagsterEcsTaskDefinitionConfig(
File "/usr/local/lib/python3.10/site-packages/dagster_aws/ecs/tasks.py", line 53, in __new__
check.str_param(image, "image"),
File "/usr/local/lib/python3.10/site-packages/dagster/_check/__init__.py", line 1363, in str_param
raise _param_type_mismatch_exception(obj, str, param_name, additional_message)
Shahab Tasharrofi
01/27/2023, 7:26 PMMitchell Hynes
01/27/2023, 7:27 PMworkspace.yaml
, is it manual?Shahab Tasharrofi
01/27/2023, 7:30 PMworkspace.yaml
to create the final workspace.yaml
(before dagster is run)Mitchell Hynes
01/27/2023, 7:31 PMShahab Tasharrofi
01/27/2023, 7:31 PMMitchell Hynes
01/27/2023, 7:33 PMMitchell Hynes
01/27/2023, 10:08 PMexport DAGSTER_CONTAINER_CONTEXT='{"ecs":{"task_definition_arn":"arn:aws:ecs:ca-central-1:<ACCOUNT>:task-definition/dagster-mitch-user_code:8","container_name":"user_code"}}'
My dagster.yaml:
run_launcher:
module: dagster_aws.ecs
class: "EcsRunLauncher"
config:
include_sidecars: true
run_task_kwargs:
launchType: "FARGATE"
networkConfiguration:
awsvpcConfiguration:
securityGroups:
- <SEC GROUP>
subnets:
- <PRIVATE SUBNET>
- <PRIVATE SUBNET>
And this in my task definition:
{
"taskDefinitionArn": "arn:aws:ecs:ca-central-1:<ACCOUNT>:task-definition/dagster-mitch-user_code:8",
"containerDefinitions": [
{
"name": "user_code",
"image": "<ACCOUNT>.<http://dkr.ecr.ca-central-1.amazonaws.com/deploy_ecs/user_code:latest@sha256:<HASH|dkr.ecr.ca-central-1.amazonaws.com/deploy_ecs/user_code:latest@sha256:<HASH>>",
But when I try to materialize an asset I still get Param "image" is not a str.
. Any advice?Mitchell Hynes
01/27/2023, 10:13 PMChris Zubak-Skees
01/28/2023, 8:27 PMDAGSTER_CURRENT_IMAGE
on my code location task.Chris Zubak-Skees
01/28/2023, 8:30 PMMitchell Hynes
01/29/2023, 1:39 PM