From 1b0de5396b658643725384c46af505c6af0383aa Mon Sep 17 00:00:00 2001 From: Tiziano Santoro Date: Tue, 18 Aug 2020 16:55:23 +0100 Subject: [PATCH] Move oak_runtime and oak_loader crates Make them top-level crates, and fix imports transitively This is more in line with standard Rust conventions, and also makes the code more organized and easier to navigate. Move proto folder to top level too. Use more explicit dependencies between local crates (using `path`). --- .github/workflows/upload_coverage.yaml | 2 +- docs/programming-oak.md | 2 +- docs/sdk.md | 3 +- examples/Cargo.toml | 2 +- .../aggregator/scripts/docker_build_and_push | 2 +- examples/aggregator/scripts/run_server | 2 +- examples/authentication/README.md | 2 +- examples/authentication/client/build.rs | 2 +- examples/chat/proto/BUILD | 2 +- examples/chat/proto/chat.proto | 2 +- .../google/oak/hello_world/MainActivity.java | 4 +-- examples/hello_world/client/nodejs/index.js | 36 +++++++++---------- examples/hello_world/module/cpp/BUILD | 2 +- examples/injection/proto/BUILD | 2 +- examples/injection/proto/injection.proto | 2 +- examples/tensorflow/module/cpp/BUILD | 4 +-- examples/translator/client/translator.go | 2 +- oak/common/label.cc | 2 +- oak/module/oak_main.h | 2 +- oak/server/Cargo.toml | 22 ------------ oak_abi/Cargo.toml | 9 ++--- oak_io/Cargo.lock | 12 ++----- oak_io/Cargo.toml | 6 ++++ {oak/server => oak_loader}/.dockerignore | 0 {oak/server => oak_loader}/Cargo.lock | 26 -------------- .../rust/oak_loader => oak_loader}/Cargo.toml | 14 +++++--- {oak/server => oak_loader}/Dockerfile | 0 {oak/server => oak_loader}/deny.toml | 0 .../src/certs/README.md | 0 .../src/certs/roots.pem | 0 .../oak_loader => oak_loader}/src/main.rs | 2 +- .../oak_loader => oak_loader}/src/options.rs | 0 .../oak_loader => oak_loader}/src/tests.rs | 0 .../oak_runtime => oak_runtime}/Cargo.toml | 22 +++++++----- .../rust/oak_runtime => oak_runtime}/build.rs | 6 ++-- .../src/auth/mod.rs | 0 .../src/auth/oidc_utils.rs | 0 .../src/channel.rs | 0 .../oak_runtime => oak_runtime}/src/config.rs | 0 .../oak_runtime => oak_runtime}/src/graph.rs | 0 .../src/introspect.rs | 0 .../src/introspection_events.rs | 0 .../oak_runtime => oak_runtime}/src/io.rs | 0 .../oak_runtime => oak_runtime}/src/lib.rs | 0 .../src/message.rs | 0 .../src/metrics/mod.rs | 0 .../src/metrics/server.rs | 0 .../src/node/grpc/client.rs | 0 .../src/node/grpc/codec.rs | 0 .../src/node/grpc/invocation.rs | 0 .../src/node/grpc/mod.rs | 0 .../src/node/grpc/server/auth/mod.rs | 0 .../src/node/grpc/server/auth/oidc_service.rs | 0 .../src/node/grpc/server/mod.rs | 0 .../src/node/http/mod.rs | 0 .../src/node/http/tests.rs | 0 .../src/node/logger.rs | 0 .../src/node/mod.rs | 0 .../src/node/roughtime.rs | 0 .../src/node/storage.rs | 0 .../src/node/wasm/mod.rs | 2 +- .../src/node/wasm/tests.rs | 0 .../src/permissions.rs | 0 .../src/proto/mod.rs | 0 .../oak_runtime => oak_runtime}/src/proxy.rs | 0 .../oak_runtime => oak_runtime}/src/tests.rs | 0 .../src/time/mod.rs | 0 .../src/time/tests.rs | 0 .../tests/integration_test.rs | 0 oak_services/Cargo.toml | 9 ++--- oak_utils/Cargo.toml | 14 ++++---- {oak/proto => proto}/BUILD | 0 {oak/proto => proto}/authentication.proto | 0 {oak/proto => proto}/handle.proto | 0 .../introspection_events.proto | 0 runner/src/main.rs | 12 +++---- scripts/build_gh_pages | 6 ++-- scripts/build_reproducibility_index | 2 +- scripts/common | 13 +++++-- scripts/generate_root_ca_certs | 2 +- scripts/run_cargo_crev | 2 +- scripts/run_tests_coverage | 2 +- sdk/Cargo.toml | 2 +- sdk/rust/oak/build.rs | 4 +-- sdk/rust/oak_app_build/src/main.rs | 2 +- {oak/server/testdata => testdata}/empty.wat | 0 {oak/server/testdata => testdata}/minimal.wat | 0 {oak/server/testdata => testdata}/missing.wat | 0 {oak/server/testdata => testdata}/wrong.wat | 0 89 files changed, 120 insertions(+), 148 deletions(-) delete mode 100644 oak/server/Cargo.toml rename {oak/server => oak_loader}/.dockerignore (100%) rename {oak/server => oak_loader}/Cargo.lock (98%) rename {oak/server/rust/oak_loader => oak_loader}/Cargo.toml (53%) rename {oak/server => oak_loader}/Dockerfile (100%) rename {oak/server => oak_loader}/deny.toml (100%) rename {oak/server/rust/oak_loader => oak_loader}/src/certs/README.md (100%) rename {oak/server/rust/oak_loader => oak_loader}/src/certs/roots.pem (100%) rename {oak/server/rust/oak_loader => oak_loader}/src/main.rs (97%) rename {oak/server/rust/oak_loader => oak_loader}/src/options.rs (100%) rename {oak/server/rust/oak_loader => oak_loader}/src/tests.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/Cargo.toml (64%) rename {oak/server/rust/oak_runtime => oak_runtime}/build.rs (90%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/auth/mod.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/auth/oidc_utils.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/channel.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/config.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/graph.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/introspect.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/introspection_events.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/io.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/lib.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/message.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/metrics/mod.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/metrics/server.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/grpc/client.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/grpc/codec.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/grpc/invocation.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/grpc/mod.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/grpc/server/auth/mod.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/grpc/server/auth/oidc_service.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/grpc/server/mod.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/http/mod.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/http/tests.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/logger.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/mod.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/roughtime.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/storage.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/wasm/mod.rs (99%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/node/wasm/tests.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/permissions.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/proto/mod.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/proxy.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/tests.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/time/mod.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/src/time/tests.rs (100%) rename {oak/server/rust/oak_runtime => oak_runtime}/tests/integration_test.rs (100%) rename {oak/proto => proto}/BUILD (100%) rename {oak/proto => proto}/authentication.proto (100%) rename {oak/proto => proto}/handle.proto (100%) rename {oak/proto => proto}/introspection_events.proto (100%) rename {oak/server/testdata => testdata}/empty.wat (100%) rename {oak/server/testdata => testdata}/minimal.wat (100%) rename {oak/server/testdata => testdata}/missing.wat (100%) rename {oak/server/testdata => testdata}/wrong.wat (100%) diff --git a/.github/workflows/upload_coverage.yaml b/.github/workflows/upload_coverage.yaml index fbd17668a5a..968a262ffdf 100644 --- a/.github/workflows/upload_coverage.yaml +++ b/.github/workflows/upload_coverage.yaml @@ -35,4 +35,4 @@ jobs: - name: Upload to codecov.io run: | - bash <(curl -s https://codecov.io/bash) -f ./oak/server/target/debug/lcov.info + bash <(curl -s https://codecov.io/bash) -f ./oak_loader/target/debug/lcov.info diff --git a/docs/programming-oak.md b/docs/programming-oak.md index 2dc944bd693..ace5867fac9 100644 --- a/docs/programming-oak.md +++ b/docs/programming-oak.md @@ -292,7 +292,7 @@ the following script: The Oak Application is then started using the Oak Loader: ```bash -./oak/server/target/x86_64-unknown-linux-musl/release/oak_loader --application=./examples/hello_world/bin/hello_world.oak +./oak_loader/target/x86_64-unknown-linux-musl/release/oak_loader --application=./examples/hello_world/bin/hello_world.oak ``` The Oak Loader will launch an [Oak Runtime](concepts.md#oak-runtime), and this diff --git a/docs/sdk.md b/docs/sdk.md index 0317d27abef..8404b81e5af 100644 --- a/docs/sdk.md +++ b/docs/sdk.md @@ -129,8 +129,7 @@ as a `Duration` since the UNIX epoch. ### `oak::proto` Module -The -[`oak::proto`](https://project-oak.github.io/oak/sdk/doc/oak/proto/index.html) +The [`oak::proto`](https://project-oak.github.io/oak/sdk/doc/proto/index.html) module holds auto-generated submodules for dealing with protocol buffers. ### `oak::logger` Module diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 95997752fe0..72f279412e8 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -40,7 +40,7 @@ oak = { path = "../sdk/rust/oak" } oak_abi = { path = "../oak_abi" } oak_derive = { path = "../sdk/rust/oak_derive" } oak_io = { path = "../oak_io" } -oak_runtime = { path = "../oak/server/rust/oak_runtime" } +oak_runtime = { path = "../oak_runtime" } oak_services = { path = "../oak_services" } oak_tests = { path = "../sdk/rust/oak_tests" } oak_utils = { path = "../oak_utils" } diff --git a/examples/aggregator/scripts/docker_build_and_push b/examples/aggregator/scripts/docker_build_and_push index 3e48e9380ea..31fb07f0445 100755 --- a/examples/aggregator/scripts/docker_build_and_push +++ b/examples/aggregator/scripts/docker_build_and_push @@ -14,7 +14,7 @@ readonly BACKEND_DOCKER_IMAGE_NAME='gcr.io/oak-ci/oak-aggregator-backend' # Build aggregator image # Build the base server. - docker build --tag=oak_docker --file=./oak/server/Dockerfile ./oak/server + docker build --tag=oak_docker --file=./oak_loader/Dockerfile ./oak_loader # Build and save the example docker build --tag=aggregator --file=./examples/Dockerfile "./examples/aggregator" docker tag aggregator "${AGGREGATOR_DOCKER_IMAGE_NAME}":latest diff --git a/examples/aggregator/scripts/run_server b/examples/aggregator/scripts/run_server index 04a3f1d9df4..859486d11c0 100755 --- a/examples/aggregator/scripts/run_server +++ b/examples/aggregator/scripts/run_server @@ -8,7 +8,7 @@ source "${GLOBAL_SCRIPTS_DIR}/common" "${GLOBAL_SCRIPTS_DIR}/build_example" -e aggregator readonly APPLICATION="${PWD}/examples/aggregator/bin/aggregator.oak" -exec cargo run --release --target=x86_64-unknown-linux-musl --manifest-path=oak/server/rust/oak_loader/Cargo.toml -- \ +exec cargo run --release --target=x86_64-unknown-linux-musl --manifest-path=oak_loader/Cargo.toml -- \ --application="${APPLICATION}" \ --grpc-tls-private-key="${GLOBAL_SCRIPTS_DIR}/../examples/certs/local/local.key" \ --grpc-tls-certificate="${GLOBAL_SCRIPTS_DIR}/../examples/certs/local/local.pem" \ diff --git a/examples/authentication/README.md b/examples/authentication/README.md index 1d10adbd295..0662d14fc8d 100644 --- a/examples/authentication/README.md +++ b/examples/authentication/README.md @@ -21,7 +21,7 @@ The Oak server can be run with the OpenID Connect authentication service enabled using the --oidc-client flag: ```bash -cargo run --manifest-path=oak/server/rust/oak_loader/Cargo.toml -- \ +cargo run --manifest-path=oak_loader/Cargo.toml -- \ --application= \ --grpc-tls-private-key= \ --grpc-tls-certificate= \ diff --git a/examples/authentication/client/build.rs b/examples/authentication/client/build.rs index 010fc87e125..0829776ef98 100644 --- a/examples/authentication/client/build.rs +++ b/examples/authentication/client/build.rs @@ -18,7 +18,7 @@ use oak_utils::{generate_grpc_code, CodegenOptions}; fn main() -> Result<(), Box> { generate_grpc_code( - "../../../oak/proto", + "../../../proto", &["authentication.proto"], CodegenOptions { build_client: true, diff --git a/examples/chat/proto/BUILD b/examples/chat/proto/BUILD index 4816dcdffb2..48d77595abb 100644 --- a/examples/chat/proto/BUILD +++ b/examples/chat/proto/BUILD @@ -27,8 +27,8 @@ proto_library( name = "chat_proto", srcs = ["chat.proto"], deps = [ - "//oak/proto:handle_proto", "//oak_services/proto:grpc_encap_proto", + "//proto:handle_proto", "@com_google_protobuf//:empty_proto", ], ) diff --git a/examples/chat/proto/chat.proto b/examples/chat/proto/chat.proto index 875efdb3c69..b411cef9230 100644 --- a/examples/chat/proto/chat.proto +++ b/examples/chat/proto/chat.proto @@ -19,7 +19,7 @@ syntax = "proto3"; package oak.examples.chat; import "google/protobuf/empty.proto"; -import "oak/proto/handle.proto"; +import "proto/handle.proto"; import "oak_services/proto/grpc_encap.proto"; message CreateRoomRequest { diff --git a/examples/hello_world/client/android/java/com/google/oak/hello_world/MainActivity.java b/examples/hello_world/client/android/java/com/google/oak/hello_world/MainActivity.java index 081ee362a8a..c3acd766410 100644 --- a/examples/hello_world/client/android/java/com/google/oak/hello_world/MainActivity.java +++ b/examples/hello_world/client/android/java/com/google/oak/hello_world/MainActivity.java @@ -44,9 +44,9 @@ /** Main activity for the Oak Android "Hello, World" app. */ public class MainActivity extends Activity { - // Keep in sync with /oak/server/rust/oak_runtime/src/node/grpc/server/mod.rs. + // Keep in sync with /oak_runtime/src/node/grpc/server/mod.rs. private static final String OAK_LABEL_GRPC_METADATA_KEY = "x-oak-label-bin"; - + private HandlerThread backgroundHandlerThread; private Handler backgroundHandler; diff --git a/examples/hello_world/client/nodejs/index.js b/examples/hello_world/client/nodejs/index.js index b629c93bea0..181d2048645 100644 --- a/examples/hello_world/client/nodejs/index.js +++ b/examples/hello_world/client/nodejs/index.js @@ -23,7 +23,7 @@ const CERT_PATH = __dirname + '/../../../certs/local/ca.pem'; const SERVICE_PROTO_PATH = __dirname + '/../../proto/hello_world.proto'; const OAK_LABEL_PROTO_PATH = __dirname + '/../../../../oak_abi/proto/label.proto'; -// Keep in sync with /oak/server/rust/oak_runtime/src/node/grpc/server/mod.rs. +// Keep in sync with /oak_runtime/src/node/grpc/server/mod.rs. const oakLabelGrpcMetadataKey = 'x-oak-label-bin'; async function main() { @@ -52,8 +52,7 @@ async function main() { return metaData; } - const helloWorldProto = grpc.loadPackageDefinition(helloWorldDefinition).oak - .examples.hello_world; + const helloWorldProto = grpc.loadPackageDefinition(helloWorldDefinition).oak.examples.hello_world; const credentials = grpc.credentials.createSsl(fs.readFileSync(CERT_PATH)); const client = new helloWorldProto.HelloWorld('localhost:8080', credentials); @@ -61,22 +60,21 @@ async function main() { // For documentation on client calls see the `@grpc/grpc-js` documentation: // https://grpc.github.io/grpc/node/grpc.Client.html#~CallProperties client.sayHello( - // The arguments passed to the gRPC service. Corresponds to the - // `HelloRequest` message type in hello_world.proto file. - { greeting: 'Node.js' }, - // The metadata for this gRPC call. - getGrpcMetadata(), - // Callback invoked with the response. - (error, response) => { - if (error) { - console.error(error); - process.exit(1); - } else { - console.log(response.reply); - process.exit(0); - } - } - ); + // The arguments passed to the gRPC service. Corresponds to the + // `HelloRequest` message type in hello_world.proto file. + {greeting: 'Node.js'}, + // The metadata for this gRPC call. + getGrpcMetadata(), + // Callback invoked with the response. + (error, response) => { + if (error) { + console.error(error); + process.exit(1); + } else { + console.log(response.reply); + process.exit(0); + } + }); } main(); diff --git a/examples/hello_world/module/cpp/BUILD b/examples/hello_world/module/cpp/BUILD index 1df7d608409..e050657add3 100644 --- a/examples/hello_world/module/cpp/BUILD +++ b/examples/hello_world/module/cpp/BUILD @@ -28,6 +28,6 @@ cc_binary( "//oak/module:oak_abi", "//oak/module:oak_main", # TODO(#422): Sort out inclusion of protobuf files - # "//oak/proto:oak_api_cc_proto", + # "//proto:oak_api_cc_proto", ], ) diff --git a/examples/injection/proto/BUILD b/examples/injection/proto/BUILD index a146f7f35d8..76872b773c9 100644 --- a/examples/injection/proto/BUILD +++ b/examples/injection/proto/BUILD @@ -27,7 +27,7 @@ proto_library( name = "injection_proto", srcs = ["injection.proto"], deps = [ - "//oak/proto:handle_proto", + "//proto:handle_proto", "@com_google_protobuf//:empty_proto", ], ) diff --git a/examples/injection/proto/injection.proto b/examples/injection/proto/injection.proto index 4b738554085..27a84819885 100644 --- a/examples/injection/proto/injection.proto +++ b/examples/injection/proto/injection.proto @@ -16,7 +16,7 @@ syntax = "proto3"; -import "oak/proto/handle.proto"; +import "proto/handle.proto"; package oak.examples.injection; diff --git a/examples/tensorflow/module/cpp/BUILD b/examples/tensorflow/module/cpp/BUILD index 01e3abc52e0..aef0a455f3c 100644 --- a/examples/tensorflow/module/cpp/BUILD +++ b/examples/tensorflow/module/cpp/BUILD @@ -48,7 +48,7 @@ cc_binary( "//oak/module:oak_main", "//oak/module:placeholders", # TODO(#422): Sort out inclusion of protobuf files - # "//oak/proto:oak_api_cc_proto", + # "//proto:oak_api_cc_proto", "@org_tensorflow//tensorflow/lite:framework", "@org_tensorflow//tensorflow/lite/kernels:builtin_ops", ], @@ -82,7 +82,7 @@ cc_binary( "//oak/module:oak_main", "//oak/module:placeholders", # TODO(#422): Sort out inclusion of protobuf files - # "//oak/proto:oak_api_cc_proto", + # "//proto:oak_api_cc_proto", "@org_tensorflow//tensorflow/lite/micro:micro_framework", "@org_tensorflow//tensorflow/lite/micro/kernels:all_ops_resolver", ], diff --git a/examples/translator/client/translator.go b/examples/translator/client/translator.go index e5250694449..1e17f83e900 100644 --- a/examples/translator/client/translator.go +++ b/examples/translator/client/translator.go @@ -35,7 +35,7 @@ var ( caCert = flag.String("ca_cert", "", "Path to the PEM-encoded CA root certificate") ) -// Keep in sync with /oak/server/rust/oak_runtime/src/node/grpc/server/mod.rs. +// Keep in sync with /oak_runtime/src/node/grpc/server/mod.rs. const oakLabelGrpcMetadataKey = "x-oak-label-bin" func translate(ctx context.Context, client translator_pb.TranslatorClient, text, fromLang, toLang string) { diff --git a/oak/common/label.cc b/oak/common/label.cc index 96443e6ffc9..ffa360cfdc7 100644 --- a/oak/common/label.cc +++ b/oak/common/label.cc @@ -24,7 +24,7 @@ namespace oak { // // See https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md. // -// Keep in sync with /oak/server/rust/oak_runtime/src/node/grpc/server/mod.rs. +// Keep in sync with /oak_runtime/src/node/grpc/server/mod.rs. const char kOakLabelGrpcMetadataKey[] = "x-oak-label-bin"; // The `-bin` suffix allows sending binary data for this metadata key. diff --git a/oak/module/oak_main.h b/oak/module/oak_main.h index 1f379b1a3d0..a3d5c58fdb2 100644 --- a/oak/module/oak_main.h +++ b/oak/module/oak_main.h @@ -28,7 +28,7 @@ extern "C" void process_invocation(const uint8_t* req_buf, uint32_t req_size, oak_abi::Handle rsp_handle); // TODO(#422): Sort out inclusion of protobuf files -// #include "oak/proto/oak_api.pb.h" +// #include "proto/oak_api.pb.h" // Placeholder main entrypoint for C++ Oak Modules that have simple unary // method semantics. The Oak Module needs to provide an implementation diff --git a/oak/server/Cargo.toml b/oak/server/Cargo.toml deleted file mode 100644 index 80dab547fc6..00000000000 --- a/oak/server/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[workspace] -members = ["rust/oak_loader", "rust/oak_runtime"] - -# Patch dependencies on oak crates so that they refer to the versions within this same repository. -# -# From https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html : -# > Cargo doesn’t assume that crates in a workspace will depend on each other, so we need to be -# > explicit about the dependency relationships between the crates. -[patch.crates-io] -# Oak. -oak_abi = { path = "../../oak_abi" } -oak_io = { path = "../../oak_io" } -oak_loader = { path = "rust/oak_loader" } -oak_runtime = { path = "rust/oak_runtime" } -oak_services = { path = "../../oak_services" } -oak_utils = { path = "../../oak_utils" } -# Third party. -roughenough = { path = "../../third_party/roughenough" } -prost = { path = "../../third_party/prost" } -prost-derive = { path = "../../third_party/prost/prost-derive" } -prost-build = { path = "../../third_party/prost/prost-build" } -prost-types = { path = "../../third_party/prost/prost-types" } diff --git a/oak_abi/Cargo.toml b/oak_abi/Cargo.toml index 8f8ca8f5cfc..27a60a54e26 100644 --- a/oak_abi/Cargo.toml +++ b/oak_abi/Cargo.toml @@ -9,14 +9,15 @@ license = "Apache-2.0" [dependencies] log = "*" -prost = "*" -prost-types = "*" +prost = { path = "../third_party/prost" } +prost-types = { path = "../third_party/prost/prost-types" } [build-dependencies] oak_utils = { path = "../oak_utils" } -prost-build = "*" +prost-build = { path = "../third_party/prost/prost-build" } [patch.crates-io] -prost-build = { path = "../third_party/prost/prost-build" } prost = { path = "../third_party/prost" } +prost-build = { path = "../third_party/prost/prost-build" } +prost-derive = { path = "../third_party/prost/prost-derive" } prost-types = { path = "../third_party/prost/prost-types" } diff --git a/oak_io/Cargo.lock b/oak_io/Cargo.lock index cac1207689e..1b9b95b0a89 100644 --- a/oak_io/Cargo.lock +++ b/oak_io/Cargo.lock @@ -77,9 +77,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.8.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" dependencies = [ "either", ] @@ -172,8 +172,6 @@ dependencies = [ [[package]] name = "prost" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" dependencies = [ "bytes", "prost-derive", @@ -182,8 +180,6 @@ dependencies = [ [[package]] name = "prost-build" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b10678c913ecbd69350e8535c3aef91a8676c0773fc1d7b95cdd196d7f2f26" dependencies = [ "bytes", "heck", @@ -200,8 +196,6 @@ dependencies = [ [[package]] name = "prost-derive" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" dependencies = [ "anyhow", "itertools", @@ -213,8 +207,6 @@ dependencies = [ [[package]] name = "prost-types" version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1834f67c0697c001304b75be76f67add9c89742eda3a085ad8ee0bb38c3417aa" dependencies = [ "bytes", "prost", diff --git a/oak_io/Cargo.toml b/oak_io/Cargo.toml index e6aad702cd5..3dd51d7eca8 100644 --- a/oak_io/Cargo.toml +++ b/oak_io/Cargo.toml @@ -9,3 +9,9 @@ license = "Apache-2.0" [dependencies] oak_abi = { path = "../oak_abi" } + +[patch.crates-io] +prost = { path = "../third_party/prost" } +prost-build = { path = "../third_party/prost/prost-build" } +prost-derive = { path = "../third_party/prost/prost-derive" } +prost-types = { path = "../third_party/prost/prost-types" } diff --git a/oak/server/.dockerignore b/oak_loader/.dockerignore similarity index 100% rename from oak/server/.dockerignore rename to oak_loader/.dockerignore diff --git a/oak/server/Cargo.lock b/oak_loader/Cargo.lock similarity index 98% rename from oak/server/Cargo.lock rename to oak_loader/Cargo.lock index 11b4d7b63d5..35d2db3d0db 100644 --- a/oak/server/Cargo.lock +++ b/oak_loader/Cargo.lock @@ -513,11 +513,6 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "leb128" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "libc" version = "0.2.71" @@ -696,7 +691,6 @@ dependencies = [ "base64 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "futures-util 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -726,7 +720,6 @@ dependencies = [ "tokio 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", "tonic 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "wasmi 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "wat 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1798,22 +1791,6 @@ dependencies = [ "parity-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "wast" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "leb128 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "wat" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "wast 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "web-sys" version = "0.3.40" @@ -1965,7 +1942,6 @@ dependencies = [ "checksum jsonwebtoken 7.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b1f325ae57ddcf609f02d891486ce740f5bbd0cc3e93f9bffaacdf6594b21404" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -"checksum leb128 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" "checksum libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)" = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49" "checksum libm 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" @@ -2088,8 +2064,6 @@ dependencies = [ "checksum wasm-bindgen-shared 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)" = "c9ba19973a58daf4db6f352eda73dc0e289493cd29fb2632eb172085b6521acd" "checksum wasmi 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bf617d864d25af3587aa745529f7aaa541066c876d57e050c0d0c85c61c92aff" "checksum wasmi-validation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea78c597064ba73596099281e2f4cfc019075122a65cdda3205af94f0b264d93" -"checksum wast 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "01b1f23531740a81f9300bd2febd397a95c76bfa4aa4bfaf4ca8b1ee3438f337" -"checksum wat 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "4006d418d59293172aebfeeadb7673459dc151874a79135946ea7996b6a98515" "checksum web-sys 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "7b72fe77fd39e4bd3eaa4412fd299a0be6b3dfe9d2597e2f1c20beb968f41d17" "checksum webpki 0.21.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ab146130f5f790d45f82aeeb09e55a256573373ec64409fc19a6fb82fb1032ae" "checksum webpki-roots 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8eff4b7516a57307f9349c64bf34caa34b940b66fed4b2fb3136cb7386e5739" diff --git a/oak/server/rust/oak_loader/Cargo.toml b/oak_loader/Cargo.toml similarity index 53% rename from oak/server/rust/oak_loader/Cargo.toml rename to oak_loader/Cargo.toml index 1f75e29fe84..98d44ba969d 100644 --- a/oak/server/rust/oak_loader/Cargo.toml +++ b/oak_loader/Cargo.toml @@ -16,10 +16,10 @@ default = ["oak_debug"] anyhow = "*" env_logger = "*" log = "*" -oak_abi = "=0.1.0" -oak_runtime = "=0.1.0" -oak_utils = "=0.1.0" -prost = "*" +oak_abi = { path = "../oak_abi" } +oak_runtime = { path = "../oak_runtime" } +oak_utils = { path = "../oak_utils" } +prost = { path = "../third_party/prost" } rustls = "*" serde = { version = "*", features = ["derive"] } signal-hook = "*" @@ -28,3 +28,9 @@ tonic = { version = "*", features = ["tls"] } [dev-dependencies] maplit = "*" + +[patch.crates-io] +prost = { path = "../third_party/prost" } +prost-derive = { path = "../third_party/prost/prost-derive" } +prost-build = { path = "../third_party/prost/prost-build" } +prost-types = { path = "../third_party/prost/prost-types" } diff --git a/oak/server/Dockerfile b/oak_loader/Dockerfile similarity index 100% rename from oak/server/Dockerfile rename to oak_loader/Dockerfile diff --git a/oak/server/deny.toml b/oak_loader/deny.toml similarity index 100% rename from oak/server/deny.toml rename to oak_loader/deny.toml diff --git a/oak/server/rust/oak_loader/src/certs/README.md b/oak_loader/src/certs/README.md similarity index 100% rename from oak/server/rust/oak_loader/src/certs/README.md rename to oak_loader/src/certs/README.md diff --git a/oak/server/rust/oak_loader/src/certs/roots.pem b/oak_loader/src/certs/roots.pem similarity index 100% rename from oak/server/rust/oak_loader/src/certs/roots.pem rename to oak_loader/src/certs/roots.pem diff --git a/oak/server/rust/oak_loader/src/main.rs b/oak_loader/src/main.rs similarity index 97% rename from oak/server/rust/oak_loader/src/main.rs rename to oak_loader/src/main.rs index fd79bf3527a..ea554defaf5 100644 --- a/oak/server/rust/oak_loader/src/main.rs +++ b/oak_loader/src/main.rs @@ -19,7 +19,7 @@ //! Invoke with: //! //! ```shell -//! cargo run --manifest-path=oak/server/rust/oak_loader/Cargo.toml -- \ +//! cargo run --manifest-path=oak_loader/Cargo.toml -- \ //! --application= \ //! --grpc-tls-private-key= \ //! --grpc-tls-certificate= \ diff --git a/oak/server/rust/oak_loader/src/options.rs b/oak_loader/src/options.rs similarity index 100% rename from oak/server/rust/oak_loader/src/options.rs rename to oak_loader/src/options.rs diff --git a/oak/server/rust/oak_loader/src/tests.rs b/oak_loader/src/tests.rs similarity index 100% rename from oak/server/rust/oak_loader/src/tests.rs rename to oak_loader/src/tests.rs diff --git a/oak/server/rust/oak_runtime/Cargo.toml b/oak_runtime/Cargo.toml similarity index 64% rename from oak/server/rust/oak_runtime/Cargo.toml rename to oak_runtime/Cargo.toml index ea6d1130827..27d21a27108 100644 --- a/oak/server/rust/oak_runtime/Cargo.toml +++ b/oak_runtime/Cargo.toml @@ -27,18 +27,18 @@ jsonwebtoken = "*" lazy_static = "*" log = { version = "*" } maplit = "*" -oak_abi = "=0.1.0" -oak_io = "=0.1.0" -oak_services = "=0.1.0" +oak_abi = { path = "../oak_abi" } +oak_io = { path = "../oak_io" } +oak_services = { path = "../oak_services" } prometheus = { version = "0.8", features = [ "nightly" ], default-features = false } -prost = "*" -prost-types = "*" +prost = { path = "../third_party/prost" } +prost-types = { path = "../third_party/prost/prost-types" } rand = "*" regex = { version = "1", optional = true } reqwest = { version = "*", default-features = false, features = ["rustls-tls"] } -roughenough = "*" +roughenough = { path = "../third_party/roughenough" } rustls = "*" serde = "*" serde_json = "*" @@ -60,5 +60,11 @@ regex = "*" wat = "*" [build-dependencies] -oak_utils = "*" -prost-build = "*" +oak_utils = { path = "../oak_utils" } +prost-build = { path = "../third_party/prost/prost-build" } + +[patch.crates-io] +prost = { path = "../third_party/prost" } +prost-build = { path = "../third_party/prost/prost-build" } +prost-derive = { path = "../third_party/prost/prost-derive" } +prost-types = { path = "../third_party/prost/prost-types" } diff --git a/oak/server/rust/oak_runtime/build.rs b/oak_runtime/build.rs similarity index 90% rename from oak/server/rust/oak_runtime/build.rs rename to oak_runtime/build.rs index e99de969f7d..82a0297f23e 100644 --- a/oak/server/rust/oak_runtime/build.rs +++ b/oak_runtime/build.rs @@ -18,7 +18,7 @@ use oak_utils::{compile_protos_with_options, generate_grpc_code, CodegenOptions, fn main() { generate_grpc_code( - "../../../../oak/proto", + "../proto", &["authentication.proto"], CodegenOptions { build_server: true, @@ -28,8 +28,8 @@ fn main() { .expect("Proto compilation failed."); compile_protos_with_options( - &["../../../../oak/proto/introspection_events.proto"], - &["../../../../oak/proto"], + &["../proto/introspection_events.proto"], + &["../proto"], ProtoOptions { // Exclude generation of HandleVisit auto-derive, as it would // require a reference to the Oak SDK to compile. diff --git a/oak/server/rust/oak_runtime/src/auth/mod.rs b/oak_runtime/src/auth/mod.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/auth/mod.rs rename to oak_runtime/src/auth/mod.rs diff --git a/oak/server/rust/oak_runtime/src/auth/oidc_utils.rs b/oak_runtime/src/auth/oidc_utils.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/auth/oidc_utils.rs rename to oak_runtime/src/auth/oidc_utils.rs diff --git a/oak/server/rust/oak_runtime/src/channel.rs b/oak_runtime/src/channel.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/channel.rs rename to oak_runtime/src/channel.rs diff --git a/oak/server/rust/oak_runtime/src/config.rs b/oak_runtime/src/config.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/config.rs rename to oak_runtime/src/config.rs diff --git a/oak/server/rust/oak_runtime/src/graph.rs b/oak_runtime/src/graph.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/graph.rs rename to oak_runtime/src/graph.rs diff --git a/oak/server/rust/oak_runtime/src/introspect.rs b/oak_runtime/src/introspect.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/introspect.rs rename to oak_runtime/src/introspect.rs diff --git a/oak/server/rust/oak_runtime/src/introspection_events.rs b/oak_runtime/src/introspection_events.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/introspection_events.rs rename to oak_runtime/src/introspection_events.rs diff --git a/oak/server/rust/oak_runtime/src/io.rs b/oak_runtime/src/io.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/io.rs rename to oak_runtime/src/io.rs diff --git a/oak/server/rust/oak_runtime/src/lib.rs b/oak_runtime/src/lib.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/lib.rs rename to oak_runtime/src/lib.rs diff --git a/oak/server/rust/oak_runtime/src/message.rs b/oak_runtime/src/message.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/message.rs rename to oak_runtime/src/message.rs diff --git a/oak/server/rust/oak_runtime/src/metrics/mod.rs b/oak_runtime/src/metrics/mod.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/metrics/mod.rs rename to oak_runtime/src/metrics/mod.rs diff --git a/oak/server/rust/oak_runtime/src/metrics/server.rs b/oak_runtime/src/metrics/server.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/metrics/server.rs rename to oak_runtime/src/metrics/server.rs diff --git a/oak/server/rust/oak_runtime/src/node/grpc/client.rs b/oak_runtime/src/node/grpc/client.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/node/grpc/client.rs rename to oak_runtime/src/node/grpc/client.rs diff --git a/oak/server/rust/oak_runtime/src/node/grpc/codec.rs b/oak_runtime/src/node/grpc/codec.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/node/grpc/codec.rs rename to oak_runtime/src/node/grpc/codec.rs diff --git a/oak/server/rust/oak_runtime/src/node/grpc/invocation.rs b/oak_runtime/src/node/grpc/invocation.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/node/grpc/invocation.rs rename to oak_runtime/src/node/grpc/invocation.rs diff --git a/oak/server/rust/oak_runtime/src/node/grpc/mod.rs b/oak_runtime/src/node/grpc/mod.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/node/grpc/mod.rs rename to oak_runtime/src/node/grpc/mod.rs diff --git a/oak/server/rust/oak_runtime/src/node/grpc/server/auth/mod.rs b/oak_runtime/src/node/grpc/server/auth/mod.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/node/grpc/server/auth/mod.rs rename to oak_runtime/src/node/grpc/server/auth/mod.rs diff --git a/oak/server/rust/oak_runtime/src/node/grpc/server/auth/oidc_service.rs b/oak_runtime/src/node/grpc/server/auth/oidc_service.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/node/grpc/server/auth/oidc_service.rs rename to oak_runtime/src/node/grpc/server/auth/oidc_service.rs diff --git a/oak/server/rust/oak_runtime/src/node/grpc/server/mod.rs b/oak_runtime/src/node/grpc/server/mod.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/node/grpc/server/mod.rs rename to oak_runtime/src/node/grpc/server/mod.rs diff --git a/oak/server/rust/oak_runtime/src/node/http/mod.rs b/oak_runtime/src/node/http/mod.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/node/http/mod.rs rename to oak_runtime/src/node/http/mod.rs diff --git a/oak/server/rust/oak_runtime/src/node/http/tests.rs b/oak_runtime/src/node/http/tests.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/node/http/tests.rs rename to oak_runtime/src/node/http/tests.rs diff --git a/oak/server/rust/oak_runtime/src/node/logger.rs b/oak_runtime/src/node/logger.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/node/logger.rs rename to oak_runtime/src/node/logger.rs diff --git a/oak/server/rust/oak_runtime/src/node/mod.rs b/oak_runtime/src/node/mod.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/node/mod.rs rename to oak_runtime/src/node/mod.rs diff --git a/oak/server/rust/oak_runtime/src/node/roughtime.rs b/oak_runtime/src/node/roughtime.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/node/roughtime.rs rename to oak_runtime/src/node/roughtime.rs diff --git a/oak/server/rust/oak_runtime/src/node/storage.rs b/oak_runtime/src/node/storage.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/node/storage.rs rename to oak_runtime/src/node/storage.rs diff --git a/oak/server/rust/oak_runtime/src/node/wasm/mod.rs b/oak_runtime/src/node/wasm/mod.rs similarity index 99% rename from oak/server/rust/oak_runtime/src/node/wasm/mod.rs rename to oak_runtime/src/node/wasm/mod.rs index a92fa871e4d..67dcbd58c82 100644 --- a/oak/server/rust/oak_runtime/src/node/wasm/mod.rs +++ b/oak_runtime/src/node/wasm/mod.rs @@ -554,7 +554,7 @@ fn oak_resolve_func( signature: &wasmi::Signature, ) -> Result { // The types in the signatures correspond to the parameters from - // /oak/server/rust/oak_abi/src/lib.rs + // /oak_abi/src/lib.rs let (index, sig) = match field_name { "node_create" => ( NODE_CREATE, diff --git a/oak/server/rust/oak_runtime/src/node/wasm/tests.rs b/oak_runtime/src/node/wasm/tests.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/node/wasm/tests.rs rename to oak_runtime/src/node/wasm/tests.rs diff --git a/oak/server/rust/oak_runtime/src/permissions.rs b/oak_runtime/src/permissions.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/permissions.rs rename to oak_runtime/src/permissions.rs diff --git a/oak/server/rust/oak_runtime/src/proto/mod.rs b/oak_runtime/src/proto/mod.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/proto/mod.rs rename to oak_runtime/src/proto/mod.rs diff --git a/oak/server/rust/oak_runtime/src/proxy.rs b/oak_runtime/src/proxy.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/proxy.rs rename to oak_runtime/src/proxy.rs diff --git a/oak/server/rust/oak_runtime/src/tests.rs b/oak_runtime/src/tests.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/tests.rs rename to oak_runtime/src/tests.rs diff --git a/oak/server/rust/oak_runtime/src/time/mod.rs b/oak_runtime/src/time/mod.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/time/mod.rs rename to oak_runtime/src/time/mod.rs diff --git a/oak/server/rust/oak_runtime/src/time/tests.rs b/oak_runtime/src/time/tests.rs similarity index 100% rename from oak/server/rust/oak_runtime/src/time/tests.rs rename to oak_runtime/src/time/tests.rs diff --git a/oak/server/rust/oak_runtime/tests/integration_test.rs b/oak_runtime/tests/integration_test.rs similarity index 100% rename from oak/server/rust/oak_runtime/tests/integration_test.rs rename to oak_runtime/tests/integration_test.rs diff --git a/oak_services/Cargo.toml b/oak_services/Cargo.toml index 425f13dd8bc..a691678bf58 100644 --- a/oak_services/Cargo.toml +++ b/oak_services/Cargo.toml @@ -9,16 +9,17 @@ license = "Apache-2.0" [dependencies] log = "*" -prost = "*" -prost-types = "*" +prost = { path = "../third_party/prost" } +prost-types = { path = "../third_party/prost/prost-types" } oak_abi = { path = "../oak_abi" } oak_io = { path = "../oak_io" } [build-dependencies] oak_utils = { path = "../oak_utils" } -prost-build = "*" +prost-build = { path = "../third_party/prost/prost-build" } [patch.crates-io] -prost-build = { path = "../third_party/prost/prost-build" } prost = { path = "../third_party/prost" } +prost-build = { path = "../third_party/prost/prost-build" } +prost-derive = { path = "../third_party/prost/prost-derive" } prost-types = { path = "../third_party/prost/prost-types" } diff --git a/oak_utils/Cargo.toml b/oak_utils/Cargo.toml index acb2de81668..b596a2acb69 100644 --- a/oak_utils/Cargo.toml +++ b/oak_utils/Cargo.toml @@ -10,19 +10,21 @@ license = "Apache-2.0" [dependencies] anyhow = "*" maplit = "*" -prost = "*" -tempfile = "*" -quote = "*" -walkdir = "*" -prost-build = "*" proc-macro2 = "*" +prost = { path = "../third_party/prost" } +prost-build = { path = "../third_party/prost/prost-build" } +quote = "*" +tempfile = "*" # Disable the `rustfmt` feature, as it requires `rustfmt` which may not be supported for custom # toolchains. tonic-build = { version = "*", default-features = false, features = [ "prost", "transport" ] } +walkdir = "*" [patch.crates-io] -prost-build = { path = "../third_party/prost/prost-build" } prost = { path = "../third_party/prost" } +prost-build = { path = "../third_party/prost/prost-build" } +prost-derive = { path = "../third_party/prost/prost-derive" } +prost-types = { path = "../third_party/prost/prost-types" } diff --git a/oak/proto/BUILD b/proto/BUILD similarity index 100% rename from oak/proto/BUILD rename to proto/BUILD diff --git a/oak/proto/authentication.proto b/proto/authentication.proto similarity index 100% rename from oak/proto/authentication.proto rename to proto/authentication.proto diff --git a/oak/proto/handle.proto b/proto/handle.proto similarity index 100% rename from oak/proto/handle.proto rename to proto/handle.proto diff --git a/oak/proto/introspection_events.proto b/proto/introspection_events.proto similarity index 100% rename from oak/proto/introspection_events.proto rename to proto/introspection_events.proto diff --git a/runner/src/main.rs b/runner/src/main.rs index 58aa247f283..3ddec2c0057 100644 --- a/runner/src/main.rs +++ b/runner/src/main.rs @@ -317,7 +317,7 @@ fn build_server(opt: &BuildServer) -> Step { name: "create bin folder".to_string(), command: Cmd::new( "mkdir", - vec!["-p".to_string(), "oak/server/bin".to_string()], + vec!["-p".to_string(), "oak_loader/bin".to_string()], ), }, Step::Single { @@ -343,8 +343,8 @@ fn build_server(opt: &BuildServer) -> Step { "--release".to_string(), ] }, - "--manifest-path=oak/server/rust/oak_loader/Cargo.toml".to_string(), - "--out-dir=oak/server/bin".to_string(), + "--manifest-path=oak_loader/Cargo.toml".to_string(), + "--out-dir=oak_loader/bin".to_string(), // `--out-dir` is unstable and requires `-Zunstable-options`. "-Zunstable-options".to_string(), ...if opt.server_variant == "logless" { @@ -505,7 +505,7 @@ fn run_example_server( application_file: &str, ) -> Box { Cmd::new_with_env( - "oak/server/bin/oak_loader", + "oak_loader/bin/oak_loader", spread![ "--grpc-tls-private-key=./examples/certs/local/local.key".to_string(), "--grpc-tls-certificate=./examples/certs/local/local.pem".to_string(), @@ -719,8 +719,8 @@ fn build_docker(example: &Example) -> Step { &[ "build", "--tag=oak_docker", - "--file=./oak/server/Dockerfile", - "./oak/server", + "--file=./oak_loader/Dockerfile", + "./oak_loader", ], ), }, diff --git a/scripts/build_gh_pages b/scripts/build_gh_pages index b2d3b14da90..9cc89683e7b 100755 --- a/scripts/build_gh_pages +++ b/scripts/build_gh_pages @@ -33,10 +33,10 @@ fi readonly TARGET_ABS_PATH="$(realpath "${TARGET_DIR}")" # All the dirs that we want to generate docs for. -declare -ar SOURCE_PATHS=("oak/server" "oak_abi" "oak_utils" "sdk" "runner") -declare -ar TARGET_SUBDIRS=("oak_runtime" "oak_abi" "oak_utils" "oak" "runner") +declare -ar SOURCE_PATHS=("oak_loader" "oak_runtime" "oak_abi" "oak_utils" "sdk" "runner") +declare -ar TARGET_SUBDIRS=("oak_loader" "oak_runtime" "oak_abi" "oak_utils" "oak" "runner") -# Titles used in the top-level index.html files. +# Titles used in the top-level index.html files. declare -ar PAGE_TITLES=("Runtime" "ABI" "Utils" "SDK" "Runner") readonly LEN=${#SOURCE_PATHS[@]} diff --git a/scripts/build_reproducibility_index b/scripts/build_reproducibility_index index 63b4e5f8718..772e9f87d08 100755 --- a/scripts/build_reproducibility_index +++ b/scripts/build_reproducibility_index @@ -13,7 +13,7 @@ source "$SCRIPTS_DIR/common" # List of artifacts that are expected to be reproducibly built. readonly REPRODUCIBLE_ARTIFACTS=( ./examples/target/wasm32-unknown-unknown/release/*.wasm - ./oak/server/target/x86_64-unknown-linux-musl/release/oak_loader + ./oak_loader/target/x86_64-unknown-linux-musl/release/oak_loader ) # Index file containing hashes of the reproducible artifacts, alongside their file names. diff --git a/scripts/common b/scripts/common index e5c1da6c862..e0ab7d0d1f2 100644 --- a/scripts/common +++ b/scripts/common @@ -15,10 +15,19 @@ readonly DOCKER_IMAGE_NAME='gcr.io/oak-ci/oak' readonly SERVER_DOCKER_IMAGE_NAME='gcr.io/oak-ci/oak-server' readonly CACHE_DIR='bazel-cache' -readonly SERVER_BIN_DIR="${PWD}/oak/server/bin" +readonly SERVER_BIN_DIR="${PWD}/oak_loader/bin" # List all workspaces. -declare -ar ALL_CRATES=("oak_utils" "oak_abi" "oak/server" "sdk" "examples" "runner" "experimental") +declare -ar ALL_CRATES=( + examples + experimental + oak_abi + oak_loader + oak_runtime + oak_utils + runner + sdk +) # To set up remote cache write credentials: # - navigate to https://pantheon.corp.google.com/iam-admin/serviceaccounts?project=oak-ci diff --git a/scripts/generate_root_ca_certs b/scripts/generate_root_ca_certs index e3e767c639a..3172861bc76 100755 --- a/scripts/generate_root_ca_certs +++ b/scripts/generate_root_ca_certs @@ -10,7 +10,7 @@ readonly COMMIT="be85a54767b3559e7bb262e4f1a78e1c5829e478" readonly DOWNLOAD_DIR="${SCRIPTS_DIR}/../downloads" readonly DOWNLOAD_FILE="${DOWNLOAD_DIR}/files.tar.gz" readonly EXTRACT_DIR="${DOWNLOAD_DIR}/files" -readonly TARGET_FILE="${SCRIPTS_DIR}/../oak/server/rust/oak_loader/src/certs/roots.pem" +readonly TARGET_FILE="${SCRIPTS_DIR}/../oak_loader/src/certs/roots.pem" if [[ -d "${DOWNLOAD_DIR}" ]]; then rm --recursive --force "${DOWNLOAD_DIR}" diff --git a/scripts/run_cargo_crev b/scripts/run_cargo_crev index 5856f47cd74..62097ac7d15 100755 --- a/scripts/run_cargo_crev +++ b/scripts/run_cargo_crev @@ -22,7 +22,7 @@ done cargo crev repo fetch all ( - cd ./oak/server + cd ./oak_loader # Ignore status code from the verify command. cargo crev crate verify --show-all || true ) diff --git a/scripts/run_tests_coverage b/scripts/run_tests_coverage index a57b2ef8966..8e37d4b46b9 100755 --- a/scripts/run_tests_coverage +++ b/scripts/run_tests_coverage @@ -9,7 +9,7 @@ source "$SCRIPTS_DIR/common" # Generate coverage summary ( - cd oak/server || exit 1 + cd oak_loader || exit 1 grcov ./target/debug/ \ --source-dir=. \ --llvm \ diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index 7c6a994432a..bd61c6b0279 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -18,7 +18,7 @@ oak_abi = { path = "../oak_abi" } oak_app_build = { path = "rust/oak_app_build" } oak_derive = { path = "rust/oak_derive" } oak_io = { path = "../oak_io" } -oak_runtime = { path = "../oak/server/rust/oak_runtime" } +oak_runtime = { path = "../oak_runtime" } oak_services = { path = "../oak_services" } oak_tests = { path = "rust/oak_tests" } oak_utils = { path = "../oak_utils" } diff --git a/sdk/rust/oak/build.rs b/sdk/rust/oak/build.rs index 0797ca7b130..f77031fb6ee 100644 --- a/sdk/rust/oak/build.rs +++ b/sdk/rust/oak/build.rs @@ -19,7 +19,7 @@ fn main() { &[ "../../../oak_services/proto/storage_service.proto", "../../../oak_services/proto/roughtime_service.proto", - "../../../oak/proto/handle.proto", + "../../../proto/handle.proto", ], &["../../.."], oak_utils::ProtoOptions { @@ -34,7 +34,7 @@ fn main() { std::fs::create_dir_all(&handle_tests_out).unwrap(); oak_utils::compile_protos_with_options( &["tests/handle_extract_inject.proto"], - &["tests/", "../../../oak/proto"], + &["tests/", "../../../proto"], oak_utils::ProtoOptions { out_dir_override: Some(handle_tests_out), ..Default::default() diff --git a/sdk/rust/oak_app_build/src/main.rs b/sdk/rust/oak_app_build/src/main.rs index 08e67354bbd..61e80700b09 100644 --- a/sdk/rust/oak_app_build/src/main.rs +++ b/sdk/rust/oak_app_build/src/main.rs @@ -19,7 +19,7 @@ //! Invoke with: //! //! ```shell -//! cargo run --manifest-path=oak/server/rust/oak_app_build/Cargo.toml -- \ +//! cargo run --manifest-path=sdk/rust/oak_app_build/Cargo.toml -- \ //! --manifest-path= //! ``` //! diff --git a/oak/server/testdata/empty.wat b/testdata/empty.wat similarity index 100% rename from oak/server/testdata/empty.wat rename to testdata/empty.wat diff --git a/oak/server/testdata/minimal.wat b/testdata/minimal.wat similarity index 100% rename from oak/server/testdata/minimal.wat rename to testdata/minimal.wat diff --git a/oak/server/testdata/missing.wat b/testdata/missing.wat similarity index 100% rename from oak/server/testdata/missing.wat rename to testdata/missing.wat diff --git a/oak/server/testdata/wrong.wat b/testdata/wrong.wat similarity index 100% rename from oak/server/testdata/wrong.wat rename to testdata/wrong.wat