Skip to content

Commit 7bf031e

Browse files
Moving to SageMaker defaults
1 parent 916e915 commit 7bf031e

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

tests/test_clean_core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import os
23

34
import pytest
45
import sagemaker
@@ -11,12 +12,11 @@
1112

1213

1314
# noinspection DuplicatedCode
14-
def test_clean_train_warm_pool(request):
15+
def test_clean_train_warm_pool():
1516
logging.info("Starting training")
1617

17-
estimator = PyTorch(entry_point='train_clean.py',
18+
estimator = PyTorch(entry_point=os.path.basename('source_dir/training_clean/train_clean.py'),
1819
source_dir='source_dir/training_clean/',
19-
role=request.config.getini('sagemaker_role'),
2020
framework_version='1.9.1',
2121
py_version='py38',
2222
instance_count=1,

tests/test_functions.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import logging
2+
13
import boto3
24
import pytest
5+
import sagemaker.config
36

47
from sagemaker.pytorch import PyTorch
58
from sagemaker_ssh_helper.wrapper import SSHEnvironmentWrapper, SSHEstimatorWrapper
@@ -102,3 +105,18 @@ def test_bucket_exists():
102105
_ = _create_bucket_if_doesnt_exist('eu-west-1', custom_bucket_name)
103106
bucket = _create_bucket_if_doesnt_exist('eu-west-1', custom_bucket_name)
104107
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"))

0 commit comments

Comments
 (0)