public void UseAzureStorage_ConfiguresManager() { IMLOpsContext lcManager = new MLOpsBuilder().UseAzureStorage("UseDevelopmentStorage=true").Build(); lcManager.Should().BeOfType <MLOpsContext>("Because the default IMLLifeCycleManager is MLLifeCycleManager"); var metaDataField = typeof(MLOpsContext).GetField("metaDataStore", BindingFlags.Instance | BindingFlags.NonPublic); var repositoryField = typeof(MLOpsContext).GetField("modelRepository", BindingFlags.Instance | BindingFlags.NonPublic); metaDataField.GetValue(lcManager).Should().BeOfType <StorageAccountMetaDataStore>(); repositoryField.GetValue(lcManager).Should().BeOfType <StorageAccountModelRepository>(); }
public void UseAzureStorage_ConfiguresManager() { var sqlitePath = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}{Path.DirectorySeparatorChar}.mlops"; IMLOpsContext lcManager = new MLOpsBuilder().UseSQLite(sqlitePath).Build(); lcManager.Should().BeOfType <MLOpsContext>("Because the default IMLLifeCycleManager is MLLifeCycleManager"); var metaDataField = typeof(MLOpsContext).GetField("metaDataStore", BindingFlags.Instance | BindingFlags.NonPublic); var repositoryField = typeof(MLOpsContext).GetField("modelRepository", BindingFlags.Instance | BindingFlags.NonPublic); metaDataField.GetValue(lcManager).Should().BeOfType <SQLiteMetaDataStore>(); repositoryField.GetValue(lcManager).Should().BeOfType <LocalFileModelRepository>(); }
public void UseSQLServer_ConfiguresLifeCycleCatalog() { //Act IMLOpsContext unitUnderTest = new MLOpsBuilder() .UseSQLServer(this.configuration[ConfigurationKeys.ConnectionString]) .UseModelRepository(new Mock <IModelRepository>().Object) .Build(); unitUnderTest.Should().BeOfType <MLOpsContext>("Because the default IMLLifeCycleManager is MLLifeCycleManager"); //Assert unitUnderTest.LifeCycle.Should().NotBeNull(); }
public void UseSqlLite_ConfiguresLifeCycleCatalog() { //Act IMLOpsContext unitUnderTest = new MLOpsBuilder() .UseSQLite() .UseModelRepository(new Mock <IModelRepository>().Object) .Build(); unitUnderTest.Should().BeOfType <MLOpsContext>("Because the default IMLLifeCycleManager is MLLifeCycleManager"); //Assert unitUnderTest.LifeCycle.Should().NotBeNull(); }
public void UseAzureStorage_ConfiguresModelCatalog() { //Act IMLOpsContext unitUnderTest = new MLOpsBuilder().UseAzureStorage("UseDevelopmentStorage=true").Build(); unitUnderTest.Should().BeOfType <MLOpsContext>("Because the default IMLLifeCycleManager is MLLifeCycleManager"); //Assert unitUnderTest.Model.Should().NotBeNull(); var repositoryField = typeof(ModelCatalog).GetField("modelRepository", BindingFlags.Instance | BindingFlags.NonPublic); repositoryField.GetValue(unitUnderTest.Model).Should().BeOfType <StorageAccountModelRepository>(); }
public void UseAzureStorage_ConfiguresLifeCycleCatalog() { //Act IMLOpsContext unitUnderTest = new MLOpsBuilder().UseAzureStorage("UseDevelopmentStorage=true").Build(); unitUnderTest.Should().BeOfType <MLOpsContext>("Because the default IMLLifeCycleManager is MLLifeCycleManager"); //Assert unitUnderTest.LifeCycle.Should().NotBeNull(); var metaDataField = typeof(LifeCycleCatalog).GetField("metaDataStore", BindingFlags.Instance | BindingFlags.NonPublic); metaDataField.GetValue(unitUnderTest.LifeCycle).Should().BeOfType <StorageAccountMetaDataStore>(); }
public void UseAzureStorage_ConfiguresModelCatalog() { //Act var sqlitePath = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}{Path.DirectorySeparatorChar}.mlops"; IMLOpsContext unitUnderTest = new MLOpsBuilder().UseSQLite(sqlitePath).Build(); unitUnderTest.Should().BeOfType <MLOpsContext>("Because the default IMLLifeCycleManager is MLLifeCycleManager"); //Assert unitUnderTest.Model.Should().NotBeNull(); var repositoryField = typeof(ModelCatalog).GetField("modelRepository", BindingFlags.Instance | BindingFlags.NonPublic); repositoryField.GetValue(unitUnderTest.Model).Should().BeOfType <LocalFileModelRepository>(); }
public void UseAzureStorage_ConfiguresEvaluationCatalog() { //Act var sqlitePath = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}{Path.DirectorySeparatorChar}.mlops"; IMLOpsContext unitUnderTest = new MLOpsBuilder().UseSQLite(sqlitePath).Build(); unitUnderTest.Should().BeOfType <MLOpsContext>("Because the default IMLLifeCycleManager is MLLifeCycleManager"); //Assert unitUnderTest.Evaluation.Should().NotBeNull(); var metaDataField = typeof(EvaluationCatalog).GetField("metaDataStore", BindingFlags.Instance | BindingFlags.NonPublic); metaDataField.GetValue(unitUnderTest.Evaluation).Should().BeOfType <SQLiteMetaDataStore>(); }
public void MLOpsBuilder_BuildCreatesConfiguredLifeCycleManager() { var metaDataStore = new Mock <IMetaDataStore>().Object; var repository = new Mock <IModelRepository>().Object; IMLOpsContext lcManager = new MLOpsBuilder() .UseMetaDataStore(metaDataStore) .UseModelRepository(repository) .Build(); lcManager.Should().BeOfType <MLOpsContext>("Because the default IMLLifeCycleManager is MLLifeCycleManager"); var metaDataField = typeof(MLOpsContext).GetField("metaDataStore", BindingFlags.Instance | BindingFlags.NonPublic); var repositoryField = typeof(MLOpsContext).GetField("modelRepository", BindingFlags.Instance | BindingFlags.NonPublic); metaDataStore.Should().BeSameAs(metaDataField.GetValue(lcManager), "Because UseMetaDataStore should set the IMetaDataStore instance via constructor"); repository.Should().BeSameAs(repositoryField.GetValue(lcManager), "Because UseModelRepository should set the IModelRepository instance via constructor"); }
public void UseAWSS3ModelRepository_ConfiguresModelCatalog() { //Act IMLOpsContext unitUnderTest = new MLOpsBuilder() .UseAWSS3ModelRepository("access-key-id", "secret-access-key", "region-name") .UseMetaDataRepositories(new Mock <IDbContextFactory>().Object) .Build(); unitUnderTest.Should().BeOfType <MLOpsContext>("Because the default IMLOpsContext is MLOpsContext"); //Assert unitUnderTest.Model.Should().NotBeNull(); var repositoryField = typeof(ModelCatalog).GetField("modelRepository", BindingFlags.Instance | BindingFlags.NonPublic); repositoryField.GetValue(unitUnderTest.Model).Should().BeOfType <S3BucketModelRepository>(); }
public void UseSQLServer_ConfiguresLifeCycleCatalog() { //Act IMLOpsContext unitUnderTest = new MLOpsBuilder() .UseSQLServer("connectionString") .UseModelRepository(new Mock <IModelRepository>().Object) .Build(); unitUnderTest.Should().BeOfType <MLOpsContext>("Because the default IMLLifeCycleManager is MLLifeCycleManager"); //Assert unitUnderTest.LifeCycle.Should().NotBeNull(); var metaDataField = typeof(LifeCycleCatalog).GetField("metaDataStore", BindingFlags.Instance | BindingFlags.NonPublic); metaDataField.GetValue(unitUnderTest.LifeCycle).Should().BeOfType <SQLServerMetaDataStore>(); }
public void UseSqlLiteStorage_ConfiguresTrainingCatalog() { //Act IMLOpsContext unitUnderTest = new MLOpsBuilder() .UseSQLite() .UseModelRepository(new Mock <IModelRepository>().Object) .Build(); unitUnderTest.Should().BeOfType <MLOpsContext>("Because the default IMLLifeCycleManager is MLLifeCycleManager"); //Assert unitUnderTest.Training.Should().NotBeNull(); var metaDataField = typeof(TrainingCatalog).GetField("metaDataStore", BindingFlags.Instance | BindingFlags.NonPublic); metaDataField.GetValue(unitUnderTest.Training).Should().BeOfType <SQLiteMetaDataStore>(); }