Skip to content

Commit d82b07a

Browse files
committed
Dev guide: CI config
1 parent 2a6f40c commit d82b07a

File tree

3 files changed

+88
-1
lines changed

3 files changed

+88
-1
lines changed

docs/source/benchmarking.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _`benchmarking IMASPY`:
2+
13
Benchmarking IMASPy
24
===================
35

docs/source/ci_config.rst

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,87 @@
33
CI configuration
44
================
55

6-
.. TODO:: TODO
6+
IMASPy uses `ITER Bamboo <https://ci.iter.org/>`_ for CI. This page provides an overview
7+
of the CI Plan and deployment projects.
8+
9+
CI Plan
10+
-------
11+
12+
The `IMASPy CI plan <https://ci.iter.org/browse/IC-PYM>`_ consists of 4 types of jobs:
13+
14+
Linting and DD ZIP
15+
This job is responsible for three things:
16+
17+
1. Verify that the ``IDSDef2MDSplusPreTree.xsl`` file matches the one in the Access
18+
Layer repository. This file is required for building MDSplus models and the
19+
models built by IMASPy should match those built by the Access Layer.
20+
2. Linting: run ``black`` and ``flake8`` on the IMASPy code base. See :ref:`code
21+
style and linting`.
22+
3. Build the Data Dictionary zip file. This Task builds the Data Dictionary for all
23+
tagged releases since DD version ``3.22.0``. These are combined into the
24+
``IDSDef.zip`` file, which is distributed with IMASPy.
25+
26+
The ZIP file is built in a separate job, such that the subsequent test jobs can
27+
reuse this.
28+
29+
The CI scripts executed in this job are:
30+
31+
- ``ci/linting.sh``
32+
- ``ci/build_dd_zip.sh``
33+
34+
Test with AL<version>
35+
This runs all unit tests with pytest. There are multiple (at the time of writing 2)
36+
Access Layer versions that we test against: AL4.11.7 (from SDCC module
37+
``IMAS/3.39.0-4.11.7-intel-2020b``) and AL5.0.0 (from SDCC module
38+
``IMAS/3.39.0-5.0.0-intel-2020b``).
39+
40+
The CI script executed in this job is ``ci/run_pytest.sh``, which expects the
41+
modules it needs to load as arguments.
42+
43+
Cloning this job to test against a new AL version is easy:
44+
45+
1. On the "Default plan configuration" page of Bamboo, click "+ Add job" and select
46+
the option to "Clone an existing job".
47+
2. Select one of the existing Test jobs.
48+
3. Indicate the new AL version in the job name.
49+
4. Click Create job
50+
5. In the "Script" Task, update the module(s) in the Argument field
51+
52+
Benchmark
53+
This job runs the :ref:`ASV benchmarks <benchmarking IMASPY>` on the CI server. It
54+
is configured such that it can only run on a single CI agent
55+
(`io-ls-bamboowk6.iter.org`). There are two reasons for this:
56+
57+
1. Simplify the data I/O of the script - we can avoid file locks because there will
58+
only be a single Benchmark Job running globally. This is the main reason.
59+
2. Benchmarks should be more reproduceable when always run on the same machine.
60+
Although the agents are virtualized, so the performance will always depend to
61+
some extent to the load on the CI cluster.
62+
63+
The CI script executed in this job is: ``ci/run_benchmark.sh``.
64+
65+
Build docs and dists
66+
This job builds the Sphinx documentation and python packages for IMASPy (``sdist``
67+
and ``wheel``).
68+
69+
The CI script executed in this job is: ``ci/build_docs_and_dist.sh``.
70+
71+
72+
Deployment projects
73+
-------------------
74+
75+
There are two Bamboo deployment projects for IMASPy:
76+
77+
`Deploy IMASPy-doc <https://ci.iter.org/deploy/viewDeploymentProjectEnvironments.action?id=1784709122>`_
78+
Deploy the documentation created in the `Build docs and dists` job to `Sharepoint
79+
<https://sharepoint.iter.org/departments/POP/CM/IMDesign/Code%20Documentation/IMASPy-doc/intro.html>`_.
80+
81+
This deployment project runs for after each successful CI build of the IMASPy main
82+
branch.
83+
84+
`IMASPy-PyPi <https://ci.iter.org/deploy/viewDeploymentProjectEnvironments.action?id=1792933890>`_
85+
Deploy the python packages created in the `Build docs and dists` job to the
86+
https://pypi.iter.org/ server.
87+
88+
This deployment project runs for after each successful CI build of the IMASPy main
89+
branch.

docs/source/code_style.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _`code style and linting`:
2+
13
Code style and linting
24
======================
35

0 commit comments

Comments
 (0)