Esempio n. 1
0
def start_job_service() -> None:
    """
    Start Feast Job Service
    """

    log_fmt = "%(asctime)s %(levelname)s %(message)s"
    logging.basicConfig(level=logging.INFO, format=log_fmt)

    client = feast.Client()

    if client._config.getboolean(opt.JOB_SERVICE_ENABLE_CONTROL_LOOP):
        # Start the control loop thread only if it's enabled from configs
        thread = threading.Thread(target=start_control_loop, daemon=True)
        thread.start()

    server = grpc.server(ThreadPoolExecutor(),
                         interceptors=(LoggingInterceptor(), ))
    JobService_pb2_grpc.add_JobServiceServicer_to_server(
        JobServiceServicer(client), server)
    HealthService_pb2_grpc.add_HealthServicer_to_server(
        HealthServicer(), server)
    server.add_insecure_port("[::]:6568")
    server.start()
    logging.info("Feast Job Service is listening on port :6568")
    server.wait_for_termination()
Esempio n. 2
0
def start_job_service() -> None:
    """
    Start Feast Job Service
    """
    feast_client = FeastClient()
    client = Client(feast_client)

    if client.config.getboolean(opt.JOB_SERVICE_ENABLE_CONTROL_LOOP):
        # Start the control loop thread only if it's enabled from configs
        thread = threading.Thread(target=start_control_loop, daemon=True)
        thread.start()

    metricServerThread = threading.Thread(
        target=start_prometheus_serving,
        daemon=True,
        args=[client.config.getint(opt.JOB_SERVICE_PROMETHEUS_METRIC_PORT)],
    )
    metricServerThread.start()

    server = grpc.server(ThreadPoolExecutor(),
                         interceptors=(LoggingInterceptor(), ))
    JobService_pb2_grpc.add_JobServiceServicer_to_server(
        JobServiceServicer(client), server)
    LegacyJobService_pb2_grpc.add_JobServiceServicer_to_server(
        JobServiceServicer(client), server)
    add_HealthServicer_to_server(HealthServicerImpl(), server)
    server.add_insecure_port("[::]:6568")
    server.start()
    logger.info("Feast Job Service is listening on port :6568")
    server.wait_for_termination()
Esempio n. 3
0
def start_job_service():
    """
    Start Feast Job Service
    """
    server = grpc.server(ThreadPoolExecutor())
    JobService_pb2_grpc.add_JobServiceServicer_to_server(JobServiceServicer(), server)
    server.add_insecure_port("[::]:6568")
    server.start()
    print("Feast job server listening on port :6568")
    server.wait_for_termination()
Esempio n. 4
0
def start_job_service():
    """
    Start Feast Job Service
    """

    log_fmt = "%(asctime)s %(levelname)s %(message)s"
    logging.basicConfig(level=logging.INFO, format=log_fmt)

    server = grpc.server(ThreadPoolExecutor(),
                         interceptors=(LoggingInterceptor(), ))
    JobService_pb2_grpc.add_JobServiceServicer_to_server(
        JobServiceServicer(), server)
    HealthService_pb2_grpc.add_HealthServicer_to_server(
        HealthServicer(), server)
    server.add_insecure_port("[::]:6568")
    server.start()
    print("Feast job server listening on port :6568")
    server.wait_for_termination()
Esempio n. 5
0
    def test_run_job_no_staging(self, client, mocker):
        grpc_stub = jobs.JobServiceStub(grpc.insecure_channel(""))

        mocker.patch.object(
            grpc_stub,
            'SubmitJob',
            return_value=JobServiceTypes.SubmitImportJobResponse(
                jobId="myjob12312"))
        client._job_service_stub = grpc_stub
        importer = Importer({"import": ImportSpec()}, None,
                            {"require_staging": False})

        job_id = client.run(importer)
        assert job_id == "myjob12312"