@@ -11,7 +11,7 @@ import { getLogger } from './logger/logger'
1111import { VSCODE_EXTENSION_ID , extensionAlphaVersion } from './extensions'
1212import { Ec2MetadataClient } from './clients/ec2MetadataClient'
1313import { DefaultEc2MetadataClient } from './clients/ec2MetadataClient'
14- import { extensionVersion , getCodeCatalystDevEnvId } from './vscode/env'
14+ import { extensionVersion , getCodeCatalystDevEnvId , hasSageMakerEnvVars } from './vscode/env'
1515import globals from './extensionGlobals'
1616import { once } from './utilities/functionUtils'
1717import {
@@ -170,26 +170,14 @@ export function isCloud9(flavor: 'classic' | 'codecatalyst' | 'any' = 'any'): bo
170170 return ( flavor === 'classic' && ! codecat ) || ( flavor === 'codecatalyst' && codecat )
171171}
172172
173- /**
174- * Checks if the current environment has SageMaker-specific environment variables
175- * @returns true if SageMaker environment variables are detected
176- */
177- function hasSageMakerEnvVars ( ) : boolean {
178- return (
179- process . env . SAGEMAKER_APP_TYPE !== undefined ||
180- process . env . SAGEMAKER_INTERNAL_IMAGE_URI !== undefined ||
181- process . env . STUDIO_LOGGING_DIR ?. includes ( '/var/log/studio' ) === true
182- )
183- }
184-
185173/**
186174 *
187175 * @param appName to identify the proper SM instance
188176 * @returns true if the current system is SageMaker(SMAI or SMUS)
189177 */
190178export function isSageMaker ( appName : 'SMAI' | 'SMUS' = 'SMAI' ) : boolean {
191179 // Check for SageMaker-specific environment variables first
192- if ( hasSageMakerEnvVars ( ) || process . env . SERVICE_NAME === sageMakerUnifiedStudio ) {
180+ if ( hasSageMakerEnvVars ( ) ) {
193181 getLogger ( ) . debug ( 'SageMaker environment detected via environment variables' )
194182 return true
195183 }
0 commit comments