Skip to content

Commit

Permalink
Merge pull request #24 from epics-containers/object-id
Browse files Browse the repository at this point in the history
Changes to ObjectArg and added IdArg
  • Loading branch information
niamhdougan authored Mar 30, 2022
2 parents 0c021e0 + 2c8a23b commit 5a8d40b
Show file tree
Hide file tree
Showing 25 changed files with 308 additions and 202 deletions.
10 changes: 1 addition & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,5 @@
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"yaml.schemas": {
"tests/samples/schemas/ibek.schema.json": [
"*.ibek.yaml"
],
"tests/samples/schemas/pmac.schema.json": [
"*.pmac.yaml"
]
},
}
}
110 changes: 88 additions & 22 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
("py:class", "'float'"),
("py:class", "'int'"),
("py:class", "'bool'"),
("py:class", "'object'"),
("py:class", "'id'"),
("py:class", "apischema.utils.UndefinedType"),
("py:class", "typing_extensions.Literal"),
]
Expand Down
42 changes: 21 additions & 21 deletions docs/explanations/entities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Definition
----------

Each support module has its own **support module definition file** . This
is a YAML file whose name is by convention ``<support_module>.ibek.yaml``
is a YAML file whose name is by convention ``<support_module>.ibek.defs.yaml``

These will all reside in a folder called /ibek in the container
image.
Expand All @@ -49,7 +49,7 @@ The **support module definition file** contains **Definitions** which
determine what **Entities** an IOC instance may instantiate.

For example the pmac support module declares the following **Definitions**
in ``pmac.ibek.yaml``
in ``pmac.ibek.defs.yaml``
(currently this is limited to 3 - the full implementation would have more):

- Geobrick
Expand All @@ -76,9 +76,9 @@ Expand below for the example pmac **support module definition file**:
.. raw:: html

<details>
<summary><a>pmac.ibek.yaml</a></summary>
<summary><a>pmac.ibek.defs.yaml</a></summary>

.. include:: ../../tests/samples/yaml/pmac.ibek.yaml
.. include:: ../../tests/samples/yaml/pmac.ibek.defs.yaml
:literal:

.. raw:: html
Expand Down Expand Up @@ -147,9 +147,9 @@ Click the arrows to reveal the files.
.. raw:: html

<details>
<summary><a>bl45p-mo-ioc-02.pmac.yaml</a></summary>
<summary><a>bl45p-mo-ioc-02.ibek.entities.yaml</a></summary>

.. include:: ../../tests/samples/yaml/bl45p-mo-ioc-02.pmac.yaml
.. include:: ../../tests/samples/yaml/bl45p-mo-ioc-02.ibek.entities.yaml
:literal:

.. raw:: html
Expand Down Expand Up @@ -189,16 +189,16 @@ Thus, the sequence of files is as follows:
- Name
- Description
* - 1
- ibek.schema.json
- ibek.defs.schema.json
- Global Schema for **2**
* - 2
- <support>.ibek.yaml
- <support>.ibek.defs.yaml
- Definition file for a support module. Generates part of **3**
* - 3
- <container>.schema.json
- <container>.entities.schema.json
- Schema for **4**. Generated by combining all of **2** from a container
* - 4
- <ioc>.<container>.yaml
- <ioc>.ibek.entities.yaml
- Description of Entities for an IOC instance.
* - 5
- Helm Chart files
Expand All @@ -214,7 +214,7 @@ The Global Schema and example IOC instance schema are below:
<details>
<summary><a>ibek.schema.json</a></summary>

.. include:: ../../tests/samples/schemas/ibek.schema.json
.. include:: ../../tests/samples/schemas/ibek.defs.schema.json
:literal:

.. raw:: html
Expand All @@ -223,7 +223,7 @@ The Global Schema and example IOC instance schema are below:
<details>
<summary><a>ibek.pmac.json</a></summary>

.. include:: ../../tests/samples/schemas/pmac.schema.json
.. include:: ../../tests/samples/schemas/pmac.ibek.entities.schema.json
:literal:

.. raw:: html
Expand All @@ -244,28 +244,28 @@ The ibek commands to progress through the file sequence above are as follows
- Name
- Command
* - 1
- ``ibek.schema.json``
- ``ibek.defs.schema.json``
- ``ibek ibek-schema``
* - 2
- ``<support>.ibek.yaml``
- ``<support>.ibek.defs.yaml``
- Hand crafted by the container developer. Held in the container.
* - 3
- ``<container>.schema.json``
- ``<container>.ibek.entities.schema.json``
- ``ibek ioc-schema ...`` run at container build time. ``...``
== all ``<support>.ibek.yaml`` within the container.
== all ``<support>.ibek.defs.yaml`` within the container.
* - 4
- ``<ioc>.<container>.yaml``
- ``<ioc>.ibek.entities.yaml``
- Hand crafted at IOC instance design time
* - 5
- Helm Chart files
- ``ibek build-helm <ioc>.<container>.yaml``
- ``ibek build-helm <ioc>.ibek.entities.yaml``
run at IOC helm chart generation time. This generates a helm chart
with ``<ioc>.<container>.yaml`` in its config folder and validates it
with ``<ioc>.ibek.entities.yaml`` in its config folder and validates it
against the schema defined at the top of the YAML file.
* - 6
- IOC startup script
- ``ibek build-startup <ioc>.<container>.yaml ...``. Run at IOC startup time in the
container. ``...`` == all ``<support>.ibek.yaml`` within the container.
- ``ibek build-startup <ioc>.ibek.entities.yaml ...``. Run at IOC startup time in the
container. ``...`` == all ``<support>.ibek.defs.yaml`` within the container.



4 changes: 2 additions & 2 deletions src/ibek/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def main(
def ibek_schema(
output: Path = typer.Argument(..., help="The filename to write the schema to")
):
"""Produce the JSON global schema for all <support_module>.ibek.yaml files"""
"""Produce the JSON global schema for all <support_module>.ibek.defs.yaml files"""
schema = json.dumps(make_schema(Support), indent=2)
output.write_text(schema)

Expand All @@ -58,7 +58,7 @@ def ioc_schema(
no_schema: bool = typer.Option(False, help="disable schema checking"),
):
"""
Create a json schema from a <support_module>.ibek.yaml file
Create a json schema from a <support_module>.ibek.defs.yaml file
"""

# first check the definition file with jsonschema since it has more
Expand Down
Loading

0 comments on commit 5a8d40b

Please sign in to comment.