Skip to content

Commit

Permalink
manager: move to system/ (#32538)
Browse files Browse the repository at this point in the history
* manager: move to system/

* one more
  • Loading branch information
adeebshihadeh authored May 25, 2024
1 parent 73b02f2 commit accdade
Show file tree
Hide file tree
Showing 43 changed files with 53 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/selfdrive_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 10 || 30) }} # allow more time when we missed the scons cache
run: |
cd $STRIPPED_DIR
${{ env.RUN }} "python selfdrive/manager/build.py"
${{ env.RUN }} "python system/manager/build.py"
- name: Run tests
timeout-minutes: 3
run: |
Expand Down
20 changes: 10 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -183,59 +183,59 @@ node {
deviceStage("onroad", "tici-needs-can", [], [
// TODO: ideally, this test runs in master-ci, but it takes 5+m to build it
//["build master-ci", "cd $SOURCE_DIR/release && TARGET_DIR=$TEST_DIR $SOURCE_DIR/scripts/retry.sh ./build_devel.sh"],
["build openpilot", "cd selfdrive/manager && ./build.py"],
["build openpilot", "cd system/manager && ./build.py"],
["check dirty", "release/check-dirty.sh"],
["onroad tests", "pytest selfdrive/test/test_onroad.py -s"],
["time to onroad", "pytest selfdrive/test/test_time_to_onroad.py"],
])
},
'HW + Unit Tests': {
deviceStage("tici-hardware", "tici-common", ["UNSAFE=1"], [
["build", "cd selfdrive/manager && ./build.py"],
["build", "cd system/manager && ./build.py"],
["test pandad", "pytest selfdrive/boardd/tests/test_pandad.py"],
["test power draw", "pytest -s system/hardware/tici/tests/test_power_draw.py"],
["test encoder", "LD_LIBRARY_PATH=/usr/local/lib pytest system/loggerd/tests/test_encoder.py"],
["test pigeond", "pytest system/ubloxd/tests/test_pigeond.py"],
["test manager", "pytest selfdrive/manager/test/test_manager.py"],
["test manager", "pytest system/manager/test/test_manager.py"],
])
},
'loopback': {
deviceStage("loopback", "tici-loopback", ["UNSAFE=1"], [
["build openpilot", "cd selfdrive/manager && ./build.py"],
["build openpilot", "cd system/manager && ./build.py"],
["test boardd loopback", "pytest selfdrive/boardd/tests/test_boardd_loopback.py"],
])
},
'camerad': {
deviceStage("AR0231", "tici-ar0231", ["UNSAFE=1"], [
["build", "cd selfdrive/manager && ./build.py"],
["build", "cd system/manager && ./build.py"],
["test camerad", "pytest system/camerad/test/test_camerad.py"],
["test exposure", "pytest system/camerad/test/test_exposure.py"],
])
deviceStage("OX03C10", "tici-ox03c10", ["UNSAFE=1"], [
["build", "cd selfdrive/manager && ./build.py"],
["build", "cd system/manager && ./build.py"],
["test camerad", "pytest system/camerad/test/test_camerad.py"],
["test exposure", "pytest system/camerad/test/test_exposure.py"],
])
},
'sensord': {
deviceStage("LSM + MMC", "tici-lsmc", ["UNSAFE=1"], [
["build", "cd selfdrive/manager && ./build.py"],
["build", "cd system/manager && ./build.py"],
["test sensord", "pytest system/sensord/tests/test_sensord.py"],
])
deviceStage("BMX + LSM", "tici-bmx-lsm", ["UNSAFE=1"], [
["build", "cd selfdrive/manager && ./build.py"],
["build", "cd system/manager && ./build.py"],
["test sensord", "pytest system/sensord/tests/test_sensord.py"],
])
},
'replay': {
deviceStage("model-replay", "tici-replay", ["UNSAFE=1"], [
["build", "cd selfdrive/manager && ./build.py"],
["build", "cd system/manager && ./build.py"],
["model replay", "selfdrive/test/process_replay/model_replay.py"],
])
},
'tizi': {
deviceStage("tizi", "tizi", ["UNSAFE=1"], [
["build openpilot", "cd selfdrive/manager && ./build.py"],
["build openpilot", "cd system/manager && ./build.py"],
["test boardd loopback", "SINGLE_PANDA=1 pytest selfdrive/boardd/tests/test_boardd_loopback.py"],
["test boardd spi", "pytest selfdrive/boardd/tests/test_boardd_spi.py"],
["test pandad", "pytest selfdrive/boardd/tests/test_pandad.py"],
Expand Down
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import random

from openpilot.common.prefix import OpenpilotPrefix
from openpilot.selfdrive.manager import manager
from openpilot.system.manager import manager
from openpilot.system.hardware import TICI, HARDWARE


Expand Down
2 changes: 1 addition & 1 deletion launch_chffrplus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function launch {
tmux capture-pane -pq -S-1000 > /tmp/launch_log

# start manager
cd selfdrive/manager
cd system/manager
if [ ! -f $DIR/prebuilt ]; then
./build.py
fi
Expand Down
2 changes: 1 addition & 1 deletion release/build_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ cd $SOURCE_DIR
cp -pR -n --parents $TEST_FILES $BUILD_DIR/
cd $BUILD_DIR
RELEASE=1 selfdrive/test/test_onroad.py
#selfdrive/manager/test/test_manager.py
#system/manager/test/test_manager.py
selfdrive/car/tests/test_car_interfaces.py
rm -rf $TEST_FILES

Expand Down
10 changes: 2 additions & 8 deletions release/files_common
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,8 @@ system/camerad/cameras/camera_common.cc
system/camerad/sensors/*.h
system/camerad/sensors/*.cc

selfdrive/manager/__init__.py
selfdrive/manager/build.py
selfdrive/manager/helpers.py
selfdrive/manager/manager.py
selfdrive/manager/process_config.py
selfdrive/manager/process.py
selfdrive/manager/test/__init__.py
selfdrive/manager/test/test_manager.py
system/manager/__init__.py
system/manager/**

selfdrive/modeld/.gitignore
selfdrive/modeld/__init__.py
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/boardd/tests/test_pandad.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from cereal import log
from openpilot.common.gpio import gpio_set, gpio_init
from panda import Panda, PandaDFU, PandaProtocolMismatch
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes
from openpilot.system.hardware import HARDWARE
from openpilot.system.hardware.tici.pins import GPIO

Expand Down
2 changes: 1 addition & 1 deletion selfdrive/controls/tests/test_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from openpilot.selfdrive.car.toyota.values import CAR as TOYOTA
from openpilot.selfdrive.car.mazda.values import CAR as MAZDA
from openpilot.selfdrive.controls.lib.events import EVENT_NAME
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes

EventName = car.CarEvent.EventName
Ecu = car.CarParams.Ecu
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/debug/cpu_usage_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import re
from collections import defaultdict

from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes

# Do statistics every 5 seconds
PRINT_INTERVAL = 5
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/debug/cycle_alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from openpilot.selfdrive.car.honda.interface import CarInterface
from openpilot.selfdrive.controls.lib.events import ET, Events
from openpilot.selfdrive.controls.lib.alertmanager import AlertManager
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes

EventName = car.CarEvent.EventName

Expand Down
2 changes: 1 addition & 1 deletion selfdrive/debug/uiview.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from cereal import car, log, messaging
from openpilot.common.params import Params
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes
from openpilot.system.hardware import HARDWARE

if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/locationd/test/test_locationd.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from openpilot.common.params import Params
from openpilot.common.transformations.coordinates import ecef2geodetic

from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes


class TestLocationdProc:
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/modeld/tests/test_modeld.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from openpilot.common.transformations.camera import DEVICE_CAMERAS
from openpilot.common.realtime import DT_MDL
from openpilot.selfdrive.car.car_helpers import write_car_param
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes
from openpilot.selfdrive.test.process_replay.vision_meta import meta_from_camera_state

CAM = DEVICE_CAMERAS[("tici", "ar0231")].fcam
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/modeld/tests/timing/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np

import cereal.messaging as messaging
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes


N = int(os.getenv("N", "5"))
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/navd/tests/test_navd.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import cereal.messaging as messaging
from openpilot.common.params import Params
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes


class TestNavd:
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/test/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import cereal.messaging as messaging
from openpilot.common.params import Params
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes
from openpilot.system.hardware import PC
from openpilot.system.version import training_version, terms_version

Expand Down
2 changes: 1 addition & 1 deletion selfdrive/test/process_replay/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from openpilot.selfdrive.car.fingerprints import MIGRATION
from openpilot.selfdrive.test.process_replay.vision_meta import meta_from_encode_index
from openpilot.selfdrive.car.toyota.values import EPS_SCALE
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes
from panda import Panda


Expand Down
2 changes: 1 addition & 1 deletion selfdrive/test/process_replay/process_replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from openpilot.common.realtime import DT_CTRL
from panda.python import ALTERNATIVE_EXPERIENCE
from openpilot.selfdrive.car.car_helpers import get_car, interfaces
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes
from openpilot.selfdrive.test.process_replay.vision_meta import meta_from_camera_state, available_streams
from openpilot.selfdrive.test.process_replay.migration import migrate_all
from openpilot.selfdrive.test.process_replay.capture import ProcessOutputCapture
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/test/test_onroad.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def setup_class(cls):
# start manager and run openpilot for a minute
proc = None
try:
manager_path = os.path.join(BASEDIR, "selfdrive/manager/manager.py")
manager_path = os.path.join(BASEDIR, "system/manager/manager.py")
proc = subprocess.Popen(["python", manager_path])

sm = messaging.SubMaster(['carState'])
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/test/test_time_to_onroad.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
def test_time_to_onroad():
# launch
set_params_enabled()
manager_path = os.path.join(BASEDIR, "selfdrive/manager/manager.py")
manager_path = os.path.join(BASEDIR, "system/manager/manager.py")
proc = subprocess.Popen(["python", manager_path])

start_time = time.monotonic()
Expand Down
2 changes: 1 addition & 1 deletion system/athena/manage_athenad.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from multiprocessing import Process

from openpilot.common.params import Params
from openpilot.selfdrive.manager.process import launcher
from openpilot.system.manager.process import launcher
from openpilot.common.swaglog import cloudlog
from openpilot.system.hardware import HARDWARE
from openpilot.system.version import get_build_metadata
Expand Down
2 changes: 1 addition & 1 deletion system/athena/tests/test_athenad_ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from openpilot.common.params import Params
from openpilot.common.timeout import Timeout
from openpilot.system.athena import athenad
from openpilot.selfdrive.manager.helpers import write_onroad_params
from openpilot.system.manager.helpers import write_onroad_params
from openpilot.system.hardware import TICI

TIMEOUT_TOLERANCE = 20 # seconds
Expand Down
2 changes: 1 addition & 1 deletion system/camerad/snapshot/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from openpilot.common.realtime import DT_MDL
from openpilot.system.hardware import PC
from openpilot.selfdrive.controls.lib.alertmanager import set_offroad_alert
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes


VISION_STREAMS = {
Expand Down
2 changes: 1 addition & 1 deletion system/camerad/test/test_camerad.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import cereal.messaging as messaging
from cereal import log
from cereal.services import SERVICE_LIST
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes

TEST_TIMESPAN = 30
LAG_FRAME_TOLERANCE = {log.FrameData.ImageSensor.ar0231: 0.5, # ARs use synced pulses for frame starts
Expand Down
4 changes: 2 additions & 2 deletions system/hardware/tici/tests/test_power_draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from openpilot.common.mock import mock_messages
from openpilot.selfdrive.car.car_helpers import write_car_param
from openpilot.system.hardware.tici.power_monitor import get_power
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.selfdrive.manager.manager import manager_cleanup
from openpilot.system.manager.process_config import managed_processes
from openpilot.system.manager.manager import manager_cleanup

SAMPLE_TIME = 8 # seconds to sample power
MAX_WARMUP_TIME = 30 # seconds to wait for SAMPLE_TIME consecutive valid samples
Expand Down
2 changes: 1 addition & 1 deletion system/loggerd/tests/test_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from openpilot.common.params import Params
from openpilot.common.timeout import Timeout
from openpilot.system.hardware import TICI
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes
from openpilot.tools.lib.logreader import LogReader
from openpilot.system.hardware.hw import Paths

Expand Down
2 changes: 1 addition & 1 deletion system/loggerd/tests/test_loggerd.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from openpilot.system.hardware.hw import Paths
from openpilot.system.loggerd.xattr_cache import getxattr
from openpilot.system.loggerd.deleter import PRESERVE_ATTR_NAME, PRESERVE_ATTR_VALUE
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes
from openpilot.system.version import get_version
from openpilot.tools.lib.helpers import RE
from openpilot.tools.lib.logreader import LogReader
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions selfdrive/manager/manager.py → system/manager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
from openpilot.common.params import Params, ParamKeyType
from openpilot.common.text_window import TextWindow
from openpilot.system.hardware import HARDWARE, PC
from openpilot.selfdrive.manager.helpers import unblock_stdout, write_onroad_params, save_bootlog
from openpilot.selfdrive.manager.process import ensure_running
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.helpers import unblock_stdout, write_onroad_params, save_bootlog
from openpilot.system.manager.process import ensure_running
from openpilot.system.manager.process_config import managed_processes
from openpilot.system.athena.registration import register, UNREGISTERED_DONGLE_ID
from openpilot.common.swaglog import cloudlog, add_file_handler
from openpilot.system.version import get_build_metadata, terms_version, training_version
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from cereal import car
from openpilot.common.params import Params
from openpilot.system.hardware import PC, TICI
from openpilot.selfdrive.manager.process import PythonProcess, NativeProcess, DaemonProcess
from openpilot.system.manager.process import PythonProcess, NativeProcess, DaemonProcess

WEBCAM = os.getenv("USE_WEBCAM") is not None

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

from cereal import car
from openpilot.common.params import Params
import openpilot.selfdrive.manager.manager as manager
from openpilot.selfdrive.manager.process import ensure_running
from openpilot.selfdrive.manager.process_config import managed_processes
import openpilot.system.manager.manager as manager
from openpilot.system.manager.process import ensure_running
from openpilot.system.manager.process_config import managed_processes
from openpilot.system.hardware import HARDWARE

os.environ['FAKEUPLOAD'] = "1"
Expand Down
2 changes: 1 addition & 1 deletion system/qcomgpsd/tests/test_qcomgpsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import cereal.messaging as messaging
from openpilot.system.qcomgpsd.qcomgpsd import at_cmd, wait_for_modem
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes

GOOD_SIGNAL = bool(int(os.getenv("GOOD_SIGNAL", '0')))

Expand Down
2 changes: 1 addition & 1 deletion system/sensord/tests/test_sensord.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from cereal.services import SERVICE_LIST
from openpilot.common.gpio import get_irqs_for_action
from openpilot.common.timeout import Timeout
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes

BMX = {
('bmx055', 'acceleration'),
Expand Down
2 changes: 1 addition & 1 deletion system/sensord/tests/ttff_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import atexit

from cereal import messaging
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes

TIMEOUT = 10*60

Expand Down
2 changes: 1 addition & 1 deletion system/tests/test_logmessaged.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import time

import cereal.messaging as messaging
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes
from openpilot.system.hardware.hw import Paths
from openpilot.common.swaglog import cloudlog, ipchandler

Expand Down
2 changes: 1 addition & 1 deletion system/ubloxd/tests/test_pigeond.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from cereal.services import SERVICE_LIST
from openpilot.common.gpio import gpio_read
from openpilot.selfdrive.test.helpers import with_processes
from openpilot.selfdrive.manager.process_config import managed_processes
from openpilot.system.manager.process_config import managed_processes
from openpilot.system.hardware.tici.pins import GPIO


Expand Down
Loading

0 comments on commit accdade

Please sign in to comment.