From fa41b2eb240b99267362be2015a0415741dd9cea Mon Sep 17 00:00:00 2001 From: sachinh-amazon <188173965+sachinh-amazon@users.noreply.github.com> Date: Tue, 27 Jan 2026 14:26:05 +0000 Subject: [PATCH 1/2] Build on ubuntu-22.04 and fix the sagemaker ui poststart up patch --- .github/workflows/build-targets.yaml | 2 +- patches/sagemaker/sagemaker-ui-post-startup.diff | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-targets.yaml b/.github/workflows/build-targets.yaml index ed2e799..767105e 100644 --- a/.github/workflows/build-targets.yaml +++ b/.github/workflows/build-targets.yaml @@ -5,7 +5,7 @@ on: jobs: build: name: Build Code Editor Targets - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: build-target: [code-editor-server, code-editor-sagemaker-server, code-editor-web-embedded, code-editor-web-embedded-with-terminal] diff --git a/patches/sagemaker/sagemaker-ui-post-startup.diff b/patches/sagemaker/sagemaker-ui-post-startup.diff index ed06db9..7edc81c 100644 --- a/patches/sagemaker/sagemaker-ui-post-startup.diff +++ b/patches/sagemaker/sagemaker-ui-post-startup.diff @@ -39,7 +39,7 @@ Index: code-editor-src/src/vs/server/node/webClientServer.ts if (pathname.startsWith(WEB_EXTENSION_PATH) && pathname.charCodeAt(WEB_EXTENSION_PATH.length) === CharCode.Slash) { // extension resource support return this._handleWebExtensionResource(req, res, pathname.substring(WEB_EXTENSION_PATH.length)); -@@ -571,6 +580,41 @@ export class WebClientServer { +@@ -571,6 +580,48 @@ export class WebClientServer { serveError(req, res, 500, error.message) } } @@ -60,8 +60,15 @@ Index: code-editor-src/src/vs/server/node/webClientServer.ts + //If exists, it will start the execution and add the execution logs in logFile. + try { + if (fs.existsSync(postStartupScriptPath)) { -+ // Adding 0o755 to make script file executable -+ fs.chmodSync(postStartupScriptPath, 0o755); ++ const stats = fs.statSync(postStartupScriptPath); ++ // Check if file has execute permission for owner, group, or others ++ // parseInt('111', 8) = 73 (octal 111 = --x--x--x execute bits) ++ // Bitwise AND checks if any execute bits are set ++ const isExecutable = (stats.mode & parseInt('111', 8)) !== 0; ++ if (!isExecutable) { ++ // Adding 0o755 to make script file executable ++ fs.chmodSync(postStartupScriptPath, 0o755); ++ } + + const subprocess = spawn('bash', [`${postStartupScriptPath}`], { cwd: '/' }); + subprocess.stdout.pipe(logStream); From dcdd453ab0946f4e914789c98237792911f34548 Mon Sep 17 00:00:00 2001 From: sachinh-amazon <188173965+sachinh-amazon@users.noreply.github.com> Date: Wed, 28 Jan 2026 10:21:50 +0000 Subject: [PATCH 2/2] Remove chmod line --- patches/sagemaker/sagemaker-ui-post-startup.diff | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/patches/sagemaker/sagemaker-ui-post-startup.diff b/patches/sagemaker/sagemaker-ui-post-startup.diff index 7edc81c..eeaa681 100644 --- a/patches/sagemaker/sagemaker-ui-post-startup.diff +++ b/patches/sagemaker/sagemaker-ui-post-startup.diff @@ -39,7 +39,7 @@ Index: code-editor-src/src/vs/server/node/webClientServer.ts if (pathname.startsWith(WEB_EXTENSION_PATH) && pathname.charCodeAt(WEB_EXTENSION_PATH.length) === CharCode.Slash) { // extension resource support return this._handleWebExtensionResource(req, res, pathname.substring(WEB_EXTENSION_PATH.length)); -@@ -571,6 +580,48 @@ export class WebClientServer { +@@ -571,6 +580,38 @@ export class WebClientServer { serveError(req, res, 500, error.message) } } @@ -60,16 +60,6 @@ Index: code-editor-src/src/vs/server/node/webClientServer.ts + //If exists, it will start the execution and add the execution logs in logFile. + try { + if (fs.existsSync(postStartupScriptPath)) { -+ const stats = fs.statSync(postStartupScriptPath); -+ // Check if file has execute permission for owner, group, or others -+ // parseInt('111', 8) = 73 (octal 111 = --x--x--x execute bits) -+ // Bitwise AND checks if any execute bits are set -+ const isExecutable = (stats.mode & parseInt('111', 8)) !== 0; -+ if (!isExecutable) { -+ // Adding 0o755 to make script file executable -+ fs.chmodSync(postStartupScriptPath, 0o755); -+ } -+ + const subprocess = spawn('bash', [`${postStartupScriptPath}`], { cwd: '/' }); + subprocess.stdout.pipe(logStream); + subprocess.stderr.pipe(logStream);