Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion imagenet-classification-for-raspi/.actdk/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
},
"raspberrypi-bullseye": {
"apt": [
"libraspberrypi0"
"libraspberrypi0",
"libatomic1"
Copy link
Contributor

Choose a reason for hiding this comment

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

たぶん関係ない

],
"pip": [
"actfw-raspberrypi"
Expand Down
16 changes: 16 additions & 0 deletions use-cache-volume/.actdk/dependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"apt": [
"python3",
"python3-pil"
],
"pip": [],
"raspberrypi-bullseye": {
"apt": [
"libraspberrypi0",
"libatomic1"
],
"pip": [
"actfw-raspberrypi"
]
}
}
5 changes: 5 additions & 0 deletions use-cache-volume/.actdk/files.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"main": "main",
"healthchecker": "healthchecker",
"act_setting": "act_settings.json"
}
9 changes: 9 additions & 0 deletions use-cache-volume/.actdk/setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"app_id": "use-cache-volume",
"app_server_id": 1,
"short_description": null,
"short_descriptions": {},
"target_types": [
"raspberrypi-bullseye"
]
}
1 change: 1 addition & 0 deletions use-cache-volume/act_settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions use-cache-volume/app/healthchecker
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

true
3 changes: 3 additions & 0 deletions use-cache-volume/app/main
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exec python3 main.py
37 changes: 37 additions & 0 deletions use-cache-volume/app/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from time import sleep
import actfw_core
from actfw_core.task.task import Task
import subprocess

FILE_PATH = "/mnt/cache_volume/cachced_file"

class WritingFileTask(Task):
def run(self):
subprocess.run(["touch", FILE_PATH], check=True)
count = 0
while True:
with open(FILE_PATH, "a") as f:
f.write(f"{count}\n")
count += 1
# read file
with open(FILE_PATH, "r") as f:
actfw_core.notify([{ "message": f.read() }])
sleep(10)
if not self._is_running():
break


def main():
# Actcast application
app = actfw_core.Application()

cmd = actfw_core.CommandServer()
actfw_core.notify([{ "message": "start up" }])

app.register_task(cmd)
app.register_task(WritingFileTask())

app.run()

if __name__ == "__main__":
main()
11 changes: 11 additions & 0 deletions use-cache-volume/data_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

{
"$schema": "https://actcast.io/schema/v8/data_schema_schema.json",
"type": "array",
"items": {
"type": "object",
"properties": {
},
"required": []
}
}
14 changes: 14 additions & 0 deletions use-cache-volume/manifesto/bullseye.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 2,
"target_type": "raspberrypi-bullseye",
"boards": [
"RSPi3B",
"RSPi3BPlus",
"RSPi3APlus",
"RSPi4B"
],
"devices": [],
"cache_volume": {
"size": 256
}
}
8 changes: 8 additions & 0 deletions use-cache-volume/setting_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

{
"$schema": "https://actcast.io/schema/v8/setting_schema_schema.json",
"type": "object",
"properties": {
},
"required": []
}