Skip to content

Commit fad3e54

Browse files
authored
Merge pull request #18 from aws/staging_1.83.1
Merge staging_1.83.1 into main
2 parents f3e14e8 + 647ff01 commit fad3e54

File tree

6,931 files changed

+1942824
-19
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,931 files changed

+1942824
-19
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "vscode"]
2+
path = vscode
3+
url = https://github.com/microsoft/vscode.git

LICENSE

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
1-
MIT No Attribution
1+
MIT License
22

33
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy of
6-
this software and associated documentation files (the "Software"), to deal in
7-
the Software without restriction, including without limitation the rights to
8-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9-
the Software, and to permit persons to whom the Software is furnished to do so.
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
106

11-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
13-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
15-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
178

9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
## My Project
1+
## SageMaker Code Editor
22

3-
TODO: Fill this README out!
3+
This is the repo for `sagemaker-code-editor`.
44

5-
Be sure to:
5+
The `patched-vscode` folder's only usage is to help reviewers review the patch changes. To ease reviewing patches (`.diff` files), whenever we raise a PR for adding/updating a patch, we will also apply the patches to this directory so that this folder's diff shows up in the PR.
66

7-
* Change the title in this README
8-
* Edit your repository description on GitHub
7+
Whenever we create a new branch with `vscode` pointing to a specific commit, this folder must be populated with the same contents as `vscode` at that particular commit.
8+
9+
To properly patch, please follow instructions below:
10+
11+
* Copy resources with the shell script (also in the root directory) by running these commands:
12+
- `chmod +x copy-resources.sh`
13+
- `./copy-resources.sh`
14+
* Use `quilt` to apply patches in sequence using `quilt push -a` from the root directory.
15+
- Install quilt in mac - `brew install quilt`
916

1017
## Security
1118

1219
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
1320

1421
## License
1522

16-
This library is licensed under the MIT-0 License. See the LICENSE file.
17-
23+
This library is licensed under the MIT-0 License. See the LICENSE file.

copy-resources.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
# Exit immediately if a command exits with a non-zero status.
4+
set -ex
5+
6+
# Define the source directory for the resources
7+
SOURCE_DIR="resources"
8+
9+
# Define the destination base directory
10+
DEST_DIR="vscode"
11+
12+
# Define paths for each file relative to the base directories
13+
# Format: "source_file_path:destination_file_path"
14+
FILES_TO_COPY=(
15+
"favicon.ico:resources/server/favicon.ico"
16+
"code-icon.svg:src/vs/workbench/browser/media/code-icon.svg"
17+
"letterpress-dark.svg:src/vs/workbench/browser/parts/editor/media/letterpress-dark.svg"
18+
"letterpress-hcDark.svg:src/vs/workbench/browser/parts/editor/media/letterpress-hcDark.svg"
19+
"letterpress-hcLight.svg:src/vs/workbench/browser/parts/editor/media/letterpress-hcLight.svg"
20+
"letterpress-light.svg:src/vs/workbench/browser/parts/editor/media/letterpress-light.svg"
21+
)
22+
23+
# Loop through the file paths, check if file exists, and copy each one to its new location
24+
for FILE_PATH in "${FILES_TO_COPY[@]}"; do
25+
IFS=":" read -r SRC_FILE DEST_FILE <<< "$FILE_PATH"
26+
27+
# Construct full source and destination paths
28+
FULL_SRC_PATH="$SOURCE_DIR/$SRC_FILE"
29+
FULL_DEST_PATH="$DEST_DIR/$DEST_FILE"
30+
31+
# Check if the source file exists
32+
if [ ! -f "$FULL_SRC_PATH" ]; then
33+
echo "Error: Source file $FULL_SRC_PATH does not exist." >&2
34+
exit 1
35+
fi
36+
37+
# Check if the destination file exists. If so, delete it before copying.
38+
if [ -f "$FULL_DEST_PATH" ]; then
39+
rm "$FULL_DEST_PATH"
40+
echo "Existing file $FULL_DEST_PATH deleted."
41+
fi
42+
43+
# Copy file from source to destination
44+
cp -v "$FULL_SRC_PATH" "$FULL_DEST_PATH"
45+
done
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
2+
# Reference: https://github.com/microsoft/vscode/wiki/How-to-Contribute
3+
properties:
4+
resources:
5+
- resource: Microsoft.WinGet.DSC/WinGetPackage
6+
directives:
7+
description: Install Git
8+
allowPrerelease: true
9+
settings:
10+
id: Git.Git
11+
source: winget
12+
- resource: Microsoft.WinGet.DSC/WinGetPackage
13+
id: npm
14+
directives:
15+
description: Install NodeJS version >=18.15.x and <19
16+
allowPrerelease: true
17+
settings:
18+
id: OpenJS.NodeJS.LTS
19+
version: "18.18.0"
20+
source: winget
21+
- resource: NpmDsc/NpmPackage
22+
id: yarn
23+
dependsOn:
24+
- npm
25+
directives:
26+
description: Install Yarn
27+
allowPrerelease: true
28+
settings:
29+
Name: 'yarn'
30+
Global: true
31+
PackageDirectory: '${WinGetConfigRoot}\..\'
32+
- resource: Microsoft.WinGet.DSC/WinGetPackage
33+
directives:
34+
description: Install Python 3.10
35+
allowPrerelease: true
36+
settings:
37+
id: Python.Python.3.10
38+
source: winget
39+
- resource: Microsoft.WinGet.DSC/WinGetPackage
40+
id: vsPackage
41+
directives:
42+
description: Install Visual Studio 2022 (any edition is OK)
43+
allowPrerelease: true
44+
settings:
45+
id: Microsoft.VisualStudio.2022.BuildTools
46+
source: winget
47+
- resource: Microsoft.VisualStudio.DSC/VSComponents
48+
dependsOn:
49+
- vsPackage
50+
directives:
51+
description: Install required VS workloads
52+
allowPrerelease: true
53+
settings:
54+
productId: Microsoft.VisualStudio.Product.BuildTools
55+
channelId: VisualStudio.17.Release
56+
includeRecommended: true
57+
components:
58+
- Microsoft.VisualStudio.Workload.VCTools
59+
- resource: YarnDsc/YarnInstall
60+
dependsOn:
61+
- npm
62+
directives:
63+
description: Install dependencies
64+
allowPrerelease: true
65+
settings:
66+
PackageDirectory: '${WinGetConfigRoot}\..\'
67+
configurationVersion: 0.2.0
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM mcr.microsoft.com/devcontainers/typescript-node:18-bookworm
2+
3+
ADD install-vscode.sh /root/
4+
RUN /root/install-vscode.sh
5+
6+
RUN git config --system codespaces-theme.hide-status 1
7+
8+
USER node
9+
RUN YARN_CACHE="$(yarn cache dir)" && rm -rf "$YARN_CACHE" && ln -s /vscode-dev/yarn-cache "$YARN_CACHE"
10+
11+
USER root
12+
CMD chown node:node /vscode-dev && sudo -u node mkdir -p /vscode-dev/yarn-cache && sleep inf
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Code - OSS Development Container
2+
3+
This dev container includes configuration for a development container for working with Code - OSS in a local container. For using [GitHub Codespaces](https://github.com/features/codespaces) follow the [prebuilt setup](prebuilt/README.md) which installs VNC for displaying the application window.
4+
5+
> **Note:** You will need X11's `DISPLAY` or Wayland's `WAYLAND_DISPLAY` environment variable set locally to allow for the Code - OSS window to display. See [Running GUI app on WSL](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps) for Windows and [Quartz](https://www.xquartz.org) for Mac.
6+
7+
## Quick start
8+
9+
1. Install Docker Desktop or Docker for Linux on your local machine. (See [docs](https://aka.ms/vscode-remote/containers/getting-started) for additional details.)
10+
11+
2. **Important**: Docker needs at least **4 Cores and 8 GB of RAM** to run a full build with **9 GB of RAM** being recommended. If you are on macOS, or are using the old Hyper-V engine for Windows, update these values for Docker Desktop by right-clicking on the Docker status bar item and going to **Preferences/Settings > Resources > Advanced**.
12+
13+
> **Note:** The [Resource Monitor](https://marketplace.visualstudio.com/items?itemName=mutantdino.resourcemonitor) extension is included in the container so you can keep an eye on CPU/Memory in the status bar.
14+
15+
3. Install [Visual Studio Code Stable](https://code.visualstudio.com/) or [Insiders](https://code.visualstudio.com/insiders/) and the [Dev Containers](https://aka.ms/vscode-remote/download/containers) extension.
16+
17+
![Image of Dev Containers extension](https://microsoft.github.io/vscode-remote-release/images/dev-containers-extn.png)
18+
19+
> **Note:** The Dev Containers extension requires the Visual Studio Code distribution of Code - OSS. See the [FAQ](https://aka.ms/vscode-remote/faq/license) for details.
20+
21+
4. Due to the size of the repository we strongly recommend cloning it on a Linux filesystem for better bind mount performance. On macOS we recommend using a Docker volume (press <kbd>F1</kbd> and select **Dev Containers: Clone Repository in Container Volume...**) and on Windows we recommend using a WSL folder:
22+
23+
- Make sure you are running a recent WSL version to get X11 and Wayland support.
24+
- Use the WSL extension for VS Code to open the cloned folder in WSL.
25+
- Press <kbd>F1</kbd> and select **Dev Containers: Reopen in Container**.
26+
27+
Next: **[Try it out!](#try-it)**
28+
29+
## Try it
30+
31+
To start working with Code - OSS, follow these steps:
32+
33+
1. In your local VS Code client, open a terminal (<kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>\`</kbd>) and type the following commands:
34+
35+
```bash
36+
yarn install
37+
bash scripts/code.sh
38+
```
39+
40+
2. You should now see Code - OSS!
41+
42+
Next, let's try debugging.
43+
44+
1. Shut down Code - OSS by clicking the box in the upper right corner of the Code - OSS window.
45+
46+
2. Go to your local VS Code client, and use the **Run / Debug** view to launch the **VS Code** configuration. (Typically the default, so you can likely just press <kbd>F5</kbd>).
47+
48+
> **Note:** If launching times out, you can increase the value of `timeout` in the "VS Code", "Attach Main Process", "Attach Extension Host", and "Attach to Shared Process" configurations in [launch.json](../../.vscode/launch.json). However, running `scripts/code.sh` first will set up Electron which will usually solve timeout issues.
49+
50+
3. After a bit, Code - OSS will appear with the debugger attached!
51+
52+
Enjoy!
53+
54+
## Notes
55+
56+
The container comes with VS Code Insiders installed. To run it from an Integrated Terminal use `VSCODE_IPC_HOOK_CLI= /usr/bin/code-insiders .`.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "Code - OSS with X11/Wayland",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"overrideCommand": false,
7+
"privileged": true,
8+
"mounts": [
9+
{
10+
"source": "vscode-dev",
11+
"target": "/vscode-dev",
12+
"type": "volume"
13+
}
14+
],
15+
"customizations": {
16+
"vscode": {
17+
"extensions": [
18+
"mutantdino.resourcemonitor"
19+
]
20+
}
21+
}
22+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
apt update
4+
apt install -y wget gpg
5+
6+
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
7+
install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
8+
sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
9+
rm -f packages.microsoft.gpg
10+
11+
apt update
12+
apt install -y code-insiders libsecret-1-dev libxkbfile-dev libkrb5-dev

0 commit comments

Comments
 (0)