Skip to content

Commit

Permalink
chore: rename actor to component a bunch
Browse files Browse the repository at this point in the history
Signed-off-by: Brooks Townsend <brooksmtownsend@gmail.com>
  • Loading branch information
brooksmtownsend committed Apr 8, 2024
1 parent a074467 commit a272e01
Show file tree
Hide file tree
Showing 49 changed files with 535 additions and 512 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ metadata:
spec:
components:
- name: echo
type: actor
type: component
properties:
image: wasmcloud.azurecr.io/echo:0.3.7
traits:
Expand Down Expand Up @@ -101,7 +101,7 @@ them. Try changing the manifest you created above by updating the number of echo
spec:
components:
- name: echo
type: actor
type: component
properties:
image: wasmcloud.azurecr.io/echo:0.3.5
traits:
Expand Down
24 changes: 12 additions & 12 deletions nottests/command_consumer_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ async fn test_consumer_stream() {

// Publish a whole bunch of commands to the stream
wrapper
.publish_command(ScaleActor {
actor_id: None,
.publish_command(ScaleComponent {
component_id: None,
reference: "foobar".to_string(),
host_id: "fakehost".to_string(),
count: 3,
Expand All @@ -34,7 +34,7 @@ async fn test_consumer_stream() {
.await;
wrapper
.publish_command(PutLinkdef {
actor_id: "foobar".to_string(),
component_id: "foobar".to_string(),
provider_id: "fakehost".to_string(),
contract_id: "wasmcloud:httpserver".to_string(),
model_name: "fake".into(),
Expand All @@ -44,7 +44,7 @@ async fn test_consumer_stream() {

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

wrapper
.publish_command(ScaleActor {
actor_id: Some("foobar".to_string()),
.publish_command(ScaleComponent {
component_id: Some("foobar".to_string()),
reference: "foobarref".to_string(),
host_id: "fakehost".to_string(),
count: 0,
Expand All @@ -109,9 +109,9 @@ async fn test_consumer_stream() {
.await;

let mut cmd = wrapper.wait_for_command().await;
if let Command::ScaleActor(actor) = cmd.as_ref() {
if let Command::ScaleComponent(actor) = cmd.as_ref() {
assert_eq!(
actor.actor_id,
actor.component_id,
Some("foobar".to_string()),
"Expected to get a valid stop actor command, got command: {:?}",
cmd.as_ref()
Expand All @@ -128,8 +128,8 @@ async fn test_nack_and_rereceive() {
let mut wrapper = StreamWrapper::new("nack_and_rereceive".into(), None).await;
// Send an event
wrapper
.publish_command(ScaleActor {
actor_id: None,
.publish_command(ScaleComponent {
component_id: None,
reference: "foobar".to_string(),
host_id: "fakehost".to_string(),
count: 3,
Expand All @@ -141,7 +141,7 @@ async fn test_nack_and_rereceive() {
// Get the event and then nack it
let mut cmd = wrapper.wait_for_command().await;
// Make sure we got the right event
if let Command::ScaleActor(actor) = cmd.as_ref() {
if let Command::ScaleComponent(actor) = cmd.as_ref() {
assert_eq!(
actor.reference,
"foobar",
Expand All @@ -154,7 +154,7 @@ async fn test_nack_and_rereceive() {

cmd.nack().await;
// Now do it again and make sure we get the same event
if let Command::ScaleActor(actor) = wrapper.wait_for_command().await.as_ref() {
if let Command::ScaleComponent(actor) = wrapper.wait_for_command().await.as_ref() {
assert_eq!(
actor.reference,
"foobar",
Expand Down
24 changes: 12 additions & 12 deletions nottests/command_worker_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ async fn test_commands() {

// Start an actor
wrapper
.publish_command(ScaleActor {
actor_id: Some(ECHO_ACTOR_ID.to_string()),
.publish_command(ScaleComponent {
component_id: Some(ECHO_ACTOR_ID.to_string()),
reference: "wasmcloud.azurecr.io/echo:0.3.4".to_string(),
host_id: host_id.clone(),
count: 2,
Expand Down Expand Up @@ -172,7 +172,7 @@ async fn test_commands() {
// Put a linkdef
wrapper
.publish_command(PutLinkdef {
actor_id: ECHO_ACTOR_ID.to_owned(),
component_id: ECHO_ACTOR_ID.to_owned(),
provider_id: HTTP_SERVER_PROVIDER_ID.to_owned(),
link_name: wadm::DEFAULT_LINK_NAME.to_owned(),
contract_id: "wasmcloud:httpserver".to_string(),
Expand All @@ -195,7 +195,7 @@ async fn test_commands() {
inventory
.into_iter()
.find(|ld| {
ld.actor_id == ECHO_ACTOR_ID
ld.component_id == ECHO_ACTOR_ID
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
&& ld.contract_id == "wasmcloud:httpserver"
})
Expand All @@ -204,7 +204,7 @@ async fn test_commands() {
// Delete the linkdef
wrapper
.publish_command(DeleteLinkdef {
actor_id: ECHO_ACTOR_ID.to_owned(),
component_id: ECHO_ACTOR_ID.to_owned(),
provider_id: HTTP_SERVER_PROVIDER_ID.to_owned(),
link_name: wadm::DEFAULT_LINK_NAME.to_owned(),
contract_id: "wasmcloud:httpserver".to_string(),
Expand All @@ -225,7 +225,7 @@ async fn test_commands() {
// We could have more than one link due to local testing, so search for the proper link
assert!(
!inventory.into_iter().any(|ld| {
ld.actor_id == ECHO_ACTOR_ID
ld.component_id == ECHO_ACTOR_ID
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
&& ld.contract_id == "wasmcloud:httpserver"
}),
Expand Down Expand Up @@ -262,8 +262,8 @@ async fn test_commands() {

// Stop the actor
wrapper
.publish_command(ScaleActor {
actor_id: Some(ECHO_ACTOR_ID.to_owned()),
.publish_command(ScaleComponent {
component_id: Some(ECHO_ACTOR_ID.to_owned()),
reference: "wasmcloud.azurecr.io/echo:0.3.4".to_string(),
count: 0,
host_id: host_id.clone(),
Expand Down Expand Up @@ -335,8 +335,8 @@ async fn test_annotation_stop() {

// Start an actor
wrapper
.publish_command(ScaleActor {
actor_id: Some(ECHO_ACTOR_ID.to_string()),
.publish_command(ScaleComponent {
component_id: Some(ECHO_ACTOR_ID.to_string()),
reference: "wasmcloud.azurecr.io/echo:0.3.4".to_string(),
host_id: host_id.clone(),
count: 2,
Expand Down Expand Up @@ -387,8 +387,8 @@ async fn test_annotation_stop() {

// Stop the managed actors
wrapper
.publish_command(ScaleActor {
actor_id: Some(ECHO_ACTOR_ID.to_owned()),
.publish_command(ScaleComponent {
component_id: Some(ECHO_ACTOR_ID.to_owned()),
reference: "wasmcloud.azurecr.io/echo:0.3.4".to_string(),
count: 0,
host_id: host_id.clone(),
Expand Down
23 changes: 14 additions & 9 deletions nottests/e2e_multitenant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> {
.map_err(|e| anyhow::anyhow!("{e:?}"))?;

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

if !links.iter().any(|ld| {
ld.actor_id == MESSAGE_PUB_ACTOR_ID
ld.component_id == MESSAGE_PUB_ACTOR_ID
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
&& ld.contract_id == "wasmcloud:httpserver"
}) {
Expand All @@ -217,7 +217,7 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> {
)
}
if !links.iter().any(|ld| {
ld.actor_id == MESSAGE_PUB_ACTOR_ID
ld.component_id == MESSAGE_PUB_ACTOR_ID
&& ld.provider_id == NATS_PROVIDER_ID
&& ld.contract_id == "wasmcloud:messaging"
}) {
Expand Down Expand Up @@ -247,7 +247,7 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> {
.map_err(|e| anyhow::anyhow!("{e:?}"))?;

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

if links.iter().any(|ld| {
ld.actor_id == MESSAGE_PUB_ACTOR_ID
ld.component_id == MESSAGE_PUB_ACTOR_ID
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
&& ld.contract_id == "wasmcloud:httpserver"
}) {
Expand All @@ -289,7 +289,7 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> {
)
}
if links.iter().any(|ld| {
ld.actor_id == MESSAGE_PUB_ACTOR_ID
ld.component_id == MESSAGE_PUB_ACTOR_ID
&& ld.provider_id == NATS_PROVIDER_ID
&& ld.contract_id == "wasmcloud:messaging"
}) {
Expand All @@ -302,9 +302,14 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> {
check_status(&stream, LATTICE_EAST, "echo-simple", StatusType::Deployed)
.await
.unwrap();
check_status(&stream, LATTICE_WEST, "messaging-simple", StatusType::Deployed)
.await
.unwrap();
check_status(
&stream,
LATTICE_WEST,
"messaging-simple",
StatusType::Deployed,
)
.await
.unwrap();

Ok(())
})
Expand Down
12 changes: 6 additions & 6 deletions nottests/e2e_upgrades.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ async fn test_upgrade(client_info: &ClientInfo) {
println!("Links: {:?}", links);

if !links.iter().any(|ld| {
ld.actor_id == ECHO_ACTOR_ID
ld.component_id == ECHO_ACTOR_ID
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
&& ld.contract_id == "wasmcloud:httpserver"
&& ld
Expand All @@ -165,7 +165,7 @@ async fn test_upgrade(client_info: &ClientInfo) {
}

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

if !links.iter().any(|ld| {
ld.actor_id == ECHO_ACTOR_ID
ld.component_id == ECHO_ACTOR_ID
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
&& ld.contract_id == "wasmcloud:httpserver"
&& ld
Expand All @@ -282,7 +282,7 @@ async fn test_upgrade(client_info: &ClientInfo) {
}

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

if !links.iter().any(|ld| {
ld.actor_id == ECHO_ACTOR_ID
ld.component_id == ECHO_ACTOR_ID
&& ld.provider_id == HTTP_SERVER_PROVIDER_ID
&& ld.contract_id == "wasmcloud:httpserver"
&& ld
Expand All @@ -394,7 +394,7 @@ async fn test_upgrade(client_info: &ClientInfo) {
}

if links.iter().any(|ld| {
ld.actor_id == KV_COUNTER_ACTOR_ID
ld.component_id == KV_COUNTER_ACTOR_ID
&& ld.provider_id == KV_REDIS_PROVIDER_ID
&& ld.contract_id == "wasmcloud:keyvalue"
}) {
Expand Down
8 changes: 4 additions & 4 deletions nottests/event_consumer_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ async fn test_event_stream() -> Result<()> {
let mut evt = wait_for_event(&mut stream, LINK_OPERATION_TIMEOUT_DURATION).await;
if let Event::LinkdefSet(link) = evt.as_ref() {
assert_eq!(
link.linkdef.actor_id, ECHO_ACTOR_ID,
link.linkdef.component_id, ECHO_ACTOR_ID,
"Expected to get a linkdef event for the right actor and provider, got actor ID: {}",
link.linkdef.actor_id,
link.linkdef.component_id,
);
assert_eq!(
link.linkdef.provider_id, HTTP_SERVER_PROVIDER_ID,
Expand Down Expand Up @@ -178,9 +178,9 @@ async fn test_event_stream() -> Result<()> {
let mut evt = wait_for_event(&mut stream, LINK_OPERATION_TIMEOUT_DURATION).await;
if let Event::LinkdefDeleted(link) = evt.as_ref() {
assert_eq!(
link.linkdef.actor_id, ECHO_ACTOR_ID,
link.linkdef.component_id, ECHO_ACTOR_ID,
"Expected to get a linkdef event for the right actor and provider, got actor ID: {}",
link.linkdef.actor_id,
link.linkdef.component_id,
);
assert_eq!(
link.linkdef.provider_id, HTTP_SERVER_PROVIDER_ID,
Expand Down
2 changes: 1 addition & 1 deletion oam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ metadata:
spec:
components:
- name: userinfo
type: actor
type: component
properties:
image: wasmcloud.azurecr.io/fake:1
traits:
Expand Down
2 changes: 1 addition & 1 deletion oam/custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
spec:
components:
- name: userinfo
type: actor
type: component
properties:
image: wasmcloud.azurecr.io/fake:1
traits:
Expand Down
2 changes: 1 addition & 1 deletion oam/echo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
spec:
components:
- name: echo
type: actor
type: component
properties:
image: wasmcloud.azurecr.io/echo:0.3.7
traits:
Expand Down
2 changes: 1 addition & 1 deletion oam/kvcounter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
spec:
components:
- name: kvcounter
type: actor
type: component
properties:
image: file:///Users/brooks/github.com/wasmcloud/wadm/kvc/build/http_hello_world_s.wasm
traits:
Expand Down
2 changes: 1 addition & 1 deletion oam/kvcounter_old.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
spec:
components:
- name: kvcounter
type: actor
type: component
properties:
image: file://./build/http_hello_world_s.wasm
traits:
Expand Down

0 comments on commit a272e01

Please sign in to comment.