Skip to content

Commit b1422b1

Browse files
andistormPietfried
andauthored
Add documentation for the EVerest Development Container (EVerest#1693)
Add a note to the 'Getting started in Software' how-to, linking to devcontainers Signed-off-by: Andreas Heinrich <andreas.heinrich@rwth-aachen.de> Signed-off-by: Christoph Burandt <christoph.burandt@pionix.de> Signed-off-by: Piet Gömpel <37657534+Pietfried@users.noreply.github.com> Co-authored-by: Piet Gömpel <37657534+Pietfried@users.noreply.github.com>
1 parent 142adf8 commit b1422b1

File tree

10 files changed

+928
-74
lines changed

10 files changed

+928
-74
lines changed
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
##############################################
2+
Internals of the EVerest Development Container
3+
##############################################
4+
5+
This document explains the internal working of the EVerest
6+
development container (devcontainer) for different setup variants
7+
and how things are connected.
8+
9+
For a more hands-on explanation, consider reading:
10+
11+
- :doc:`Tutorial: Setup the EVerest Development Container </tutorials/setup-devcontainer/index>`
12+
- :doc:`How-to Guide: How to use a development container for EVerest development and sil testing </how-to-guides/devcontainer-usage/index>`
13+
14+
*******************************
15+
The Docker Compose Project Name
16+
*******************************
17+
18+
The Docker Compose project name determines how containers are
19+
named and grouped. By default, it uses the
20+
**current folder name with _devcontainer suffix**
21+
(consistent with VSC behavior), but can be customized.
22+
23+
Set the environment variable ``DOCKER_COMPOSE_PROJECT_NAME``
24+
to your desired project name before building/starting the devcontainer.
25+
26+
For example:
27+
28+
.. code-block:: bash
29+
30+
DOCKER_COMPOSE_PROJECT_NAME=my-project ./applications/devrd/devrd Start
31+
32+
This will name the containers with the pattern:
33+
34+
``{project_name}-{service}-1``, where
35+
36+
- ``{project_name}`` is the value of ``DOCKER_COMPOSE_PROJECT_NAME``
37+
- ``{service}`` is the service name defined in the docker-compose files
38+
- ``1`` is the instance number (default is 1)
39+
40+
*********************
41+
Environment Variables
42+
*********************
43+
44+
You can generate an ``.env`` file with auto-detected values using this command:
45+
46+
.. code-block:: bash
47+
48+
./applications/devrd/devrd env
49+
50+
This will create a ``.devcontainer/.env`` file with the following content:
51+
52+
.. code-block:: bash
53+
54+
# Auto-generated by setup script
55+
ORGANIZATION_ARG=EVerest
56+
REPOSITORY_HOST=github.com
57+
REPOSITORY_USER=git
58+
COMMIT_HASH=<..>
59+
EVEREST_TOOL_BRANCH=main
60+
UID=<..>
61+
GID=<..>
62+
HOST_WORKSPACE_FOLDER=<..>
63+
64+
These variables are automatically mapped in the container to the following environment variables:
65+
66+
- ``ORGANIZATION_ARG``: Maps to ``EVEREST_DEV_TOOL_DEFAULT_GIT_ORGANIZATION``
67+
- ``REPOSITORY_HOST``: Maps to ``EVEREST_DEV_TOOL_DEFAULT_GIT_HOST``
68+
- ``REPOSITORY_USER``: Maps to ``EVEREST_DEV_TOOL_DEFAULT_GIT_SSH_USER``
69+
- ``EVEREST_TOOL_BRANCH``: Maps to ``EVEREST_TOOL_BRANCH``
70+
- ``HOST_WORKSPACE_FOLDER``: The directory mapped to ``/workspace`` inside the container
71+
72+
Use this mechanism if you have a different organization or git host or user.
73+
This is useful if you have forked and you are hosting your development outside github.
74+
75+
************************
76+
Workspace Folder Mapping
77+
************************
78+
79+
The ``/workspace`` directory inside the container can be mapped
80+
to any folder on your host system. The workspace folder is
81+
determined in the following priority order:
82+
83+
1. **Command line option**: ``-w`` or ``--workspace`` flag
84+
2. **Environment variable**: ``HOST_WORKSPACE_FOLDER`` environment variable
85+
3. **`.env` file**: ``HOST_WORKSPACE_FOLDER`` value in ``.devcontainer/.env``
86+
4. **Current directory**: Falls back to the current working directory
87+
88+
The ``.devcontainer`` directory (containing ``.env`` and Docker Compose files)
89+
is always located relative to where the ``devrd`` script is installed.
90+
This allows you to:
91+
92+
- Run ``devrd`` from any directory in your workspace
93+
- Use a single ``devrd`` installation to manage multiple workspaces by changing ``HOST_WORKSPACE_FOLDER`` in the ``.env`` file
94+
95+
One can set workspace mapping via command line:
96+
97+
.. code-block:: bash
98+
99+
./applications/devrd/devrd env -w /path/to/workspace
100+
101+
Or edit ``.devcontainer/.env`` directly and set ``HOST_WORKSPACE_FOLDER``
102+
Then run from anywhere:
103+
104+
.. code-block:: bash
105+
106+
cd /path/to/workspace/subfolder
107+
../applications/devrd/devrd start # Works correctly, uses workspace from .env file
108+
109+
***************
110+
Troubleshooting
111+
***************
112+
113+
See the :doc:`separate troubleshooting section </tutorials/setup-devcontainer/troubleshooting>` for help
114+
on devcontainer-specific issues.
115+
116+
----
117+
118+
**Authors:** Florian Mihut, Andreas Heinrich

docs/source/explanation/index.rst

Lines changed: 61 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -9,85 +9,92 @@ Let us have a look at the most important topics first.
99
Below that, you will be presented with a categorized list of all articles.
1010

1111
.. grid:: 1 2 2 3
12-
:gutter: 2
12+
:gutter: 2
1313

14-
.. grid-item-card:: Framework Overview
15-
:link: high-level-overview
16-
:link-type: doc
14+
.. grid-item-card:: Framework Overview
15+
:link: high-level-overview
16+
:link-type: doc
1717

18-
Get a high-level overview of the EVerest framework.
18+
Get a high-level overview of the EVerest framework.
1919

20-
.. grid-item-card:: Error Framework
21-
:link: error-framework
22-
:link-type: doc
20+
.. grid-item-card:: Error Framework
21+
:link: error-framework
22+
:link-type: doc
2323

24-
How to communicate error states between modules.
24+
How to communicate error states between modules.
2525

26-
.. grid-item-card:: EVerest Modules in Detail
27-
:link: detail-module-concept
28-
:link-type: doc
26+
.. grid-item-card:: EVerest Modules in Detail
27+
:link: detail-module-concept
28+
:link-type: doc
2929

30-
Learn about the module concept of EVerest.
30+
Learn about the module concept of EVerest.
3131

32-
.. grid-item-card:: Tier Module Mapping
33-
:link: tier-module-mappings
34-
:link-type: doc
32+
.. grid-item-card:: Tier Module Mapping
33+
:link: tier-module-mappings
34+
:link-type: doc
3535

36-
EVerest's 3-tier module mapping explained.
36+
EVerest's 3-tier module mapping explained.
3737

38-
.. grid-item-card:: Adapt EVerest
39-
:link: adapt-everest/index
40-
:link-type: doc
38+
.. grid-item-card:: Adapt EVerest
39+
:link: adapt-everest/index
40+
:link-type: doc
4141

42-
Learn how EVerest can be adapted to your use-case.
42+
Learn how EVerest can be adapted to your use-case.
4343

44-
.. grid-item-card:: The EVerest Dependency Manager
45-
:link: dev-tools/edm
46-
:link-type: doc
44+
.. grid-item-card:: The EVerest Dependency Manager
45+
:link: dev-tools/edm
46+
:link-type: doc
4747

48-
Tool helping to orchestrate dependencies between the different EVerest repositories.
48+
Tool helping to orchestrate dependencies between the different EVerest repositories.
4949

50-
.. grid-item-card:: The ev-cli Development Tool
51-
:link: dev-tools/edm
52-
:link-type: doc
50+
.. grid-item-card:: The ev-cli Development Tool
51+
:link: dev-tools/edm
52+
:link-type: doc
5353

54-
Command line tool to generate C++ code from interface and manifest definitions.
54+
Command line tool to generate C++ code from interface and manifest definitions.
5555

56-
.. grid-item-card:: The Plug&Charge Process in EVerest
57-
:link: dev-tools/edm
58-
:link-type: doc
56+
.. grid-item-card:: The Plug&Charge Process in EVerest
57+
:link: dev-tools/edm
58+
:link-type: doc
5959

60-
Learn how Plug&Charge is implemented in EVerest.
60+
Learn how Plug&Charge is implemented in EVerest.
6161

62-
.. grid-item-card:: Linux / Yocto and EVerest
63-
:link: linux-yocto/index
64-
:link-type: doc
62+
.. grid-item-card:: Linux / Yocto and EVerest
63+
:link: linux-yocto/index
64+
:link-type: doc
6565

66-
Learn how to integrate EVerest in your embedded application via Yocto and allow for secure OTA updates.
66+
Learn how to integrate EVerest in your embedded application via Yocto and allow for secure OTA updates.
6767

68-
.. grid-item-card:: Hardware Architecture
69-
:link: hardware-architecture
70-
:link-type: doc
68+
.. grid-item-card:: Hardware Architecture
69+
:link: hardware-architecture
70+
:link-type: doc
7171

72-
Some ideas and guidance on the general architecture of AC or DC chargers.
72+
Some ideas and guidance on the general architecture of AC or DC chargers.
7373

74-
.. grid-item-card:: Powermeter OCMF Handling
75-
:link: powermeter-ocmf
76-
:link-type: doc
74+
.. grid-item-card:: Powermeter OCMF Handling
75+
:link: powermeter-ocmf
76+
:link-type: doc
7777

78-
How OCMF records are expected to be handled by modules implementing powermeters.
78+
How OCMF records are expected to be handled by modules implementing powermeters.
7979

80-
.. grid-item-card:: A Selection of included Hardware Drivers
81-
:link: hardware-drivers
82-
:link-type: doc
80+
.. grid-item-card:: A Selection of included Hardware Drivers
81+
:link: hardware-drivers
82+
:link-type: doc
8383

84-
Description of natively supported hardware driver modules included in EVerest.
84+
Description of natively supported hardware driver modules included in EVerest.
8585

86-
.. grid-item-card:: Structure of the EVerest Documentation
87-
:link: the-everest-documentation
88-
:link-type: doc
86+
.. grid-item-card:: Structure of the EVerest Documentation
87+
:link: the-everest-documentation
88+
:link-type: doc
8989

90-
How this documentation is structured.
90+
How this documentation is structured.
91+
92+
.. grid-item-card:: Use the EVerest Development Container
93+
:link: devcontainer-internal/index
94+
:link-type: doc
95+
96+
Internal working of the EVerest development container
97+
for different setup variants and how things are connected.
9198

9299
.. toctree::
93100
:hidden:
@@ -107,3 +114,4 @@ Below that, you will be presented with a categorized list of all articles.
107114
hardware-drivers
108115
the-everest-documentation
109116
powermeter-ocmf
117+
devcontainer-internal/index

0 commit comments

Comments
 (0)