Runtime plugins
A runtime plugin lets n5i install apps in formats other than its own app.yml. The backend contains runtime plugins for Umbrel and Tipi apps.
How it works
When n5i finds an app directory without both app.yml and metadata.yml, it sends the directory (as a gzip-compressed tar archive) to the installed runtime plugins:
IsSupportedApp: the plugin says whether it can handle this app.ParseApp: the plugin converts it into n5i's internal app representation, encoded as JSON. Then5i-appscrate defines this format (InternalAppRepresentation).InstallAppandUninstallAppare called when the app is installed and removed, so the plugin can do additional work for its format.
n5i itself creates the Kubernetes objects from the parsed app, so a runtime plugin only has to translate the format.
RPC interface
proto
syntax = "proto3";
package n5i_plugin;
import "common.proto";
message ParseAppRequest {
string app_id = 1;
// The directory of the app as a compressed tar archive (compressed using gzip)
bytes app_directory = 2;
UserState user_state = 3;
optional string initial_domain = 4;
string app_seed_base = 5;
}
message ParseAppResponse {
// The JSON-encoded parsed app in n5i's internal app format
string parsed_app = 1;
}
message InstallAppRequest {
string app_id = 1;
// The directory of the app as a compressed tar archive (compressed using gzip)
bytes app_directory = 2;
UserState user_state = 3;
optional string initial_domain = 4;
string app_seed_base = 5;
}
message InstallAppResponse {}
message UninstallAppRequest {
string app_id = 1;
// The directory of the app as a compressed tar archive (compressed using gzip)
bytes app_directory = 2;
UserState user_state = 3;
string app_seed_base = 4;
}
message UninstallAppResponse {}
message PauseAppRequest {
string app_id = 1;
// The directory of the app as a compressed tar archive (compressed using gzip)
bytes app_directory = 2;
UserState user_state = 3;
optional string initial_domain = 4;
string app_seed_base = 5;
}
message PauseAppResponse {}
message ResumeAppRequest {
string app_id = 1;
// The directory of the app as a compressed tar archive (compressed using gzip)
bytes app_directory = 2;
UserState user_state = 3;
optional string initial_domain = 4;
string app_seed_base = 5;
}
message ResumeAppResponse {}
message IsSupportedAppRequest {
string app_id = 1;
bytes app_directory = 2;
UserState user_state = 3;
}
message IsSupportedAppResponse {
bool supported = 1;
}
// A parser/runtime plugin adds a custom parser for app files
// It may also contain a custom runtime for the app and just proxy to it
service RuntimePlugin {
rpc IsSupportedApp(IsSupportedAppRequest) returns (IsSupportedAppResponse) {}
rpc ParseApp(ParseAppRequest) returns (ParseAppResponse) {}
// Installs are also partially handled by n5i, but this lets the plugin know about it
// so it can also do something on its part if needed for the particular format
rpc InstallApp(InstallAppRequest) returns (InstallAppResponse) {}
rpc UninstallApp(UninstallAppRequest) returns (UninstallAppResponse) {}
rpc PauseApp(PauseAppRequest) returns (PauseAppResponse) {}
rpc ResumeApp(ResumeAppRequest) returns (ResumeAppResponse) {}
}