File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1
1
import logging
2
+ import os
2
3
3
4
import pytest
4
5
import sagemaker
11
12
12
13
13
14
# noinspection DuplicatedCode
14
- def test_clean_train_warm_pool (request ):
15
+ def test_clean_train_warm_pool ():
15
16
logging .info ("Starting training" )
16
17
17
- estimator = PyTorch (entry_point = ' train_clean.py' ,
18
+ estimator = PyTorch (entry_point = os . path . basename ( 'source_dir/training_clean/ train_clean.py') ,
18
19
source_dir = 'source_dir/training_clean/' ,
19
- role = request .config .getini ('sagemaker_role' ),
20
20
framework_version = '1.9.1' ,
21
21
py_version = 'py38' ,
22
22
instance_count = 1 ,
Original file line number Diff line number Diff line change
1
+ import logging
2
+
1
3
import boto3
2
4
import pytest
5
+ import sagemaker .config
3
6
4
7
from sagemaker .pytorch import PyTorch
5
8
from sagemaker_ssh_helper .wrapper import SSHEnvironmentWrapper , SSHEstimatorWrapper
@@ -102,3 +105,18 @@ def test_bucket_exists():
102
105
_ = _create_bucket_if_doesnt_exist ('eu-west-1' , custom_bucket_name )
103
106
bucket = _create_bucket_if_doesnt_exist ('eu-west-1' , custom_bucket_name )
104
107
bucket .delete ()
108
+
109
+
110
+ def test_sagemaker_default_config_location ():
111
+ f"""
112
+ See: https://sagemaker.readthedocs.io/en/stable/overview.html#default-configuration-file-location
113
+ See: { sagemaker .config .config_schema .SAGEMAKER_PYTHON_SDK_CONFIG_SCHEMA }
114
+ """
115
+ import os
116
+ from platformdirs import site_config_dir , user_config_dir
117
+
118
+ # Prints the location of the admin config file
119
+ logging .info (os .path .join (site_config_dir ("sagemaker" ), "config.yaml" ))
120
+
121
+ # Prints the location of the user config file
122
+ logging .info (os .path .join (user_config_dir ("sagemaker" ), "config.yaml" ))
You can’t perform that action at this time.
0 commit comments