Skip to main content

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.

Protocol 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

  1. Develop .proto files.

  2. Alternative ways to test your changes:

    1. 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 tox there. Note that tox will build its environments into .tox w.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 bare tox invokes the job tox -e git_fetch which will fail because there is no private ssh key setup to access gitlab in the container. Make sure you have fetched the latest master.

    2. Test with a local Python environment. You need a Python environment with the package tox installed, see required versions in the tox.ini file. Run tox without arguments to: (steps can be run individually as well)

      1. lint protobuf definitions (tox -e lint)

      2. fetch the current tip of master from remote (tox -e git_fetch). Requires this repository to be cloned with git in order to see previous proto definitions.

      3. check protobuf definitions backwards compatibility (tox -e breaking)

      4. finally, generate wrapper source code files from the .proto files (tox -e generate). Requires protoc installed (https://developers.google.com/protocol-buffers/docs/reference/python-generated). See ci.Dockerfile for which version the pipeline is using.

      Linting and checking compatibility requires buf to be installed (https://docs.buf.build/installation). See ci.Dockerfile for which version the pipeline is using.

    3. 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.

    4. Publish a pre-release package from your branch to the internal GitLab package registry. This is useful when you want to install and test the generated package in another project before your branch is merged.

      1. Push your branch, open its pipeline in GitLab, and click the play button on the publish to gitlab package registry job. The version published is printed in the job log.

      2. Go to the package registry <https://gitlab.iqm.fi/iqm/qccsw/iqm-data-definitions/-/packages>, find the published version, and download the .whl file under Assets.

      3. Install it directly:

        pip install iqm_data_definitions-<version>-py3-none-any.whl

  3. 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.

  4. Repeat from 1. until you're comfortable with your changes and commit the .proto files (not the generated sources).

  5. If a new version is needed, create and commit a CHANGELOG entry as well. Breaking changes in the protocol require a major version change of the Python package, though a new major version does not imply a breaking change in protobof.

  6. Create merge request.

  7. 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iqm_data_definitions-3.0.tar.gz (241.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iqm_data_definitions-3.0-py3-none-any.whl (84.7 kB view details)

Uploaded Python 3

File details

Details for the file iqm_data_definitions-3.0.tar.gz.

File metadata

  • Download URL: iqm_data_definitions-3.0.tar.gz
  • Upload date:
  • Size: 241.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for iqm_data_definitions-3.0.tar.gz
Algorithm Hash digest
SHA256 d283c5571509e7401c36b2ff1a1e754a2bfc03d564eb13047f751599d57ee16a
MD5 38ca21b502fcdb9c9fd59ae955eefcf6
BLAKE2b-256 ac53c562d2f787d83e5e3ab34d7b43d82b60f32be6372cb322f20a72e6ca8cd5

See more details on using hashes here.

File details

Details for the file iqm_data_definitions-3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for iqm_data_definitions-3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f6262a10e9185bd829b776ba08f5ea609ba473f07581e7e818fa7a2a1682deb
MD5 1c6281879a5a4fa470b4950979ac3934
BLAKE2b-256 30a4bd3b5ffc6e2c0744b7fc0e2c9f5f1e59768ee706908ebc0329a1bc28fd95

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.0 This release

2 files

2.29

2 files

2.28

2 files

2.27

2 files

2.26

2 files

2.25

2 files

2.24

2 files

2.23

2 files

2.22

2 files

2.21

2 files

2.20

2 files

2.19

2 files

2.18

2 files

2.17

2 files

2.15

2 files

2.14

2 files

2.13

2 files

2.12

2 files

2.11

2 files

2.10

2 files

2.9

2 files

2.8

2 files

2.7

2 files

2.6

2 files

2.5

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page