Hi, We are trying to run Dagster CLI command insid...
# ask-community
s
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
perhaps have your sensor return / yield a RunRequest instead? https://docs.dagster.io/_apidocs/schedules-sensors
s
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
hmm, if you really want cli - try
dagster job launch
i.e. `launch` instead of `execute`
s
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