-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to handle SMB enable/disable and move templating to helm (#7)
* updating paths * adding spacefx chart utils * adding postStart * adding helm template util * adding resourceLimits to pods * adding appSettings and appSettingsMount * Adding appsettings * updating for volume templates * adding persistentvolumes and persistentvolumeclaims * updating for persistentvolumeclaim * updating for integration test * updating to include service account * updating to reuse persistentvolumeclaim when available * updating devcontainer to prod feature
- Loading branch information
1 parent
98e0700
commit 9fbcf33
Showing
24 changed files
with
729 additions
and
492 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
regctl image export ghcr.io/dapr/samples/pubsub-csharp-subscriber:1.9.0 --name pubsub-csharp-subscriber > /workspace/platform-deployment/test/sampleSchedules/pubsub-csharp-subscriber.tar |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
namespace Microsoft.Azure.SpaceFx.PlatformServices.Deployment; | ||
|
||
public partial class MessageHandler<T> : Microsoft.Azure.SpaceFx.Core.IMessageHandler<T> where T : notnull { | ||
private readonly ILogger<MessageHandler<T>> _logger; | ||
public static EventHandler<T>? MessageReceivedEvent; | ||
private readonly Microsoft.Azure.SpaceFx.Core.Services.PluginLoader _pluginLoader; | ||
private readonly IServiceProvider _serviceProvider; | ||
private readonly Core.Client _client; | ||
private readonly Models.APP_CONFIG _appConfig; | ||
private readonly PluginDelegates _pluginDelegates; | ||
|
||
public MessageHandler(ILogger<MessageHandler<T>> logger, PluginDelegates pluginDelegates, Microsoft.Azure.SpaceFx.Core.Services.PluginLoader pluginLoader, IServiceProvider serviceProvider, Core.Client client) { | ||
_logger = logger; | ||
_pluginDelegates = pluginDelegates; | ||
_pluginLoader = pluginLoader; | ||
_serviceProvider = serviceProvider; | ||
_client = client; | ||
|
||
_appConfig = new Models.APP_CONFIG(); | ||
} | ||
|
||
public void MessageReceived(T message, MessageFormats.Common.DirectToApp fullMessage) => Task.Run(() => { | ||
using (var scope = _serviceProvider.CreateScope()) { | ||
if (message == null || EqualityComparer<T>.Default.Equals(message, default)) { | ||
_logger.LogInformation("Received empty message '{messageType}' from '{appId}'. Discarding message.", typeof(T).Name, fullMessage.SourceAppId); | ||
return; | ||
} | ||
// This function is just a catch all for any messages that come in. They are not processed and no plugins are triggered for security reasons. | ||
// We're catching all messages here to reduce the log warnings for OOTB messages that are flowing | ||
} | ||
}); | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
|
||
using YamlDotNet.Core; | ||
using YamlDotNet.Core.Events; | ||
using YamlDotNet.Serialization; | ||
|
||
namespace Microsoft.Azure.SpaceFx.PlatformServices.Deployment; | ||
public static partial class Models { | ||
public class KubernetesObjects { | ||
public class ResourceDefinition { | ||
public ResourceSection Resources { get; set; } | ||
|
||
public ResourceDefinition() { | ||
Resources = new ResourceSection(); | ||
} | ||
} | ||
|
||
public class ResourceSection { | ||
public ResourceDetails Limits { get; set; } | ||
public ResourceDetails Requests { get; set; } | ||
|
||
public ResourceSection() { | ||
Limits = new ResourceDetails(); | ||
Requests = new ResourceDetails(); | ||
} | ||
} | ||
|
||
public class ResourceDetails { | ||
public string Cpu { get; set; } | ||
public string Memory { get; set; } | ||
|
||
public ResourceDetails() { | ||
Cpu = ""; | ||
Memory = ""; | ||
} | ||
} | ||
|
||
public class VolumeMountRoot { | ||
public List<V1VolumeMount> VolumeMounts { get; set; } | ||
public VolumeMountRoot() { | ||
VolumeMounts = new List<V1VolumeMount>(); | ||
} | ||
} | ||
|
||
public class VolumeRoot { | ||
public List<V1Volume> Volumes { get; set; } | ||
public VolumeRoot() { | ||
Volumes = new List<V1Volume>(); | ||
} | ||
|
||
public class ConfigMapVolumeSource { | ||
public string Name { get; set; } | ||
public ConfigMapVolumeSource() { | ||
Name = ""; | ||
} | ||
} | ||
|
||
public class SecretVolumeSource { | ||
public string SecretName { get; set; } | ||
public SecretVolumeSource() { | ||
SecretName = ""; | ||
} | ||
} | ||
|
||
public class PersistentVolumeClaimVolumeSource { | ||
public string ClaimName { get; set; } | ||
public PersistentVolumeClaimVolumeSource() { | ||
ClaimName = ""; | ||
} | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.