From 72d49c65e8d9b11abfac15998fc482b1afdb1280 Mon Sep 17 00:00:00 2001 From: Ryan Campbell <89273172+bigtallcampbell@users.noreply.github.com> Date: Tue, 18 Jun 2024 11:32:53 -0500 Subject: [PATCH 1/2] Centralizing protos into -setup repo (#25) * Adding sdk protos to repo * Removing subfolder --------- Co-authored-by: Ryan Campbell --- protos/spacefx/common/Common.proto | 184 +++++++++++++++++++++ protos/spacefx/deployment/Deployment.proto | 80 +++++++++ protos/spacefx/link/Link.proto | 32 ++++ protos/spacefx/position/Position.proto | 45 +++++ protos/spacefx/sensor/Sensor.proto | 59 +++++++ 5 files changed, 400 insertions(+) create mode 100644 protos/spacefx/common/Common.proto create mode 100644 protos/spacefx/deployment/Deployment.proto create mode 100644 protos/spacefx/link/Link.proto create mode 100644 protos/spacefx/position/Position.proto create mode 100644 protos/spacefx/sensor/Sensor.proto diff --git a/protos/spacefx/common/Common.proto b/protos/spacefx/common/Common.proto new file mode 100644 index 0000000..00746ee --- /dev/null +++ b/protos/spacefx/common/Common.proto @@ -0,0 +1,184 @@ +syntax = "proto3"; + +package Microsoft.Azure.SpaceFx.MessageFormats.Common; +option csharp_namespace = "Microsoft.Azure.SpaceFx.MessageFormats.Common"; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/wrappers.proto"; + +enum Topics { + HEARTBEAT_PULSE = 0; + } + +enum StatusCodes { + SUCCESSFUL = 0; + UNAUTHORIZED = 1; + FORBIDDEN = 2; + NOT_FOUND = 3; + GENERAL_FAILURE = 4; + HEALTHY = 5; + READY = 6; + PENDING = 7; + TRANSMITTING = 8; + NOT_APPLICABLE = 9; + REJECTED = 10; + REQUEST = 11; + SERVICE_UNAVAILABLE = 12; + TIMEOUT = 13; + INTERNAL_SERVICE_ERROR = 14; + INVALID_ARGUMENT = 15; + UNKNOWN = 16; +} + +enum Priority { + LOW = 0; + MEDIUM = 1; + HIGH = 2; + CRITICAL = 3; +} + +enum HostServices { + LOGGING = 0; + POSITION = 1; + SENSOR = 2; + LINK = 3; +} + +enum PlatformServices { + DEPLOYMENT = 0; + MTS = 1; +} + +message RequestHeader { + string trackingId = 1; + string correlationId = 2; + string appId = 3; + map metadata = 4; +} + +message ResponseHeader { + string trackingId = 1; + string correlationId = 2; + StatusCodes status = 3; + string message = 4; + string appId = 5; + map metadata = 6; +} + +message HeartBeatPulse { + ResponseHeader responseHeader = 1; + string appId = 2; + google.protobuf.Timestamp currentSystemTime = 4; + google.protobuf.Timestamp appStartTime = 5; + int32 pulseFrequencyMS = 6; + string appVersion = 7; +} + + message DirectToApp { + ResponseHeader responseHeader = 1; + string sourceAppId = 3; + string messageType = 4; + google.protobuf.Any message = 5; +} + +// The health check response +message CacheItem { + RequestHeader requestHeader = 1; + string name = 2; + google.protobuf.Timestamp creationTime = 3; + google.protobuf.Timestamp expirationTime = 4; + google.protobuf.Any item = 5; +} + +// The health check request +message HealthCheckRequest { + RequestHeader requestHeader = 1; +} + +// The health check response +message HealthCheckResponse { + ResponseHeader responseHeader = 1; +} + +// The health check request +message PluginHealthCheckRequest { + RequestHeader requestHeader = 1; +} + +// The health check response +message PluginHealthCheckResponse { + ResponseHeader responseHeader = 1; +} + +// The health check request +message PluginConfigurationRequest { + RequestHeader requestHeader = 1; +} + +// The health check response +message PluginConfigurationResponse { + message PluginConfig { + StatusCodes status = 1; + string pluginName = 2; + string pluginPath = 3; + int32 processing_order = 4; + bool enabled = 5; + string corePermissions = 6; + string permissions = 7; + } + ResponseHeader responseHeader = 1; + repeated PluginConfig plugins = 2; +} + +message TelemetryMetric { + RequestHeader requestHeader = 1; + string metricName = 2; + google.protobuf.Int32Value metricValue = 3; + google.protobuf.Timestamp metricTime = 4; +} + +message TelemetryMultiMetric { + RequestHeader requestHeader = 1; + repeated TelemetryMetric telemetryMetrics = 2; +} + +message TelemetryMetricResponse { + ResponseHeader responseHeader = 1; +} + +message TelemetryMultiMetricResponse { + ResponseHeader responseHeader = 1; +} + +message LogMessage { + enum LOG_LEVEL{ + TRACE = 0; + DEBUG = 1; + INFO = 2; + WARNING = 3; + ERROR = 4; + CRITICAL = 5; + NONE = 6; + TELEMETRY = 7; + } + RequestHeader requestHeader = 1; + + LOG_LEVEL logLevel = 2; + string message = 3; + Priority priority = 4; + string category = 5; + string subCategory = 6; + repeated google.protobuf.Int32Value intValues = 7; + repeated google.protobuf.FloatValue floatValues = 8; + repeated google.protobuf.Timestamp dateTimeValues = 9; + repeated string stringValues = 10; + google.protobuf.Timestamp logTime = 11; + google.protobuf.Timestamp logReceivedTime = 12; + string logTimeUserReadable = 13; +} + +// Response sent back to the app from a logging request +message LogMessageResponse { + ResponseHeader responseHeader = 1; +} diff --git a/protos/spacefx/deployment/Deployment.proto b/protos/spacefx/deployment/Deployment.proto new file mode 100644 index 0000000..efc2e56 --- /dev/null +++ b/protos/spacefx/deployment/Deployment.proto @@ -0,0 +1,80 @@ +syntax = "proto3"; +package Microsoft.Azure.SpaceFx.MessageFormats.PlatformServices.Deployment; +option csharp_namespace = "Microsoft.Azure.SpaceFx.MessageFormats.PlatformServices.Deployment"; + +import "spacefx/common/Common.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; + +message DeployRequest { + enum DeployActions { + APPLY = 0; + CREATE = 1; + DELETE = 2; + LOAD_IMAGE_TARBALL = 3; + BUILD_IMAGE = 4; + RESTART_DEPLOYMENT = 5; + UPLINK_FILE = 6; + } + message AppContextString { + string appContext = 1; + } + message AppContextFile { + string fileName = 1; + bool required = 2; + } + + Common.RequestHeader requestHeader = 1; + string appName = 2; + string nameSpace = 3; + string appGroupLabel = 4; + string customerTrackingId = 5; + string schedule = 6; + google.protobuf.Timestamp startTime = 7; + google.protobuf.Duration maxDuration = 8; + string yamlFileContents = 9; + string containerInjectionTarget = 10; + DeployActions deployAction = 11; + Common.Priority priority = 12; + oneof appContext{ + AppContextString appContextString = 13; + AppContextFile appContextFile = 14; + } + enum GpuOptions { + NONE = 0; + NVIDIA = 1; + } + GpuOptions gpuRequirement = 15; + + message AppContainerImage { + string tarballFileName = 1; + string destinationRepository = 2; + string destinationTag = 3; + } + + AppContainerImage appContainerImage = 16; + + message AppContainerBuild { + string dockerFile = 1; + string destinationRepository = 2; + string destinationTag = 3; + map buildArguments = 4; + } + + AppContainerBuild appContainerBuild = 17; +} + +message DeployResponse { + Common.ResponseHeader responseHeader = 1; + DeployRequest deployRequest = 2; +} + +message ScheduledDeployments { + google.protobuf.Timestamp deploymentTime = 1; + repeated DeployResponse scheduleQueue = 2; +} + + +message DeployRequestsCollection { + repeated DeployRequest deployRequests = 1; + } diff --git a/protos/spacefx/link/Link.proto b/protos/spacefx/link/Link.proto new file mode 100644 index 0000000..57a8e44 --- /dev/null +++ b/protos/spacefx/link/Link.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package Microsoft.Azure.SpaceFx.MessageFormats.HostServices.Link; +option csharp_namespace = "Microsoft.Azure.SpaceFx.MessageFormats.HostServices.Link"; + +import "spacefx/common/Common.proto"; +import "google/protobuf/timestamp.proto"; + +message LinkRequest { + enum LinkType { + UNKNOWN = 0; + UPLINK = 1; + CROSSLINK = 2; + APP2APP = 3; + DOWNLINK = 4; + } + Common.RequestHeader requestHeader = 1; + LinkType linkType = 2; + Common.Priority priority = 3; + string fileName = 4; + string subdirectory = 5; + string destinationAppId = 6; + bool overwrite = 7; + bool leaveSourceFile = 8; + google.protobuf.Timestamp expirationTime = 9; +} + +message LinkResponse { + Common.ResponseHeader responseHeader = 1; + LinkRequest linkRequest = 2; + int64 fileSizeKB = 3; + google.protobuf.Timestamp linkProcessedTime = 4; +} \ No newline at end of file diff --git a/protos/spacefx/position/Position.proto b/protos/spacefx/position/Position.proto new file mode 100644 index 0000000..c2cf702 --- /dev/null +++ b/protos/spacefx/position/Position.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; +package Microsoft.Azure.SpaceFx.MessageFormats.HostServices.Position; +option csharp_namespace = "Microsoft.Azure.SpaceFx.MessageFormats.HostServices.Position"; + +import "spacefx/common/Common.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +message PositionRequest { + Common.RequestHeader requestHeader = 1; +} + +message PositionResponse { + Common.ResponseHeader responseHeader = 1; + Position position = 2; +} + +message PositionUpdateRequest { + Common.RequestHeader requestHeader = 1; + Position position = 2; +} + +message PositionUpdateResponse { + Common.ResponseHeader responseHeader = 1; +} + +// Response sent back to the app from a logging request +message Position { + message Attitude { + google.protobuf.DoubleValue x = 1; + google.protobuf.DoubleValue y = 2; + google.protobuf.DoubleValue z = 3; + google.protobuf.DoubleValue k = 4; + } + + message Point { + google.protobuf.DoubleValue x = 1; + google.protobuf.DoubleValue y = 2; + google.protobuf.DoubleValue z = 3; + } + + google.protobuf.Timestamp positionTime = 1; + Point point = 2; + Attitude attitude = 3; +} \ No newline at end of file diff --git a/protos/spacefx/sensor/Sensor.proto b/protos/spacefx/sensor/Sensor.proto new file mode 100644 index 0000000..f4565ff --- /dev/null +++ b/protos/spacefx/sensor/Sensor.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; +package Microsoft.Azure.SpaceFx.MessageFormats.HostServices.Sensor; +option csharp_namespace = "Microsoft.Azure.SpaceFx.MessageFormats.HostServices.Sensor"; + +import "spacefx/common/Common.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; + +message SensorsAvailableRequest { + Common.RequestHeader requestHeader = 1; +} + +message SensorsAvailableResponse { + Common.ResponseHeader responseHeader = 1; + + message SensorAvailable { + string sensorID = 1; + map metadata = 2; + } + repeated SensorAvailable sensors = 2; + } + + message TaskingPreCheckRequest { + Common.RequestHeader requestHeader = 1; + string sensorID = 2; + google.protobuf.Timestamp requestTime = 3; + google.protobuf.Timestamp expirationTime = 4; + google.protobuf.Any requestData = 5; + } + + message TaskingPreCheckResponse { + Common.ResponseHeader responseHeader = 1; + string sensorID = 2; + google.protobuf.Any responseData = 3; + } + + message TaskingRequest { + Common.RequestHeader requestHeader = 1; + string sensorID = 2; + google.protobuf.Timestamp requestTime = 3; + google.protobuf.Timestamp expirationTime = 4; + google.protobuf.Any requestData = 5; + } + + message TaskingResponse { + Common.ResponseHeader responseHeader = 1; + string sensorID = 2; + google.protobuf.Any responseData = 3; + } + + message SensorData { + Common.ResponseHeader responseHeader = 1; + string destinationAppId = 2; + string sensorID = 3; + string taskingTrackingId = 4; + google.protobuf.Any data = 5; + google.protobuf.Timestamp generatedTime = 6; + google.protobuf.Timestamp expirationTime = 7; + } \ No newline at end of file From 66618dfceea5707f8d087fecd424a42f4c22cc4f Mon Sep 17 00:00:00 2001 From: Ryan Campbell <89273172+bigtallcampbell@users.noreply.github.com> Date: Tue, 18 Jun 2024 11:35:24 -0500 Subject: [PATCH 2/2] add dotnet_sdk_version to app.env (#26) Co-authored-by: Ryan Campbell --- .devcontainer/features/spacefx-dev/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.devcontainer/features/spacefx-dev/install.sh b/.devcontainer/features/spacefx-dev/install.sh index 81e37c3..0fb907f 100755 --- a/.devcontainer/features/spacefx-dev/install.sh +++ b/.devcontainer/features/spacefx-dev/install.sh @@ -239,6 +239,7 @@ function gen_app_env() { export _REMOTE_USER=${_REMOTE_USER} export _REMOTE_USER_HOME=${_REMOTE_USER_HOME} export _CONTAINER_USER=${_CONTAINER_USER} +export DOTNET_SDK_VERSION=${DOTNET_SDK_VERSION} export KUBECONFIG=${KUBECONFIG} export CLUSTER_ENABLED=${CLUSTER_ENABLED} export K3S_VERSION=${K3S_VERSION}