Repository navigation
Conversation
…proto and VERSION Move the generated compute-driver proto closure (options, extension, datamodel, sandbox, compute_driver) and the git-derived build VERSION into a new openshell-driver-sdk crate. openshell-core refers to the generated types by extern path and re-exports them, so every path under openshell_core::proto keeps resolving to the same single definition. Signed-off-by: Evan Lezar <elezar@nvidia.com>
Move sandbox_session, sandbox_generation, time, progress, image, external_driver_socket, jwt (session tokens), extension_protocol, network_trust and the compute driver trait into openshell-driver-sdk, and re-export each from openshell-core so existing paths keep working. Add openshell-container-runtime for desktop-only code and move the Podman destination-trust generation markers there. parse_exp_secs stays in core because only core uses it. Signed-off-by: Evan Lezar <elezar@nvidia.com>
…een SDK and desktop crate Move sandbox_env, container_paths, driver_mounts, e2fsprogs, and the shared half of driver_utils and paths into openshell-driver-sdk. Move the desktop-only half of driver_utils and local_api_socket into openshell-container-runtime, and point the Docker and Podman drivers at it. openshell-core re-exports the SDK modules so existing paths keep resolving. Signed-off-by: Evan Lezar <elezar@nvidia.com>
…d config Move the items shared with core into openshell-driver-sdk and the desktop-only items (CDI GPU selection, resource-admission provenance labels, the string-list serde helper, and the Docker/Podman config defaults) into openshell-container-runtime. Core-only items stay in openshell-core, which re-exports the SDK items. Point the Docker, Podman, and VM drivers at the new paths. Signed-off-by: Evan Lezar <elezar@nvidia.com>
…m the desktop drivers Move the Isolation Backend contract types, the policy conversion they depend on, the backend registration types, and the shared constants into openshell-driver-sdk, with openshell-isolation-interface, openshell-sandbox-backend, and openshell-policy re-exporting them. Move the remaining shared helpers (net, settings, telemetry env value) into the SDK. The Docker, Podman, and VM drivers now import from the SDK and openshell-container-runtime and no longer name openshell-core. Move the sha2 allowance in deny.toml and CRYPTO.md from openshell-isolation-interface to openshell-driver-sdk, where that code now lives, and document the new crates. Signed-off-by: Evan Lezar <elezar@nvidia.com>
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Splits the code that the Docker, Podman, and VM drivers share with core into a thin
openshell-driver-sdkcrate and a desktop-onlyopenshell-container-runtimecrate.openshell-corere-exports every SDK item, so each item has one definition and no public path changes. This is the first implementation step of RFC 0022 / #5200.Related Issue
Closes #5383
Changes
crates/openshell-driver-sdk. It depends only on workspace crates and crates.io (never onopenshell-core). It owns the generated compute-driver proto closure (options,extension,datamodel,sandbox,compute_driver), the git-derivedVERSION, and the items classified as SDK below.crates/openshell-container-runtimefor items used only by the desktop drivers. It depends on the SDK, never on core.openshell-corere-exports the SDK modules and items. Its build refers to the moved protos through prostextern_path, soopenshell_core::proto::...types are the same types.FILE_DESCRIPTOR_SETstill covers every proto.openshell-isolation-interfaceand the shared constants inopenshell-sandbox-backendandopenshell-policynow re-export the SDK definitions.openshell_core. The compiler proves the classification: nothing core-only is used by them directly.jwt,otel,clap, andtelemetryforward to the SDK.driver-extractionis removed because the tar and cache helpers it gated are desktop-only and now live unconditionally in the container-runtime crate.sha2allowance indeny.tomlandCRYPTO.mdfromopenshell-isolation-interfacetoopenshell-driver-sdk, where that code now lives. No exception is added or widened.AGENTS.mdandCONTRIBUTING.mdand add READMEs for the new crates.Classification table
Legend: SDK = used by something that stays in core (gateway, supervisor, Kubernetes driver, sandbox) and by the desktop drivers; desktop = used only by the Docker, Podman, and VM drivers; core-only = not used by the desktop drivers. Usage was traced from what the three drivers compile against, item by item including
usegroups, and then checked for users outside the drivers. SDK =openshell-driver-sdk, CR =openshell-container-runtime.compute_driver.prototypes and clients/servers,proto::{compute,extension,sandbox,datamodel}openshell-core::protoproto(core refers to them byextern_pathand re-exports)VERSIONopenshell-corebuild.rs; core re-exports)compute::ComputeDriveropenshell-core::computeSandboxSessionId,SandboxGenerationIdopenshell-coreError,Result,ComputeDriverErroropenshell-core::errorNetworkSupervisorTrustBundle,MAX_NETWORK_SUPERVISOR_TRUST_BUNDLE_BYTESopenshell-core::network_trustNETWORK_SUPERVISOR_TRUST_GENERATION_KEY,..._NONEopenshell-core::network_trustnetwork_trustsandbox_env::*(env names,OtlpProtocol,OtlpExport,SupervisorOtlp,SupervisorOtlpArgs,MainProcessConfig, UID/GID defaults, OTLP relay)openshell-core::sandbox_envsandbox_env, whole module (see Notes)jwt::{CredentialEpoch, SandboxLaunchAuthentication, SecretJwt, SessionRotation, SessionVerificationKey, SupervisorAuthBundle, ...}openshell-core::jwtjwt(featurejwt)jwt::parse_exp_secsopenshell-core::jwtextension_protocol::*openshell-coreexternal_driver_socket::*openshell-corecontainer_paths::*(incl.SSH_SOCKET_PATH,VM_GUEST_*,NETNS_MOUNT_ROOT)openshell-coredriver_mounts::*openshell-coree2fsprogs::{resolve, preflight}openshell-coredriver_utils: labels,CONDITION_{EXITED,STOPPED,RUNTIME_RESTART},SUPERVISOR_EXIT_WORKSPACE_VALIDATION_FAILED, mount paths used by Kubernetes, upstream-proxy parsing/reading,sandbox_log_level,validate_guest_spiffe_tcp_endpointopenshell-core::driver_utilsdriver_utilsdriver_utils:LABEL_SANDBOX_NAMESPACE,CONDITION_WORKSPACE_VALIDATION_FAILED,WORKSPACE_VALIDATION_FAILED_MESSAGE,SANDBOX_RUNTIME_IMAGE_BINARY_PATH,PROXY_CA_MOUNT_PATH,PROVIDER_SPIFFE_WORKLOAD_API_SOCKET_MOUNT_DIR,validate_provider_spiffe_unix_socket,projected_provider_spiffe_socket_path,sandbox_token_path,supervisor_image_tag,supervisor_image_should_refresh,extract_first_tar_entry,write_cache_binary_atomic,supervisor_cache_path,temp_extract_container_name,validate_linux_elf_binaryopenshell-core::driver_utilsdriver_utilsgpu::{effective_driver_gpu_count, driver_gpu_requirements}openshell-core::gpugpugpu::{CdiGpuInventory, CdiGpuDefaultSelector, CdiGpuSelectionError, validate_cdi_*, validate_specific_gpu_device_request}openshell-core::gpugpugpu::{sandbox_gpu_requested, sandbox_gpu_count}openshell-core::gpugpuresource_admission::{ResourceAdmissionConfig, DriverAdmissionConfig, check_sandbox_driver_config, check_driver_config}openshell-coreresource_admission::{CONFIG_USED_LABEL, IDENTITIES_LABEL, check_config_provenance}openshell-coreresource_admissionconfig::{AppArmorProfile, ImagePullPolicy, UpstreamProxyConfig, DEFAULT_SERVER_PORT, DEFAULT_STOP_TIMEOUT_SECS, SANDBOX_RUNTIME_IMAGE_ENV, SUPERVISOR_IMAGE_ENV, default_sandbox_runtime_image, default_supervisor_image, resolve_supervisor_image_tag}openshell-core::configconfigconfig::{DEFAULT_SSH_PORT, DEFAULT_SANDBOX_PIDS_LIMIT, default_sandbox_pids_limit, CDI_GPU_DEVICE_ALL}openshell-core::configconfigconfig::Configand gateway/server/auth tablesopenshell-core::configproto_struct::{json_object_to_struct, struct_to_json_value, struct_to_json_object, value_to_json, json_value_to_proto}openshell-coreproto_struct::deserialize_optional_non_empty_string_listopenshell-coreproto_structpaths::{xdg_state_dir, xdg_data_dir, create_dir_restricted, set_dir_owner_only, set_file_owner_only, is_posix_absolute}openshell-core::pathspathspaths::*openshell-core::pathsnet::{set_tcp_nodelay_best_effort, connect_tcp_nodelay_best_effort}openshell-core::netnetnetopenshell-core::nettime::*,progress::*,image::*openshell-coresettings::parse_bool_likeopenshell-core::settingssettingssettings::*openshell-core::settingstelemetry::enabled_env_valueopenshell-core::telemetrytelemetry(featuretelemetry)telemetry::*openshell-core::telemetrylocal_api_socket::*openshell-corelocal_api_socketpolicy::*(sandbox policy conversion used by the Isolation Backend contract),isolation_registration::*openshell-corecontract::{BackendError, ProvisioningEvidence, ResolvedWorkloadIdentity, ...},AgentSpecopenshell-isolation-interfaceisolation_interface; crate re-exportsBACKEND_NAME,GPU_RESOURCE_CLAIM,ALLOW_EXTRA_SUPPLEMENTARY_GROUPS_RESOURCE_CLAIM,SUPERVISOR_CA_RUNTIME_ROOT,SUPERVISOR_CA_RUNTIME_DIRopenshell-sandbox-backendisolation_interface; crate re-exportsboundary_protocol::{BoundaryConfig, BoundaryListener, GatewayVerificationKey, SandboxRuntimeDescriptor, SandboxTls*, SandboxTransport, generate_sandbox_tls_material}openshell-sandbox-backendMIN_SANDBOX_UID,MAX_SANDBOX_UIDopenshell-policypolicy;openshell-policyre-exportsComputeDriverTracing,DriverTracingConfig,InProcessRpcTracer,compute_driver_rpc_layer,install_driver_tracing,rpc::*,ErrorStatusGuard,record_error_result,current_trace_context_environment,layer_excluding_target_prefixes,TracedGrpcStreamopenshell-otelopenshell-otel(see Notes)Notes on choices
DriverSandboxSpecare used by every driver and by the gateway, so they are SDK items. The closure ofcompute_driver.protois small (options,extension,datamodel,sandbox), so it moved whole. This is what the issue's import-path count missed: almost every other SDK item depends on these types.sandbox_env,container_paths,driver_mounts,time,progress,image,error,e2fsprogs, andisolation_interfaceform one protocol or policy that the supervisor, the Kubernetes driver, and the desktop drivers all read, and the unused remainder is small or checks against the rest of the module (for exampleCONTROL_ROOTSincontainer_pathsis the collision list thatdriver_mountsvalidates against). Splitting them would put one rule in two crates and bring back the drift the RFC warns about. Items in these modules that only the desktop drivers use (VM_GUEST_*,NETNS_MOUNT_ROOT,DEFAULT_SANDBOX_GID,SelinuxLabel,AppArmorProfile::oci_security_opt) are called out here rather than moved.AppArmorProfile::oci_security_optis an inherent method and has to stay with its type.driver_utils,gpu,resource_admission,config,proto_struct,network_trust,paths,net,settings,telemetry,jwt.NetworkSupervisorTrustBundleandMAX_NETWORK_SUPERVISOR_TRUST_BUNDLE_BYTESare SDK: the gateway validates against the limit and every driver receives the bundle. The Podman-only generation labels beside them are desktop.openshell-sandbox-backend::boundary_protocol. Its items are SDK items (the sandbox, supervisor, and Kubernetes driver use them), but the module is 2k lines and depends onprotobufwire helpers, route-handle validation inruntime_routed, and the generatedsandbox.backend.v1andsandbox.protocol.v1protos. Moving it needs a second proto split and a split of the wire helpers, so it belongs in its own change. Until then the Docker, Podman, and VM drivers still depend onopenshell-sandbox-backend(and through it on core). It needs a follow-up issue.openshell-otelstays in place. The tracing items are SDK-category, but the crate is already independent of core and the drivers already depend on it directly. Re-exporting it from the SDK would pull the OpenTelemetry stack into every SDK consumer.telemetry::enabled_env_valuekeeps its behavior: it reports"false"when thetelemetryfeature is off. The feature flows from core to the SDK, so a build that enables core telemetry still enables it here.Release Notes
None.
Testing
Ran locally:
cargo fmt --allcargo clippy --workspace --all-targets -- -D warningscargo testforopenshell-driver-sdk,openshell-container-runtime,openshell-core,openshell-isolation-interface,openshell-policy,openshell-sandbox-backend,openshell-driver-docker,openshell-driver-podman(tests moved with their code; no test logic changed)cargo testforopenshell-driver-kubernetes,openshell-supervisor,openshell-supervisor-control,openshell-sandboxpass.openshell-driver-vmhas 6 failing tests that needmke2fs/debugfs, which are not installed on the machine used (unrelated to this change; not re-run onmain).openshell-gatewaytests were not run: the host lackslibz3for linking.cargo check --all-targetsfor the nested workspaces (tests/*,e2e/rust,examples/*)mise run rust:deny:policyandrust:lockfiles:check(via the pre-commit hook)Checklist