Skip to content

Conversation

@SergioGasquez
Copy link
Member

@SergioGasquez SergioGasquez commented Mar 28, 2022

Adding devcontainer to enable the use of Visual Studio Code remote containers to have a working environment with necessary dependencies among useful VSCode settings and extensions.

It also includes proper files to run Wokwi simulator with the exercises

@SergioGasquez SergioGasquez marked this pull request as draft March 28, 2022 13:51
@SergioGasquez SergioGasquez marked this pull request as ready for review March 28, 2022 13:51
@georgik
Copy link

georgik commented Mar 30, 2022

Note: When running the container on Podman 4 for macOS, it's necessary to specify mount-points when initializing VM so that it can be mounted to container. Examples of initialization:

podman machine init --disk-size 80  --cpus 8 -m 4096 -v /Users/georgik/projects/espressif-training:/Users/georgik/projects/espressif-trainings

More details about mount-points: containers/podman#8016 (comment)

Please include this hint in DevContainer file or in the documentation.

@Mirabellensaft , @spookyvision : Please review this PR for adding support for DevContainer for VS Code.

@SergioGasquez
Copy link
Member Author

Note: When running the container on Podman 4 for macOS, it's necessary to specify mount-points when initializing VM so that it can be mounted to container. Examples of initialization:

podman machine init --disk-size 80  --cpus 8 -m 4096 -v /Users/georgik/projects/espressif-training:/Users/georgik/projects/espressif-trainings

More details about mount-points: containers/podman#8016 (comment)

Please include this hint in DevContainer file or in the documentation.

@Mirabellensaft , @spookyvision : Please review this PR for adding support for DevContainer for VS Code.

Added information about this in the esp-rs-devcontainer repository and a reference to it in espressif-trainings readme.

@Mirabellensaft
Copy link
Contributor

Hi @SergioGasquez thank you for the contribution, I will test on Monday!

@SergioGasquez
Copy link
Member Author

I updated my main branch with a Dockerfile, so users can edit devcontainer.json to choose between using the built image or the Dockerfile.

Same could be done in .gitpod.yml, although this is currently not working due to gitpod-io/gitpod#7754.

Kudos to @georgik for the idea!

@justahero
Copy link
Contributor

Hello @SergioGasquez,

thanks for the update.

looks like I was a bit late, I tested an earlier state of your branch Dockerfile (I think it was this commit). Let me check again.

@SergioGasquez
Copy link
Member Author

Hello @SergioGasquez,

thanks for the update.

looks like I was a bit late, I tested an earlier state of your branch Dockerfile (I think it was this commit). Let me check again.

Sorry for merging it in advance, that commit includes the main changes of the branch. Let me know how it went! 😄

https://github.com/espressif/esp-idf.git $HOME/esp-idf
RUN $HOME/esp-idf/install.sh ${ESP_BOARD}
ENV IDF_PATH=$HOME/esp-idf
RUN git clone https://github.com/ferrous-systems/espressif-trainings.git && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My recommentation is to remove these compilation checks from the Dockerfile. One option is to make these run in a CI pipeline. But this is outside of the scope of this PR.

{
"name": "espressif-training",
// Choose between "image" and "build" properties to pull built image or build from Dockerfile
"image": "docker.io/sergiogasquez/esp-rs-env:esp32c3-training",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to use the build property with the local Dockerfile as the default, otherwise the dev environment relies on this particular image to be available.

python3 python3-pip libusb-1.0-0 libssl-dev pkg-config libtinfo5 clang \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
RUN pip3 install websockets==10.2
ARG CONTAINER_USER=gitpod
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if it's possible to specify the user for Gitpod via .gitpod.yml or is it always a user named gitpod? I checked the documentation but could not find anything in my initial search related to that.

One option I see is to specify the Docker user explicitly (for example "esp"), regardless of the environment. This way the user would be consistent for docker CLI, VS Code devcontainer, Gitpod, etc. Some parts of the code also require a specific user to be present, for example file wowki/wowki-server.py expects its paths to contain name vscode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants