From 5d542a285e2ba76f7aa93f496b237c7ddf57d15e Mon Sep 17 00:00:00 2001 From: Brett Parker <67550533+Brett-Parker@users.noreply.github.com> Date: Sat, 29 Aug 2020 22:53:05 +0100 Subject: [PATCH 1/6] Baseline commit --- Benchmarks/MLOps.NET.Benchmarks/Benchmark.cs | 13 ++++++++ .../LifeCylceCatalogBenchmark.cs | 32 +++++++++++++++++++ .../MLOps.NET.Benchmarks.csproj | 17 ++++++++++ MLOps.NET.sln | 5 +++ 4 files changed, 67 insertions(+) create mode 100644 Benchmarks/MLOps.NET.Benchmarks/Benchmark.cs create mode 100644 Benchmarks/MLOps.NET.Benchmarks/LifeCylceCatalogBenchmark.cs create mode 100644 Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj diff --git a/Benchmarks/MLOps.NET.Benchmarks/Benchmark.cs b/Benchmarks/MLOps.NET.Benchmarks/Benchmark.cs new file mode 100644 index 00000000..4614c5c6 --- /dev/null +++ b/Benchmarks/MLOps.NET.Benchmarks/Benchmark.cs @@ -0,0 +1,13 @@ +using BenchmarkDotNet.Running; +using System; + +namespace MLOps.NET.Benchmarks +{ + public class Benchmark + { + public static void Main(string[] args) + { + var lifeCylceCatalogBenchmarks = BenchmarkRunner.Run(); + } + } +} diff --git a/Benchmarks/MLOps.NET.Benchmarks/LifeCylceCatalogBenchmark.cs b/Benchmarks/MLOps.NET.Benchmarks/LifeCylceCatalogBenchmark.cs new file mode 100644 index 00000000..d77b71b8 --- /dev/null +++ b/Benchmarks/MLOps.NET.Benchmarks/LifeCylceCatalogBenchmark.cs @@ -0,0 +1,32 @@ +using BenchmarkDotNet.Attributes; +using MLOps.NET.Catalogs; +using MLOps.NET.Storage; +using MLOps.NET.Utilities; +using Moq; +using System.Threading.Tasks; + +namespace MLOps.NET.Benchmarks +{ + public class LifeCylceCatalogBenchmarks + { + private Mock clockMock; + private Mock experimentRepositoryMock; + private Mock runRepositoryMock; + private LifeCycleCatalog sut; + + [GlobalSetup] + public void Initialize() + { + this.clockMock = new Mock(); + this.experimentRepositoryMock = new Mock(); + this.runRepositoryMock = new Mock(); + this.sut = new LifeCycleCatalog(experimentRepositoryMock.Object, runRepositoryMock.Object, clockMock.Object); + } + + [Benchmark] + public async Task CreateExperimentAsync() + { + await sut.CreateExperimentAsync("Benchmark experiment"); + } + } +} diff --git a/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj b/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj new file mode 100644 index 00000000..478917e9 --- /dev/null +++ b/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj @@ -0,0 +1,17 @@ + + + + Exe + netcoreapp3.1 + + + + + + + + + + + + diff --git a/MLOps.NET.sln b/MLOps.NET.sln index 1d49cf68..d775f8ec 100644 --- a/MLOps.NET.sln +++ b/MLOps.NET.sln @@ -103,6 +103,10 @@ Global {A45E6A71-DF5B-49DB-B78C-864740A81D6F}.Debug|Any CPU.Build.0 = Debug|Any CPU {A45E6A71-DF5B-49DB-B78C-864740A81D6F}.Release|Any CPU.ActiveCfg = Release|Any CPU {A45E6A71-DF5B-49DB-B78C-864740A81D6F}.Release|Any CPU.Build.0 = Release|Any CPU + {7547EBD6-6D86-4C83-8B0F-0E85526AA667}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7547EBD6-6D86-4C83-8B0F-0E85526AA667}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7547EBD6-6D86-4C83-8B0F-0E85526AA667}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7547EBD6-6D86-4C83-8B0F-0E85526AA667}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -123,6 +127,7 @@ Global {F8403022-3BE3-4491-A0E7-4E8EE0338957} = {BFA1E5BE-95E8-4A9B-BE55-8EFA8F8488F1} {8EF5AE0B-17DC-4909-8298-31AC27377184} = {D826364F-D0C6-4FB9-A4D1-837372F6367C} {A45E6A71-DF5B-49DB-B78C-864740A81D6F} = {D826364F-D0C6-4FB9-A4D1-837372F6367C} + {7547EBD6-6D86-4C83-8B0F-0E85526AA667} = {8AB880D4-678B-4DDF-A560-D07F0301519A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {44F93107-BB01-4A51-BBCB-A475BE891E6A} From 5cc1ae423a6427f38f0f0be0a0411104c6a204ca Mon Sep 17 00:00:00 2001 From: Brett Parker <67550533+Brett-Parker@users.noreply.github.com> Date: Sat, 29 Aug 2020 22:53:12 +0100 Subject: [PATCH 2/6] Update MLOps.NET.sln --- MLOps.NET.sln | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MLOps.NET.sln b/MLOps.NET.sln index d775f8ec..9c608b24 100644 --- a/MLOps.NET.sln +++ b/MLOps.NET.sln @@ -37,6 +37,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MLOps.NET.AWS.Tests", "test EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MLOps.NET.AWS.IntegrationTests", "test\MLOps.NET.AWS.IntegrationTests\MLOps.NET.AWS.IntegrationTests.csproj", "{A45E6A71-DF5B-49DB-B78C-864740A81D6F}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{8AB880D4-678B-4DDF-A560-D07F0301519A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MLOps.NET.Benchmarks", "Benchmarks\MLOps.NET.Benchmarks\MLOps.NET.Benchmarks.csproj", "{7547EBD6-6D86-4C83-8B0F-0E85526AA667}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU From e03e38dbc7b34c63f3106699cc8602779763884a Mon Sep 17 00:00:00 2001 From: Brett Parker <67550533+Brett-Parker@users.noreply.github.com> Date: Sun, 30 Aug 2020 13:52:00 +0100 Subject: [PATCH 3/6] Added project folder structure --- .../LifeCylceCatalogBenchmark.cs | 32 ------------------- .../MLOps.NET.Benchmarks.csproj | 6 ++++ .../SQLLite/BenchmarkSetup.cs | 19 +++++++++++ .../SQLLite/LifeCylceCatalogBenchmark.cs | 24 ++++++++++++++ 4 files changed, 49 insertions(+), 32 deletions(-) delete mode 100644 Benchmarks/MLOps.NET.Benchmarks/LifeCylceCatalogBenchmark.cs create mode 100644 Benchmarks/MLOps.NET.Benchmarks/SQLLite/BenchmarkSetup.cs create mode 100644 Benchmarks/MLOps.NET.Benchmarks/SQLLite/LifeCylceCatalogBenchmark.cs diff --git a/Benchmarks/MLOps.NET.Benchmarks/LifeCylceCatalogBenchmark.cs b/Benchmarks/MLOps.NET.Benchmarks/LifeCylceCatalogBenchmark.cs deleted file mode 100644 index d77b71b8..00000000 --- a/Benchmarks/MLOps.NET.Benchmarks/LifeCylceCatalogBenchmark.cs +++ /dev/null @@ -1,32 +0,0 @@ -using BenchmarkDotNet.Attributes; -using MLOps.NET.Catalogs; -using MLOps.NET.Storage; -using MLOps.NET.Utilities; -using Moq; -using System.Threading.Tasks; - -namespace MLOps.NET.Benchmarks -{ - public class LifeCylceCatalogBenchmarks - { - private Mock clockMock; - private Mock experimentRepositoryMock; - private Mock runRepositoryMock; - private LifeCycleCatalog sut; - - [GlobalSetup] - public void Initialize() - { - this.clockMock = new Mock(); - this.experimentRepositoryMock = new Mock(); - this.runRepositoryMock = new Mock(); - this.sut = new LifeCycleCatalog(experimentRepositoryMock.Object, runRepositoryMock.Object, clockMock.Object); - } - - [Benchmark] - public async Task CreateExperimentAsync() - { - await sut.CreateExperimentAsync("Benchmark experiment"); - } - } -} diff --git a/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj b/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj index 478917e9..1ee6bfdf 100644 --- a/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj +++ b/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj @@ -11,6 +11,12 @@ + + + + + + diff --git a/Benchmarks/MLOps.NET.Benchmarks/SQLLite/BenchmarkSetup.cs b/Benchmarks/MLOps.NET.Benchmarks/SQLLite/BenchmarkSetup.cs new file mode 100644 index 00000000..3218472e --- /dev/null +++ b/Benchmarks/MLOps.NET.Benchmarks/SQLLite/BenchmarkSetup.cs @@ -0,0 +1,19 @@ +using Microsoft.EntityFrameworkCore; +using MLOps.NET.Extensions; +using MLOps.NET.SQLite; +using MLOps.NET.Storage.Database; +using MLOps.NET.Storage.Interfaces; + +namespace MLOps.NET.Benchmarks +{ + internal class BenchmarkSetup + { + internal static IMLOpsContext Initialize() + { + return new MLOpsBuilder() + .UseLocalFileModelRepository() + .UseSQLite() + .Build(); + } + } +} diff --git a/Benchmarks/MLOps.NET.Benchmarks/SQLLite/LifeCylceCatalogBenchmark.cs b/Benchmarks/MLOps.NET.Benchmarks/SQLLite/LifeCylceCatalogBenchmark.cs new file mode 100644 index 00000000..20a77a6c --- /dev/null +++ b/Benchmarks/MLOps.NET.Benchmarks/SQLLite/LifeCylceCatalogBenchmark.cs @@ -0,0 +1,24 @@ +using BenchmarkDotNet.Attributes; +using MLOps.NET.Extensions; +using MLOps.NET.SQLite; +using System.Threading.Tasks; + +namespace MLOps.NET.Benchmarks +{ + public class LifeCylceCatalogBenchmarks + { + private IMLOpsContext sut; + + [GlobalSetup] + public void Initialize() + { + sut = BenchmarkSetup.Initialize(); + } + + [Benchmark] + public async Task CreateRunAsync() + { + await sut.LifeCycle.CreateRunAsync("Benchmark"); + } + } +} From 793825dca5483f79177d4532798d5208afca049b Mon Sep 17 00:00:00 2001 From: Brett Parker <67550533+Brett-Parker@users.noreply.github.com> Date: Sun, 30 Aug 2020 16:41:09 +0100 Subject: [PATCH 4/6] Added LifeCycleCatalog Added LifeCycleCatalog Benchmark only --- .../LifeCycleCatalogAzureBenchmark.cs} | 6 +-- Benchmarks/MLOps.NET.Benchmarks/Benchmark.cs | 21 ++++++++- .../Configuration/ConfigurationFactory.cs | 15 +++++++ .../Configuration/ConfigurationKeysAzure.cs | 9 ++++ .../ConfigurationKeysSQLServer.cs | 7 +++ .../MLOps.NET.Benchmarks.csproj | 11 ++--- .../SQLLite/BenchmarkSetup.cs | 19 -------- .../LifeCycleCatalogSQLServerBenchmark.cs | 24 ++++++++++ .../SQLite/LifeCycleCatalogSQLiteBenchmark.cs | 24 ++++++++++ .../Setup/BenchmarkSetup.cs | 45 +++++++++++++++++++ 10 files changed, 152 insertions(+), 29 deletions(-) rename Benchmarks/MLOps.NET.Benchmarks/{SQLLite/LifeCylceCatalogBenchmark.cs => Azure/LifeCycleCatalogAzureBenchmark.cs} (68%) create mode 100644 Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationFactory.cs create mode 100644 Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationKeysAzure.cs create mode 100644 Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationKeysSQLServer.cs delete mode 100644 Benchmarks/MLOps.NET.Benchmarks/SQLLite/BenchmarkSetup.cs create mode 100644 Benchmarks/MLOps.NET.Benchmarks/SQLServer/LifeCycleCatalogSQLServerBenchmark.cs create mode 100644 Benchmarks/MLOps.NET.Benchmarks/SQLite/LifeCycleCatalogSQLiteBenchmark.cs create mode 100644 Benchmarks/MLOps.NET.Benchmarks/Setup/BenchmarkSetup.cs diff --git a/Benchmarks/MLOps.NET.Benchmarks/SQLLite/LifeCylceCatalogBenchmark.cs b/Benchmarks/MLOps.NET.Benchmarks/Azure/LifeCycleCatalogAzureBenchmark.cs similarity index 68% rename from Benchmarks/MLOps.NET.Benchmarks/SQLLite/LifeCylceCatalogBenchmark.cs rename to Benchmarks/MLOps.NET.Benchmarks/Azure/LifeCycleCatalogAzureBenchmark.cs index 20a77a6c..6bffeb03 100644 --- a/Benchmarks/MLOps.NET.Benchmarks/SQLLite/LifeCylceCatalogBenchmark.cs +++ b/Benchmarks/MLOps.NET.Benchmarks/Azure/LifeCycleCatalogAzureBenchmark.cs @@ -5,20 +5,20 @@ namespace MLOps.NET.Benchmarks { - public class LifeCylceCatalogBenchmarks + public class LifeCycleCatalogAzureBenchmark { private IMLOpsContext sut; [GlobalSetup] public void Initialize() { - sut = BenchmarkSetup.Initialize(); + sut = BenchmarkSetup.InitializeAzure(); } [Benchmark] public async Task CreateRunAsync() { - await sut.LifeCycle.CreateRunAsync("Benchmark"); + await sut.LifeCycle.CreateRunAsync("Benchmark Azure"); } } } diff --git a/Benchmarks/MLOps.NET.Benchmarks/Benchmark.cs b/Benchmarks/MLOps.NET.Benchmarks/Benchmark.cs index 4614c5c6..d46a3f7d 100644 --- a/Benchmarks/MLOps.NET.Benchmarks/Benchmark.cs +++ b/Benchmarks/MLOps.NET.Benchmarks/Benchmark.cs @@ -1,5 +1,4 @@ using BenchmarkDotNet.Running; -using System; namespace MLOps.NET.Benchmarks { @@ -7,7 +6,25 @@ public class Benchmark { public static void Main(string[] args) { - var lifeCylceCatalogBenchmarks = BenchmarkRunner.Run(); + SQLiteBenchmarks(); + SQLServerBenchmarks(); + SQLServerAzure(); } + + public static void SQLiteBenchmarks() + { + var lifeCycleCatalogBenchmarks = BenchmarkRunner.Run(); + } + + public static void SQLServerBenchmarks() + { + var lifeCycleCatalogBenchmarks = BenchmarkRunner.Run(); + } + + public static void SQLServerAzure() + { + var lifeCycleCatalogBenchmarks = BenchmarkRunner.Run(); + } + } } diff --git a/Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationFactory.cs b/Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationFactory.cs new file mode 100644 index 00000000..cae01720 --- /dev/null +++ b/Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationFactory.cs @@ -0,0 +1,15 @@ +using Microsoft.Extensions.Configuration; + +namespace MLOps.NET.Benchmarks +{ + public static class ConfigurationFactory + { + public static IConfiguration GetConfiguration() + { + return new ConfigurationBuilder() + .AddJsonFile("appsettings.json") + .AddEnvironmentVariables() + .Build(); + } + } +} diff --git a/Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationKeysAzure.cs b/Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationKeysAzure.cs new file mode 100644 index 00000000..6efe92cb --- /dev/null +++ b/Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationKeysAzure.cs @@ -0,0 +1,9 @@ +namespace MLOps.NET.Benchmarks +{ + internal class ConfigurationKeysAzure + { + public static string StorageAccount = "StorageAccount:ConnectionString"; + public static string CosmosEndPoint = "Cosmos:Endpoint"; + public static string CosmosAccountKey = "Cosmos:AccountKey"; + } +} diff --git a/Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationKeysSQLServer.cs b/Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationKeysSQLServer.cs new file mode 100644 index 00000000..3700d7f9 --- /dev/null +++ b/Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationKeysSQLServer.cs @@ -0,0 +1,7 @@ +namespace MLOps.NET.Benchmarks +{ + internal class ConfigurationKeysSQLServer + { + public static string ConnectionString = "SQLServer:ConnectionString"; + } +} diff --git a/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj b/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj index 1ee6bfdf..4ddf8008 100644 --- a/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj +++ b/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj @@ -6,17 +6,18 @@ + + + - - - - - + + + diff --git a/Benchmarks/MLOps.NET.Benchmarks/SQLLite/BenchmarkSetup.cs b/Benchmarks/MLOps.NET.Benchmarks/SQLLite/BenchmarkSetup.cs deleted file mode 100644 index 3218472e..00000000 --- a/Benchmarks/MLOps.NET.Benchmarks/SQLLite/BenchmarkSetup.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using MLOps.NET.Extensions; -using MLOps.NET.SQLite; -using MLOps.NET.Storage.Database; -using MLOps.NET.Storage.Interfaces; - -namespace MLOps.NET.Benchmarks -{ - internal class BenchmarkSetup - { - internal static IMLOpsContext Initialize() - { - return new MLOpsBuilder() - .UseLocalFileModelRepository() - .UseSQLite() - .Build(); - } - } -} diff --git a/Benchmarks/MLOps.NET.Benchmarks/SQLServer/LifeCycleCatalogSQLServerBenchmark.cs b/Benchmarks/MLOps.NET.Benchmarks/SQLServer/LifeCycleCatalogSQLServerBenchmark.cs new file mode 100644 index 00000000..40adbe18 --- /dev/null +++ b/Benchmarks/MLOps.NET.Benchmarks/SQLServer/LifeCycleCatalogSQLServerBenchmark.cs @@ -0,0 +1,24 @@ +using BenchmarkDotNet.Attributes; +using MLOps.NET.Extensions; +using MLOps.NET.SQLite; +using System.Threading.Tasks; + +namespace MLOps.NET.Benchmarks +{ + public class LifeCycleCatalogSQLServerBenchmark + { + private IMLOpsContext sut; + + [GlobalSetup] + public void Initialize() + { + sut = BenchmarkSetup.InitializeSQLServer(); + } + + [Benchmark] + public async Task CreateRunAsync() + { + await sut.LifeCycle.CreateRunAsync("Benchmark SQLServer"); + } + } +} diff --git a/Benchmarks/MLOps.NET.Benchmarks/SQLite/LifeCycleCatalogSQLiteBenchmark.cs b/Benchmarks/MLOps.NET.Benchmarks/SQLite/LifeCycleCatalogSQLiteBenchmark.cs new file mode 100644 index 00000000..cddb9c02 --- /dev/null +++ b/Benchmarks/MLOps.NET.Benchmarks/SQLite/LifeCycleCatalogSQLiteBenchmark.cs @@ -0,0 +1,24 @@ +using BenchmarkDotNet.Attributes; +using MLOps.NET.Extensions; +using MLOps.NET.SQLite; +using System.Threading.Tasks; + +namespace MLOps.NET.Benchmarks +{ + public class LifeCycleCatalogSQLiteBenchmark + { + private IMLOpsContext sut; + + [GlobalSetup] + public void Initialize() + { + sut = BenchmarkSetup.InitializeSQLite(); + } + + [Benchmark] + public async Task CreateRunAsync() + { + await sut.LifeCycle.CreateRunAsync("Benchmark SQLite"); + } + } +} diff --git a/Benchmarks/MLOps.NET.Benchmarks/Setup/BenchmarkSetup.cs b/Benchmarks/MLOps.NET.Benchmarks/Setup/BenchmarkSetup.cs new file mode 100644 index 00000000..103b0e8a --- /dev/null +++ b/Benchmarks/MLOps.NET.Benchmarks/Setup/BenchmarkSetup.cs @@ -0,0 +1,45 @@ +using Microsoft.EntityFrameworkCore; +using MLOps.NET.AWS; +using MLOps.NET.Azure; +using MLOps.NET.Extensions; +using MLOps.NET.SQLite; +using MLOps.NET.SQLServer; +using MLOps.NET.Storage.Database; +using MLOps.NET.Storage.Interfaces; + +namespace MLOps.NET.Benchmarks +{ + internal class BenchmarkSetup + { + internal static IMLOpsContext InitializeSQLite() + { + return new MLOpsBuilder() + .UseLocalFileModelRepository() + .UseSQLite() + .Build(); + } + + internal static IMLOpsContext InitializeSQLServer() + { + var configuration = ConfigurationFactory.GetConfiguration(); + + return new MLOpsBuilder() + .UseLocalFileModelRepository() + .UseSQLServer(configuration[ConfigurationKeysSQLServer.ConnectionString]) + .Build(); + } + + internal static IMLOpsContext InitializeAzure() + { + var configuration = ConfigurationFactory.GetConfiguration(); + + return new MLOpsBuilder() + .UseLocalFileModelRepository() + .UseCosmosDb(configuration[ConfigurationKeysAzure.CosmosEndPoint], + configuration[ConfigurationKeysAzure.CosmosAccountKey]) + .Build(); + } + } +} + + From 2ed5e1094260ffc4959ace7fbcd7907bf471fd83 Mon Sep 17 00:00:00 2001 From: Brett Parker <67550533+Brett-Parker@users.noreply.github.com> Date: Sun, 30 Aug 2020 16:48:57 +0100 Subject: [PATCH 5/6] Removed Using Removed unneccessary usings. --- .../Azure/LifeCycleCatalogAzureBenchmark.cs | 2 -- .../SQLServer/LifeCycleCatalogSQLServerBenchmark.cs | 2 -- .../SQLite/LifeCycleCatalogSQLiteBenchmark.cs | 2 -- Benchmarks/MLOps.NET.Benchmarks/Setup/BenchmarkSetup.cs | 6 +----- 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Benchmarks/MLOps.NET.Benchmarks/Azure/LifeCycleCatalogAzureBenchmark.cs b/Benchmarks/MLOps.NET.Benchmarks/Azure/LifeCycleCatalogAzureBenchmark.cs index 6bffeb03..6e783eda 100644 --- a/Benchmarks/MLOps.NET.Benchmarks/Azure/LifeCycleCatalogAzureBenchmark.cs +++ b/Benchmarks/MLOps.NET.Benchmarks/Azure/LifeCycleCatalogAzureBenchmark.cs @@ -1,6 +1,4 @@ using BenchmarkDotNet.Attributes; -using MLOps.NET.Extensions; -using MLOps.NET.SQLite; using System.Threading.Tasks; namespace MLOps.NET.Benchmarks diff --git a/Benchmarks/MLOps.NET.Benchmarks/SQLServer/LifeCycleCatalogSQLServerBenchmark.cs b/Benchmarks/MLOps.NET.Benchmarks/SQLServer/LifeCycleCatalogSQLServerBenchmark.cs index 40adbe18..b85cf5e1 100644 --- a/Benchmarks/MLOps.NET.Benchmarks/SQLServer/LifeCycleCatalogSQLServerBenchmark.cs +++ b/Benchmarks/MLOps.NET.Benchmarks/SQLServer/LifeCycleCatalogSQLServerBenchmark.cs @@ -1,6 +1,4 @@ using BenchmarkDotNet.Attributes; -using MLOps.NET.Extensions; -using MLOps.NET.SQLite; using System.Threading.Tasks; namespace MLOps.NET.Benchmarks diff --git a/Benchmarks/MLOps.NET.Benchmarks/SQLite/LifeCycleCatalogSQLiteBenchmark.cs b/Benchmarks/MLOps.NET.Benchmarks/SQLite/LifeCycleCatalogSQLiteBenchmark.cs index cddb9c02..6cf09c79 100644 --- a/Benchmarks/MLOps.NET.Benchmarks/SQLite/LifeCycleCatalogSQLiteBenchmark.cs +++ b/Benchmarks/MLOps.NET.Benchmarks/SQLite/LifeCycleCatalogSQLiteBenchmark.cs @@ -1,6 +1,4 @@ using BenchmarkDotNet.Attributes; -using MLOps.NET.Extensions; -using MLOps.NET.SQLite; using System.Threading.Tasks; namespace MLOps.NET.Benchmarks diff --git a/Benchmarks/MLOps.NET.Benchmarks/Setup/BenchmarkSetup.cs b/Benchmarks/MLOps.NET.Benchmarks/Setup/BenchmarkSetup.cs index 103b0e8a..f94d8654 100644 --- a/Benchmarks/MLOps.NET.Benchmarks/Setup/BenchmarkSetup.cs +++ b/Benchmarks/MLOps.NET.Benchmarks/Setup/BenchmarkSetup.cs @@ -1,11 +1,7 @@ -using Microsoft.EntityFrameworkCore; -using MLOps.NET.AWS; -using MLOps.NET.Azure; +using MLOps.NET.Azure; using MLOps.NET.Extensions; using MLOps.NET.SQLite; using MLOps.NET.SQLServer; -using MLOps.NET.Storage.Database; -using MLOps.NET.Storage.Interfaces; namespace MLOps.NET.Benchmarks { From 5162566de2843e696d0aecb71e68094fabd20145 Mon Sep 17 00:00:00 2001 From: Brett Parker <67550533+Brett-Parker@users.noreply.github.com> Date: Sun, 30 Aug 2020 17:04:10 +0100 Subject: [PATCH 6/6] Appsettings --- .../Configuration/ConfigurationFactory.cs | 4 ++-- .../MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj | 9 +++++++++ .../MLOps.NET.Benchmarks/Settings/appsettingsazure.json | 9 +++++++++ .../Settings/appsettingssqlserver.json | 5 +++++ Benchmarks/MLOps.NET.Benchmarks/Setup/BenchmarkSetup.cs | 4 ++-- 5 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 Benchmarks/MLOps.NET.Benchmarks/Settings/appsettingsazure.json create mode 100644 Benchmarks/MLOps.NET.Benchmarks/Settings/appsettingssqlserver.json diff --git a/Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationFactory.cs b/Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationFactory.cs index cae01720..d041d2b4 100644 --- a/Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationFactory.cs +++ b/Benchmarks/MLOps.NET.Benchmarks/Configuration/ConfigurationFactory.cs @@ -4,10 +4,10 @@ namespace MLOps.NET.Benchmarks { public static class ConfigurationFactory { - public static IConfiguration GetConfiguration() + public static IConfiguration GetConfiguration(string configuration) { return new ConfigurationBuilder() - .AddJsonFile("appsettings.json") + .AddJsonFile(configuration) .AddEnvironmentVariables() .Build(); } diff --git a/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj b/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj index 4ddf8008..fd929f67 100644 --- a/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj +++ b/Benchmarks/MLOps.NET.Benchmarks/MLOps.NET.Benchmarks.csproj @@ -21,4 +21,13 @@ + + + Always + + + Always + + + diff --git a/Benchmarks/MLOps.NET.Benchmarks/Settings/appsettingsazure.json b/Benchmarks/MLOps.NET.Benchmarks/Settings/appsettingsazure.json new file mode 100644 index 00000000..c0b60b58 --- /dev/null +++ b/Benchmarks/MLOps.NET.Benchmarks/Settings/appsettingsazure.json @@ -0,0 +1,9 @@ +{ + "StorageAccount": { + "ConnectionString": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;" + }, + "Cosmos": { + "Endpoint": "https://localhost:8081", + "AccountKey": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" + } +} diff --git a/Benchmarks/MLOps.NET.Benchmarks/Settings/appsettingssqlserver.json b/Benchmarks/MLOps.NET.Benchmarks/Settings/appsettingssqlserver.json new file mode 100644 index 00000000..a53c88e8 --- /dev/null +++ b/Benchmarks/MLOps.NET.Benchmarks/Settings/appsettingssqlserver.json @@ -0,0 +1,5 @@ +{ + "SQLServer": { + "ConnectionString": "Server=localhost,1433;Database=MLOpsNET_IntegrationTests;User Id=sa;Password=MLOps4TheWin!;" + } +} diff --git a/Benchmarks/MLOps.NET.Benchmarks/Setup/BenchmarkSetup.cs b/Benchmarks/MLOps.NET.Benchmarks/Setup/BenchmarkSetup.cs index f94d8654..bed9d998 100644 --- a/Benchmarks/MLOps.NET.Benchmarks/Setup/BenchmarkSetup.cs +++ b/Benchmarks/MLOps.NET.Benchmarks/Setup/BenchmarkSetup.cs @@ -17,7 +17,7 @@ internal static IMLOpsContext InitializeSQLite() internal static IMLOpsContext InitializeSQLServer() { - var configuration = ConfigurationFactory.GetConfiguration(); + var configuration = ConfigurationFactory.GetConfiguration("appsettingssqlserver.json"); return new MLOpsBuilder() .UseLocalFileModelRepository() @@ -27,7 +27,7 @@ internal static IMLOpsContext InitializeSQLServer() internal static IMLOpsContext InitializeAzure() { - var configuration = ConfigurationFactory.GetConfiguration(); + var configuration = ConfigurationFactory.GetConfiguration("appsettingsazure.json"); return new MLOpsBuilder() .UseLocalFileModelRepository()