Skip to content

Commit 9827b07

Browse files
committed
Update telemetry
1 parent 76f0d2e commit 9827b07

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

sagemaker-core/src/sagemaker/core/user_agent.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,18 @@
2323
NOTEBOOK_METADATA_FILE = "/etc/opt/ml/sagemaker-notebook-instance-version.txt"
2424
STUDIO_METADATA_FILE = "/opt/ml/metadata/resource-metadata.json"
2525

26-
SDK_VERSION = 1.0
26+
def _get_sdk_version():
27+
"""Read SDK version from VERSION file"""
28+
current_dir = os.path.dirname(os.path.abspath(__file__))
29+
repo_root = os.path.normpath(os.path.join(current_dir, '../../../..'))
30+
version_file_path = os.path.join(repo_root, 'VERSION')
31+
try:
32+
with open(version_file_path, 'r') as f:
33+
return f.read().strip()
34+
except (FileNotFoundError, IOError):
35+
return "3.0" # fallback version
36+
37+
SDK_VERSION = _get_sdk_version()
2738

2839

2940
def process_notebook_metadata_file():

0 commit comments

Comments
 (0)