Skip to content

Commit 28dcf2b

Browse files
committed
add running outside of K8S
1 parent 14753b8 commit 28dcf2b

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

docs/user/how-to/run_iocs.rst

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,48 @@
11
Run an IOC without Kubernetes
22
=============================
33

4-
**TODO**
4+
When we run a containerized IOC we are selecting a generic IOC container image
5+
to launch and some configuration to pass to the IOC. The configuration we
6+
pass is what makes the IOC a unique instance instead of a generic IOC.
7+
8+
In the tutorials we are running the IOC in a Kubernetes cluster and we
9+
use a Kubernetes ConfigMap to pass the configuration to the IOC.
10+
11+
However it is perfectly possible to do this without Kubernetes. To demonstrate
12+
this easily, first create the test beamline repo as described in
13+
`../tutorials/04_create_beamline`.
14+
15+
Now if you cd into the test beamline repo and run the following command you
16+
will see the IOC running in a container:
17+
18+
.. code-block:: bash
19+
20+
podman run -it -v $(pwd)/iocs/bl01t-ea-ioc-01/config:/repos/epics/ioc/config ghcr.io/epics-containers/ioc-template-linux-runtime:23.3.3
21+
22+
What you have done here is pull down the generic ``ioc-template-linux-runtime``
23+
container image from the GitHub Container Registry and run it.
24+
The -it means it is an interactive terminal session.
25+
26+
The -v mounts the local directory ``iocs/bl01t-ea-ioc-01/config`` into the
27+
container at ``/repos/epics/ioc/config``. This is where the IOC expects to
28+
find its configuration. The leading $(pwd) means the current working directory
29+
is appended to the path and that is required because the path for mounting
30+
into a container must be absolute.
31+
32+
``iocs/bl01t-ea-ioc-01/config`` contains a simple iocShell boot script and the
33+
default behaviour is to pass that to the generic IOC binary.
34+
35+
Using this approach you could manage your config folders and IOC launches
36+
yourself using whatever mechanism you prefer. Probably docker compose or
37+
docker swarm would be the most likely candidates.
38+
39+
It may be worth noting that this ``ec`` command does exactly the same
40+
thing as the above podman command:
41+
42+
.. code-block:: bash
43+
44+
ec ioc-launch iocs/bl01t-ea-ioc-01 --tag 23.3.3
45+
46+
That is because ``ioc-launch`` is intended for locally testing an IOC instance
47+
that is destined for Kubernetes.
48+

0 commit comments

Comments
 (0)