Skip to content

Commit 48ecefe

Browse files
Merge pull request PowerGridModel#1191 from PowerGridModel/feature/docker-test
Dev environment: add support and documentation for Docker
2 parents 2208498 + 4786db0 commit 48ecefe

File tree

2 files changed

+43
-11
lines changed

2 files changed

+43
-11
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
2+
#
3+
# SPDX-License-Identifier: MPL-2.0
4+
5+
src/power_grid_model/_core/power_grid_model_c/lib/libpower_grid_model_c.so

docs/working_with_containers/container-setup.md

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,18 @@ the Python side.
1111

1212
## Setup Requirements
1313

14-
To begin using the container there are two open-source applications that must be installed.
14+
To begin using the container, you have several options, e.g.:
15+
16+
* Podman + DevPod (both are free, open-source tools)
17+
* Docker + DevPod (NOTE: Docker Desktop requires a subscription that is not free for commercial usage)
1518

1619
* Podman (<https://podman.io/>) - a container engine that lets developers build, run, and manage containers and pods
1720
without needing a background service.
1821
* DevPod (<https://devpod.sh/>) - a tool that instantiates reproducible, disposable development environments allowing
1922
developers to code inside the containers with their usual editors.
23+
* Docker (<https://www.docker.com/>) - a popular container platform that uses a background service (daemon) to build,
24+
run, and manage containerized applications. (NOTE: Docker Desktop requires a subscription that is not free for
25+
commercial usage).
2026

2127
## The Recommended Setup Process
2228

@@ -28,34 +34,55 @@ Firstly, setup the repository by cloning it into the desired destination.
2834
git clone <https>
2935
```
3036

31-
Make sure that you are in the right branch, the branch should have ".devcontainer" folder in it.
37+
Make sure that you are on the right branch.
3238

33-
### DevPod Setup
39+
### Podman and DevPod Setup
3440

35-
Secondly, open DevPod and go into the "Providers" section. There click on "+ Add", select the docker icon, give it a
36-
name and click on save. In the same window open advanced settings and under Docker path add the path to podman.exe (If
37-
you are on Windows, it likely is in Program Files\RedHat directory).
41+
#### DevPod Setup
42+
43+
Open DevPod and go into the "Providers" section. There click on "+ Add", select the docker icon, give it a
44+
name and click on save. In the same window open advanced settings and under Docker path add the path to 'podman'
45+
executable (If you are on Windows, it likely is in Program Files\RedHat directory).
3846

39-
### Podman Setup
47+
#### Podman Setup
4048

41-
Thirdly, to initialize Podman the Podman Desktop application has to be opened and "initialize and start" button has to
49+
To initialize Podman the Podman Desktop application has to be opened and "initialize and start" button has to
4250
be pressed. If the start succeeds, there will be a keyword "RUNNING" in green displayed.
4351

44-
### Initializing the container
52+
#### Initializing the container
4553

4654
Finally, to initialize and open the container everything will be done through DevPod.
4755

4856
* Upon openning DevPod go to "Workspaces" and click on "Create Workspace".
4957
* Under the "Enter Workspace Source", select the "Folder" option and navigate to the destination where you cloned the
5058
repository to.
5159
* Under the "Default IDE" select VSCode.
52-
* Under "Provider" select the provider that you have setup previously (it should have the docker icon, but the path
53-
should be to podman.exe)
60+
* Under "Provider" select the provider that you have setup previously (it should have the docker icon)
5461

5562
Finally, click "Create Workspace"
5663

64+
### Docker and DevPod Setup
65+
66+
#### Docker Setup
67+
68+
Before you begin, install Docker Desktop and open it. It will initialize automatically when launched.
69+
70+
#### DevPod Setup
71+
72+
Secondly, open DevPod and go into the "Providers" section. There click on "+ Add", select the docker icon, give it a
73+
name and click on save. DevPod should find the PATH to the 'docker' executable itself, however if you think that there
74+
are issues within your setup you can adjust the PATH in the advanced settings by adding the path to the 'docker'
75+
executable under Docker path.
76+
77+
For the final initialization step, see [Initializing the container](#initializing-the-container).
78+
5779
## Possible solutions to issues during setup
5880

5981
* If you are facing issues while building the container then try and allocate more memory in Podman. Go to
6082
Podman -> Settings (Bottom left corner) -> Resources -> Edit.
6183
* Try and make a fresh clone of the repository and redo the setup on it.
84+
85+
## Support for Apple Container
86+
87+
We have tested a container setup with Apple's container app. However, currently there is not a simplistic way to open
88+
that container within VSCode. With future plugin developments we expect to add support for Apple's container.

0 commit comments

Comments
 (0)