https://dagster.io/ logo
#ask-community
Title
# ask-community
s

Sathish

06/21/2022, 4:18 AM
Hi, We are trying to run Dagster CLI command inside a sensor to run a job os.system('dagster job execute -f <py file> -j <job_name>'). when the command is triggered from a sensor it's loading a new repository instance and loading the dagster objects again. instead is there a way to trigger a job in the same instance
🤖 1
d

David Hyman

06/21/2022, 11:24 AM
perhaps have your sensor return / yield a RunRequest instead? https://docs.dagster.io/_apidocs/schedules-sensors
s

Sathish

06/21/2022, 11:54 AM
Runrequest is expecting job_definition, I want to trigger a job using job_name and path_to_file
I am able run the job using above command but it's loading the repository again instead using loaded instance
forget about the sensor Is there a way run cli commands using the loaded instance
d

David Hyman

06/21/2022, 1:31 PM
hmm, if you really want cli - try
dagster job launch
i.e. `launch` instead of `execute`
s

Sathish

06/24/2022, 1:39 PM
Hi @David Hyman, launch is triggering a job within the same dagster instance(with dagster job launch -f <filename> -j <jobname>). We want to use the same command in deployed version in AKS cluster, there we can't use the python file name, we have the host and port name values of depoyed version can we use these trigger the job
4 Views