-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
96 changed files
with
4,775 additions
and
1,952 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 2835a1986dbe3e42d92c6c5d24989128 | ||
config: cc63392b6049ba5e288592f41f70f349 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _ioc-source: | ||
|
||
Dev Container vs Runtime Container | ||
================================== | ||
|
||
TODO: explain how and why ioc-xxxx is mounted in dev container and what happens | ||
to the ioc folder. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,127 @@ | ||
Changing the Generic IOC | ||
======================== | ||
Changing a Generic IOC Part 1 | ||
============================= | ||
|
||
.. warning :: | ||
This tutorial is a work in progress. It is not yet complete. | ||
This tutorial will make a simple change to the Generic IOC ``ioc-adsimdetector``. | ||
We will also update the IOC instance ``bl01t-ea-ioc-02`` use the new feature of | ||
the Generic IOC. | ||
This is a type 2 change from `ioc_change_types`. | ||
|
||
We are going to add an additional support module to the Generic IOC and then | ||
use it to add a new record to the IOC instance to use this new support. | ||
The changes that you can make in an IOC instance are limited to what | ||
the author of the associated Generic IOC has made configurable. | ||
Therefore you will | ||
occasionally need to update the Generic IOC that your instance is using. | ||
Some of the reasons for doing this are: | ||
|
||
- Update one or more support modules to new versions | ||
- Add additional support such as autosave or iocStats | ||
- For ibek generated IOC instances, you may need to add or change functionality | ||
in the support YAML file. | ||
|
||
This tutorial will make some changes to the generic IOC ``ioc-adsample``. | ||
This Generic IOC is a simplified copy of ``ioc-adsimdetector`` tailored for | ||
use in these tutorials. | ||
|
||
For this exercise we will initially work locally inside the ``ioc-adsample`` | ||
developer container. | ||
|
||
At the end we will push the changes and see the CI build a new version of the | ||
generic IOC container image. This allows for the demonstration of: | ||
|
||
- Deploying an IOC instance using a new image published by the CI | ||
- Showing how to do a Pull Request back to the original repository. | ||
|
||
For this exercise we will be using an example IOC Instance to test our changes. | ||
Instead of working with a beamline repository, we will use the example ioc instance | ||
that comes with ``ioc-adsample``. It is a good idea for Generic IOC authors to | ||
include an example IOC Instance in their repository for testing changes in | ||
isolation. | ||
|
||
|
||
Preparation | ||
----------- | ||
|
||
Because we want to push our changes we will first make a fork of the | ||
``ioc-adsample`` repository. We will then clone our fork locally and | ||
make the changes there. | ||
|
||
To make a fork go to | ||
`ioc-adsample <https://github.com/epics-containers/ioc-adsample>`_ | ||
and click the ``Fork`` button in the top right corner. This will create a fork | ||
of the repository under your own GitHub account. | ||
|
||
Now, clone the fork, build the container image locally and open the | ||
developer container: | ||
|
||
.. code-block:: console | ||
git clone [email protected]:<YOUR GITHUB ACCOUNT NAME>/ioc-adsample.git | ||
cd ioc-adsample | ||
./build | ||
code . | ||
# click the green button in the bottom left corner of vscode and select | ||
# "Reopen in Container" | ||
The ``build`` script does two things. | ||
|
||
- it fetches the git submodule called ``ibek-support``. This submodule is shared | ||
between all the EPICS IOC container images and contains the support YAML files | ||
that tell ``ibek`` how to build support modules inside the container | ||
environment. | ||
- it builds the Generic IOC container image locally. | ||
|
||
.. note:: | ||
|
||
The ``build`` script is a convenience script that is provided in the | ||
Generic IOC Template project. It is exactly equivalent to cloning | ||
with ``--recursive`` flag and then running ``ec dev build``. | ||
|
||
Verify the Example IOC Instance is working | ||
------------------------------------------ | ||
|
||
When a new Generic IOC developer container is opened, there are two things | ||
that need to be done before you can run an IOC instance inside of it. | ||
|
||
- Build the IOC source code | ||
- Select an IOC instance definition to run | ||
|
||
The folder ``ioc`` inside of the ``ioc-adsample`` is where the IOC source code | ||
is created and built. When you open the developer container, this folder does | ||
not yet exist. The following command will create it and build the IOC: | ||
|
||
.. code-block:: console | ||
ec ioc build | ||
The IOC instance definition is a YAML file that tells ``ibek`` what the runtime | ||
assets (ie. EPICS DB and startup script) should look like. Previous tutorials | ||
selected the IOC instance definition from a beamline repository. In this case | ||
we will use the example IOC instance that comes with ``ioc-adsample``. The | ||
following command will select the example IOC instance: | ||
|
||
.. code-block:: console | ||
ibek dev instance /epics/ioc-adsample/ioc_examples/bl01t-ea-ioc-02 | ||
In an earlier tutorial when learning about the dev container, we manually | ||
performed this step, see `choose-ioc-instance`. The above command does | ||
exactly the same thing: removes the existing config folder in ``/epics/ioc`` | ||
and symlinks in the chosen IOC instance definition's ``config`` folder. | ||
|
||
Now run the IOC: | ||
|
||
.. code-block:: console | ||
ibek dev run | ||
You should see a iocShell prompt and no error messages above. | ||
|
||
.. note:: | ||
|
||
For this exercise all changes will be local so you will not need to make a | ||
fork of ``ioc-adsimdetector``. The next tutorial will show how to a new | ||
Generic IOC and we will look at the Generic IOC CI at that time. | ||
The ``ec ioc build`` command required to re-create the IOC source code. | ||
This is even though the container you are using already had the IOC | ||
source code built by its Dockerfile (``ioc-adsample/Dockerfile`` | ||
contains the same command). | ||
|
||
TODO: WIP. | ||
For a detailed explanation of why this is the case see | ||
`ioc-source` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
Making a new Support Module | ||
=========================== | ||
Changing a Generic IOC Part 2 | ||
============================= | ||
|
||
This tutorial will create a new Generic IOC for a new support module. We will | ||
then create a new IOC Instance that uses this new support module. | ||
This is a type 3 change from `ioc_change_types`. | ||
This is a type 2 change from `ioc_change_types`. | ||
|
||
This tutorial will change the support yaml used by a generic IOC. | ||
|
||
This exercise will create a new Stream Device support module that implements | ||
a very simple ASCII protocol. So simple that we will be able to test it | ||
by typing into a telnet session. | ||
|
||
TODO: WIP. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Making a new Support Module | ||
=========================== | ||
|
||
This tutorial will create a new Generic IOC for a new support module. We will | ||
then create a new IOC Instance that uses this new support module. | ||
This is a type 3 change from `ioc_change_types`. | ||
|
||
This exercise will create a new Stream Device support module that implements | ||
a very simple ASCII protocol. So simple that we will be able to test it | ||
by typing into a telnet session. | ||
|
||
TODO: WIP. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.