@@ -4,15 +4,31 @@ Essential Concepts
4
4
Overview
5
5
--------
6
6
7
- Kubernetes for EPICS IOCs provides the means to deploy and manage IOCs using
8
- modern industry standard approaches . The same approaches used by the large
9
- majority of micro-service and SOA applications.
7
+ Kubernetes for EPICS IOCs applies modern industry standards to the management
8
+ of IOCs . The same standards used by the majority of micro-service and
9
+ SOA applications today .
10
10
11
- This page briefly describes the required concepts and technologies.
11
+ There are 5 themes to this strategy:
12
12
13
+ :Containers:
14
+ Package IOC software and execute it in a lightweight virtual environment.
13
15
14
- Industry Standard Technologies
15
- ------------------------------
16
+ :Kubernetes:
17
+ Centrally orchestrate all IOCs at a facility.
18
+
19
+ :Helm Charts:
20
+ Deploy IOCs into Kubernetes with version management.
21
+
22
+ :Repositories:
23
+ Source, container and helm repositories manage all of the above assets. No shared file systems required.
24
+
25
+ :Continuous Integration / Deployment:
26
+ Source repositories automatically build assets from source when it is updated. And potentially deploy to Kubernetes.
27
+
28
+ See below for more detail on each of these.
29
+
30
+ Concepts
31
+ --------
16
32
17
33
Images and Containers
18
34
~~~~~~~~~~~~~~~~~~~~~
@@ -32,12 +48,31 @@ container runtime.
32
48
This article does a good job of explaining the relationship between docker /
33
49
containers and Kubernetes https://semaphoreci.com/blog/kubernetes-vs-docker
34
50
35
- Perhaps the best outcome of using containers is that you can alter the
51
+ An important outcome of using containers is that you can alter the
36
52
environment inside the container to suit the IOC code, instead of altering the
37
53
code to suit your infrastructure. At DLS, this means that we are able to use
38
54
vanilla EPICS base and support modules. We no longer require our own
39
55
forks of these repositories.
40
56
57
+ Generic IOCs and instances
58
+ """"""""""""""""""""""""""
59
+
60
+ An important principal of the approach presented here is that an IOC container
61
+ image represents a 'generic' IOC. The generic IOC image is used for all
62
+ IOC instances that connect to a given class of device.
63
+
64
+ An IOC instance runs in a container that bases its
65
+ filesystem on a generic IOC image.
66
+ In addition the instance has configuration mapped into the
67
+ container that will bootstrap the unique properties of that instance.
68
+ In most cases the configuration need only be a single IOC boot script.
69
+
70
+ This approach reduces the number of images required and saves disk. It also
71
+ makes for simple configuration management.
72
+
73
+ Throughout this documentation we will use the terms Generic IOC and
74
+ IOC Instance. The word IOC without this context is ambiguous.
75
+
41
76
42
77
Kubernetes
43
78
~~~~~~~~~~
@@ -86,75 +121,52 @@ In this project we use Helm Charts to define and deploy IOC instances. Each
86
121
beamline has its own Helm Repository which stores current and historical
87
122
version of its IOC instances.
88
123
89
-
90
- Concepts
91
- --------
92
-
93
- Generic IOCs and instances
94
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
95
-
96
- An important principal of the approach presented here is that an IOC container
97
- image represents a 'generic' IOC. The generic IOC image is used for all
98
- IOC instances that connect to a given class of device.
99
-
100
- An IOC instance runs in a container that bases its
101
- filesystem on a generic IOC image.
102
- In addition the instance has configuration mapped into the
103
- container that will bootstrap the unique properties of that instance.
104
- In most cases the configuration need only be a single IOC boot script.
105
-
106
- This approach reduces the number of images required and saves disk. It also
107
- makes for simple configuration management.
108
-
109
- Throughout this documentation we will use the terms Generic IOC and
110
- IOC Instance. The word IOC without this context is ambiguous.
111
-
112
124
Repositories
113
125
~~~~~~~~~~~~
114
126
115
- Another important principal is that all of the assets required to manage a
127
+ All of the assets required to manage a
116
128
set of IOCs for a beamline are held in repositories.
117
129
118
- These repositories all maintain their own history and version information.
119
-
120
- Thus all configuration management is done
130
+ Thus all version control is done
121
131
via these repositories and no special locations in
122
- the local filesystem are required
132
+ a shared filesystem are required
123
133
(The legacy approach at DLS relied heavily on
124
- know locations in the filesystem).
134
+ know locations in a shared filesystem).
125
135
126
- In the epics-containers examples all 3 repositories are held in the same
136
+ In the epics-containers examples all repositories are held in the same
127
137
github organization. This is nicely contained and means that only one set
128
138
of credentials is required to access all the resources.
129
139
130
140
There are many alternative services for storing these repositories, both
131
141
in the cloud and on premises. Below we list the choices we have tested
132
- during proof of concept .
142
+ during the POC .
133
143
134
- The 3 repositories are as follows:
144
+ The 3 classes of repository are as follows:
135
145
136
- - ** Source Repository ** This not only holds the source but also provides the
137
- Continuous Integration actions for testing, building and publishing to
138
- the following 2 repositories. These have been tested
139
- during proof of concept :
146
+ : Source Repository:
147
+ - Holds the source code but also provides the
148
+ Continuous Integration actions for testing, building and publishing to
149
+ the following 2 repositories. These have been tested :
140
150
141
- - github
142
- - gitlab (on prem)
151
+ - github
152
+ - gitlab (on prem)
143
153
144
- - **An image registry ** that holds the generic IOC container images and their
145
- dependencies. The following have been tested during proof of concept:
154
+ :An image repository:
155
+ - Holds the generic IOC container images and their
156
+ dependencies. The following have been tested:
146
157
147
- - github packages
148
- - dockerhub
149
- - Google Cloud Container Registry
158
+ - github packages
159
+ - dockerhub
160
+ - Google Cloud Container Registry
150
161
151
- - **A helm chart registry **. This is where the definitions of IOC instances
152
- are stored. They are in the form of a helm chart which describes to
153
- Kubernetes the resources needed to spin up the IOC.
154
- The following have been tested during proof of concept:
162
+ :A helm chart repository:
163
+ - This is where the definitions of IOC instances
164
+ are stored. They are in the form of a helm chart which describes to
165
+ Kubernetes the resources needed to spin up the IOC.
166
+ These have been tested:
155
167
156
- - github packages
157
- - Google Cloud Artifact Registry
168
+ - github packages
169
+ - Google Cloud Artifact Registry
158
170
159
171
Continuous Integration
160
172
~~~~~~~~~~~~~~~~~~~~~~
@@ -168,22 +180,22 @@ and the tags of their built resources.
168
180
169
181
There are these types of CI:
170
182
171
- :Generic IOC repositories :
183
+ :Generic IOC source :
172
184
- builds a generic IOC container image
173
185
- runs some tests against that image
174
186
- publishes the image to github packages (only if the commit is tagged)
175
187
176
- :beamline repositories :
188
+ :beamline definition source :
177
189
- builds a helm chart from each ioc definition
178
190
(TODO ibek will do this - at present the charts are hand coded)
179
191
- TODO: IOCs which are unchanged should not be published again
180
192
- publishes the charts to github packages (only if the commit is tagged)
181
193
182
- :helm library repositories :
194
+ :helm library source :
183
195
- builds the helm chart
184
196
- publishes it to github packages (only if the commit is tagged)
185
197
186
- :documentation repository :
198
+ :documentation source :
187
199
- builds the sphinx docs
188
200
- publishes it to github.io pages
189
201
0 commit comments