-
Notifications
You must be signed in to change notification settings - Fork 113
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
Refactor parameter specification #689
Comments
@ipetr0v let's start with insecure parameters only for now, since we will need them to configure things like gRPC endpoints, logging, authentication, etc. To take a concrete example, let's imagine we need to provide a username and password to use to connect to a non-Oak server (e.g. for storage). #696 covers figuring out how to get those secrets provisioned for a specific VM instance, but in this issue let's focus on what to do once we have those secrets available. I am thinking we could have a single parameter @ipetr0v @daviddrysdale WDYT? |
I was also thinking of doing something similar to Kubernetes, where we will have a YAML file with different nodes and their parameters: nodes:
- name: "aggregator"
parameters:
- backend_address: 127.0.0.1
- name: "load_balancer"
parameters:
- port: 8080
entrypoint:
node: "aggregator"
function: "oak_main" And each parameter will be passed only to a single node specified in the config (e.g. a dictionary But since YAML is a textual representation and we want to change it at any point in time without recompiling, we still need to pass our module to the Oak Loader. And there are 3 options:
- name: "aggregator"
url: "oak.google.com/aggregator"
parameters:
- backend_address: 127.0.0.1 |
In your example, how would the "aggregator" node instance (which is a generic Wasm node) get access to its parameters? That's the part I am trying to figure out :) the rest, as you say, can be done in a number of different ways |
IIUC each node has its main function: oak/examples/abitest/module_0/rust/src/lib.rs Lines 94 to 102 in d22711f
oak/examples/abitest/module_1/rust/src/lib.rs Lines 27 to 31 in d22711f
So parameters for each module can be passed alongside the #[no_mangle]
pub extern "C" fn oak_main(handle: u64, parameters: HashMap<String, String>) {} or pub extern "C" fn oak_main(handle: u64, node_sub_config: String) {
let parameters = serde_yaml::from_str(&node_sub_config)?;
} |
Conceptually that make sense, but note that neither |
@ipetr0v what's the current plan then? An additional channel over which the configuration can be read by the node at startup? What format should it have, and how should it be serialized? |
I still would prefer different parameters to |
FYI I just came across this https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/ , in case it helps. |
This will be used to pass configuration files and secrets to Oak Applications, by specifying them via command line flags to the `oak_loader` binary. Ref project-oak#689
This will be used to pass configuration files and secrets to Oak Applications, by specifying them via command line flags to the `oak_loader` binary. Also switch the top-level `oak_loader` error handling to the `anyhow` crate. Ref project-oak#689
This will be used to pass configuration files and secrets to Oak Applications, by specifying them via command line flags to the `oak_loader` binary. Also switch the top-level `oak_loader` error handling to the `anyhow` crate. Ref project-oak#689
This will be used to pass configuration files and secrets to Oak Applications, by specifying them via command line flags to the `oak_loader` binary. Also switch the top-level `oak_loader` error handling to the `anyhow` crate. Ref project-oak#689
This will be used to pass configuration files and secrets to Oak Applications, by specifying them via command line flags to the `oak_loader` binary. Also switch the top-level `oak_loader` error handling to the `anyhow` crate. Ref project-oak#689
This will be used to pass configuration files and secrets to Oak Applications, by specifying them via command line flags to the `oak_loader` binary. Also switch the top-level `oak_loader` error handling to the `anyhow` crate. Ref project-oak#689
This will be used to pass configuration files and secrets to Oak Applications, by specifying them via command line flags to the `oak_loader` binary. Also switch the top-level `oak_loader` error handling to the `anyhow` crate. Ref project-oak#689
This will be used to pass configuration files and secrets to Oak Applications, by specifying them via command line flags to the `oak_loader` binary. Also switch the top-level `oak_loader` error handling to the `anyhow` crate. Ref project-oak#689
This will be used to pass configuration files and secrets to Oak Applications, by specifying them via command line flags to the `oak_loader` binary. Also switch the top-level `oak_loader` error handling to the `anyhow` crate. Ref #689
Should this issue be closed? cc @tiziano88 |
After talking to @tiziano88 we decided that it's worth thinking about refactoring a way parameters for Oak applications are specified.
Currently we only have parameters inside an application configuration
config.textproto
file that is compiled in aconfig.bin
file using Protobuf:oak/examples/hello_world/config/config.textproto
Lines 1 to 13 in c4865b2
And any change requires a recompilation, so it's not very convenient.
Basically, there are two types of possible parameters for an Oak Application:
SAMPLE_THRESHOLD
from the Aggregator example. ThisSAMPLE_THRESHOLD
specifies the amount of samples that should be collected from users before revealing the aggregated value.In the case of insecure parameters it may feel strange to always recompile a
config.bin
whenever developers need to change something, for example when a backend service changed an IP address.So I think it makes sense to have secure parameters hardcoded (for now), since all changes will definitely effect the Wasm module hash value. And for insecure parameters the most obvious solution would be to have an additional argument{s} for
oak_runner
:Possible ways of implementing include:
oak_main
function, so they could be parsed inside the module, and developers could use whatever configuration they want (JSON
,YAML
etc.).config
pseudo-node with a correspondingfn get(name: &String) -> String
function.cc @project-oak/core
P.S.
Also I think that
grpc_port
could be a command-line argument too, so it would be more convenient to deploy Oak applications (as long as we will have only one gRPC server pseudo-node in Oak applications).The text was updated successfully, but these errors were encountered: