Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ARG RUNTIME_OS_IMAGE=ubuntu:24.04@sha256:a08e551cb33850e4740772b38217fc1796a66da2506d312abe51acda354ff061

# -------------- Common Base Stage (ported to Ubuntu 24.04) --------------
FROM ubuntu:24.04@sha256:a08e551cb33850e4740772b38217fc1796a66da2506d312abe51acda354ff061 AS scenescape-common-base-24-04
FROM ${RUNTIME_OS_IMAGE} AS scenescape-common-base-24-04

# We use root for runtime init. The command in ENTRYPOINT will drop to an unprivileged user.
# hadolint ignore=DL3002
Expand All @@ -16,22 +16,22 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN : \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
# Keep package list in alphabetical order
cmake \
curl \
g++ \
git \
libeigen3-dev \
libgtest-dev \
make \
# needed by fast_geometry
pkg-config \
pybind11-dev \
python3-dev \
python3-pip \
# needed by fast_geometry
python3-scipy \
python-is-python3 \
# Keep package list in alphabetical order
cmake \
curl \
g++ \
git \
libeigen3-dev \
libgtest-dev \
make \
# needed by fast_geometry
pkg-config \
pybind11-dev \
python3-dev \
python3-pip \
# needed by fast_geometry
python3-scipy \
python-is-python3 \
&& rm -rf /var/lib/apt/lists/*

# install common dependencies
Expand All @@ -56,8 +56,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN : \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
libopencv-dev \
python3-venv \
libopencv-dev \
python3-venv \
&& rm -rf /var/lib/apt/lists/*

# create and set up Python virtual environment
Expand All @@ -78,7 +78,7 @@ RUN export OpenCV_DIR="/usr/lib/x86_64-linux-gnu/cmake/opencv4" \
&& cd dist \
&& ${BUILD_ENV_DIR}/bin/pip3 install --no-cache-dir ./*.whl \
&& cd \
&& rm -rf /tmp/robot_vision
&& rm -rf /tmp/robot_vision

# Build main controller package
COPY ./controller/src/controller /tmp/controller/controller
Expand Down Expand Up @@ -116,14 +116,14 @@ USER root
RUN : \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
gosu \
libgl1 \
libopencv-contrib406t64 \
libopencv-stitching406t64 \
libpython3.12 \
netbase \
python3-pip \
sudo \
gosu \
libgl1 \
libopencv-contrib406t64 \
libopencv-stitching406t64 \
libpython3.12 \
netbase \
python3-pip \
sudo \
&& rm -rf /usr/lib/x86_64-linux-gnu/libLLVM-15.so.1 \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Expand Down
7 changes: 5 additions & 2 deletions controller/requirements-runtime.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# SPDX-FileCopyrightText: (C) 2025 Intel Corporation
# SPDX-FileCopyrightText: (C) 2025 - 2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# This file is licensed under Apache 2.0 License.
# Modifications:
# Nokia VPOD (Emerging Products, BLR), 2026

mapbox_earcut==1.0.3
ntplib==0.4.0
numpy==1.26.4
open3d-cpu==0.19.0
opencv-python-headless==4.11.0.86
orjson==3.11.3
orjson==3.11.5
paho-mqtt==2.1.0
scipy==1.16.1
shapely==2.1.1
Expand All @@ -16,3 +18,4 @@ vdms==0.0.22
opentelemetry-api==1.38.0
opentelemetry-sdk==1.38.0
opentelemetry-exporter-otlp-proto-grpc==1.38.0
requests==2.32.3
35 changes: 32 additions & 3 deletions controller/src/controller-cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,37 @@

# SPDX-FileCopyrightText: (C) 2024 - 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# Modifications:
# Nokia VPOD (Emerging Products, BLR), 2026

import argparse
import os
import threading
from http.server import BaseHTTPRequestHandler, HTTPServer

from controller.scene_controller import SceneController
from controller.observability import metrics, tracing

class HealthCheckHandler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path == '/healthz':
self.send_response(200)
self.send_header('Content-type', 'text/plain')
self.end_headers()
self.wfile.write(b'OK')
else:
self.send_response(404)
self.end_headers()

def log_message(self, format, *args):
pass

def start_health_server(port):
server = HTTPServer(('0.0.0.0', port), HealthCheckHandler)
thread = threading.Thread(target=server.serve_forever, daemon=True)
thread.start()
return server

def build_argparser():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("--rewriteBadTime", action="store_true",
Expand All @@ -18,9 +42,6 @@ def build_argparser():
parser.add_argument("--maxlag", help="Maximum amount of lag in seconds",
default=1.0, type=float)

# FIXME - configure mosquitto to authenticate against REST so that
# same user/pass can be used for both REST and MQTT
# https://pypi.org/project/django-mqtt/
parser.add_argument("--broker", default="broker.scenescape.intel.com:1883",
help="hostname or IP of MQTT broker, optional :port")
parser.add_argument("--brokerauth", default="/run/secrets/controller.auth",
Expand All @@ -43,12 +64,20 @@ def build_argparser():
parser.add_argument("--visibility_topic", help="Which topic to publish visibility on."
"Valid options are 'unregulated', 'regulated', or 'none'",
default="regulated")
parser.add_argument("--healthcheck_port", type=int,
default=int(os.environ.get("CONTROLLER_HEALTHCHECK_PORT", "0")),
help="HTTP port for /healthz endpoint (0 disables)")
return parser

def main():
args = build_argparser().parse_args()

metrics.init()
tracing.init()

if args.healthcheck_port > 0:
start_health_server(args.healthcheck_port)

controller = SceneController(args.rewriteBadTime, args.rewriteAllTime,
args.maxlag, args.broker,
args.brokerauth, args.resturl,
Expand Down
Loading
Loading