PTP Notifications Overview¶
StarlingX provides ptp-notification to support applications that rely on
PTP for time synchronization and require the ability to determine if the system
time is out of sync. ptp-notification provides the ability for user applications
to query the sync state of hosts as well as subscribe to push notifications for
changes in the sync status.
StarlingX provides a Sidecar, which runs with the hosted application in the same pod and communicates with the application via a REST API.
PTP-notification consists of two main components:
The
ptp-notificationsystem application can be installed on nodes using PTP clock synchronization. This monitors the various time services and provides the v2 REST API for clients to query and subscribe to.The
ptp-notificationsidecar. This is a container image which can be configured as a sidecar and deployed alongside user applications that wish to use theptp-notificationAPI. User applications only need to be aware of the sidecar, making queries and subscriptions via its API. The sidecar handles locating the appropriateptp-notificationendpoints, executing the query and returning the results to the user application.
StarlingX supports the following features:
Provides the capability to enable application(s) subscribe to PTP status notifications and pull for the PTP state on demand.
Uses a REST API to communicate PTP notifications to the application.
Enables operators to install the ptp-notification-armada-app, Sidecar container, and the application supporting the REST API. For more information, see https://docs.starlingx.io/api-ref/ptp-notification-armada-app/index.html.
Supports the ptp4l module and PTP port that is configured in Subordinate mode (Secondary mode).
The PTP notification Sidecar container can be configured with a Liveness Probe, if required. See, Liveness Probe for more information.
The
ptp-notificationsystem application supports automatic upgrade functionality via the application framework. When a higher version tarball is installed at /usr/local/share/applications/helm/, the application framework will detect and deploy the new version automatically.
ptp-notification Limitations
Deployment of
ptp-notificationat bootstrap time is not supported due to dependencies on the system PTP configuration which is handled post-bootstrap.The helm-chart-attribute-modify command is not supported for
ptp-notificationbecause the application consists of a single chart. Disabling the chart would renderptp-notificationnon-functional. See Application Commands and Helm Overrides for details on this command.
v2 REST APIs¶
Integrated Containerized Applications
Applications that rely on PTP for synchronization have the ability to retrieve the relevant data for the status of the monitored service. User applications may subscribe to notifications from multiple service types and from multiple separate nodes.
Once an application subscribes to PTP notifications it receives the initial data that shows the service state, and receives notifications when there is a state change to the sync status and/or per request for notification (pull).
The figure below describes the subscription framework for PTP notifications.
Liveness Probe
The PTP notification Sidecar container can be configured with a Liveness probe, if required. You can edit the Sidecar values in the deployment manifest to include these parameters.
Note
Port and timeout values can be configured to meet user preferences.
The periodSeconds and timeoutSeconds values can be adjusted based
on system performance. A shorter value places more resource demand on the
Sidecar pod, so longer values can improve pod stability.
cat <<EOF >
items:
spec:
template:
spec:
containers:
livenessProbe:
exec:
command:
- curl
- http://127.0.0.1:8080/health
failureThreshold: 3
initialDelaySeconds: 30
periodSeconds: 5
httpGet:
path: /health
port: 8080
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 3
successThreshold: 1
timeoutSeconds: 5
EOF
Container images and API compatibility
The ptp-notification provides a v2 API for O-RAN Spec Compliant Timing
notifications. ptp-notification deploys notificationservice-base-v2
container to support this API. To use v2 API, users deploy the compatible
notificationclient-base image as a sidecar with their consumer application.
The v2 API uses starlingx/notificationservice-base-v2:stx.11.0-v2.4.5
Compatible with the image:
starlingx/notificationclient-base:stx.11.0-v2.3.3
Upgrades of StarlingX r11.0 to the next patch will automatically upgrade the
ptp-notification application and deploy v2 API containers. Consumer
applications interact with v2 API with compatible version of
notificationclient-base that is deployed along side their application.