Skip to content

Commit

Permalink
otp: Add configuration for gitpod and DevContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
garazdawi committed Jan 21, 2022
1 parent 4ee5806 commit cf17282
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/cpp
{
"name": "Erlang/OTP",
"build": {
"dockerfile": "../.github/dockerfiles/Dockerfile.ubuntu-base",
"context": "../.github",
"args": {
"BASE": "mcr.microsoft.com/vscode/devcontainers/base:focal",
"USER": "vscode",
"GROUP": "vscode"
}
},
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],

// Set *default* container specific settings.json values on container create.
"settings": {},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-vscode.cpptools",
"erlang-ls.erlang-ls" ],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "gcc -v",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
7 changes: 7 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
image:
file: .github/dockerfiles/Dockerfile.ubuntu-base
context: .github
vscode:
extensions:
- ms-vscode.cpptools
- erlang-ls.erlang-ls
22 changes: 22 additions & 0 deletions HOWTO/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ with.
7. [Github Actions](#github-actions)
1. [Debugging github actions failures](#debugging-github-actions-failures)
8. [Using Docker](#using-docker)
1. [Gidpod.io or VSCode dev container](#gitpod-io-or-vscode-dev-container)

## Short version

Expand Down Expand Up @@ -520,3 +521,24 @@ docker run --init -v $PWD/make_test_dir:/buildroot/otp/lib/stdlib/make_test_dir

The Common Test logs will be placed in `make_test_dir/ct_logs`.

### Gidpod.io or VSCode dev container

This git repository is also prepared to run using [Gitpod](https://gitpod.io/) or
[VSCode Devcontainer](https://code.visualstudio.com/docs/remote/containers).

The support for these environments is very early so it will be a bit unstable.

To access the gitpod for Erlang/OTP you just navigate to
[https://gitpod.io/#https://github.com/erlang/otp](https://gitpod.io/#https://github.com/erlang/otp).

When using a VSCode dev container, you only need to open [VSCode](https://code.visualstudio.com/)
in the Erlang/OTP repository and you should get a popup that asks if you want to
run in a dev container.

The gitpod and dev container both use the base ubuntu image built in [Using Docker](#using-docker).
So it should be possible to run all tests inside the containers with all test
dependencies available.

*WARNING*: Using VSCode dev container on macOS can be very slow because of limitations
in the filesystem. So I would recommend either using gitpod or just work locally without
the dev container on macOS.
10 changes: 10 additions & 0 deletions erlang_ls.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apps_dirs:
- "lib/*"
- "erts/preloaded"
include_dirs:
- "lib/*/src"
- "lib/*/include"
- "erts/preloaded/src"
diagnostics:
enabled:
- bound_var_in_pattern

0 comments on commit cf17282

Please sign in to comment.