@@ -11,7 +11,7 @@ import { getLogger } from './logger/logger'
11
11
import { VSCODE_EXTENSION_ID , extensionAlphaVersion } from './extensions'
12
12
import { Ec2MetadataClient } from './clients/ec2MetadataClient'
13
13
import { DefaultEc2MetadataClient } from './clients/ec2MetadataClient'
14
- import { extensionVersion , getCodeCatalystDevEnvId } from './vscode/env'
14
+ import { extensionVersion , getCodeCatalystDevEnvId , hasSageMakerEnvVars } from './vscode/env'
15
15
import globals from './extensionGlobals'
16
16
import { once } from './utilities/functionUtils'
17
17
import {
@@ -170,26 +170,14 @@ export function isCloud9(flavor: 'classic' | 'codecatalyst' | 'any' = 'any'): bo
170
170
return ( flavor === 'classic' && ! codecat ) || ( flavor === 'codecatalyst' && codecat )
171
171
}
172
172
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
-
185
173
/**
186
174
*
187
175
* @param appName to identify the proper SM instance
188
176
* @returns true if the current system is SageMaker(SMAI or SMUS)
189
177
*/
190
178
export function isSageMaker ( appName : 'SMAI' | 'SMUS' = 'SMAI' ) : boolean {
191
179
// Check for SageMaker-specific environment variables first
192
- if ( hasSageMakerEnvVars ( ) || process . env . SERVICE_NAME === sageMakerUnifiedStudio ) {
180
+ if ( hasSageMakerEnvVars ( ) ) {
193
181
getLogger ( ) . debug ( 'SageMaker environment detected via environment variables' )
194
182
return true
195
183
}
0 commit comments