Skip to content

Commit

Permalink
Merge pull request #32 from golemcloud/plugin1
Browse files Browse the repository at this point in the history
Added plugin-related information to the oplog entries
  • Loading branch information
vigoo authored Nov 26, 2024
2 parents 0f7596f + b377c91 commit 8f3839e
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions wit/deps/golem-1.1/golem-oplog-1.1.wit
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface oplog {
use wasi:clocks/wall-clock@0.2.0.{datetime};
use golem:rpc/types@0.1.0.{wit-value};

use host.{account-id, component-version, oplog-index, retry-policy, worker-id};
use host.{account-id, component-version, oplog-index, retry-policy, uuid, worker-id};

variant wrapped-function-type {
/// The side-effect reads from the worker's local state (for example local file system,
Expand All @@ -27,6 +27,13 @@ interface oplog {
write-remote-batched(option<oplog-index>)
}

record plugin-installation-description {
installation-id: uuid,
name: string,
version: string,
parameters: list<tuple<string, string>>
}

record create-parameters {
timestamp: datetime,
worker-id: worker-id,
Expand All @@ -36,7 +43,8 @@ interface oplog {
account-id: account-id,
parent: option<worker-id>,
component-size: u64,
initial-total-linear-memory-size: u64
initial-total-linear-memory-size: u64,
initial-active-plugins: list<plugin-installation-description>
}

record imported-function-invoked-parameters {
Expand Down Expand Up @@ -118,7 +126,8 @@ interface oplog {
record successful-update-parameters {
timestamp: datetime,
target-version: component-version,
new-component-size: u64
new-component-size: u64,
new-active-plugins: list<plugin-installation-description>
}

record failed-update-parameters {
Expand Down Expand Up @@ -169,6 +178,16 @@ interface oplog {
message: string
}

record activate-plugin-parameters {
timestamp: datetime,
plugin: plugin-installation-description
}

record deactivate-plugin-parameters {
timestamp: datetime,
plugin: plugin-installation-description
}

variant oplog-entry {
/// The initial worker oplog entry
create(create-parameters),
Expand Down Expand Up @@ -229,7 +248,11 @@ interface oplog {
/// The worker emitted a log message
log(log-parameters),
/// The worker's has been restarted, forgetting all its history
restart(datetime)
restart(datetime),
/// Activates a plugin
activate-plugin(activate-plugin-parameters),
/// Deactivates a plugin
deactivate-plugin(deactivate-plugin-parameters)
}

resource get-oplog {
Expand Down

0 comments on commit 8f3839e

Please sign in to comment.