Skip to content

Commit b6febbb

Browse files
feat(model): rename actor type to component
Signed-off-by: Brooks Townsend <brooksmtownsend@gmail.com>
1 parent f9558af commit b6febbb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+529
-496
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ metadata:
4646
spec:
4747
components:
4848
- name: echo
49-
type: actor
49+
type: component
5050
properties:
5151
image: wasmcloud.azurecr.io/echo:0.3.7
5252
traits:
@@ -101,7 +101,7 @@ them. Try changing the manifest you created above by updating the number of echo
101101
spec:
102102
components:
103103
- name: echo
104-
type: actor
104+
type: component
105105
properties:
106106
image: wasmcloud.azurecr.io/echo:0.3.5
107107
traits:

nottests/command_consumer_integration.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ async fn test_consumer_stream() {
1515

1616
// Publish a whole bunch of commands to the stream
1717
wrapper
18-
.publish_command(ScaleActor {
19-
actor_id: None,
18+
.publish_command(ScaleComponent {
19+
component_id: None,
2020
reference: "foobar".to_string(),
2121
host_id: "fakehost".to_string(),
2222
count: 3,
@@ -34,7 +34,7 @@ async fn test_consumer_stream() {
3434
.await;
3535
wrapper
3636
.publish_command(PutLinkdef {
37-
actor_id: "foobar".to_string(),
37+
component_id: "foobar".to_string(),
3838
provider_id: "fakehost".to_string(),
3939
contract_id: "wasmcloud:httpserver".to_string(),
4040
model_name: "fake".into(),
@@ -44,7 +44,7 @@ async fn test_consumer_stream() {
4444

4545
// Make sure we get the right data back, in the right order
4646
let mut cmd = wrapper.wait_for_command().await;
47-
if let Command::ScaleActor(actor) = cmd.as_ref() {
47+
if let Command::ScaleComponent(actor) = cmd.as_ref() {
4848
assert_eq!(
4949
actor.reference,
5050
"foobar",
@@ -98,8 +98,8 @@ async fn test_consumer_stream() {
9898
.expect("Should be able to publish data");
9999

100100
wrapper
101-
.publish_command(ScaleActor {
102-
actor_id: Some("foobar".to_string()),
101+
.publish_command(ScaleComponent {
102+
component_id: Some("foobar".to_string()),
103103
reference: "foobarref".to_string(),
104104
host_id: "fakehost".to_string(),
105105
count: 0,
@@ -109,9 +109,9 @@ async fn test_consumer_stream() {
109109
.await;
110110

111111
let mut cmd = wrapper.wait_for_command().await;
112-
if let Command::ScaleActor(actor) = cmd.as_ref() {
112+
if let Command::ScaleComponent(actor) = cmd.as_ref() {
113113
assert_eq!(
114-
actor.actor_id,
114+
actor.component_id,
115115
Some("foobar".to_string()),
116116
"Expected to get a valid stop actor command, got command: {:?}",
117117
cmd.as_ref()
@@ -128,8 +128,8 @@ async fn test_nack_and_rereceive() {
128128
let mut wrapper = StreamWrapper::new("nack_and_rereceive".into(), None).await;
129129
// Send an event
130130
wrapper
131-
.publish_command(ScaleActor {
132-
actor_id: None,
131+
.publish_command(ScaleComponent {
132+
component_id: None,
133133
reference: "foobar".to_string(),
134134
host_id: "fakehost".to_string(),
135135
count: 3,
@@ -141,7 +141,7 @@ async fn test_nack_and_rereceive() {
141141
// Get the event and then nack it
142142
let mut cmd = wrapper.wait_for_command().await;
143143
// Make sure we got the right event
144-
if let Command::ScaleActor(actor) = cmd.as_ref() {
144+
if let Command::ScaleComponent(actor) = cmd.as_ref() {
145145
assert_eq!(
146146
actor.reference,
147147
"foobar",
@@ -154,7 +154,7 @@ async fn test_nack_and_rereceive() {
154154

155155
cmd.nack().await;
156156
// Now do it again and make sure we get the same event
157-
if let Command::ScaleActor(actor) = wrapper.wait_for_command().await.as_ref() {
157+
if let Command::ScaleComponent(actor) = wrapper.wait_for_command().await.as_ref() {
158158
assert_eq!(
159159
actor.reference,
160160
"foobar",

nottests/command_worker_integration.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ async fn test_commands() {
4343

4444
// Start an actor
4545
wrapper
46-
.publish_command(ScaleActor {
47-
actor_id: Some(ECHO_ACTOR_ID.to_string()),
46+
.publish_command(ScaleComponent {
47+
component_id: Some(ECHO_ACTOR_ID.to_string()),
4848
reference: "wasmcloud.azurecr.io/echo:0.3.4".to_string(),
4949
host_id: host_id.clone(),
5050
count: 2,
@@ -172,7 +172,7 @@ async fn test_commands() {
172172
// Put a linkdef
173173
wrapper
174174
.publish_command(PutLinkdef {
175-
actor_id: ECHO_ACTOR_ID.to_owned(),
175+
component_id: ECHO_ACTOR_ID.to_owned(),
176176
provider_id: HTTP_SERVER_PROVIDER_ID.to_owned(),
177177
link_name: wadm::DEFAULT_LINK_NAME.to_owned(),
178178
contract_id: "wasmcloud:httpserver".to_string(),
@@ -195,7 +195,7 @@ async fn test_commands() {
195195
inventory
196196
.into_iter()
197197
.find(|ld| {
198-
ld.actor_id == ECHO_ACTOR_ID
198+
ld.component_id == ECHO_ACTOR_ID
199199
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
200200
&& ld.contract_id == "wasmcloud:httpserver"
201201
})
@@ -204,7 +204,7 @@ async fn test_commands() {
204204
// Delete the linkdef
205205
wrapper
206206
.publish_command(DeleteLinkdef {
207-
actor_id: ECHO_ACTOR_ID.to_owned(),
207+
component_id: ECHO_ACTOR_ID.to_owned(),
208208
provider_id: HTTP_SERVER_PROVIDER_ID.to_owned(),
209209
link_name: wadm::DEFAULT_LINK_NAME.to_owned(),
210210
contract_id: "wasmcloud:httpserver".to_string(),
@@ -225,7 +225,7 @@ async fn test_commands() {
225225
// We could have more than one link due to local testing, so search for the proper link
226226
assert!(
227227
!inventory.into_iter().any(|ld| {
228-
ld.actor_id == ECHO_ACTOR_ID
228+
ld.component_id == ECHO_ACTOR_ID
229229
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
230230
&& ld.contract_id == "wasmcloud:httpserver"
231231
}),
@@ -262,8 +262,8 @@ async fn test_commands() {
262262

263263
// Stop the actor
264264
wrapper
265-
.publish_command(ScaleActor {
266-
actor_id: Some(ECHO_ACTOR_ID.to_owned()),
265+
.publish_command(ScaleComponent {
266+
component_id: Some(ECHO_ACTOR_ID.to_owned()),
267267
reference: "wasmcloud.azurecr.io/echo:0.3.4".to_string(),
268268
count: 0,
269269
host_id: host_id.clone(),
@@ -335,8 +335,8 @@ async fn test_annotation_stop() {
335335

336336
// Start an actor
337337
wrapper
338-
.publish_command(ScaleActor {
339-
actor_id: Some(ECHO_ACTOR_ID.to_string()),
338+
.publish_command(ScaleComponent {
339+
component_id: Some(ECHO_ACTOR_ID.to_string()),
340340
reference: "wasmcloud.azurecr.io/echo:0.3.4".to_string(),
341341
host_id: host_id.clone(),
342342
count: 2,
@@ -387,8 +387,8 @@ async fn test_annotation_stop() {
387387

388388
// Stop the managed actors
389389
wrapper
390-
.publish_command(ScaleActor {
391-
actor_id: Some(ECHO_ACTOR_ID.to_owned()),
390+
.publish_command(ScaleComponent {
391+
component_id: Some(ECHO_ACTOR_ID.to_owned()),
392392
reference: "wasmcloud.azurecr.io/echo:0.3.4".to_string(),
393393
count: 0,
394394
host_id: host_id.clone(),

nottests/e2e_multitenant.rs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> {
172172
.map_err(|e| anyhow::anyhow!("{e:?}"))?;
173173

174174
if !links.iter().any(|ld| {
175-
ld.actor_id == ECHO_ACTOR_ID
175+
ld.component_id == ECHO_ACTOR_ID
176176
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
177177
&& ld.contract_id == "wasmcloud:httpserver"
178178
}) {
@@ -207,7 +207,7 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> {
207207
.map_err(|e| anyhow::anyhow!("{e:?}"))?;
208208

209209
if !links.iter().any(|ld| {
210-
ld.actor_id == MESSAGE_PUB_ACTOR_ID
210+
ld.component_id == MESSAGE_PUB_ACTOR_ID
211211
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
212212
&& ld.contract_id == "wasmcloud:httpserver"
213213
}) {
@@ -217,7 +217,7 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> {
217217
)
218218
}
219219
if !links.iter().any(|ld| {
220-
ld.actor_id == MESSAGE_PUB_ACTOR_ID
220+
ld.component_id == MESSAGE_PUB_ACTOR_ID
221221
&& ld.provider_id == NATS_PROVIDER_ID
222222
&& ld.contract_id == "wasmcloud:messaging"
223223
}) {
@@ -247,7 +247,7 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> {
247247
.map_err(|e| anyhow::anyhow!("{e:?}"))?;
248248

249249
if links.iter().any(|ld| {
250-
ld.actor_id == ECHO_ACTOR_ID
250+
ld.component_id == ECHO_ACTOR_ID
251251
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
252252
&& ld.contract_id == "wasmcloud:httpserver"
253253
}) {
@@ -279,7 +279,7 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> {
279279
.map_err(|e| anyhow::anyhow!("{e:?}"))?;
280280

281281
if links.iter().any(|ld| {
282-
ld.actor_id == MESSAGE_PUB_ACTOR_ID
282+
ld.component_id == MESSAGE_PUB_ACTOR_ID
283283
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
284284
&& ld.contract_id == "wasmcloud:httpserver"
285285
}) {
@@ -289,7 +289,7 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> {
289289
)
290290
}
291291
if links.iter().any(|ld| {
292-
ld.actor_id == MESSAGE_PUB_ACTOR_ID
292+
ld.component_id == MESSAGE_PUB_ACTOR_ID
293293
&& ld.provider_id == NATS_PROVIDER_ID
294294
&& ld.contract_id == "wasmcloud:messaging"
295295
}) {
@@ -302,9 +302,14 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> {
302302
check_status(&stream, LATTICE_EAST, "echo-simple", StatusType::Deployed)
303303
.await
304304
.unwrap();
305-
check_status(&stream, LATTICE_WEST, "messaging-simple", StatusType::Deployed)
306-
.await
307-
.unwrap();
305+
check_status(
306+
&stream,
307+
LATTICE_WEST,
308+
"messaging-simple",
309+
StatusType::Deployed,
310+
)
311+
.await
312+
.unwrap();
308313

309314
Ok(())
310315
})

nottests/e2e_upgrades.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ async fn test_upgrade(client_info: &ClientInfo) {
149149
println!("Links: {:?}", links);
150150

151151
if !links.iter().any(|ld| {
152-
ld.actor_id == ECHO_ACTOR_ID
152+
ld.component_id == ECHO_ACTOR_ID
153153
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
154154
&& ld.contract_id == "wasmcloud:httpserver"
155155
&& ld
@@ -165,7 +165,7 @@ async fn test_upgrade(client_info: &ClientInfo) {
165165
}
166166

167167
if !links.iter().any(|ld| {
168-
ld.actor_id == KV_COUNTER_ACTOR_ID
168+
ld.component_id == KV_COUNTER_ACTOR_ID
169169
&& ld.provider_id == KV_REDIS_PROVIDER_ID
170170
&& ld.contract_id == "wasmcloud:keyvalue"
171171
&& ld
@@ -266,7 +266,7 @@ async fn test_upgrade(client_info: &ClientInfo) {
266266
.map_err(|e| anyhow::anyhow!("{e:?}"))?;
267267

268268
if !links.iter().any(|ld| {
269-
ld.actor_id == ECHO_ACTOR_ID
269+
ld.component_id == ECHO_ACTOR_ID
270270
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
271271
&& ld.contract_id == "wasmcloud:httpserver"
272272
&& ld
@@ -282,7 +282,7 @@ async fn test_upgrade(client_info: &ClientInfo) {
282282
}
283283

284284
if links.iter().any(|ld| {
285-
ld.actor_id == KV_COUNTER_ACTOR_ID
285+
ld.component_id == KV_COUNTER_ACTOR_ID
286286
&& ld.provider_id == KV_REDIS_PROVIDER_ID
287287
&& ld.contract_id == "wasmcloud:keyvalue"
288288
}) {
@@ -378,7 +378,7 @@ async fn test_upgrade(client_info: &ClientInfo) {
378378
.map_err(|e| anyhow::anyhow!("{e:?}"))?;
379379

380380
if !links.iter().any(|ld| {
381-
ld.actor_id == ECHO_ACTOR_ID
381+
ld.component_id == ECHO_ACTOR_ID
382382
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
383383
&& ld.contract_id == "wasmcloud:httpserver"
384384
&& ld
@@ -394,7 +394,7 @@ async fn test_upgrade(client_info: &ClientInfo) {
394394
}
395395

396396
if links.iter().any(|ld| {
397-
ld.actor_id == KV_COUNTER_ACTOR_ID
397+
ld.component_id == KV_COUNTER_ACTOR_ID
398398
&& ld.provider_id == KV_REDIS_PROVIDER_ID
399399
&& ld.contract_id == "wasmcloud:keyvalue"
400400
}) {

nottests/event_consumer_integration.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ async fn test_event_stream() -> Result<()> {
146146
let mut evt = wait_for_event(&mut stream, LINK_OPERATION_TIMEOUT_DURATION).await;
147147
if let Event::LinkdefSet(link) = evt.as_ref() {
148148
assert_eq!(
149-
link.linkdef.actor_id, ECHO_ACTOR_ID,
149+
link.linkdef.component_id, ECHO_ACTOR_ID,
150150
"Expected to get a linkdef event for the right actor and provider, got actor ID: {}",
151-
link.linkdef.actor_id,
151+
link.linkdef.component_id,
152152
);
153153
assert_eq!(
154154
link.linkdef.provider_id, HTTP_SERVER_PROVIDER_ID,
@@ -178,9 +178,9 @@ async fn test_event_stream() -> Result<()> {
178178
let mut evt = wait_for_event(&mut stream, LINK_OPERATION_TIMEOUT_DURATION).await;
179179
if let Event::LinkdefDeleted(link) = evt.as_ref() {
180180
assert_eq!(
181-
link.linkdef.actor_id, ECHO_ACTOR_ID,
181+
link.linkdef.component_id, ECHO_ACTOR_ID,
182182
"Expected to get a linkdef event for the right actor and provider, got actor ID: {}",
183-
link.linkdef.actor_id,
183+
link.linkdef.component_id,
184184
);
185185
assert_eq!(
186186
link.linkdef.provider_id, HTTP_SERVER_PROVIDER_ID,

oam/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ metadata:
3131
spec:
3232
components:
3333
- name: userinfo
34-
type: actor
34+
type: component
3535
properties:
3636
image: wasmcloud.azurecr.io/fake:1
3737
traits:

oam/custom.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
spec:
99
components:
1010
- name: userinfo
11-
type: actor
11+
type: component
1212
properties:
1313
image: wasmcloud.azurecr.io/fake:1
1414
traits:

oam/echo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
spec:
99
components:
1010
- name: echo
11-
type: actor
11+
type: component
1212
properties:
1313
image: wasmcloud.azurecr.io/echo:0.3.7
1414
traits:

oam/kvcounter.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
spec:
99
components:
1010
- name: kvcounter
11-
type: actor
11+
type: component
1212
properties:
1313
image: file:///Users/brooks/github.com/wasmcloud/wadm/kvc/build/http_hello_world_s.wasm
1414
traits:

oam/kvcounter_old.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
spec:
1010
components:
1111
- name: kvcounter
12-
type: actor
12+
type: component
1313
properties:
1414
image: file://./build/http_hello_world_s.wasm
1515
traits:

0 commit comments

Comments
 (0)