Skip to content

Commit 84f44bb

Browse files
committed
add some notes
1 parent 124a028 commit 84f44bb

File tree

2 files changed

+46
-6
lines changed

2 files changed

+46
-6
lines changed

docs/user/tutorials/dev_container.rst

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ The next section will show you how to use this feature. Note that you can use
8282
any IDE that supports remote development in a container, you could also
8383
simply launch the developer container in a shell and use it via CLI only.
8484

85+
TODO: add features to ``ec dev`` to launch the container in developer mode,
86+
with appropriate host mounts. This will enable non vscode users developer
87+
containers.
88+
8589
Starting a Developer Container
8690
------------------------------
8791

@@ -224,7 +228,8 @@ It is useful to understand that /epics/ioc is a soft link to the IOC source
224228
that came with your generic IOC source code. Therefore if you edit this
225229
code and recompile it, the changes will be visible inside the container and
226230
outside the container. Meaning that the repository ``ioc-adsimdetector`` is
227-
now showing your changes and you could push them up to GitHub if you wanted.
231+
now showing your changes in it's ``ioc`` folder and you could push them
232+
up to GitHub if you wanted.
228233

229234
The above is true because your project folder ioc-adsimdetector is mounted into
230235
the container's filesystem with a bind mount at the same place that the
@@ -240,19 +245,21 @@ destroyed when the container is rebuilt or deleted.
240245
See `container-layout`_ for details of which host folders are mounted into the
241246
container.
242247

243-
The IOC code is entirely boilerplate, the ``/epics/ioc/iocApp/src/Makefile``
248+
The IOC source code is entirely boilerplate, ``/epics/ioc/iocApp/src/Makefile``
244249
determines which dbd and lib files to link by including two files that
245-
``ibek`` generated during the container build namely
250+
``ibek`` generated during the container build. You can see these files in
246251
``/epics/support/configure/lib_list`` and ``/epics/support/configure/dbd_list``.
252+
247253
Although all Generic IOCs derived from ioc-template start out with the same
248-
generic source in ``iocApp/src``, you are free to change them if there is
254+
generic source, you are free to change them if there is
249255
a need for different compilation options etc.
250256

251257
The Generic IOC should now be ready to run inside of the container. To do this:
252258

253259
.. code-block:: bash
254260
255-
./start.sh
261+
cd /epics/ioc
262+
./start.sh
256263
257264
You will just see the default output of a Generic IOC that has no Instance
258265
configuration. Hit ``Ctrl-C`` to stop the this default script.
@@ -344,6 +351,18 @@ host. i.e. the root folder under which your projects are all cloned):
344351
- WS/ioc-adsimdetector
345352
- A second - fixed location mount of the Generic IOC source repo
346353

354+
IMPORTANT: remember that the container filesystem is temporary and will be
355+
destroyed when the container is rebuilt or deleted. All folders above with
356+
``Host Mount Path`` ``N/A`` are in the container filesystem. The devcontainer
357+
has been configured to mount the most useful host folders, but note that
358+
all support modules are in the container filesystem. Later we will learn
359+
how to work on support modules, first ensuring that they are made available
360+
in the host filesystem.
361+
362+
Also note that VSCode keeps your developer container until you rebuild it
363+
or explicitly delete it. Restarting your PC and coming back to the same
364+
devcontainer does keep all state. This can make you complacent about doing
365+
work in the container filesystem, this is not recommended.
347366

348367
.. _choose-ioc-instance:
349368

@@ -369,6 +388,15 @@ means we can edit the config, restart the IOC to test it and the changes
369388
will already be in place in the beamline repo. You can even open a shell
370389
onto the beamline repo and commit and push the changes.
371390

391+
.. note::
392+
393+
The manual steps above were shown to demonstrate the process. In practice
394+
you can use this command to do the same thing:
395+
396+
.. code-block:: bash
397+
398+
ibek dev instance /workspaces/bl01t/iocs/bl01t-ea-ioc-02
399+
372400
Wrapping Up
373401
-----------
374402

docs/user/tutorials/ioc_changes2.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Changing a Generic IOC Part 1
33

44
.. warning ::
55
6-
This tutorial is a work in progress. It is not yet complete.
6+
TODO: This tutorial is a work in progress. It is not yet complete.
77
88
This is a type 2 change from `ioc_change_types`.
99

@@ -18,6 +18,18 @@ Some of the reasons for doing this are:
1818
- For ibek generated IOC instances, you may need to add or change functionality
1919
in the support YAML file.
2020

21+
.. note::
22+
23+
If you are considering making a change to a Generic IOC because you
24+
want to add support for a second device, this is allowed but you should
25+
consider the alternative of creating a new Generic IOC.
26+
If you keep your Generic IOCs simple and focused on a single device, they
27+
will be smaller and there will be less of them. IOCs can still be
28+
linked via CA and this is preferable to recompiling a Generic IOC
29+
for every possible combination of devices. Using Kubernetes to
30+
manage multiple small services is cleaner than having a handful of
31+
monolithic services.
32+
2133
This tutorial will make some changes to the generic IOC ``ioc-adsample``.
2234
This Generic IOC is a simplified copy of ``ioc-adsimdetector`` tailored for
2335
use in these tutorials.

0 commit comments

Comments
 (0)