forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split Codespaces configuration based on development scenarios (dotnet…
…#74683) * Split libraries and wasm devcontainers Codespaces allows for monorepo support now. So we can have different pre-builds for different dev environments. Creating a "libraries" pre-build and a "wasm" pre-build devcontainer. * Move devcontainer files into separate folders * Path up a directory to the Dockerfile * Split the Dockerfile so it can be customized per devcontainer * Update Codespaces docs * Respond to PR feedback * Use the new open devcontainers path. * Use the GH CLI feature instead of installing it ourselves * Set hostRequirements for Codespaces Developing in dotnet/runtime with a 2-core / 4GB ram machine doesn't work very well. Add a minimum of 4-core machine to the devcontainer spec. Fix dotnet#75680
- Loading branch information
Showing
7 changed files
with
174 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.192.0/containers/dotnet/.devcontainer/base.Dockerfile | ||
# For details on dotnet specific container, see: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/dotnet | ||
|
||
# [Choice] .NET version: 6.0, 3.1 | ||
ARG VARIANT="6.0-focal" | ||
FROM mcr.microsoft.com/devcontainers/dotnet:0-${VARIANT} | ||
|
||
# Set up machine requirements to build the repo and the gh CLI | ||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install --no-install-recommends \ | ||
cmake \ | ||
llvm-10 \ | ||
clang-10 \ | ||
build-essential \ | ||
python \ | ||
curl \ | ||
git \ | ||
lldb-6.0 \ | ||
liblldb-6.0-dev \ | ||
libunwind8 \ | ||
libunwind8-dev \ | ||
gettext \ | ||
libicu-dev \ | ||
liblttng-ust-dev \ | ||
libssl-dev \ | ||
libnuma-dev \ | ||
libkrb5-dev \ | ||
zlib1g-dev \ | ||
ninja-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. | ||
{ | ||
"name": "C# (.NET)", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"args": { | ||
// Update 'VARIANT' to pick a .NET Core version: 3.1, 6.0 | ||
// Append -bullseye or -focal to pin to an OS version. | ||
"VARIANT": "6.0-focal" | ||
} | ||
}, | ||
"hostRequirements": { | ||
"cpus": 4, | ||
"memory": "8gb" | ||
}, | ||
|
||
"features": { | ||
"ghcr.io/devcontainers/features/github-cli:1": {} | ||
}, | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
// Configure properties specific to VS Code. | ||
"vscode": { | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"ms-dotnettools.csharp" | ||
], | ||
"settings": { | ||
// Loading projects on demand is better for larger codebases | ||
"omnisharp.enableMsBuildLoadProjectsOnDemand": true, | ||
"omnisharp.enableRoslynAnalyzers": true, | ||
"omnisharp.enableEditorConfigSupport": true, | ||
"omnisharp.enableAsyncCompletion": true, | ||
"omnisharp.testRunSettings": "${containerWorkspaceFolder}/artifacts/obj/vscode/.runsettings" | ||
} | ||
} | ||
}, | ||
|
||
// Use 'onCreateCommand' to run pre-build commands inside the codespace | ||
"onCreateCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/onCreateCommand.sh libraries", | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/postCreateCommand.sh", | ||
|
||
// Add the locally installed dotnet to the path to ensure that it is activated | ||
// This allows developers to just use 'dotnet build' on the command-line, and the local dotnet version will be used. | ||
"remoteEnv": { | ||
"PATH": "${containerWorkspaceFolder}/.dotnet:${containerEnv:PATH}", | ||
"DOTNET_MULTILEVEL_LOOKUP": "0" | ||
}, | ||
|
||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 29 additions & 16 deletions
45
.devcontainer/devcontainer.json → .devcontainer/wasm/devcontainer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.