-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from Dstack-TEE/teepod-vsock
teepod: Listening host api on VSOCK
- Loading branch information
Showing
48 changed files
with
1,509 additions
and
337 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
tdxctl notify-host -e "boot.progress" -d "pulling images" || true | ||
if ! docker compose pull; then | ||
tdxctl notify-host -e "boot.error" -d "failed to pull images" | ||
exit 1 | ||
fi | ||
|
||
tdxctl notify-host -e "boot.progress" -d "starting containers" || true | ||
if ! docker compose up -d; then | ||
tdxctl notify-host -e "boot.error" -d "failed to start containers" | ||
exit 1 | ||
fi | ||
|
||
tdxctl notify-host -e "boot.progress" -d "containers started" || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[package] | ||
name = "host-api" | ||
version.workspace = true | ||
authors.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
|
||
[dependencies] | ||
prpc.workspace = true | ||
prost.workspace = true | ||
serde = { workspace = true, features = ["derive"] } | ||
serde_json.workspace = true | ||
anyhow.workspace = true | ||
http-client = { workspace = true, optional = true, features = ["prpc"] } | ||
|
||
[build-dependencies] | ||
prpc-build.workspace = true | ||
|
||
[features] | ||
default = ["client"] | ||
client = ["dep:http-client"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
fn main() { | ||
prpc_build::configure() | ||
.out_dir("./src/generated") | ||
.mod_prefix("super::") | ||
.build_scale_ext(false) | ||
.disable_service_name_emission() | ||
.disable_package_emission() | ||
.enable_serde_extension() | ||
.compile_dir("./proto") | ||
.expect("failed to compile proto files"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
syntax = "proto3"; | ||
|
||
import "google/protobuf/empty.proto"; | ||
|
||
package host_api; | ||
|
||
message HostInfo { | ||
string name = 1; | ||
string version = 2; | ||
} | ||
|
||
message Notification { | ||
string event = 1; | ||
string payload = 2; | ||
} | ||
|
||
service HostApi { | ||
rpc Info(google.protobuf.Empty) returns (HostInfo); | ||
rpc Notify(Notification) returns (google.protobuf.Empty); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
use crate::host_api_client::HostApiClient; | ||
use http_client::prpc::PrpcClient; | ||
|
||
pub type DefaultClient = HostApiClient<PrpcClient>; | ||
|
||
pub fn new_client(base_url: String) -> DefaultClient { | ||
DefaultClient::new(PrpcClient::new(base_url)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pub use host_api::*; | ||
|
||
#[allow(async_fn_in_trait)] | ||
mod host_api; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
extern crate alloc; | ||
|
||
pub use generated::*; | ||
|
||
mod generated; | ||
|
||
#[cfg(feature = "client")] | ||
pub mod client; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[package] | ||
name = "http-client" | ||
version.workspace = true | ||
authors.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
|
||
[dependencies] | ||
anyhow.workspace = true | ||
http-body-util.workspace = true | ||
hyper.workspace = true | ||
hyper-util.workspace = true | ||
hyperlocal.workspace = true | ||
log.workspace = true | ||
pin-project-lite = "0.2.15" | ||
prpc = { workspace = true, optional = true } | ||
tokio.workspace = true | ||
tokio-vsock.workspace = true | ||
tower-service = "0.3.3" | ||
|
||
[dev-dependencies] | ||
tokio = { workspace = true, features = ["full"] } | ||
|
||
[features] | ||
default = ["prpc"] | ||
prpc = ["dep:prpc"] |
Oops, something went wrong.