Skip to content

Commit

Permalink
Fix devcontainer (#2675)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Steiner authored Dec 1, 2023
1 parent dc7e2b0 commit c4b68b0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhisto
&& echo $SNIPPET >> "/home/$USERNAME/.bashrc"

# Install system dependencies
RUN apt update
RUN apt install -y curl wget gnupg python3 python-is-python3 python3-pip git \
RUN apt-get update
RUN apt-get install -y curl wget gnupg python3 python-is-python3 python3-pip git \
build-essential tmux vim

RUN python -m pip install \
Expand Down
16 changes: 10 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"dockerFile": "Dockerfile",
"postCreateCommand": "poetry install --extras \"simulation\"",
"extensions": ["ms-python.python"],
"settings": {
"files.watcherExclude": {},
"search.exclude": {},
"terminal.integrated.defaultProfile.linux": "bash"
"postCreateCommand": "sudo poetry install --extras \"simulation\"",
"customizations": {
"vscode": {
"settings": {
"files.watcherExclude": { },
"search.exclude": { },
"terminal.integrated.defaultProfile.linux": "bash"
},
"extensions": [ "ms-python.python" ]
}
},
"remoteUser": "flwr-vscode",
"containerEnv": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Develop in VSCode Dev Containers
Develop in VSCode Dev Containers
================================

When working on the Flower framework we want to ensure that all contributors use the same developer environment to format code or run tests. For this purpose we are using the VSCode Remote Containers extension. What is it? Read the following quote:
Expand All @@ -14,7 +14,7 @@ Source: `Official VSCode documentation <https://code.visualstudio.com/docs/remot
Getting started
---------------

Configuring and setting up the :code:`Dockerfile` as well the configuration for the devcontainer can be a bit more involved. The good thing is you want have to do it. Usually it should be enough to install Docker on your system and ensure its available on your command line. Additionally, install the `VSCode Containers Extension <vscode:extension/ms-vscode-remote.remote-containers>`_.
Configuring and setting up the :code:`Dockerfile` as well the configuration for the devcontainer can be a bit more involved. The good thing is you don't have to do it. Usually it should be enough to install [Docker](https://docs.docker.com/engine/install/) on your system and ensure its available on your command line. Additionally, install the `VSCode Containers Extension <vscode:extension/ms-vscode-remote.remote-containers>`_.

Now you should be good to go. When starting VSCode, it will ask you to run in the container environment and - if you confirm - automatically build the container and use it. To manually instruct VSCode to use the devcontainer, you can, after installing the extension, click the green area in the bottom left corner of your VSCode window and select the option *(Re)Open Folder in Container*.

Expand Down

0 comments on commit c4b68b0

Please sign in to comment.