Common repository for data definitions inside IQM
Project description
iqm-data-definitions
A common place for data definitions shared inside IQM. This repository is meant to be independent of any projects other than necessary 3rd party libraries that are required for code auto-generation. Thus, this repo:
-
Contains files that define the data formats. As a concrete example, Protobuf message formats for the quantum computer control software stack are located here.
-
Contains CI logic to auto-generate and publish serialization and deserialization code as packages that other software projects can use.
-
Should not contain any hand-written logic that depends on other 3rd party or in-house projects. Note that this is subject to change if we decide to include wrapper code for common things in this repo. A separate package should then be built from that code with its own dependencies.
Versioning
Breaking changes to data definitions require a major version update.
Major versions are described in the directory paths inside protos/. For instance, version 1.x protocol buffers
definitions (.proto files) are located in protos/iqm/data_definitions/subpackage/v1/*.proto, where there can be
multiple subpackages for any version.
Backwards-compatible changes can be handled as minor version upgrades. As opposed to being written out in the path name,
minor versions are declared in the package version.
For instance, version 1.2 protocol buffers are still located in the same place as version 1.1 ones, but their
distributable packages have different versions. As an example for Python, the package with version 1.1 protocol buffer
auto-generated code is specified as iqm-data-definitions==1.1. That package contains version 1 generated code, where
there is a high-level namespace iqm that can contain multiple subpackages with import paths defined as
iqm.data_definitions.subpackage.v1.*_pb2.
Workflow
-
Develop .proto files.
-
Alternative ways to test your changes:
-
Test locally with Docker:
docker run -v path_to_this_repo_root:/home/iqm/idd -w /home/iqm/idd --rm <image_path> tox. Replace <image_path> with the official pipeline image:gitlab.iqm.fi:5005/iqm/qccsw/iqm-data-definitions:latest, or use other available tag (tags are created by master commit short-sha), or build it by yourself for your own platform:docker build -t idd:latest -f ci.Dockerfile .- The docker command will mount the current repo root to the image and run
toxthere. Note that tox will build its environments into.toxw.r.t. the Python environment and architecture inside the container. Thus, you may need to remove the folder if you desire to run tox outside the container.
With the local
docker run, running baretoxinvokes the jobtox -e git_fetchwhich will fail because there is no private ssh key setup to access gitlab in the container. Make sure you have fetched the latest master. - The docker command will mount the current repo root to the image and run
-
Test with a local Python environment. You need a Python environment with the package
toxinstalled, see required versions in thetox.inifile. Runtoxwithout arguments to: (steps can be run individually as well)-
lint protobuf definitions (
tox -e lint) -
fetch the current tip of master from remote (
tox -e git_fetch). Requires this repository to be cloned withgitin order to see previous proto definitions. -
check protobuf definitions backwards compatibility (
tox -e breaking) -
finally, generate wrapper source code files from the .proto files (
tox -e generate). Requiresprotocinstalled (https://developers.google.com/protocol-buffers/docs/reference/python-generated). Seeci.Dockerfilefor which version the pipeline is using.
Linting and checking compatibility requires
bufto be installed (https://docs.buf.build/installation). Seeci.Dockerfilefor which version the pipeline is using. -
-
Use only the pipeline. Commit and push your changes to the .proto files, and create a merge request. Download the artifact from the pipeline job
generate sources merge request. Extract the artifact onto the root of this directory, it should contain the generated sources.
-
-
Test the new auto-generated code with your desired ways. For Python, editable sources can be installed to an environment by
pip install -e path_to_the_root_of_this_repo. -
Repeat from 1. until you're comfortable with your changes and commit the .proto files (not the generated sources).
-
If a new version is needed, create and commit a CHANGELOG entry as well.
-
Create merge request.
-
After the merge request has been merged, a pipeline will kick in automatically to 1: create a new tag matching the new changelog entry, 2: auto-generate source code for all defined languages, 3: finally publish packages from the generates sources. Package version is equal to the tag name.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iqm_data_definitions-2.12.tar.gz.
File metadata
- Download URL: iqm_data_definitions-2.12.tar.gz
- Upload date:
- Size: 223.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe6902a8b8f563e6b41f703134bb63256f3c3d0b11a8e9e4400d8167d01e1211
|
|
| MD5 |
fe35643239e5686ec8360341ccb6a020
|
|
| BLAKE2b-256 |
88a3165f793b5d78d82f193a5c3059704b8f952e0dea2932b4bf37de1803a549
|
File details
Details for the file iqm_data_definitions-2.12-py3-none-any.whl.
File metadata
- Download URL: iqm_data_definitions-2.12-py3-none-any.whl
- Upload date:
- Size: 73.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f623cf9545a74072d61f2be20b0ad054d39eb3529fc4811eb6f62e3940c10246
|
|
| MD5 |
00ada0b48dcc4195a657d88b0da84548
|
|
| BLAKE2b-256 |
0552e8be49bd370b36f22ddb70b86e218643ed0f1259f232fac999c2165bffab
|