Skip to content

Commit

Permalink
Merge oak_containers_orchestrator_client into o_c_c (#4603)
Browse files Browse the repository at this point in the history
Ref #4531
  • Loading branch information
jblebrun authored Jan 4, 2024
1 parent 3841fab commit 13f97d6
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 128 deletions.
21 changes: 2 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ members = [
"oak_containers_hello_world_untrusted_app",
"oak_containers_launcher",
"oak_containers_orchestrator",
"oak_containers_orchestrator_client",
"oak_containers_stage1",
"oak_containers_syslogd",
"oak_core",
Expand Down Expand Up @@ -82,7 +81,7 @@ micro_rpc_build = { path = "./micro_rpc_build" }
oak_attestation_verification = { path = "./oak_attestation_verification" }
oak_channel = { path = "./oak_channel" }
oak_client = { path = "./oak_client" }
oak_containers_orchestrator_client = { path = "./oak_containers_orchestrator_client" }
oak_containers_orchestrator = { path = "./oak_containers_orchestrator" }
oak_containers_launcher = { path = "./oak_containers_launcher" }
oak_core = { path = "./oak_core" }
oak_crypto = { path = "./oak_crypto" }
Expand Down
1 change: 0 additions & 1 deletion oak_containers_orchestrator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ hpke = { version = "*", default-features = false, features = [
] }
log = "*"
nix = "*"
oak_containers_orchestrator_client = { workspace = true }
oak_crypto = { workspace = true }
oak_dice = { workspace = true }
oak_remote_attestation = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions oak_containers_orchestrator/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
generate_grpc_code(
"../",
&[
"oak_remote_attestation/proto/v1/messages.proto",
"oak_containers/proto/interfaces.proto",
"proto/key_provisioning/key_provisioning.proto",
"proto/containers/orchestrator_crypto.proto",
"proto/containers/hostlib_key_provisioning.proto",
],
CodegenOptions {
build_server: true,
build_client: true,
..Default::default()
},
)?;
Expand Down
10 changes: 6 additions & 4 deletions oak_containers_orchestrator/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use crate::proto::oak::containers::v1::{
orchestrator_crypto_server::OrchestratorCrypto, DeriveSessionKeysRequest,
DeriveSessionKeysResponse, KeyOrigin,
use crate::proto::oak::{
containers::v1::{
orchestrator_crypto_server::OrchestratorCrypto, DeriveSessionKeysRequest,
DeriveSessionKeysResponse, KeyOrigin,
},
key_provisioning::v1::GroupKeys,
};
use anyhow::{anyhow, Context};
use hpke::{kem::X25519HkdfSha256, Deserializable, Kem};
use oak_containers_orchestrator_client::proto::oak::key_provisioning::v1::GroupKeys;
use oak_crypto::encryptor::{EncryptionKeyProvider, RecipientContextGenerator, ServerEncryptor};
use std::sync::Arc;
use tonic::{Request, Response};
Expand Down
2 changes: 1 addition & 1 deletion oak_containers_orchestrator/src/ipc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

use crate::{
crypto::{CryptoService, KeyStore},
launcher_client::LauncherClient,
proto::oak::containers::{
orchestrator_server::{Orchestrator, OrchestratorServer},
v1::orchestrator_crypto_server::OrchestratorCryptoServer,
GetApplicationConfigResponse, GetCryptoContextRequest, GetCryptoContextResponse,
},
};
use anyhow::Context;
use oak_containers_orchestrator_client::LauncherClient;
use oak_crypto::encryptor::{EncryptionKeyProvider, RecipientContextGenerator};
use std::{fs::Permissions, os::unix::prelude::PermissionsExt, sync::Arc};
use tokio::{fs::set_permissions, net::UnixListener};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

pub mod proto {
pub mod oak {
pub mod containers {
#![allow(clippy::return_self_not_must_use)]
tonic::include_proto!("oak.containers");
pub mod v1 {
#![allow(clippy::return_self_not_must_use)]
tonic::include_proto!("oak.containers.v1");
}
}
pub use oak_crypto::proto::oak::crypto;
pub use oak_remote_attestation::proto::oak::{attestation, session};
pub mod key_provisioning {
pub mod v1 {
#![allow(clippy::return_self_not_must_use)]
tonic::include_proto!("oak.key_provisioning.v1");
}
}
}
}

use self::proto::oak::{
use crate::proto::oak::{
attestation::v1::Evidence,
containers::{
launcher_client::LauncherClient as GrpcLauncherClient,
Expand Down
3 changes: 2 additions & 1 deletion oak_containers_orchestrator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

mod proto {
pub mod proto {
pub mod oak {
pub mod containers {
#![allow(clippy::return_self_not_must_use)]
Expand All @@ -39,5 +39,6 @@ pub mod crypto;
pub mod dice;
pub mod ipc_server;
pub mod key_provisioning;
pub mod launcher_client;
pub mod logging;
pub mod metrics;
6 changes: 3 additions & 3 deletions oak_containers_orchestrator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

use anyhow::{anyhow, Context};
use clap::Parser;
use oak_containers_orchestrator::crypto::InstanceKeyStore;
use oak_containers_orchestrator_client::{
proto::oak::containers::v1::KeyProvisioningRole, LauncherClient,
use oak_containers_orchestrator::{
crypto::InstanceKeyStore, launcher_client::LauncherClient,
proto::oak::containers::v1::KeyProvisioningRole,
};
use oak_dice::cert::generate_ecdsa_key_pair;
use oak_remote_attestation::attester::{Attester, EmptyAttestationReportGenerator};
Expand Down
2 changes: 1 addition & 1 deletion oak_containers_orchestrator/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
// limitations under the License.
//

use crate::launcher_client::LauncherClient;
use anyhow::Result;
use oak_containers_orchestrator_client::LauncherClient;
use opentelemetry_api::{
metrics::{AsyncInstrument, Meter, MeterProvider, ObservableCounter, ObservableGauge, Unit},
KeyValue,
Expand Down
24 changes: 0 additions & 24 deletions oak_containers_orchestrator_client/Cargo.toml

This file was deleted.

10 changes: 0 additions & 10 deletions oak_containers_orchestrator_client/README.md

This file was deleted.

35 changes: 0 additions & 35 deletions oak_containers_orchestrator_client/build.rs

This file was deleted.

2 changes: 1 addition & 1 deletion oak_containers_syslogd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "Apache-2.0"
anyhow = "*"
bitflags = "*"
clap = { version = "*", features = ["derive"] }
oak_containers_orchestrator_client = { workspace = true }
oak_containers_orchestrator = { workspace = true }
opentelemetry_api = { version = "*", default-features = false, features = [
"logs"
] }
Expand Down
2 changes: 1 addition & 1 deletion oak_containers_syslogd/src/log_relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use crate::systemd_journal::{Journal, JournalOpenFlags};
use anyhow::{Context, Result};
use oak_containers_orchestrator_client::LauncherClient;
use oak_containers_orchestrator::launcher_client::LauncherClient;
use opentelemetry_api::logs::{AnyValue, LogRecord, Logger, Severity};
use std::{
sync::Arc,
Expand Down
2 changes: 1 addition & 1 deletion oak_containers_syslogd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mod systemd_journal;

use anyhow::anyhow;
use clap::Parser;
use oak_containers_orchestrator_client::LauncherClient;
use oak_containers_orchestrator::launcher_client::LauncherClient;
use opentelemetry_api::global::set_error_handler;
use signal_hook::consts::signal::SIGTERM;
use signal_hook_tokio::Signals;
Expand Down
2 changes: 1 addition & 1 deletion oak_functions_containers_app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ anyhow = "*"
async-trait = { version = "*", default-features = false }
clap = { version = "*", features = ["derive"] }
http = "*"
oak_containers_orchestrator_client = { workspace = true }
oak_containers_orchestrator = { workspace = true }
oak_functions_service = { workspace = true, features = ["std"] }
oak_crypto = { workspace = true }
oak_remote_attestation = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion oak_functions_containers_app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use anyhow::{anyhow, Context};
use clap::Parser;
use oak_containers_orchestrator_client::LauncherClient;
use oak_containers_orchestrator::launcher_client::LauncherClient;
use oak_functions_containers_app::{orchestrator_client::OrchestratorClient, serve};
use opentelemetry_api::global::set_error_handler;
use std::{
Expand Down

0 comments on commit 13f97d6

Please sign in to comment.