Skip to content

Commit 71e5725

Browse files
committed
first pass of create generic IOC
1 parent 0b67051 commit 71e5725

File tree

3 files changed

+28
-35
lines changed

3 files changed

+28
-35
lines changed

docs/tutorials/generic_ioc.md

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,22 @@ your personal GitHub user space.
5555
(create_generic_ioc)=
5656
## Steps
5757

58-
1. Go to your GitHub account home page. Click on 'Repositories' and then 'New', give your new repository the name `ioc-lakeshore340` plus a description, then click 'Create repository'.
58+
1. Create a new repository in your GitHub account using this link <https://github.com/new>. Give your new repository the name `ioc-lakeshore340` plus a description, then click 'Create repository'.
5959

6060
1. From a command line with your virtual environment activated. Use copier to start to make a new repository like this:
6161

6262
```bash
63-
pip install copier
63+
source $HOME/ec-venv/bin/activate
6464
# this will create the folder ioc-lakeshore340 in the current directory
6565
copier copy gh:epics-containers/ioc-template --trust ioc-lakeshore340
6666
```
6767
1. Answer the copier template questions as follows:
68-
6968
<pre><font color="#5F87AF">🎤</font><b> A name for this project. By convention the name will start with ioc- and</b>
7069
<b>have a lower case suffix of the primary support module. e.g.</b>
7170
<b>ioc-adsimdetector</b>
7271
<b> </b><font color="#FFAF00"><b>ioc-lakeshore340</b></font>
7372
<font color="#5F87AF">🎤</font><b> A One line description of the module</b>
74-
<b> </b><font color="#FFAF00"><b>ttttt</b></font>
73+
<b> </b><font color="#FFAF00"><b>The Generic IOC for the lakeshore 340 temperature controller</b></font>
7574
<font color="#5F87AF">🎤</font><b> Git platform hosting the repository.</b>
7675
<b> </b><font color="#FFAF00"><b>github.com</b></font>
7776
<font color="#5F87AF">🎤</font><b> The GitHub organisation that will contain this repo.</b>
@@ -85,21 +84,21 @@ your personal GitHub user space.
8584

8685
1. Make the first commit and push the repository to GitHub.
8786

88-
```bash
89-
cd ioc-lakeshore340
90-
git add .
91-
git commit -m "initial commit"
92-
git push -u origin main
93-
```
87+
```bash
88+
cd ioc-lakeshore340
89+
git add .
90+
git commit -m "initial commit"
91+
git push -u origin main
92+
```
9493

9594
1. Get the Generic IOC container built, open the project in vscode and launch the devcontainer.
9695

97-
```bash
98-
./build
99-
# DLS users make sure you have done: module load vscode
100-
code .
101-
# reopen in container (ctrl-shift-p reopen in container)
102-
```
96+
```bash
97+
cd ioc-lakeshore340
98+
# DLS users make sure you have done: module load vscode
99+
code .
100+
# reopen in container (ctrl-shift-p reopen in container)
101+
```
103102

104103
As soon as you pushed the project, GitHub Actions CI will start building the project. This will make a container image of the template project, but not publish it because there is no release tag as yet. You can watch this by clicking on the `Actions` tab in your new repository.
105104

@@ -114,6 +113,8 @@ to make your own Generic IOC.
114113
2. **README.md** - change to describe your Generic IOC
115114
3. **ibek-support** - add new support module recipes into this submodule
116115

116+
The rest of the files created by the template are essentially boilerplate and can be left alone for most Generic IOCs. However there are many places where changes could be made for advanced use cases. An example of this is the ioc-adaravis Generic IOC, this has a custom version of the start.sh entrypoint script. It connects to the GigE cameras described in the IOC instance and gets information regarding the set of configuration parameters each camera supports - this is then used to generate custom database and OPI files.
117+
117118
To work on this project we will use local a developer container. All changes and testing will be performed inside this developer container.
118119

119120
Once the developer container is running it is always instructive to have the `/epics` folder added to your workspace:
@@ -151,38 +152,30 @@ first install those inside our devcontainer as follows:
151152
```bash
152153
# open a new terminal in VSCode (Terminal -> New Terminal)
153154
cd /workspaces/ioc-lakeshore340/ibek-support
154-
asyn/install.sh R4-42
155-
StreamDevice/install.sh 2.8.24
155+
asyn/install.sh R4-44-2
156+
StreamDevice/install.sh 2.8.26
156157
```
157158

158-
This pulls the two support modules from GitHub and builds them in our devcontainer. Now any IOC instances we run in the devcontainer will be able to use these support modules.
159+
This uses ibek-support 'recipes' to pull the two support modules from GitHub and builds them in our devcontainer. Now any IOC instances we run in the devcontainer will be able to use these support modules.
159160

160161
Next, make sure that the next build of our `ioc-lakeshore340` container image will have the same support built in by updating the Dockerfile as follows:
161162

162163
```dockerfile
163164
COPY ibek-support/asyn/ asyn/
164-
RUN asyn/install.sh R4-42
165+
RUN asyn/install.sh R4-44-2
165166
166167
COPY ibek-support/StreamDevice/ StreamDevice/
167-
RUN StreamDevice/install.sh 2.8.24
168+
RUN StreamDevice/install.sh 2.8.26
168169
```
169170

170-
The above commands added `StreamDevice` and its dependency `asyn`.
171-
For each support module
172-
we copy it's `ibek-support` folder and then run the `install.sh` script. The
173-
only argument to `install.sh` is the git tag for the version of the support
174-
module required. `ibek-support` is a submodule used by all the Generic IOC
175-
projects that contains recipes for building support modules, it will be covered
176-
in more detail as we learn to add our own recipe for the lakeshore340 below.
171+
The above commands added `StreamDevice` and its dependency `asyn`. For each support module we copy it's `ibek-support` folder and then run the `install.sh` script. The only argument to `install.sh` is the git tag for the version of the support module required. `ibek-support` is a submodule used by all the Generic IOC projects that contains recipes for building support modules, it will be covered in more detail as we learn to add our own recipe for the lakeshore340 below.
177172
178-
You may think that there is a lot of duplication here e.g. `asyn` appears 3 times. However, this is explicitly done to make the build cache more efficient and speed up development. For example we could copy everything out of the ibek-support directory
179-
in a single command but then if I changed a StreamDevice ibek-support file the build would have to re-fetch and re-make all the support modules. By only copying the files we are about to use in the next step we can massively increase the build cache hit rate.
173+
You may think that there is a lot of duplication here e.g. `asyn` appears 3 times. However, this is explicitly done to make the build cache more efficient and speed up development. For example we could copy everything out of the ibek-support directory in a single command but then if I changed a StreamDevice ibek-support file the build would have to re-fetch and re-make all the support modules. By only copying the files we are about to use in the next step we can massively increase the build cache hit rate.
180174
181175
:::{note}
182-
These changes to the Dockerfile mean that if we were to exit the devcontainer, and then run `./build` again, it would would add the `asyn` and
183-
`StreamDevice` support modules to the container image. Re-launching the devcontainer would then have the new support modules available right away.
176+
These changes to the Dockerfile mean that if we were to rebuild our developer container, it would would add the `asyn` and `StreamDevice` support modules to the container image.
184177
185-
This is a common pattern for working in these devcontainers. You can try out installing anything you need. Then once happy with it, add the commands to the Dockerfile, so that these changes become permanent.
178+
This is a common pattern for working in these devcontainers. You can try out installing anything you need. Then once happy with it, add the commands you just used into the Dockerfile, so that these changes become permanent for future builds of the container image.
186179
:::
187180
188181
## Prepare The ibek-support Submodule

docs/tutorials/rtems_ioc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# RTEMS - Deploying an Example IOC
22

33
:::{Warning}
4-
This tutorial is out of date and will be updated by June 2024.
4+
This tutorial is out of date and will be updated by Sept 2024.
55
:::
66

77
The previous tutorials walked through how to create a Generic linux soft

docs/tutorials/rtems_setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# RTEMS - Creating a File Server
22

33
:::{Warning}
4-
This tutorial is out of date and will be updated in June 2024.
4+
This tutorial is out of date and will be updated in Sept 2024.
55
:::
66

77
## Introduction

0 commit comments

Comments
 (0)