Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable updating host labels via the control interface #780

Merged
merged 3 commits into from Nov 28, 2023

Conversation

connorsmith256
Copy link
Contributor

@connorsmith256 connorsmith256 commented Oct 22, 2023

Feature or Problem

This adds two new topics to the host's control interface: wasmbus.ctl.{lattice_id}.labels.{host_id}.{put/del}. Publishing on these topics allows users to dynamically adjust the target host's labels

Related Issues

Relates to #692

Release Information

Minor bump to the control interface crate as well as the host. Functionality via wash to be added after both of the former are released

Consumer Impact

This is a potentially a step in the direction of enabling lame-duck mode on the host (we could use a special label to convey that intent)

Testing

Unit Test(s)

Acceptance or Integration

I exercised put and delete via the wasmbus tests

Manual Verification

wash get hosts -o json | jq -r '.hosts | .[] | .labels'
{
  "hostcore.arch": "aarch64",
  "hostcore.os": "macos",
  "hostcore.osfamily": "unix"
}

nats req wasmbus.ctl.default.labels.NARZ43WTEW56DC3Q42FXIND2WJV5TFVTBYJBJ2T42S5OB2AHIPITDDWW.put '{"label": "foo", "value": "bar"}'

18:31:08 Sending request on "wasmbus.ctl.default.labels.NARZ43WTEW56DC3Q42FXIND2WJV5TFVTBYJBJ2T42S5OB2AHIPITDDWW.put"
18:31:08 Received with rtt 501.459µs
{"accepted":true,"error":""}

wash get hosts -o json | jq -r '.hosts | .[] | .labels'
{
  "foo": "bar",
  "hostcore.arch": "aarch64",
  "hostcore.os": "macos",
  "hostcore.osfamily": "unix"
}

nats req wasmbus.ctl.default.labels.NARZ43WTEW56DC3Q42FXIND2WJV5TFVTBYJBJ2T42S5OB2AHIPITDDWW.del '{"label": "foo"}'

18:31:20 Sending request on "wasmbus.ctl.default.labels.NARZ43WTEW56DC3Q42FXIND2WJV5TFVTBYJBJ2T42S5OB2AHIPITDDWW.del"
18:31:20 Received with rtt 551.917µs
{"accepted":true,"error":""}

wash get hosts -o json | jq -r '.hosts | .[] | .labels'
{
  "hostcore.arch": "aarch64",
  "hostcore.os": "macos",
  "hostcore.osfamily": "unix"
}

rvolosatovs pushed a commit to rvolosatovs/wasmCloud that referenced this pull request Oct 23, 2023
…no-0.4.30

build(deps): Bump chrono from 0.4.29 to 0.4.30
Signed-off-by: Connor Smith <connor.smith.256@gmail.com>
@connorsmith256 connorsmith256 marked this pull request as ready for review November 24, 2023 22:51
@connorsmith256 connorsmith256 requested review from a team as code owners November 24, 2023 22:51
Signed-off-by: Connor Smith <connor.smith.256@gmail.com>
Copy link
Member

@brooksmtownsend brooksmtownsend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with this, and I think the topics fit into our current structure. We may want to change them when we audit the control interface topics but that's okay

crates/control-interface/src/types.rs Outdated Show resolved Hide resolved
Signed-off-by: Connor Smith <connor.smith.256@gmail.com>
Copy link
Contributor

@vados-cosmonic vados-cosmonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@connorsmith256 connorsmith256 merged commit bdb72ee into wasmCloud:main Nov 28, 2023
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants