-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add system_resource_tracker and performance-metrics to image
- Loading branch information
1 parent
ad5d1e0
commit 9848175
Showing
5 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python 3.10.13 |
16 changes: 16 additions & 0 deletions
16
layers/meta-opentrons/recipes-devtools/python/python3-psutil_6.0.0.bb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
DESCRIPTION = "psutil is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network, sensors) in Python." | ||
HOMEPAGE = "https://github.com/giampaolo/psutil" | ||
SECTION = "devel/python" | ||
LICENSE = "BSD-3-Clause" | ||
LIC_FILES_CHKSUM = "file://LICENSE;md5=d2ac07f3999abbbb82c4c1a5397a2b27" | ||
|
||
SRC_URI[sha256sum] = "9e4c75b17b7c4e40b0d3f6e3e44dc9f9a23e5468ae75c4c28f42d3717cfc2580" | ||
SRC_URI = "https://github.com/giampaolo/psutil/archive/refs/tags/release-6.0.0.tar.gz" | ||
|
||
S = "${WORKDIR}/psutil-release-6.0.0" | ||
|
||
inherit pypi setuptools3 | ||
|
||
RDEPENDS_${PN} += "python3" | ||
|
||
FILES_${PN} += "${libdir}/python3*/site-packages/psutil" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...s-robot/opentrons-system-resource-tracker/files/opentrons-system-resource-tracker.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[Unit] | ||
Description=Opentrons System Resource Tracker | ||
After=opentrons-robot-server.service | ||
|
||
[Service] | ||
Type=notify | ||
ExecStart=python3 -m performance_metrics.system_resource_tracker | ||
StateDirectory=system-resource-tracker | ||
Environment=PYTHONPATH=/opt/opentrons-robot-server | ||
Environment=OT_SYSTEM_RESOURCE_TRACKER_ENABLED=true | ||
Environment=OT_SYSTEM_RESOURCE_TRACKER_REFRESH_INTERVAL=15.0 | ||
|
||
Restart=no | ||
TimeoutSec=10s | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
44 changes: 44 additions & 0 deletions
44
...rons/recipes-robot/opentrons-system-resource-tracker/opentrons-system-resource-tracker.bb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
inherit externalsrc | ||
EXTERNALSRC = "${@os.path.abspath(os.path.join("${TOPDIR}", os.pardir, os.pardir, "opentrons"))}" | ||
|
||
LICENSE = "Apache-2.0" | ||
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" | ||
|
||
# Modify these as desired | ||
DEST_SYSTEMD_DROPFILE ?= "${B}/system-resource-tracker-version.conf" | ||
OT_PACKAGE = "performance-metrics" | ||
inherit insane systemd get_ot_package_version | ||
|
||
SYSTEMD_AUTO_ENABLE = "enable" | ||
SYSTEMD_SERVICE:${PN} = "opentrons-system-resource-tracker.service" | ||
FILESEXTRAPATHS:prepend = "${THISDIR}/files:" | ||
SRC_URI:append = " file://opentrons-system-resource-tracker.service" | ||
|
||
PIPENV_APP_BUNDLE_PROJECT_ROOT = "${S}/performance-metrics" | ||
PIPENV_APP_BUNDLE_DIR = "/opt/opentrons-robot-server/performance-metrics" | ||
PIPENV_APP_BUNDLE_USE_GLOBAL = "systemd-python " | ||
PIPENV_APP_BUNDLE_STRIP_HASHES = "yes" | ||
PIPENV_APP_BUNDLE_EXTRA_PIP_ENVARGS = "OPENTRONS_PROJECT=${OPENTRONS_PROJECT}" | ||
|
||
do_compile:append() { | ||
} | ||
|
||
addtask do_write_systemd_dropfile after do_compile before do_install | ||
|
||
do_install:append () { | ||
# create json file to be used in VERSION.json | ||
install -d ${D}/opentrons_versions | ||
python3 ${S}/scripts/python_build_utils.py performance-metrics ${OPENTRONS_PROJECT} dump_br_version > ${D}/opentrons_versions/performance-metrics.json | ||
|
||
install -d ${D}/${systemd_system_unitdir} | ||
install -m 0644 ${WORKDIR}/opentrons-system-resource-tracker.service ${D}/${systemd_system_unitdir}/opentrons-system-resource-tracker.service | ||
} | ||
|
||
FILES:${PN}:append = " ${systemd_system_unitdir/opentrons-system-resource-tracker.service.d \ | ||
${systemd_system_unitdir}/opentrons-system-resource-tracker.service.d/system-resource-tracker-version.conf \ | ||
" | ||
|
||
RDEPENDS:${PN} += " python3-systemd python3-psutil" | ||
|
||
inherit pipenv_app_bundle |