def create_remote_scheduler(url): """Creates a remote scheduler :returns: The remote scheduler :rtype: :class:`rpc.RemoteScheduler` """ return rpc.RemoteScheduler(url)
def create_remote_scheduler(self, url): return rpc.RemoteScheduler(url)
def create_remote_scheduler(self, host, port): return rpc.RemoteScheduler(host=host, port=port)
def getRemoteScheduler(): return rpc.RemoteScheduler("http://localhost:8082")
from subprocess import call from luigi import worker, rpc import requests import time import threading from data_access import * from luigi_tools.phenotype_helper import * from claritynlp_logging import log, ERROR from luigi_module import PhenotypeTask import luigi scheduler = rpc.RemoteScheduler(url=util.luigi_scheduler) def get_active_workers(): url = util.luigi_scheduler + "/api/task_list?data={%22status%22:%22RUNNING%22}" log(url) req = requests.get(url) if req.status_code == 200: json_res = req.json() keys = (json_res['response'].keys()) return len(keys) return 0 def run_pipeline(pipeline_type: str, pipeline_id: str, job_id: int, owner: str): log("PLEASE RUN PIPELINE THROUGH PHENOTYPES", ERROR)