-
Notifications
You must be signed in to change notification settings - Fork 18
python3-labgrid: Add new package for coordinator #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,9 @@ HOMEPAGE = "https://github.com/labgrid-project" | |
| LICENSE = "LGPL-2.1-or-later" | ||
| LIC_FILES_CHKSUM = "file://LICENSE;md5=c0e9407a08421b8c72f578433434f0bd" | ||
|
|
||
| PACKAGE_BEFORE_PN += "${PN}-coordinator" | ||
| RDEPENDS:${PN}-coordinator = "${PN}" | ||
|
|
||
| RDEPENDS:${PN} = " \ | ||
| coreutils \ | ||
| libgpiod \ | ||
|
|
@@ -29,6 +32,7 @@ RDEPENDS:${PN} = " \ | |
| SRC_URI = " \ | ||
| file://configuration.yaml \ | ||
| file://labgrid-exporter.service \ | ||
| file://labgrid-coordinator.service \ | ||
| file://environment \ | ||
| " | ||
|
|
||
|
|
@@ -40,13 +44,16 @@ DEPENDS += "python3-pytest-runner-native" | |
| inherit python_setuptools_build_meta systemd | ||
|
|
||
| SYSTEMD_SERVICE:${PN} = "labgrid-exporter.service" | ||
| SYSTEMD_SERVICE:${PN}-coordinator = "labgrid-coordinator.service" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should just be added to |
||
|
|
||
| do_install:append() { | ||
| install -d ${D}${sysconfdir}/labgrid | ||
| install -m 0644 ${UNPACKDIR}/configuration.yaml ${D}${sysconfdir}/labgrid | ||
| install -m 0644 ${UNPACKDIR}/environment ${D}${sysconfdir}/labgrid | ||
| install -d ${D}${systemd_system_unitdir} | ||
| install -m 0644 ${UNPACKDIR}/labgrid-exporter.service ${D}${systemd_system_unitdir}/ | ||
| install -m 0644 ${UNPACKDIR}/labgrid-coordinator.service ${D}${systemd_system_unitdir}/ | ||
| } | ||
|
|
||
| FILES:${PN}-coordinator += "${systemd_system_unitdir}/labgrid-coordinator.service /usr/bin/labgrid-coordinator" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see the need for this. |
||
| FILES:${PN} += "${sysconfdir} ${systemd_system_unitdir}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,8 @@ | |
|
|
||
| LABGRID_COORDINATOR_IP=127.0.0.1 | ||
| LABGRID_COORDINATOR_PORT=20408 | ||
|
|
||
| ### The coordinator service will listen to the following ip, if the service is also | ||
| ### enabled. | ||
|
|
||
| LABGRID_COORDINATOR_LISTEN_IP=0.0.0.0 | ||
|
Comment on lines
+6
to
+10
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why can't we simply use
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because you might want to listen to 0.0.0.0 and connect to 127.0.0.1 and allow others to connect to your coordinator, even if you don't know its public IP address.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's take a step back here: Having the coordinator as part of a device that will usually be the exporter (that's at least what That configuration works for my LXA TAC home setup with.. ..in my
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is where we differ in our goals. I want it be generic, because there is no reason to have it only fit your use case, It hinders people from using meta-labgrid on a generic coordinator. (Might not be the case for everyone, but why not?) |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| [Unit] | ||
| Description=Labgrid Coordinator | ||
| After=network.target | ||
|
|
||
| [Service] | ||
| Environment="PYTHONUNBUFFERED=1" | ||
| Environment="LABGRID_COORDINATOR_LISTEN_IP=0.0.0.0" | ||
| Environment="LABGRID_COORDINATOR_PORT=20408" | ||
|
Comment on lines
+7
to
+8
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be redundant to the contents of the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are the defaults, that can be overwritten with the environment file. If there are no entries in environment, there are used. Otherwise they have to be specified.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't be needed.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If everything is configured correctly in the environment, then yes. But i always like to have sane defaults in case something is missing.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't follow.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, and if you forget to declare a variable in /etc/labgrid/environment, should there be a default value, or should the service fail? |
||
| EnvironmentFile=/etc/labgrid/environment | ||
| ExecStart=/usr/bin/labgrid-coordinator -l ${LABGRID_COORDINATOR_LISTEN_IP}:${LABGRID_COORDINATOR_PORT} | ||
| Restart=on-failure | ||
| DynamicUser=yes | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure that's a good idea. The state directory permissions will probably cause issues after an update. |
||
| StateDirectory=labgrid-coordinator | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default for this is |
||
| # Set WorkingDirectory to StateDirectory, this works in DynamicUser mode since symlinks are created | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we drop
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copied from https://github.com/labgrid-project/labgrid/blob/master/contrib/systemd/labgrid-coordinator.service |
||
| WorkingDirectory=%S/labgrid-coordinator | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need to be a separate package? Simply installing the systemd service and the labgrid-coordinator entry point (as done before) should not hurt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to reduce the amount of systemd-services, that get started by default and not have it in there, but be a deliberate decision to activate the coordinator on a device.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
labgrid-coordinator.serviceis not started by default, hence installing the coordinator entry point and the systemd service does not change anything. Asystemctl enable labgrid-coordinator.serviceis still needed.