Skip to content

Commit

Permalink
chore: improve setup of devconatiner for contributions (#6954)
Browse files Browse the repository at this point in the history
# Description

This PR contains an enhancement of the devcontainer definition as
described in #6923 based on the setup list from
[here](https://github.com/radius-project/radius/tree/main/docs/contributing/contributing-code/contributing-code-prerequisites).
All tools and the corresponding extensions are integrated in the
devcontainer.

The following commands have been tested and get executed without errors:

- `make build && make lint`
- `make generate`

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request adds or changes features of Radius and has an
approved issue (issue link required).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Connected to: #6923 - issue si not yet resolved as update of
documentation is missing

## Auto-generated summary

<!--
GitHub Copilot for docs will auto-generate a summary of the PR
-->

<!--
copilot:all
-->
### <samp>🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset)
Generated by Copilot at 05c1e92</samp>

### Summary
🛠️🌐📚

<!--
1. 🛠️ - This emoji can be used to indicate that the pull request
improves the devcontainer configuration by adding more features and
tools that can help with development and debugging.
2. 🌐 - This emoji can be used to indicate that the pull request supports
various programming languages and frameworks that can be used with dapr,
such as Python, Node.js, Java, .NET, and Go.
3. 📚 - This emoji can be used to indicate that the pull request adds a
comment with a documentation link that can help contributors learn more
about devcontainers and how to use them with dapr.
-->
Enhance devcontainer configuration for contributors. Add features,
extensions, and commands for `dapr` and other languages and tools.
Specify memory requirement in
`.devcontainer/contributor/devcontainer.json`.

> _To make devcontainer more complete_
> _They added features, tools, and cheats_
> _With extensions galore_
> _And commands to explore_
> _And a comment to help and a `hostRequirements` repeat_

### Walkthrough
* Add comment with link to contributing code prerequisites and expand
features and extensions for various programming languages and tools in
`.devcontainer/contributor/devcontainer.json`
([link](https://github.com/radius-project/radius/pull/6954/files?diff=unified&w=0#diff-935f2b2e55e0ab1017fd1c544b9191e499e90e473ece926f8e65e95ddfbb1b1eL3-R15),
[link](https://github.com/radius-project/radius/pull/6954/files?diff=unified&w=0#diff-935f2b2e55e0ab1017fd1c544b9191e499e90e473ece926f8e65e95ddfbb1b1eL14-R28),
[link](https://github.com/radius-project/radius/pull/6954/files?diff=unified&w=0#diff-935f2b2e55e0ab1017fd1c544b9191e499e90e473ece926f8e65e95ddfbb1b1eL21-R48))
* Add postCreateCommand to run code generation commands in
`.devcontainer/contributor/devcontainer.json`
([link](https://github.com/radius-project/radius/pull/6954/files?diff=unified&w=0#diff-935f2b2e55e0ab1017fd1c544b9191e499e90e473ece926f8e65e95ddfbb1b1eL21-R48))
* Add hostRequirements to specify minimum memory for devcontainer in
`.devcontainer/contributor/devcontainer.json`
([link](https://github.com/radius-project/radius/pull/6954/files?diff=unified&w=0#diff-935f2b2e55e0ab1017fd1c544b9191e499e90e473ece926f8e65e95ddfbb1b1eL21-R48))

Signed-off-by: Christian Lechner <[email protected]>
  • Loading branch information
lechnerc77 authored Dec 14, 2023
1 parent 479bd51 commit 6016160
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions .devcontainer/contributor/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,50 @@
{
"name": "Radius - Contributor",
// For details see https://github.com/radius-project/radius/tree/main/docs/contributing/contributing-code/contributing-code-prerequisites
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/go:1": {},
//Git and GitHub Setup
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
//Programming languages
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/guiyomh/features/gotestsum:0.1.1": {},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers-contrib/features/typescript:2": {},
"ghcr.io/devcontainers/features/python:1": {},
//Container and K8s
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"minikube": "none"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"moby": true
}
},
//Tools
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {},
"ghcr.io/mpriscella/features/kind:1": {},
"ghcr.io/dhoeric/features/stern:1": {},
//Dapr
"ghcr.io/dapr/cli/dapr-cli:0": {}
},
"customizations": {
"vscode": {
"extensions": [
"redhat.vscode-yaml",
"golang.go",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-azuretools.rad-vscode-bicep",
"ms-kubernetes-tools.vscode-kubernetes-tools"
"ms-kubernetes-tools.vscode-kubernetes-tools",
"ms-azuretools.vscode-dapr",
"ms-vscode.makefile-tools"
]
}
}
},
// Prerequisite for Code Generation, see https://github.com/radius-project/radius/tree/main/docs/contributing/contributing-code/contributing-code-prerequisites#code-generation
// Adding workspace as safe directory to avoid permission issues
"postCreateCommand": "git config --global --add safe.directory /workspaces/radius && cd typespec && npm ci && npm install -g autorest && npm install -g oav && go install sigs.k8s.io/controller-tools/cmd/[email protected] && go install github.com/golang/mock/[email protected]",
"hostRequirements": {
"memory": "8gb"
},
}

0 comments on commit 6016160

Please sign in to comment.