Ejemplo n.º 1
0
 def test_mk_notebook_no_scripts(self, prj_no_vpc):
     notebook_cfg_no_vpc = cli_utils.mk_notebook(prj_no_vpc, "notebook-1")
     assert notebook_cfg_no_vpc == {
         "NotebookInstanceName": "modelling-project-notebook-1",
         "InstanceType": "ml.t2.medium",
         "DirectInternetAccess": "Disabled",
         "RoleArn": "arn:aws:iam::111111111111:role/modelling-project",
         "Tags": [{
             "Key": "ml2p-project",
             "Value": "modelling-project"
         }],
         "LifecycleConfigName":
         "modelling-project-notebook-1-lifecycle-config",
         "VolumeSizeInGB": 8,
     }
Ejemplo n.º 2
0
 def test_mk_notebook(self, prj):
     notebook_cfg_no_repo = cli_utils.mk_notebook(prj, "notebook-1")
     assert notebook_cfg_no_repo == {
         "NotebookInstanceName": "modelling-project-notebook-1",
         "DirectInternetAccess": "Disabled",
         "InstanceType": "ml.t2.medium",
         "RoleArn": "arn:aws:iam::111111111111:role/modelling-project",
         "Tags": [{
             "Key": "ml2p-project",
             "Value": "modelling-project"
         }],
         "LifecycleConfigName":
         "modelling-project-notebook-1-lifecycle-config",
         "VolumeSizeInGB": 8,
         "SubnetId": "subnet-1",
         "SecurityGroupIds": ["sg-1"],
     }
     notebook_cfg_repo = cli_utils.mk_notebook(prj,
                                               "notebook-1",
                                               repo_name="notebook-1-repo")
     assert notebook_cfg_repo == {
         "NotebookInstanceName": "modelling-project-notebook-1",
         "InstanceType": "ml.t2.medium",
         "DirectInternetAccess": "Disabled",
         "RoleArn": "arn:aws:iam::111111111111:role/modelling-project",
         "Tags": [{
             "Key": "ml2p-project",
             "Value": "modelling-project"
         }],
         "LifecycleConfigName":
         "modelling-project-notebook-1-lifecycle-config",
         "VolumeSizeInGB": 8,
         "DefaultCodeRepository": "modelling-project-notebook-1-repo",
         "SubnetId": "subnet-1",
         "SecurityGroupIds": ["sg-1"],
     }
Ejemplo n.º 3
0
 def test_mk_notebook_with_direct_internet_access_disabled_by_default(
         self, prj):
     notebook_cfg = cli_utils.mk_notebook(prj, "notebook-1")
     assert notebook_cfg["DirectInternetAccess"] == "Disabled"
Ejemplo n.º 4
0
 def test_mk_notebook_with_direct_internet_access_enabled(self, prj):
     prj.cfg["notebook"]["direct_internet_access"] = "Enabled"
     notebook_cfg = cli_utils.mk_notebook(prj, "notebook-1")
     assert notebook_cfg["DirectInternetAccess"] == "Enabled"