Skip to content

feat: ietf-schedule basic recurrence implementation#1523

Open
saba8814 wants to merge 3 commits into
kernelkit:mainfrom
saba8814:feat/add-scheduler-support
Open

feat: ietf-schedule basic recurrence implementation#1523
saba8814 wants to merge 3 commits into
kernelkit:mainfrom
saba8814:feat/add-scheduler-support

Conversation

@saba8814
Copy link
Copy Markdown
Collaborator

@saba8814 saba8814 commented Jun 2, 2026

Description

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

Comment thread package/confd/crond.conf
@@ -0,0 +1,2 @@
# Cron daemon for infix-schedule
service [S12345] crond -f -- Cron daemon
Copy link
Copy Markdown
Contributor

@mattiaswal mattiaswal Jun 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not start in runlevel S, 2345 should be enough. This since we have seen slow platforms (arm32) struggle with starting to much, when it should focus on confd.

Comment thread src/confd/src/schedule.c
if (iv <= 0)
iv = 1;

if (strstr(freq, "secondly")) {
Copy link
Copy Markdown
Contributor

@mattiaswal mattiaswal Jun 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it not possible to set in cron, it should not be possible to set in YANG, block it in yang model, the problematic here is that it is an identity, do not remember how we did with unsupported identities. Lets discuss this.

We have as a policy that everything should be validated in the yang model (using deviate or must expression, mandatory etc), to keep the c-code as little as possible.

}

augment "/sys:system" {
container schedules {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing "description"

leaf description {
type string;
}
choice action {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing description


leaf last-check {
type yang:date-and-time;
description
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For things that pure operational, set as config: false

Comment thread src/confd/yang/confd.inc
"infix-ptp@2026-04-07.yang"
"ietf-schedule@2026-03-10.yang -e basic-recurrence"
"infix-schedule@2026-05-27.yang"
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this file you also need to update the reference to all updated yang models, in this case infix-system-software@.....yang

}
})

with test.step("Verify schedule is configured"):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundat, since if the YANG model succeed to apply, it is configured.

@@ -0,0 +1,108 @@
module infix-schedule {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file should just be a symlink to infix-schedule.yang, see surrounding files.

fi

# Read configured update-url from sysrepo, fall back to upstream
UPDATE_URL=$(sysrepocfg -d running -f json \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use jq here instead of calls to misc shell programs, this to limit forking:
like this (This is pure AI, not tested, just to give you a hint what i mean):

 UPDATE_URL=$(sysrepocfg -d running -f json \                                                                                           
     -x '/ietf-system:system/infix-system:software/check-update/update-url' \                                                                            
     2>/dev/null \                                                                                                                                       
     | jq -r '.. | objects | ."update-url"? // empty')                                                                                                   

fi

# Read configured update-url from sysrepo, fall back to upstream
UPDATE_URL=$(sysrepocfg -d running -f json \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should look to use the 'copy' shell command instead of sysrepocfg here, since there will be problem calling sysrepocfg for everone except root:

admin@infix-00-00-00:$ sysrepocfg -X -f json -d operational
[ERR] open() on "/etc/sysrepo/sr_main_lock" failed (Permission denied).
sysrepocfg error: Failed to connect (System function call failed)
admin@infix-00-00-00:
$

copy also respect nacm if i remember it correctly.

@mattiaswal
Copy link
Copy Markdown
Contributor

Also add the the "magic" key word fix #issue number in the PR description, this closes the open issue automatically when merged.

@saba8814
Copy link
Copy Markdown
Collaborator Author

saba8814 commented Jun 2, 2026

Also add the the "magic" key word fix #issue number in the PR description, this closes the open issue automatically when merged.

Thing is #1301 is formulated in way that it is support for full unattended upgrade, and this PR adds scheduling stuff and just a check for update availiability thus I ommited it from git message, since full implementation of unnattended-upgrade will be handled in a separete merge request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants