1
1
Changing a Generic IOC
2
2
======================
3
3
4
- .. warning ::
5
-
6
- TODO: This tutorial is a work in progress. It is not yet complete.
7
-
8
4
This is a type 2 change from `ioc_change_types `.
9
5
10
6
The changes that you can make in an IOC instance are limited to what
@@ -30,49 +26,36 @@ Some of the reasons for doing this are:
30
26
manage multiple small services is cleaner than having a handful of
31
27
monolithic services.
32
28
33
- This tutorial will make some changes to the generic IOC ``ioc-adsample ``.
34
- This Generic IOC is a simplified copy of ``ioc-adsimdetector `` tailored for
35
- use in these tutorials.
36
29
37
- For this exercise we will initially work locally inside the ``ioc-adsample ``
38
- developer container .
30
+ This tutorial will make some changes to the generic IOC ``ioc-adsimdetector ``
31
+ that you already used in earlier tutorials .
39
32
40
- At the end we will push the changes and see the CI build a new version of the
41
- generic IOC container image. This allows for the demonstration of:
42
-
43
- - Deploying an IOC instance using a new image published by the CI
44
- - Showing how to do a Pull Request back to the original repository.
33
+ For this exercise we will work locally inside the ``ioc-adsimdetector ``
34
+ developer container. To discover how to fork repositories and push changes
35
+ back to GitHub
45
36
46
37
For this exercise we will be using an example IOC Instance to test our changes.
47
38
Instead of working with a beamline repository, we will use the example ioc instance
48
- that comes with ``ioc-adsample ``. It is a good idea for Generic IOC authors to
39
+ inside ``ioc-adsimdetector ``. It is a good idea for Generic IOC authors to
49
40
include an example IOC Instance in their repository for testing changes in
50
41
isolation.
51
42
52
-
53
43
Preparation
54
44
-----------
55
45
56
- Because we want to push our changes we will first make a fork of the
57
- ``ioc-adsample `` repository. We will then clone our fork locally and
58
- make the changes there.
59
-
60
- To make a fork go to
61
- `ioc-adsample <https://github.com/epics-containers/ioc-adsample >`_
62
- and click the ``Fork `` button in the top right corner. This will create a fork
63
- of the repository under your own GitHub account.
64
-
65
- Now, clone the fork, build the container image locally and open the
66
- developer container:
46
+ First, clone the ``ioc-adsimdetector `` repository and make sure the container
47
+ build is working:
67
48
68
49
.. code-block :: console
69
50
70
- git clone [email protected] :<YOUR GITHUB ACCOUNT NAME> /ioc-adsample .git
71
- cd ioc-adsample
51
+ git clone [email protected] :epics-containers /ioc-adsimdetector .git
52
+ cd ioc-adsimdetector
72
53
./build
73
54
code .
74
- # click the green button in the bottom left corner of vscode and select
75
- # "Reopen in Container"
55
+ # Choose "Reopen in Container"
56
+
57
+ Note that if you do not see the prompt to reopen in container, you can open
58
+ the ``Remote `` menu with ``Ctrl+Alt+O `` and select ``Reopen in Container ``.
76
59
77
60
The ``build `` script does two things.
78
61
@@ -94,26 +77,39 @@ Verify the Example IOC Instance is working
94
77
When a new Generic IOC developer container is opened, there are two things
95
78
that need to be done before you can run an IOC instance inside of it.
96
79
97
- - Build the IOC source code
80
+ - Build the IOC binary
98
81
- Select an IOC instance definition to run
99
82
100
- The folder ``ioc `` inside of the ``ioc-adsample `` is where the IOC source code
101
- is created and built. When you open the developer container, this folder does
102
- not yet exist. The following command will create it and build the IOC:
83
+ The folder ``ioc `` inside of the ``ioc-adsimdetector `` is where the IOC source code
84
+ resided. However the devcontainer always makes a symlink to this folder at
85
+ ``/epics/ioc ``. This is so that it is always in the same place and can easily be
86
+ found by ibek and the developer. Therefore you can build the binary with the
87
+ following command:
103
88
104
89
.. code-block :: console
105
90
106
- ec ioc build
91
+ cd /epics/ioc
92
+ make
93
+
94
+ .. note ::
95
+
96
+ Note that we are required to build the IOC.
97
+ This is even though the container you are using already had the IOC
98
+ source code built by its Dockerfile (``ioc-adsimdetector/Dockerfile ``
99
+ contains the same command).
100
+
101
+ For a detailed explanation of why this is the case see
102
+ `ioc-source `
107
103
108
104
The IOC instance definition is a YAML file that tells ``ibek `` what the runtime
109
105
assets (ie. EPICS DB and startup script) should look like. Previous tutorials
110
106
selected the IOC instance definition from a beamline repository. In this case
111
- we will use the example IOC instance that comes with ``ioc-adsample ``. The
107
+ we will use the example IOC instance that comes with ``ioc-adsimdetector ``. The
112
108
following command will select the example IOC instance:
113
109
114
110
.. code-block :: console
115
111
116
- ibek dev instance /epics/ioc-adsample /ioc_examples/bl01t-ea-ioc-02
112
+ ibek dev instance /epics/ioc-adsimdetector /ioc_examples/bl01t-ea-ioc-02
117
113
118
114
In an earlier tutorial when learning about the dev container, we manually
119
115
performed this step, see `choose-ioc-instance `. The above command does
@@ -124,23 +120,7 @@ Now run the IOC:
124
120
125
121
.. code-block :: console
126
122
127
- ibek dev run
128
-
129
- You should see a iocShell prompt and no error messages above.
130
-
131
- .. note ::
132
-
133
- The ``ec ioc build `` command required to re-create the IOC source code.
134
- This is even though the container you are using already had the IOC
135
- source code built by its Dockerfile (``ioc-adsample/Dockerfile ``
136
- contains the same command).
137
-
138
- For a detailed explanation of why this is the case see
139
- `ioc-source `
140
-
123
+ cd /epics/ioc
124
+ ./start.sh
141
125
142
- TODO: complete by adding iocStats and using it in the ioc instance, then
143
- pushing and verifying CI runs and publishes a new image.
144
- TODO: now that cacheing is working, consider using ioc-adsimdetector instead
145
- of ioc-adsample. This is simpler - the change could be the addition of
146
- auto start of the sim detector IOC just like the presentation.
126
+ You should see an iocShell prompt and no error messages above.
0 commit comments