Can StepLaunchers be ConfigurableResources yet? I'...
# ask-community
z
Can StepLaunchers be ConfigurableResources yet? I'm working with this example:
Copy code
from time import sleep
from dagster import ConfigurableResource, StepLauncher, op, job

class NewStepLauncher(StepLauncher, ConfigurableResource):
    def launch_step(self, step_context):
        <http://step_context.log.info|step_context.log.info>("Launching step from custom StepLauncher")
        sleep(10)


@op()
def my_custom_step(context, step_launcher: NewStepLauncher):
    pass


@job(resource_defs={"step_launcher": NewStepLauncher})
def my_custom_job():
    my_custom_step()

defs = Definitions(
    resources={"step_launcher": NewStepLauncher().configure_at_launch()},
    jobs=[my_custom_job],
)
and while the code loads fine, it doesn't seem to be using the
NewStepLauncher.launch_step
method to launch
my_custom_step
🤖 1
This is using v1.3.13 - is this perhaps supported in a more recent version?
Doesn't look like it works with v1.4.7 either. I guess I'll open up an issue - this prevents being able to use ConfigurableResources in any jobs that use a step launcher, as you're required to pass the step launcher via
required_resource_keys
. Unfortunately the majority of my team's jobs use a step launcher 😿
s
Thanks for opening the issue, we’ll try to add this quickly if there isn’t any major blocker (I don’t know enough about this area to know)
z
No problem! It does seem like something that will feel a little odd if it works exactly like ConfigurableResources right now - it'd be kinda strange to pass the step launcher into the dependent op function params but then never use it within the op. But if that's the easiest way to get it implemented then that's just what it is