Skip to content

Commit c14e284

Browse files
authored
Merge pull request #22 from FyraStack/vmagent/networking
VM Agents: Networking
2 parents 67539a7 + 9b51599 commit c14e284

20 files changed

Lines changed: 1516 additions & 69 deletions

File tree

.github/workflows/build_x86.yml

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,31 @@ env:
1111

1212
jobs:
1313
build:
14-
1514
runs-on: ubuntu-latest
1615

1716
steps:
18-
- uses: actions/checkout@v4
19-
- uses: rui314/setup-mold@v1
20-
- name: Run sccache-cache
21-
uses: mozilla-actions/sccache-action@v0.0.9
22-
23-
- name: Build
24-
run: cargo build --verbose --release
25-
- name: Upload artifact - agent
26-
uses: actions/upload-artifact@v7
27-
with:
28-
archive: false
29-
name: odorobo-agent-x86
30-
path: |
31-
target/release/odorobo-agent
32-
33-
- name: Upload artifact - odoroboctl
34-
uses: actions/upload-artifact@v7
35-
with:
36-
archive: false
37-
name: odoroboctl-x86
38-
path: |
39-
target/release/odoroboctl
40-
41-
- name: Run tests
42-
run: cargo test --verbose
17+
- uses: actions/checkout@v4
18+
- uses: rui314/setup-mold@v1
19+
- name: Run sccache-cache
20+
uses: mozilla-actions/sccache-action@v0.0.9
21+
22+
- name: Build
23+
run: cargo build --verbose --release
24+
- name: Upload artifact - agent
25+
uses: actions/upload-artifact@v7
26+
with:
27+
archive: false
28+
name: odorobo-agent-x86
29+
path: |
30+
target/release/odorobo-agent
31+
32+
- name: Upload artifact - odoroboctl
33+
uses: actions/upload-artifact@v7
34+
with:
35+
archive: false
36+
name: odoroboctl-x86
37+
path: |
38+
target/release/odoroboctl
39+
40+
- name: Run tests
41+
run: cargo test --verbose

.github/workflows/clippy.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ on:
1313
push:
1414
pull_request:
1515
schedule:
16-
- cron: '39 6 * * 6'
17-
16+
- cron: "39 6 * * 6"
1817

1918
env:
2019
CARGO_TERM_COLOR: always
@@ -41,18 +40,15 @@ jobs:
4140
components: clippy
4241
override: true
4342

44-
4543
- uses: rui314/setup-mold@v1
4644
- name: Run sccache-cache
4745
uses: mozilla-actions/sccache-action@v0.0.9
4846

49-
5047
- name: Install required cargo
5148
run: cargo install clippy-sarif sarif-fmt
5249

5350
- name: Run rust-clippy
54-
run:
55-
cargo clippy
51+
run: cargo clippy
5652
--all-features
5753
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
5854
continue-on-error: true

Cargo.lock

Lines changed: 80 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ odoroboctl = { path = "odoroboctl" }
3232
odorobo-manager = { path = "odorobo-manager" }
3333
dotenvy = "0.15"
3434
clap = { version = "4", features = ["derive", "env"] }
35+
ipnet = {version = "2.12.0", features = ["serde", "schemars08"]}
3536
# these are for performance optimizations, based on https://nnethercote.github.io/perf-book/build-configuration.html#optimization-level
3637
# these options can take a while to compile (up to 5-10 minutes), so its really only necessary for production binaries.
3738
# also look in .cargo/config.toml for info on microarchitecture optimizations.

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ Odorobo Agent is meant to be run as a system agent on each bare-metal node (or a
2828
Build the Agent binary with `cargo build --release` and run it on the host machine. The Agent will listen for commands from the Gateway to create, manage, and delete VMs.
2929

3030
```bash
31+
# Install dependencies (fedora)
32+
sudo dnf in -y clang-devel nftables
33+
3134
# Build the Agent
3235
cargo build --release
3336
# Run the Agent (requires write permissions to /run/odorobo, and access to systemd's system session bus
@@ -62,14 +65,19 @@ Now apply the [Cloud Hypervisor VM spec](https://github.com/cloud-hypervisor/clo
6265
odoroboctl create my-vm --boot ./my-vm.json
6366
```
6467

65-
To connect directly on the host, look up the PTY path from the VM info:
68+
To connect directly on the host, connect to the VM's serial console socket in its runtime directory:
6669

6770
```bash
68-
odoroboctl info my-vm # find config.serial.file, e.g. /dev/pts/3
69-
screen /dev/pts/3
71+
sudo socat -,rawer UNIX-CONNECT:/run/odorobo/vms/01KPBBXKK0R0M09VN7G6R6R3JF/console.sock
72+
```
73+
74+
Replace the VM ID in the socket path with your VM's ID. The serial console socket is created at:
75+
76+
```text
77+
/run/odorobo/vms/<vmid>/console.sock
7078
```
7179

72-
See [docs/console.md](docs/console.md) for WebSocket console usage and integration details.
80+
See [docs/console.md](docs/console.md) for direct serial socket access, WebSocket console usage, and integration details.
7381

7482
For more advanced usage, Odorobo Agent also exposes a passthrough route for the local Cloud Hypervisor API, allowing you to call the full Cloud Hypervisor API directly through the agent's REST API
7583

0 commit comments

Comments
 (0)