-
Notifications
You must be signed in to change notification settings - Fork 7
docs: add App specification #67
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
Draft
dido18
wants to merge
10
commits into
main
Choose a base branch
from
app-specification
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+98
−0
Draft
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7c6699e
feat: add Arduino App specification document
dido18 d13cf8a
docs: update Arduino App specification for clarity and completeness
dido18 189fcb9
docs: clarify Arduino App folder structure and reserved names
dido18 953a761
app
dido18 5a37e66
Applied linter
cmaglie cf4b9a3
Merge remote-tracking branch 'origin/main' into app-specification
cmaglie 1de5f41
Add a first model draft
martacarbone ec3f5ca
Added the section with changes to the current implementation
martacarbone 1b24f67
Move in a dedicater branch
martacarbone 9ccf95d
Added some details
cmaglie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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,88 @@ | ||
| # Arduino App specification | ||
|
|
||
| This is the specification for the `Arduino App` (from now on called App) format to be used with `arduino-app-cli` and `Arduino App Lab`. | ||
|
|
||
| # Arduino App Folder structure | ||
|
|
||
| An App is a self-contained folder that includes the following components: | ||
|
|
||
| - `app.yaml` (mandatory) the file descriptor of the app in YAML format. | ||
| - `sketch` (optional) the folder containing an Arduino [Sketch](https://arduino.github.io/arduino-cli/1.3/sketch-specification/)). | ||
| - `python` (optional) the folder containing the Python code. | ||
|
|
||
| At least one on `sketch` or `python` folder must be present. | ||
| The App must be self-contained (it does not contain references to external files) because this means it can be exported, shared, or zipped easily. | ||
|
|
||
| The user-defined apps are saved into `/home/arduino/ArduinoApps` folder. | ||
| The builtin-apps are stored into `home/arduino/.local/share/arduino-app-cli/examples` folder. | ||
|
|
||
| Example of a `my-app` folder structure | ||
|
|
||
| ``` | ||
| my-app/ | ||
| README.md | ||
| app.yaml | ||
| sketch/ | ||
| sketch.ino | ||
| sketch.yaml | ||
| python/ | ||
| main.py | ||
| ``` | ||
|
|
||
| ## `README.md` file | ||
|
|
||
| An (optional) readme file in markdown. | ||
| The link to local resources must be in the same folder of the app. For example, a png inside the folder `myapp/docs/my-banner.png` can be referenced using  syntax. | ||
|
|
||
| ### `app.yaml` file descriptor | ||
|
|
||
| The `app.yaml` (or `app.yml`) is a YAML file that describes an App. | ||
|
|
||
| - `name`: (optional) a short name of the app. | ||
| - `description`: (optional) a brief description of the app. | ||
| - `icon`: (optional) the emoji of the app | ||
| - `ports`: (optional) a list of ports to be exposed externally. If not given a random port is opened (if necessary). | ||
| - `bricks` (optional) a list of bricks used by the app with its variable definitions. | ||
|
|
||
| Example: | ||
|
|
||
| ```yaml | ||
| name: My Arduino App | ||
| description: An example app showcasing what you can do | ||
| icon: 🍓 | ||
| ports: | ||
| - 7000 | ||
|
|
||
| bricks: | ||
| - arduino/dbstorage: | ||
| variables: | ||
| ROOT_PASSWORD: ${secret.db_password} | ||
| PORT: 8080 | ||
| - arduino/text-generation: | ||
| model: gemma-1 | ||
| - arduino/objectdetection: | ||
| model: yolo | ||
| ``` | ||
|
|
||
| ### `sketch` sub folder | ||
|
|
||
| The content of the `sketch` subfolder contains the Ardiuno skecth. | ||
| It must omply with the [Sketch specification](https://arduino.github.io/arduino-cli/1.3/sketch-specification/). | ||
|
|
||
| If present it must contain the followign files: | ||
|
|
||
| - `sketch.ino` | ||
| - `sketch.yaml` that is compliant to the [Sketch project file](https://arduino.github.io/arduino-cli/1.3/sketch-project-file/) | ||
|
|
||
| ### `python` sub folder | ||
|
|
||
| The content of the `python` contains the python code. | ||
|
|
||
| If present, it must contain the `main.py` with the python code of the main. | ||
| Optionally, a `requirements.txt` with additional python package dependencies to be installed. | ||
|
|
||
| ### Other | ||
|
|
||
| Other sub-folders or files can be added to the app folder. | ||
| The reserved folder names are `sketch` and `python`. | ||
| The reserved file names are `app.yaml` and `sketch.yaml`. | ||
|
Comment on lines
+94
to
+98
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 think we should discourage adding extra files in the root folder; maybe we could reserve an |
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is the name optional?
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've removed the optional piece. Maybe we should just specify what's mandatory, implying that everything else is optional.
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.
Or, better, we should provide a JSON SCHEMA file (as we did for the Arduino CLI configuration) https://github.com/arduino/arduino-cli/blob/master/internal/cli/configuration/configuration.schema.json
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.
BTW, currently an empty
app.yamlis valid and the ardiuno-app-cli is able to run it.