Merge branch 'refs/heads/master-priv' into master-dev-c3

This commit is contained in:
DevTekVE
2024-07-26 11:25:23 +02:00
5 changed files with 23 additions and 15 deletions
+2 -2
View File
@@ -50,7 +50,7 @@ default:
- 'mkdir -p "${BUILD_DIR}/"'
- *configure_git
workflow: # If running on any branch other than main, use the `aws-datacontracts-dev` account; otherwise use `aws-datacontracts`
workflow: # If running on any branch other than main.
rules:
# We are an MR, but it's a draft, we won't proceed with anything.
- if: '$CI_MERGE_REQUEST_TITLE =~ /^wip:/i || $CI_MERGE_REQUEST_TITLE =~ /^draft:/i'
@@ -64,7 +64,7 @@ workflow: # If running on any branch other than main, use the `aws-datacontracts
when: always
# We are a merge request
- if: $CI_MERGE_REQUEST_IID #|| $CI_COMMIT_REF_NAME == "gitlab-pipelines" # TBD once merged
- if: $CI_MERGE_REQUEST_IID
variables:
EXTRA_VERSION_IDENTIFIER: "-${CI_PIPELINE_IID}"
NEW_BRANCH: ${CI_COMMIT_REF_NAME}-prebuilt
+2
View File
@@ -341,6 +341,8 @@ std::unordered_map<std::string, uint32_t> keys = {
{"SunnylinkCache_Users", PERSISTENT},
{"SunnylinkCache_Roles", PERSISTENT},
{"EnableGitlabRunner", PERSISTENT | BACKUP},
{"EnableSunnylinkUploader", PERSISTENT | BACKUP},
// PFEIFER - MAPD {{
{"MapdVersion", PERSISTENT},
+2
View File
@@ -119,6 +119,8 @@ def manager_init() -> None:
("CustomDrivingModel", "0"),
("DrivingModelGeneration", "4"),
("LastSunnylinkPingTime", "0"),
("EnableGitlabRunner", "0"),
("EnableSunnylinkUploader", "0"),
]
if not PC:
default_params.append(("LastUpdateTime", datetime.datetime.now(datetime.UTC).replace(tzinfo=None).isoformat().encode('utf8')))
+12 -13
View File
@@ -6,7 +6,7 @@ from openpilot.system.hardware import PC, TICI
from openpilot.selfdrive.modeld.custom_model_metadata import CustomModelMetadata, ModelCapabilities
from openpilot.system.manager.process import PythonProcess, NativeProcess, DaemonProcess
from openpilot.system.mapd_manager import MAPD_PATH, COMMON_DIR
from openpilot.system.manager.sunnylink import sunnylink_need_register, sunnylink_ready
from openpilot.system.manager.sunnylink import sunnylink_need_register, sunnylink_ready, use_sunnylink_uploader
WEBCAM = os.getenv("USE_WEBCAM") is not None
@@ -44,6 +44,10 @@ def only_onroad(started: bool, params, CP: car.CarParams) -> bool:
def only_offroad(started, params, CP: car.CarParams) -> bool:
return not started
def use_gitlab_runner(started, params, CP: car.CarParams) -> bool:
return (not PC and params.get_bool("EnableGitlabRunner") and only_offroad(started, params, CP)
and os.path.exists("./gitlab_runner.sh"))
def model_use_nav(started, params, CP: car.CarParams) -> bool:
custom_model_metadata = CustomModelMetadata(params=params, init_only=True)
return started and custom_model_metadata.valid and custom_model_metadata.capabilities & ModelCapabilities.NoO
@@ -56,6 +60,10 @@ def sunnylink_need_register_shim(started, params, CP: car.CarParams) -> bool:
"""Shim for sunnylink_need_register to match the process manager signature."""
return sunnylink_need_register(params)
def use_sunnylink_uploader_shim(started, params, CP: car.CarParams) -> bool:
"""Shim for use_sunnylink_uploader to match the process manager signature."""
return use_sunnylink_uploader(params) and os.path.exists("../loggerd/sunnylink_uploader.py")
procs = [
DaemonProcess("manage_athenad", "system.athena.manage_athenad", "AthenadPid"),
@@ -112,21 +120,12 @@ procs = [
PythonProcess("webrtcd", "system.webrtc.webrtcd", notcar),
PythonProcess("webjoystick", "tools.bodyteleop.web", notcar),
# Sunnypilot devs
NativeProcess("gitlab_runner_start", "system/manager", ["./gitlab_runner.sh", "start"], use_gitlab_runner, sigkill=False),
# Sunnylink <3
DaemonProcess("manage_sunnylinkd", "system.athena.manage_sunnylinkd", "SunnylinkdPid"),
PythonProcess("sunnylink_registration", "system.manager.sunnylink", sunnylink_need_register_shim),
PythonProcess("sunnylink_uploader", "system.loggerd.sunnylink_uploader", use_sunnylink_uploader_shim),
]
if os.path.exists("../loggerd/sunnylink_uploader.py"):
procs += [
PythonProcess("sunnylink_uploader", "system.loggerd.sunnylink_uploader", sunnylink_ready_shim),
]
if os.path.exists("./gitlab_runner.sh") and not PC:
# Only devs!
procs += [
NativeProcess("gitlab_runner_start", "system/manager", ["./gitlab_runner.sh", "start"], only_offroad, sigkill=False),
NativeProcess("gitlab_runner_stop", "system/manager", ["./gitlab_runner.sh", "stop"], only_onroad, sigkill=False)
]
managed_processes = {p.name: p for p in procs}
+5
View File
@@ -27,6 +27,11 @@ def sunnylink_ready(params=Params()) -> bool:
return is_sunnylink_enabled and is_registered
def use_sunnylink_uploader(params) -> bool:
"""Check if the device is ready to use Sunnylink and the uploader is enabled."""
return sunnylink_ready(params) and params.get_bool("EnableSunnylinkUploader")
def sunnylink_need_register(params=Params()) -> bool:
"""Check if the device needs to be registered with Sunnylink."""
is_sunnylink_enabled, is_registered = get_sunnylink_status(params)