Skip to content

Commit cbe116f

Browse files
authored
Codespace setup (#41836)
* Codespace setup * Cspell the devcontainer folder
1 parent 573386c commit cbe116f

File tree

3 files changed

+99
-40
lines changed

3 files changed

+99
-40
lines changed

.devcontainer/devcontainer.json

Lines changed: 61 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,62 @@
11
{
2-
"name": "GitHub Codespaces (Default)",
3-
"settings": {
4-
"terminal.integrated.profiles.linux": {
5-
"bash": {
6-
"path": "/bin/bash",
7-
"args": []
8-
}
9-
},
10-
"terminal.integrated.defaultProfile.linux": "bash",
11-
"go.useGoProxyToCheckForToolUpdates": false,
12-
"go.useLanguageServer": true,
13-
"go.gopath": "/go",
14-
"go.goroot": "/usr/local/go",
15-
"go.toolsGopath": "/go/bin",
16-
"python.defaultInterpreterPath": "/opt/python/latest/bin/python",
17-
"lldb.executable": "/usr/bin/lldb",
18-
"files.watcherExclude": {
19-
"**/target/**": true
20-
}
21-
},
22-
"remoteUser": "codespace",
23-
"overrideCommand": false,
24-
"workspaceMount": "source=${localWorkspaceFolder},target=/home/codespace/workspace,type=bind,consistency=cached",
25-
"workspaceFolder": "/home/codespace/workspace",
26-
"mounts": [ "source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind" ],
27-
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined", "--privileged" ],
28-
29-
// Add the IDs of extensions you want installed when the container is created.
30-
"extensions": [
31-
"GitHub.vscode-pull-request-github",
32-
"MS-vsliveshare.vsliveshare",
33-
"VisualStudioExptTeam.vscodeintellicode"
34-
]
35-
36-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
37-
// "forwardPorts": [],
38-
39-
// Use 'postCreateCommand' to run commands after the container is created.
40-
// "postCreateCommand": "uname -a"
41-
}
2+
"name": "GitHub Codespaces (Default)",
3+
"remoteUser": "codespace",
4+
"overrideCommand": false,
5+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/codespace/workspace,type=bind,consistency=cached",
6+
"workspaceFolder": "/home/codespace/workspace",
7+
"mounts": [
8+
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind"
9+
],
10+
"runArgs": [
11+
"--cap-add=SYS_PTRACE",
12+
"--security-opt",
13+
"seccomp=unconfined",
14+
"--privileged"
15+
],
16+
"postCreateCommand": "bash .devcontainer/init.sh",
17+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
18+
// "forwardPorts": [],
19+
"customizations": {
20+
"codespaces": {
21+
"repositories": {
22+
"Azure/azure-sdk-assets": {
23+
"permissions": {
24+
"contents": "write"
25+
}
26+
}
27+
}
28+
},
29+
"vscode": {
30+
"settings": {
31+
"terminal.integrated.shell.linux": "/bin/bash",
32+
"go.useGoProxyToCheckForToolUpdates": false,
33+
"go.useLanguageServer": true,
34+
"go.gopath": "/go",
35+
"go.goroot": "/usr/local/go",
36+
"go.toolsGopath": "/go/bin",
37+
"python.pythonPath": "/opt/python/latest/bin/python",
38+
"python.linting.enabled": true,
39+
"python.linting.pylintEnabled": true,
40+
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
41+
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
42+
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
43+
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
44+
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
45+
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
46+
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
47+
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
48+
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
49+
"lldb.executable": "/usr/bin/lldb",
50+
"files.watcherExclude": {
51+
"**/target/**": true
52+
}
53+
},
54+
// Add the IDs of extensions you want installed when the container is created.
55+
"extensions": [
56+
"GitHub.vscode-pull-request-github",
57+
"MS-vsliveshare.vsliveshare",
58+
"VisualStudioExptTeam.vscodeintellicode"
59+
]
60+
}
61+
}
62+
}

.devcontainer/init.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
# Install and use nvm version from .nvmrc
4+
source $NVM_DIR/nvm.sh
5+
nvm install
6+
nvm use
7+
# Set default node to version we just installed so that new shells start with it
8+
nvm alias default $(node --version)
9+
10+
# Install utilities
11+
npm install -g autorest @typespec/compiler @azure-tools/typespec-client-generator-cli
12+
13+
# Install PowerShell. PowerShell is needed for the test proxy asset sync migration scripts,
14+
# and is also useful for running scripts in eng/common/scripts and eng/common/TestResources.
15+
# Update the list of packages
16+
sudo apt-get update
17+
# Install pre-requisite packages.
18+
sudo apt-get install -y wget apt-transport-https software-properties-common
19+
# Download the Microsoft repository GPG keys
20+
wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
21+
# Register the Microsoft repository GPG keys
22+
sudo dpkg -i packages-microsoft-prod.deb
23+
# Delete the the Microsoft repository GPG keys file
24+
rm packages-microsoft-prod.deb
25+
# Update the list of packages after we added packages.microsoft.com
26+
sudo apt-get update
27+
# Install PowerShell
28+
sudo apt-get install -y powershell
29+
30+
# Install Python tooling
31+
# init env
32+
python -m pip install -U pip > /dev/null
33+
python scripts/dev_setup.py -p azure-core > /dev/null
34+
pip install tox==4.15.0 > /dev/null
35+
pip install wheel==0.43.0 > /dev/null
36+
pip install setuptools==78.1.0 > /dev/null
37+
pip install setuptools-scm==8.3.0 > /dev/null

.vscode/cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"en-gb"
1212
],
1313
"ignorePaths": [
14+
".devcontainer/**",
1415
"eng/**",
1516
".github/CODEOWNERS",
1617
"scripts/**",

0 commit comments

Comments
 (0)