Skip to content

Commit

Permalink
Merge branch 'vikas0212git-patch-1' of https://github.com/microsoft/v…
Browse files Browse the repository at this point in the history
…scode-azure-iot-edge into vikas0212git-patch-1
  • Loading branch information
vikas0212git committed Oct 6, 2021
2 parents f0ab37d + f1ae0b8 commit 8c3adb2
Show file tree
Hide file tree
Showing 17 changed files with 751 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Change Log
## 1.25.0- 2021-10-05
### Changed
* Added Dev Container definitions for all supported languages
* Incorporate Dev Container definition with every new EdgeSolution
* Added a new command to add Dev Container definition to existing solutions

## 1.24.4 - 2021-10-01
### Changed
* Maximum version number for edgeHub/properties.desired.schemaVersion is capped to 1.1
Expand Down
17 changes: 17 additions & 0 deletions assets/containers/CSharp/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/dotnet/.devcontainer/base.Dockerfile
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-3.1

# Install Docker CE
COPY library-scripts/*.sh /tmp/library-scripts/
RUN \
apt-get update -y \
# Use Docker script from script library to set things up - enable non-root docker, user vscode, using moby
&& /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh "true" "vscode" "true" \
# install iotedgehubdev
&& apt-get install -y python3-pip && pip3 install iotedgehubdev \
# Clean up
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/

# launch docker-ce
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
CMD [ "sleep", "infinity" ]
61 changes: 61 additions & 0 deletions assets/containers/CSharp/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// 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/dotnet
{
"name": "Azure IoTEdge C# (.NET)",
"build": { "dockerfile": "Dockerfile" },
"runArgs": ["--init", "--privileged"],
"mounts": [
// Keep command history
"source=ostf-bashhistory,target=/commandhistory,type=volume",
// Use docker-in-docker socket
"source=dind-var-lib-docker,target=/var/lib/docker,type=volume"
],
"overrideCommand": false,

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
}
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-dotnettools.csharp",
"ms-azuretools.vscode-docker",
"vsciot-vscode.azure-iot-tools"
],

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

// [Optional] To reuse of your local HTTPS dev cert:
//
// 1. Export it locally using this command:
// * Windows PowerShell:
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
// * macOS/Linux terminal:
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
//
// 2. Uncomment these 'remoteEnv' lines:
// "remoteEnv": {
// "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere",
// "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx",
// },
//
// 3. Do one of the following depending on your scenario:
// * When using GitHub Codespaces and/or Remote - Containers:
// 1. Start the container
// 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer
// 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https"
//
// * If only using Remote - Containers with a local container, uncomment this line instead:
// "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aspnet/https,target=/home/vscode/.aspnet/https,type=bind" ],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "dotnet restore",

"remoteUser": "vscode"
}
20 changes: 20 additions & 0 deletions assets/containers/Cpp/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/debian/.devcontainer/base.Dockerfile

# [Choice] Debian version: bullseye, buster, stretch
ARG VARIANT="buster"
FROM mcr.microsoft.com/vscode/devcontainers/cpp:0-${VARIANT}

# Install Docker CE
COPY library-scripts/*.sh /tmp/library-scripts/
RUN \
apt-get update -y \
# Use Docker script from script library to set things up - enable non-root docker, user vscode, using moby
&& /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh "true" "automatic" "true" \
# install iotedgehubdev
&& apt-get install -y python3-pip && pip3 install --upgrade pip && pip install iotedgehubdev \
# Clean up
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/

# launch docker-ce
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
CMD [ "sleep", "infinity" ]
39 changes: 39 additions & 0 deletions assets/containers/Cpp/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// 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/debian
{
"name": "Azure IoT Edge C/C++",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Debian version: bullseye, buster, stretch
"args": { "VARIANT": "buster" }
},
"runArgs": ["--init", "--privileged"],
"mounts": [
// Keep command history
"source=ostf-bashhistory,target=/commandhistory,type=volume",
// Use docker-in-docker socket
"source=dind-var-lib-docker,target=/var/lib/docker,type=volume"
],
"overrideCommand": false,

// Set *default* container specific settings.json values on container create.
"settings": { "terminal.integrated.defaultProfile.linux": "/bin/bash" },

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-vscode.cpptools",
"ms-azuretools.vscode-docker",
"vsciot-vscode.azure-iot-tools"
],

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

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],

// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],

"remoteUser": "vscode"
}
25 changes: 25 additions & 0 deletions assets/containers/Java/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/java/.devcontainer/base.Dockerfile

# [Choice] Java version: 11, 16
ARG VARIANT="16"
FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}

# [Option] Install Maven
ARG INSTALL_MAVEN="false"
ARG MAVEN_VERSION=""
RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi

# Install Docker CE
COPY library-scripts/*.sh /tmp/library-scripts/
RUN \
apt-get update -y \
# Use Docker script from script library to set things up - enable non-root docker, user vscode, using moby
&& /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh "true" "automatic" "true" \
# install iotedgehubdev
&& apt-get install -y python3-pip && pip3 install --upgrade pip && pip install iotedgehubdev \
# Clean up
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/

# launch docker-ce
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
CMD [ "sleep", "infinity" ]
49 changes: 49 additions & 0 deletions assets/containers/Java/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// 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/java
{
"name": "Azure IoTEdge Java",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update the VARIANT arg to pick a Java version: 11, 16
"VARIANT": "11",
// Options
"INSTALL_MAVEN": "true",
"INSTALL_GRADLE": "false",
"NODE_VERSION": "none"
}
},
"runArgs": ["--init", "--privileged"],
"mounts": [
// Keep command history
"source=ostf-bashhistory,target=/commandhistory,type=volume",
// Use docker-in-docker socket
"source=dind-var-lib-docker,target=/var/lib/docker,type=volume"
],
"overrideCommand": false,

// Set *default* container specific settings.json values on container create.
"settings": {
"java.home": "/docker-java-home",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
}
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"vscjava.vscode-java-pack",
"ms-azuretools.vscode-docker",
"vsciot-vscode.azure-iot-tools"
],

// 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": "java -version",

"remoteUser": "vscode"
}
26 changes: 26 additions & 0 deletions assets/containers/Node/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/javascript-node/.devcontainer/base.Dockerfile

# [Choice] Node.js version: 16, 14, 12
ARG VARIANT="16-buster"
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}

# Install Docker CE
COPY library-scripts/*.sh /tmp/library-scripts/
RUN \
apt-get update -y \
# Use Docker script from script library to set things up - enable non-root docker, user vscode, using moby
&& /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh "true" "automatic" "true" \
# install iotedgehubdev
&& apt-get install -y python3-pip && pip3 install --upgrade pip && pip install iotedgehubdev \
# Clean up
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/

# [Optional] Uncomment this line to install global node packages.
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

RUN npm install -g yo@latest generator-azure-iot-edge-module

# launch docker-ce
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
CMD [ "sleep", "infinity" ]
38 changes: 38 additions & 0 deletions assets/containers/Node/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// 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/javascript-node
{
"name": "Azure IoTEdge Node.js",
"build": { "dockerfile": "Dockerfile" },
"runArgs": ["--init", "--privileged"],
"mounts": [
// Keep command history
"source=ostf-bashhistory,target=/commandhistory,type=volume",
// Use docker-in-docker socket
"source=dind-var-lib-docker,target=/var/lib/docker,type=volume"
],
"overrideCommand": false,

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
}
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint",
"ms-azuretools.vscode-docker",
"vsciot-vscode.azure-iot-tools"
],

// 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": "yarn install"

"remoteUser": "node"
}
26 changes: 26 additions & 0 deletions assets/containers/Python/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/python-3/.devcontainer/base.Dockerfile

# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
ARG VARIANT="3.7"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

# Install Docker CE
COPY library-scripts/*.sh /tmp/library-scripts/
RUN \
apt-get update -y \
# Use Docker script from script library to set things up - enable non-root docker, user vscode, using moby
&& /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh "true" "automatic" "true" \
# install iotedgehubdev
# && apt-get install -y python3-pip && pip3 install --upgrade pip && pip install iotedgehubdev \
&& apt-get install -y python3-pip && pip install iotedgehubdev \
# Clean up
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/

# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
# COPY requirements.txt /tmp/pip-tmp/
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
# && rm -rf /tmp/pip-tmp

# launch docker-ce
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
CMD [ "sleep", "infinity" ]
59 changes: 59 additions & 0 deletions assets/containers/Python/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// 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/python-3
{
"name": "Azure IoT Edge Python 3.7",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
"VARIANT": "3.7"
}
},
"runArgs": ["--init", "--privileged"],
"mounts": [
// Keep command history
"source=ostf-bashhistory,target=/commandhistory,type=volume",
// Use docker-in-docker socket
"source=dind-var-lib-docker,target=/var/lib/docker,type=volume"
],
"overrideCommand": false,

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
},
"terminal.integrated.defaultProfile.linux": "bash",
"python.pythonPath": "/usr/local/bin/python",
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-azuretools.vscode-docker",
"vsciot-vscode.azure-iot-tools"
],

// 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": "pip3 install --user -r requirements.txt",

"remoteUser": "vscode"
}
Loading

0 comments on commit 8c3adb2

Please sign in to comment.