Adding New Action Scripts
How to add action scripts manually to a robot
- Add new action metadata to online_assets spreadsheet here. Metadata =
category_slug, robot, script_lang, name_en, name_kk, name_ru, description_en, description_kk, description_ru, image_filename, script_en, script_kk, script_ru - Create audio files necessary for the action.
- Create a python script that references these files in the proper remote path (see other robot scripts for reference on the syntax and file path).
- Add audio file paths to the perfect_state_robots spreadsheet here. Create a copy spreadsheet page with the proper name and date when adding new paths to keep track the changes (see other page names for reference). You only need to insert new paths to
remote_pathcolumn. - Update perfect state file on the online app server (in static files). The file is localed at
/srv/apps/april_robots_online/mount/static/perfect_state/<robot>_files.csv. To update, export the spreadsheet page for the robot as CSV and replace the file, edit the CSV file directly. - Upload audio files to the correct path on the online app server into static files. Audios are located at
/srv/apps/april_robots_online/mount/static/robot_files/<robot>/audios/<some-path>. Behaviours for NAO are located in a directory next toaudios/. The part afterrobot_files/should be equal to theurlcolumn in the perfect_state_robots spreadsheet, withrobot_files/<path>swapped asrf/<path>. - Add the action via AR Online admin dashboard based on the metadata from step 1. Beware: the script paths will be resolved to
<lang>/<category-slug>/<script-name>.py(e.g.kk/povar/povar.pyin theactions/dir of the MS). - Add the python script file to the proper location in the robot’s MS repository (see previous step).
- Release the new version of the MS (check the release docs for that).
- Installed Offline App should pull the new version of the MS on the next start-up. The action will work only if MS is updated on the PC.
- Launch the cloud sync process from the Offline App to pull new action metadata.
- Launch the robot sync process from the Offline App to upload necessary robot files on the robot.
How it should work in the future
Admins should be able to upload script files directly through AR Online frontend, from which corresponding MS will be semi-automatically updated (via GH workflows).
sequenceDiagram
participant Admin / Developer
participant OnlineApp
participant Server
participant GitHub
participant GitRunner
participant GHCR
Admin / Developer->>OnlineApp: Creates new Action, uploads action script and audio files via UI
OnlineApp->>Server: Saves audio files to RFs folder, script file to private folder
Note over Admin / Developer,GitHub: Admin triggers workflow manually (workflow_dispatch) on the MS repo?
Admin / Developer->>GitHub: Manually triggers workflow_dispatch
GitHub->>GitRunner: Starts CI/CD workflow
GitRunner->>Server: Executes scp to download the script file
GitRunner->>GitRunner: Saves the script file into MS repo action scripts folder
GitRunner->>GitRunner: Builds new MS Docker image with files
GitRunner->>GHCR: Pushes image to registry