-
Notifications
You must be signed in to change notification settings - Fork 90
Add devcontainer #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Add devcontainer #48
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
a2352b9
Add devcontainer
SergioGasquez 9de0317
Update readme: devcontainer
SergioGasquez 898f77b
Update from dockerfile to image
SergioGasquez 640f20c
Remove rust-toolchain file
SergioGasquez 0ec1bab
Remove rust-toolchain files
SergioGasquez b7341e5
Update the container image
SergioGasquez b5e2264
Merge pull request #1 from SergioGasquez/feature/fetch-dependencies
SergioGasquez 3d1cc45
Add more information on podman
SergioGasquez 7d7448f
Format indentation
SergioGasquez 25a1d98
Add gitpod file
SergioGasquez fca1d4b
Test before task
SergioGasquez 3f632a3
Add vscode extensions
SergioGasquez 611deeb
Update commands
SergioGasquez 36b030d
Update extensions
SergioGasquez eb43c38
Update extensions
SergioGasquez 523e1f4
Fix typo
SergioGasquez 362885e
Fix typo
SergioGasquez 50c3d1f
Remove export
SergioGasquez c79461e
Add gitpod button
SergioGasquez 3ba1ec4
Update readme
SergioGasquez 4a5b1fa
Update commands
SergioGasquez e01345a
Merge pull request #2 from SergioGasquez/feature/gitpod
SergioGasquez d883f49
Add gitpod flashing and monitoring information
SergioGasquez a2e8c24
Merge pull request #3 from SergioGasquez/feature/gitpod
SergioGasquez 837be4e
Integration with wokwi
SergioGasquez f71c657
Test gitpod integration with wokwi
SergioGasquez 5589a89
Modify gitignore to include tasks
SergioGasquez 625b103
Add task.json
SergioGasquez 8a95f6a
Add documentation for Wokwi simulation
SergioGasquez d99f6fe
Rename task
SergioGasquez 54e6b3a
Update path
SergioGasquez 4ab3ae9
Update message
SergioGasquez 901a316
Merge pull request #4 from SergioGasquez/feature/wokwi
SergioGasquez 83b269f
Update board
SergioGasquez 70d0ce0
Add run script
SergioGasquez d168e83
Add one task for every project
SergioGasquez 2075121
Update README.md
SergioGasquez ac4ca5a
Update Wokwi Simulator documentation
SergioGasquez 1eaccb3
Add Dockerfile
SergioGasquez 423a89b
Open Wokwi port
SergioGasquez 50f5beb
Avoid runing simulator if build fails
SergioGasquez a23f0b5
Update auth_method to allow open access points
SergioGasquez 9bfbb01
Include both "image" and "build" properties
SergioGasquez 53c1e84
Update wokwi server script
SergioGasquez a819852
Add dockerfile to gitpod
SergioGasquez f892170
Fix cargo-espflash version
SergioGasquez 82f71a9
Use FS repo to fetch dependencies
SergioGasquez 8d0408a
Add default user
SergioGasquez 584b410
Add the option to build from Dockerfile
SergioGasquez df5ede8
Add documentation about Dockerfile
SergioGasquez 27ba47b
Merge branch 'main' into feature/dockerfile
SergioGasquez 5979916
Merge pull request #5 from SergioGasquez/feature/dockerfile
SergioGasquez fac56f7
Update container user, tasks and documentation
SergioGasquez 75de511
Update user in gitpod
SergioGasquez 661eb2c
Add rust-toolchain
SergioGasquez 84277a3
Update rust version
SergioGasquez 19c2041
Add rust-toolchain
SergioGasquez 3d70ede
Use rust board with neopixel for some projects
SergioGasquez ef86ac2
Use neopixel in advanced/button-interrupt examples
SergioGasquez ad2f3f8
Edit script url to allow simulation in gitpod
SergioGasquez e7a21c1
Edit script url to allow simulation in gitpod
SergioGasquez d6e161e
Edit script url to allow simulation in gitpod
SergioGasquez 7c3ee80
Add port 9012
SergioGasquez d9c24e1
Update port visibility
SergioGasquez 8b45d2e
Update wokwi server script for gitpod
SergioGasquez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| FROM debian:bullseye | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
| ENV LC_ALL=C.UTF-8 | ||
| ENV LANG=C.UTF-8 | ||
| RUN apt-get update \ | ||
| && apt-get install -y vim nano git curl gcc ninja-build cmake libudev-dev \ | ||
| 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=esp | ||
| ENV USER=${CONTAINER_USER} | ||
| RUN adduser --disabled-password --gecos "" ${CONTAINER_USER} | ||
| USER ${CONTAINER_USER} | ||
| WORKDIR /home/${CONTAINER_USER} | ||
| RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ | ||
| --default-toolchain nightly-2022-03-30 -y | ||
| ENV PATH=${PATH}:$HOME/.cargo/bin:$HOME/.cargo/bin | ||
| RUN $HOME/.cargo/bin/rustup component add rust-src --toolchain nightly-2022-03-30 | ||
| RUN $HOME/.cargo/bin/rustup target add riscv32i-unknown-none-elf | ||
| RUN $HOME/.cargo/bin/cargo install cargo-generate espmonitor bindgen ldproxy | ||
| RUN $HOME/.cargo/bin/cargo install cargo-espflash --version 1.4.0 | ||
| ENV ESP_IDF_TOOLS_INSTALL_DIR=global | ||
| ENV ESP_BOARD=esp32c3 | ||
| ENV ESP_IDF_VER=v4.4 | ||
| ENV ESP_IDF_VERSION=release/v4.4 | ||
| ENV ESP_IDF_BRANCH=release/v4.4 | ||
| RUN git clone --recursive --depth 1 --shallow-submodules -b ${ESP_IDF_BRANCH} \ | ||
| https://github.com/espressif/esp-idf.git $HOME/esp-idf | ||
| RUN $HOME/esp-idf/install.sh ${ESP_BOARD} | ||
| ENV IDF_PATH=$HOME/esp-idf | ||
| # In order to have dependencies pre-fecthed please, uncoment this section: | ||
| # RUN git clone https://github.com/ferrous-systems/espressif-trainings.git && \ | ||
| # # Hardware Check | ||
| # cd $HOME/espressif-trainings/intro/hardware-check && \ | ||
| # $HOME/.cargo/bin/cargo fetch && \ | ||
| # $HOME/.cargo/bin/cargo build && \ | ||
| # $HOME/.cargo/bin/cargo clean && \ | ||
| # # Http Client | ||
| # cd $HOME/espressif-trainings/intro/http-client/exercise && \ | ||
| # $HOME/.cargo/bin/cargo fetch && \ | ||
| # cd $HOME/espressif-trainings/intro/http-client/solution && \ | ||
| # $HOME/.cargo/bin/cargo fetch && \ | ||
| # # Http Server | ||
| # cd $HOME/espressif-trainings/intro/http-server/exercise && \ | ||
| # $HOME/.cargo/bin/cargo fetch && \ | ||
| # cd $HOME/espressif-trainings/intro/http-server/solution && \ | ||
| # $HOME/.cargo/bin/cargo fetch && \ | ||
| # # MQTT | ||
| # cd $HOME/espressif-trainings/intro/mqtt/exercise && \ | ||
| # $HOME/.cargo/bin/cargo fetch && \ | ||
| # cd $HOME/espressif-trainings/intro/mqtt/solution && \ | ||
| # $HOME/.cargo/bin/cargo fetch && \ | ||
| # cd $HOME/espressif-trainings/intro/mqtt/host-client && \ | ||
| # $HOME/.cargo/bin/cargo fetch && \ | ||
| # # Button Interrupt | ||
| # cd $HOME/espressif-trainings/advanced/button-interrupt/exercise && \ | ||
| # $HOME/.cargo/bin/cargo fetch && \ | ||
| # cd $HOME/espressif-trainings/advanced/button-interrupt/solution && \ | ||
| # $HOME/.cargo/bin/cargo fetch && \ | ||
| # # I2C Driver | ||
| # cd $HOME/espressif-trainings/advanced/i2c-driver/solution && \ | ||
| # $HOME/.cargo/bin/cargo fetch && \ | ||
| # # I2C Sensor Reading | ||
| # cd $HOME/espressif-trainings/advanced/i2c-sensor-reading/solution && \ | ||
| # $HOME/.cargo/bin/cargo fetch && \ | ||
| # # Delete the repository | ||
| # rm -rf $HOME/espressif-trainings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| { | ||
| "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", | ||
| // "build": { | ||
| // "dockerfile": "Dockerfile", | ||
| // }, | ||
| "settings": { | ||
| "editor.formatOnPaste": true, | ||
| "editor.formatOnSave": true, | ||
| "editor.formatOnSaveMode": "modifications", | ||
| "editor.formatOnType": true, | ||
| "lldb.executable": "/usr/bin/lldb", | ||
| "files.watcherExclude": { | ||
| "**/target/**": true | ||
| }, | ||
| "rust-analyzer.checkOnSave.command": "clippy", | ||
| "[rust]": { | ||
| "editor.defaultFormatter": "matklad.rust-analyzer" | ||
| }, | ||
| }, | ||
| "extensions": [ | ||
| "matklad.rust-analyzer", | ||
| "tamasfe.even-better-toml", | ||
| "vadimcn.vscode-lldb", | ||
| "serayuzgur.crates", | ||
| "mutantdino.resourcemonitor", | ||
| "yzhang.markdown-all-in-one", | ||
| ], | ||
| // Uncomment if using Podman and choose the proper device | ||
| // "runArgs": ["--userns=keep-id", "--device", "/dev/ttyUSB0", "--security-opt", "label=disable", "--annotation", "run.oci.keep_original_groups=1"], | ||
| "forwardPorts": [ | ||
| 9012 | ||
| ], | ||
| "workspaceMount": "source=${localWorkspaceFolder},target=/home/esp/workspace,type=bind,consistency=cached", | ||
| "workspaceFolder": "/home/esp/workspace/" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| .vscode | ||
| !.vscode/tasks.json | ||
| target | ||
| Cargo.lock | ||
| cfg.toml | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Choose between building from Dockerfile or pulling the built image. | ||
| image: sergiogasquez/esp-rs-env:esp32c3-training | ||
| # image: | ||
| # Due to https://github.com/gitpod-io/gitpod/issues/7754 building from Dockerfile is not working | ||
| # file: .devcontainer/Dockerfile | ||
| tasks: | ||
| - name: Adopt environment in the container image to gitpod user | ||
| command: | | ||
| ln -s /home/esp/.rustup /home/gitpod/.rustup | ||
| mkdir /home/gitpod/.cargo | ||
| ln -s /home/esp/.cargo/bin /home/gitpod/.cargo/bin | ||
| ln -s /home/esp/.cargo/env /home/gitpod/.cargo/env | ||
| source /home/gitpod/.cargo/env | ||
| vscode: | ||
| extensions: | ||
| - matklad.rust-analyzer | ||
| - tamasfe.even-better-toml | ||
| - vadimcn.vscode-lldb | ||
| - anwar.resourcemonitor | ||
| - yzhang.markdown-all-in-one | ||
| ports: | ||
| - port: 9012 | ||
| visibility: public |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,201 @@ | ||
| { | ||
| "version": "2.0.0", | ||
| "tasks": [ | ||
| { | ||
| "type": "shell", | ||
| "command": [ | ||
| "cd ${relativeFileDirname}/.. &&", | ||
| "cargo espflash --release save-image app.bin &&", | ||
| "python3 $HOME/workspace/wokwi/wokwi-server.py" | ||
| ], | ||
| "problemMatcher": [ | ||
| "$rustc" | ||
| ], | ||
| "label": "Build and run Wokwi simulation: Focused project", | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": true | ||
| } | ||
| }, | ||
| { | ||
| "type": "shell", | ||
| "command": [ | ||
| "export CURRENT_PROJECT=intro/hardware-check &&", | ||
| "bash wokwi/run.sh" | ||
| ], | ||
| "problemMatcher": [ | ||
| "$rustc" | ||
| ], | ||
| "label": "Build and run Wokwi simulation: intro/hardware-check", | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": false | ||
| } | ||
| }, | ||
| { | ||
| "type": "shell", | ||
| "command": [ | ||
| "export CURRENT_PROJECT=intro/http-client/exercise &&", | ||
| "bash wokwi/run.sh" | ||
| ], | ||
| "problemMatcher": [ | ||
| "$rustc" | ||
| ], | ||
| "label": "Build and run Wokwi simulation: intro/http-client/exercise", | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": false | ||
| } | ||
| }, | ||
| { | ||
| "type": "shell", | ||
| "command": [ | ||
| "export CURRENT_PROJECT=intro/http-client/solution &&", | ||
| "bash wokwi/run.sh" | ||
| ], | ||
| "problemMatcher": [ | ||
| "$rustc" | ||
| ], | ||
| "label": "Build and run Wokwi simulation: intro/http-client/solution", | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": false | ||
| } | ||
| }, | ||
| { | ||
| "type": "shell", | ||
| "command": [ | ||
| "export CURRENT_PROJECT=intro/http-server/exercise &&", | ||
| "bash wokwi/run.sh" | ||
| ], | ||
| "problemMatcher": [ | ||
| "$rustc" | ||
| ], | ||
| "label": "Build and run Wokwi simulation: intro/http-server/exercise", | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": false | ||
| } | ||
| }, | ||
| { | ||
| "type": "shell", | ||
| "command": [ | ||
| "export CURRENT_PROJECT=intro/http-server/solution &&", | ||
| "bash wokwi/run.sh" | ||
| ], | ||
| "problemMatcher": [ | ||
| "$rustc" | ||
| ], | ||
| "label": "Build and run Wokwi simulation: intro/http-server/solution", | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": false | ||
| } | ||
| }, | ||
| { | ||
| "type": "shell", | ||
| "command": [ | ||
| "export CURRENT_PROJECT=intro/mqtt/exercise &&", | ||
| "bash wokwi/run.sh" | ||
| ], | ||
| "problemMatcher": [ | ||
| "$rustc" | ||
| ], | ||
| "label": "Build and run Wokwi simulation: intro/mqtt/exercise", | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": false | ||
| } | ||
| }, | ||
| { | ||
| "type": "shell", | ||
| "command": [ | ||
| "export CURRENT_PROJECT=intro/mqtt/host-client &&", | ||
| "bash wokwi/run.sh" | ||
| ], | ||
| "problemMatcher": [ | ||
| "$rustc" | ||
| ], | ||
| "label": "Build and run Wokwi simulation: intro/mqtt/host-client", | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": false | ||
| } | ||
| }, | ||
| { | ||
| "type": "shell", | ||
| "command": [ | ||
| "export CURRENT_PROJECT=intro/mqtt/solution &&", | ||
| "bash wokwi/run.sh" | ||
| ], | ||
| "problemMatcher": [ | ||
| "$rustc" | ||
| ], | ||
| "label": "Build and run Wokwi simulation: intro/mqtt/solution", | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": false | ||
| } | ||
| }, | ||
| { | ||
| "type": "shell", | ||
| "command": [ | ||
| "export CURRENT_PROJECT=advanced/button-interrupt/exercise &&", | ||
| "bash wokwi/run.sh" | ||
| ], | ||
| "problemMatcher": [ | ||
| "$rustc" | ||
| ], | ||
| "label": "Build and run Wokwi simulation: advanced/button-interrupt/exercise", | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": false | ||
| } | ||
| }, | ||
| { | ||
| "type": "shell", | ||
| "command": [ | ||
| "export CURRENT_PROJECT=advanced/button-interrupt/solution &&", | ||
| "bash wokwi/run.sh" | ||
| ], | ||
| "problemMatcher": [ | ||
| "$rustc" | ||
| ], | ||
| "label": "Build and run Wokwi simulation: advanced/button-interrupt/solution", | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": false | ||
| } | ||
| }, | ||
| { | ||
| "type": "shell", | ||
| "command": [ | ||
| "export CURRENT_PROJECT=advanced/i2c-driver/solution &&", | ||
| "bash wokwi/run.sh" | ||
| ], | ||
| "problemMatcher": [ | ||
| "$rustc" | ||
| ], | ||
| "label": "Build and run Wokwi simulation: advanced/i2c-driver/solution", | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": false | ||
| } | ||
| }, | ||
| { | ||
| "type": "shell", | ||
| "command": [ | ||
| "export CURRENT_PROJECT=advanced/i2c-sensor-reading/solution &&", | ||
| "bash wokwi/run.sh" | ||
| ], | ||
| "problemMatcher": [ | ||
| "$rustc" | ||
| ], | ||
| "label": "Build and run Wokwi simulation: advanced/i2c-sensor-reading/solution", | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": false | ||
| } | ||
| }, | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
buildproperty with the localDockerfileas the default, otherwise the dev environment relies on this particular image to be available.