From dbae4b6512fc23889dd1d663201b6e9029765140 Mon Sep 17 00:00:00 2001 From: YaroslavVlasenko Date: Mon, 1 Jun 2026 13:16:47 +0300 Subject: [PATCH] TEST: Update cloud pipeline configuration and support configurable app port --- .../cloud/gettingstarted_web/app.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/gettingstarted_web/app.py b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/gettingstarted_web/app.py index 8ec3dd460..37f1c675a 100644 --- a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/gettingstarted_web/app.py +++ b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/gettingstarted_web/app.py @@ -81,6 +81,7 @@ from fiftyone_pipeline_core.logger import Logger from fiftyone_pipeline_core.web import webevidence, set_response_header import json +import os import sys class GettingStartedWeb(): @@ -99,15 +100,23 @@ def build(self, resource_key, logger): # used by the device detection API when it runs. "enable_cookies": True } + pipeline_settings = { + "resource_key": resource_key, + "javascript_builder_settings": javascript_builder_settings, + } + # If a cloud endpoint is set in the environment, point the pipeline at it. + cloud_endpoint = ExampleUtils.get_cloud_endpoint() + if cloud_endpoint: + pipeline_settings["cloud_endpoint"] = cloud_endpoint + GettingStartedWeb.pipeline = DeviceDetectionPipelineBuilder( - resource_key = resource_key, - javascript_builder_settings = javascript_builder_settings).add_logger(logger).build() + **pipeline_settings).add_logger(logger).build() return self def run(self): - GettingStartedWeb.app.run() + GettingStartedWeb.app.run(port=int(os.environ.get("PORT", 5000))) # First we make a JSON route that will be called from the client side and will return # a JSON encoded property database using any additional evidence provided by the client