You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/generic_ioc.md
+26-33Lines changed: 26 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,23 +55,22 @@ your personal GitHub user space.
55
55
(create_generic_ioc)=
56
56
## Steps
57
57
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'.
59
59
60
60
1. From a command line with your virtual environment activated. Use copier to start to make a new repository like this:
61
61
62
62
```bash
63
-
pip install copier
63
+
source$HOME/ec-venv/bin/activate
64
64
# this will create the folder ioc-lakeshore340 in the current directory
<font color="#5F87AF">🎤</font><b> The GitHub organisation that will contain this repo.</b>
@@ -85,21 +84,21 @@ your personal GitHub user space.
85
84
86
85
1. Make the first commit and push the repository to GitHub.
87
86
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
+
```
94
93
95
94
1. Get the Generic IOC container built, open the project in vscode and launch the devcontainer.
96
95
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
+
```
103
102
104
103
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.
105
104
@@ -114,6 +113,8 @@ to make your own Generic IOC.
114
113
2. **README.md** - change to describe your Generic IOC
115
114
3. **ibek-support** - add new support module recipes into this submodule
116
115
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
+
117
118
To work on this project we will use local a developer container. All changes and testing will be performed inside this developer container.
118
119
119
120
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:
151
152
```bash
152
153
# open a new terminal in VSCode (Terminal -> New Terminal)
153
154
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
156
157
```
157
158
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.
159
160
160
161
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:
161
162
162
163
```dockerfile
163
164
COPY ibek-support/asyn/ asyn/
164
-
RUN asyn/install.sh R4-42
165
+
RUN asyn/install.sh R4-44-2
165
166
166
167
COPY ibek-support/StreamDevice/ StreamDevice/
167
-
RUN StreamDevice/install.sh 2.8.24
168
+
RUN StreamDevice/install.sh 2.8.26
168
169
```
169
170
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.
177
172
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.
180
174
181
175
:::{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.
184
177
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.
0 commit comments