Skip to content

Commit d00926d

Browse files
committed
further work on create_ioc
1 parent 599a6f1 commit d00926d

File tree

9 files changed

+173
-196
lines changed

9 files changed

+173
-196
lines changed

docs/explanations/introduction.md

Lines changed: 41 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,14 @@ forks of these repositories.
3939

4040
#### Generic IOCs and instances
4141

42-
An important principal of the approach presented here is that an IOC container
43-
image represents a 'Generic' IOC. The Generic IOC image is used for all
44-
IOC instances that connect to a given class of device. For example the
45-
Generic IOC image here:
46-
[ghcr.io/epics-containers/ioc-adaravis-linux-runtime:2023.10.2](https://github.com/epics-containers/ioc-adaravis/pkgs/container/ioc-adaravis-linux-runtime)
47-
uses the AreaDetector driver ADAravis to connect to GigE cameras.
42+
An important principal of the approach presented here is that an IOC container image represents a 'Generic' IOC. The Generic IOC image is used for all IOC instances that connect to a given class of device. For example the Generic IOC image here: [ghcr.io/epics-containers/ioc-adaravis-linux-runtime:2024.1.2](https://github.com/epics-containers/ioc-adaravis/pkgs/container/ioc-adaravis-linux-runtime) uses the AreaDetector driver ADAravis to connect to GigE cameras.
4843

4944
An IOC instance runs in a container runtime by loading two things:
5045

5146
- The Generic IOC image passed to the container runtime.
5247
- The IOC instance configuration. This is mapped into the container at
5348
runtime by mounting it into the filesystem. The mount point
54-
for this configuration is always /epics/ioc/config.
49+
for this configuration is always `/epics/ioc/config`.
5550

5651
The configuration will bootstrap the unique properties of that instance.
5752
The following contents for the configuration are supported:
@@ -63,8 +58,7 @@ The following contents for the configuration are supported:
6358
- start.sh a bash script to fully override the startup of the IOC. start.sh
6459
can refer to any additional files in the configuration directory.
6560

66-
This approach reduces the number of images required and saves disk. It also
67-
makes for simple configuration management.
61+
This approach reduces the number of images required and saves disk and memory. It also makes for simpler configuration management.
6862

6963
Throughout this documentation we will use the terms Generic IOC and
7064
IOC Instance. The word IOC without this context is ambiguous.
@@ -77,18 +71,16 @@ Kubernetes easily and efficiently manages containers across clusters of hosts.
7771
When deploying an IOC into a Kubernetes cluster, you request the resources
7872
required by the IOC and Kubernetes will then schedule the IOC onto a suitable host.
7973

80-
It builds upon 15 years of experience of running production workloads at
81-
Google, combined with best-of-breed ideas and practices from the community,
82-
since it was open-sourced in 2014.
74+
It builds upon years of experience of running production workloads at Google, combined with best-of-breed ideas and practices from the community, since it was open-sourced in 2014.
8375

8476
Today it is by far the dominant orchestration technology for containers.
8577

8678
In this project we use Kubernetes and helm to provide a standard way of
8779
implementing these features:
8880

89-
- Auto start IOCs when servers come up
81+
- Auto start IOCs the cluster comes up from power off
9082
- Manually Start and Stop IOCs
91-
- Monitor IOC status and versions
83+
- Monitor IOC health and versions
9284
- Deploy versioned IOCs to the beamline
9385
- Rollback to a previous IOC version
9486
- Allocate a server with adequate resources on which to run each IOC
@@ -133,11 +125,10 @@ of the chart within the cluster.
133125
It also supports registries for storing version history of charts,
134126
much like docker.
135127

136-
In this project we use Helm Charts to define and deploy IOC instances.
137-
Each beamline (or accelerator domain) has its own git repository that holds
138-
the domain Helm Chart for its IOC Instances. Each IOC instance need only
139-
provide a values.yaml file to override the default values in the domain
140-
Helm Chart and a config folder as described in {any}`generic-iocs`.
128+
In this project we use Helm Charts to define and deploy IOC instances. Each beamline or accelerator area has its own git {any}`ec-services-repo` that holds the Helm Charts for its IOC Instances. Each IOC instance need only provide:
129+
130+
- a values.yaml file to override the default values in the repository's global Helm Chart
131+
- a config folder as described in {any}`generic-iocs`.
141132

142133
**epics-containers** does not use helm repositories for storing IOC instances.
143134
Such repositories only hold a zipped version of the chart and a values.yaml file,
@@ -146,13 +137,9 @@ information. Instead we provide a command line tool for installing and updating
146137
IOCs. Which performs the following steps:
147138

148139
- Clone the beamline repository at a specific tag to a temporary folder
149-
- extract the beamline chart and apply the values.yaml to it
150-
- additionally generate a config map from the config folder files
151140
- install the resulting chart into the cluster
152141
- remove the temporary folder
153142

154-
This means that we don't store the chart itself but we do store all of the
155-
information required to re-generate it in a version tagged repository.
156143

157144
### Repositories
158145

@@ -172,47 +159,33 @@ There are many alternative services for storing these repositories, both
172159
in the cloud and on premises. Below we list the choices we have tested
173160
during the POC.
174161

175-
The 2 classes of repository are as follows:
162+
The classes of repository are as follows:
176163

177164
```{eval-rst}
165+
:Source Repository:
178166
179-
:An OCI image repository:
167+
Holds the source code but also provides the Continuous Integration actions for testing, building and publishing to the image / helm repositories. These have been tested:
180168
181-
- Holds the Generic IOC container images and their
182-
dependencies. Also used to hold the helm charts that define the shared
183-
elements between all domains.
169+
- github
170+
- gitlab (on premises)
184171
185-
The following have been tested:
172+
:Generic IOC Source Repositories:
186173
187-
- Github Container Registry
188-
- DockerHub
189-
- Google Cloud Container Registry
174+
Define how a Generic IOC image is built, this does not typically include source code, but instead is a set of instructions for building the Generic IOC image by compiling source from a number of upstream support module repositories. Boilerplate IOC source code is also included in the Generic IOC source repository and can be customized if needed.
190175
176+
:EC Services Source Repositories:
191177
192-
Continuous Integration
193-
~~~~~~~~~~~~~~~~~~~~~~
178+
Define the IOC instances for a beamline or accelerator area. This includes the IOC boot scripts and any other configuration required to make the IOC instance unique. For ibek based IOCs, each IOC instance is defined by an ibek yaml file only.
194179
195-
Our examples all use continuous integration to get from pushed source
196-
to the published images, IOC instances helm charts and documentation.
180+
:An OCI Image Repository:
197181
198-
This allows us to maintain a clean code base that is continually tested for
199-
integrity and also to maintain a direct relationship between source code version
200-
tags and the tags of their built resources.
182+
Holds the Generic IOC container images and their dependencies. Also used to hold he helm charts that define the shared elements between all domains.
201183
202-
There are these types of CI:
184+
The following have been tested:
203185
204-
:Generic IOC source:
205-
- builds a Generic IOC container image
206-
- runs some tests against that image - these will eventually include
207-
system tests that talk to simulated hardware
208-
- publishes the image to github packages (only if the commit is tagged)
209-
or other OCI registry
210-
211-
:beamline definition source:
212-
- prepares a helm chart from each IOC instance definition
213-
- tests that the helm chart is deployable (but does not deploy it)
214-
- locally launches each IOC instance and loads its configuration to
215-
verify that the configuration is valid (no system tests because this
186+
- Github Container Registry
187+
- DockerHub
188+
- Google Cloud Container Registry
216189
```
217190

218191
### Continuous Integration
@@ -228,7 +201,14 @@ There are these types of CI:
228201

229202
```{eval-rst}
230203
231-
:beamline definition source:
204+
:Generic IOC source:
205+
- builds a Generic IOC container image
206+
- runs some tests against that image - these will eventually include
207+
system tests that talk to simulated hardware
208+
- publishes the image to github packages (only if the commit is tagged)
209+
or other OCI registry
210+
211+
:`ec-services-repo` source:
232212
- prepares a helm chart from each IOC instance definition
233213
- tests that the helm chart is deployable (but does not deploy it)
234214
- locally launches each IOC instance and loads its configuration to
@@ -239,11 +219,11 @@ There are these types of CI:
239219
- builds the sphinx docs
240220
- publishes it to github.io pages with version tag or branch tag.
241221
242-
Scope
243-
-----
244-
This project initially targets x86_64 Linux Soft IOCs and RTEMS IOC running
245-
on MVME5500 hardware. Soft IOCs that require access to hardware on the
246-
server (e.g. USB or PCIe) will be supported by mounting the hardware into
222+
:global helm chart source:
223+
- ``ec-helm-chars`` repo only
224+
- packages a helm chart from source
225+
- publishes it to github packages (only if the commit is tagged)
226+
or other OCI registry
247227
```
248228

249229
## Scope
@@ -264,20 +244,19 @@ See <https://github.com/epics-containers/pvi>.
264244

265245
## Additional Tools
266246

267-
### epics-containers-cli
247+
### edge-containers-cli
268248

269249
This is the developer's 'outside of the container' helper tool. The command
270250
line entry point is **ec**.
271251

272252
The project is a python package featuring simple command
273-
line functions for deploying, monitoring building and debugging
274-
Generic IOCs and IOC instances. It is a wrapper
253+
line functions for deploying and monitoring IOC instances. It is a wrapper
275254
around the standard command line tools kubectl, podman/docker, helm, and git
276255
but saves typing and provides help and command line completion. It also
277256
can teach you how to use these tools by showing you the commands it is
278257
running.
279258

280-
See {any}`CLI` for details.
259+
See {any}`CLI` for moore details.
281260

282261
### **ibek**
283262

@@ -286,7 +265,6 @@ helper tool. It is a python package that is installed into the Generic IOC
286265
container images. It is used:
287266

288267
- at container build time: to fetch and build EPICS support modules
289-
- at container build time: to generate the IOC source code and compile it
290268
- at container run time: to extract all useful build artifacts into a
291269
runtime image
292270

docs/reference/glossary.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,22 @@
44
(ec-services-repo)=
55
## ec-services repository
66

7-
A repository that contains the definitions for a group of IOC and service instances that are deployed in a Kubernetes cluster. The grouping of instances is up to the facility. At DLS the instances are grouped by beamline, accelerator groupings are by location or by technical domain as appropriate.
7+
A repository that contains the definitions for a group of IOC and service instances that are deployed in a Kubernetes cluster. The grouping of instances is up to the facility. At DLS the instances are grouped by beamline for beamline IOCs. Accelerator IOC groupings are by location or by technical domain as appropriate.
88

99
(edge-containers-cli)=
1010
## edge-containers-cli
1111

12-
A command line tool for deploying and managing service and IOC instances within an [](ec-services-repo). So named 'edge' containers because these services all run close to the hardware. Historically this tool was called epics containers cli and both versions use the command line entry point ``ec``.
12+
A Python command line tool for the developer that runs *outside* of containers. It provides features for deploying and managing service and IOC instances within an [](ec-services-repo).
13+
14+
So named 'edge' containers because these services all run close to the hardware. Uses the command line entry point `ec`.
15+
16+
(ibek)=
17+
## ibek
18+
A Python command line tool that provides services *inside* of the Generic IOC container such as:
19+
20+
- building support modules at build time
21+
- configuring global assets such as the RELEASE file at build time
22+
- converting developer containers into light-weight runtime containers
23+
- Generating startup assets for an IOC Instance from a set of yaml files at runtime.
24+
25+
Uses the command line entry point `ibek`.

0 commit comments

Comments
 (0)