Skip to content

Commit 0002934

Browse files
committed
started create ioc instance tutorial
1 parent b202295 commit 0002934

File tree

4 files changed

+81
-6
lines changed

4 files changed

+81
-6
lines changed

docs/user/tutorials/create_beamline.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ with basic configuration.
2727

2828
The tests on beamline repositories are basic at present. However the intention
2929
is that eventually each device on a beamline will be simulated using
30-
`Tickit <https://github.com/dls-controls/tickit>`_ and that the CI so system
31-
tests of each IOC against simulated hardware.
30+
`Tickit <https://github.com/dls-controls/tickit>`_ . Then Continuous
31+
Integration will perform system tests for each IOC against simulated hardware.
3232

3333
Also note that each of these IOC instances will be launched using a
3434
Generic IOC image. Ideally the CI for each Generic IOC should have already run
@@ -81,7 +81,7 @@ Steps
8181

8282
.. _these instructions: https://github.com/epics-containers/blxxi-template#how-to-copy-this-template-project
8383

84-
#. Clone the template repo locally.
84+
#. Clone the template repo locally (substituting in your own GitHub Account).
8585

8686
.. code-block:: bash
8787

docs/user/tutorials/create_ioc.rst

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,82 @@ The last section covered deploying and managing the example Instance that
88
came with the template beamline repository. Here we will create a new
99
IOC Instance that implements a simulated detector.
1010

11-
TODO - complete this.
11+
Create a New IOC Instance
12+
-------------------------
13+
14+
To create a new IOC Instance simply add a new folder to the ``iocs`` folder
15+
in your beamline repo. The name of the folder will be the name of the IOC.
16+
This folder needs to contain these two items:
17+
18+
:values.yaml: a file that specifies which Generic IOC Image your IOC Instance
19+
will run inside of.
20+
21+
:config: a folder that contains the IOC configuration files. The configuration
22+
can take a number of forms, and these were listed inside of the example
23+
IOC from the previous Tutorial.
24+
`Click this link to review the options <https://github.com/epics-containers/ibek/blob/ea9da7e1cfe88f2a300ad236f820221837dd9dcf/src/ibek/templates/ioc/config/start.sh>`_
25+
26+
We will start by creating the values.yaml file:
27+
28+
.. code-block:: bash
29+
30+
cd bl01t
31+
mkdir iocs/bl01t-ea-ioc-02
32+
code values.yaml
33+
34+
This should launch vscode and open the values.yaml file. Add the following:
35+
36+
.. code-block:: yaml
37+
38+
image: ghcr.io/epics-containers/ioc-adsimdetector-linux-runtime:2023.10.5
39+
40+
This tells the IOC Instance to run in the ``ioc-adsimdetector-linux-runtime``
41+
container. This container was built by the Generic IOC source repo here
42+
https://github.com/epics-containers/ioc-adsimdetector. The container has
43+
support for AreaDetector and ADSimDetector compiled into its IOC binary.
44+
45+
Generic IOCs have compiled IOC binaries and `dbd` files but no startup script or
46+
EPICS database files. These are baked into the container at container build
47+
time.
48+
49+
Startup and Database are provided by the IOC Instance at container run time.
50+
This is what makes a unique IOC Instance from a Generic IOC container.
51+
52+
Therefore we need to create a startup and EPICS Database to make this into
53+
a functional IOC Instance. To do that we will use the ``ibek`` tool. To
54+
recap, we have two python CLI tools for supporting epics-containers:
55+
56+
:ibek: runs *inside* the Generic IOC containers and provides commands for:
57+
- Fetching and compiling support modules at build time
58+
- Other build time utilities such as creating and compiling IOC source and
59+
extracting runtime assets for the runtime container target.
60+
- Generating startup scripts and EPICS databases at container runtime
61+
from IOC yaml files
62+
63+
:ec: provides developer support *outside* of the container such as:
64+
- Deploying, managing and debugging IOC Instances
65+
- Building and debugging Generic IOC containers
66+
67+
``ibek`` is already installed inside of the Generic IOC container we selected
68+
above. So now we will provide some IOC yaml files to ``ibek`` so that it
69+
will generate startup assets for our IOC Instance.
70+
71+
Create IOC YAML Files
72+
---------------------
73+
74+
IOC yaml files are a sequence of ``entities``. Each entity is a dictionary
75+
76+
TODO continue: show how Support YAML works and show how IOCs publish schema etc.
77+
78+
79+
80+
81+
82+
83+
84+
85+
86+
1287

1388
.. figure:: ../images/c2dv.png
1489

docs/user/tutorials/setup_k8s.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Setup a Kubernetes Server
55
=========================
66

7-
.. Warning ::
7+
.. Warning::
88

99
This information is out of date. It will be updated soon.
1010

docs/user/tutorials/setup_workstation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ will deploy containers to the local workstation's docker or podman instance.
173173

174174
However, everything in these tutorials would also work with Kubernetes. If you
175175
are particularly interested in Kubernetes then you can jump to
176-
`setup_kubernetes` and follow the instructions there. Then '{{(index (index .NetworkSettings.Ports "8787/tcp") 0).HostPort}}'come back to this
176+
`setup_kubernetes` and follow the instructions there. Then come back to this
177177
point and continue with the tutorials.
178178

179179
If you are planning not to use Kubernetes at all then now might be

0 commit comments

Comments
 (0)