All Projects → rigetti → rpcq

rigetti / rpcq

Licence: Apache-2.0 License
The RPC framework and message specification for @rigetti Quantum Cloud Services.

Programming Languages

common lisp
692 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to rpcq

thinkgo
Public libraries and components for glang development.
Stars: ✭ 14 (-79.1%)
Mutual labels:  rpc
sdkgen
sdkgen is a tool to help design, implement and maintain good APIs with minimal effort
Stars: ✭ 61 (-8.96%)
Mutual labels:  rpc
spring-boot-protocol
springboot功能扩充-netty动态协议,可以支持各种网络协议的动态切换(单端口支持多个网络协议).支持mmap,sendfile零拷贝,http请求批量聚合
Stars: ✭ 68 (+1.49%)
Mutual labels:  rpc
simple-rpc-plus
使用netty和zookeeper技术实现的远程调用框架
Stars: ✭ 16 (-76.12%)
Mutual labels:  rpc
krotov
Python implementation of Krotov's method for quantum optimal control
Stars: ✭ 46 (-31.34%)
Mutual labels:  quantum-computing
dolphin
Automated code tool for Golang
Stars: ✭ 27 (-59.7%)
Mutual labels:  rpc
scala-json-rpc
Let your servers and clients communicate over function calls! JSON-RPC 2.0 library for Scala and Scala.js
Stars: ✭ 38 (-43.28%)
Mutual labels:  rpc
Study.Microservices
一步一步,由浅入深,学习如何使用.net core搭建微服务框架。
Stars: ✭ 18 (-73.13%)
Mutual labels:  rpc
lightning-rpc-explorer
Simple, self-hosted lightning network explorer.
Stars: ✭ 45 (-32.84%)
Mutual labels:  rpc
tsrpc
A TypeScript RPC framework, with runtime type checking and serialization, support both HTTP and WebSocket. It is very suitable for website / APP / games, and absolutely comfortable to full-stack TypeScript developers.
Stars: ✭ 866 (+1192.54%)
Mutual labels:  rpc
polix
🚀 Node.js Web Framework
Stars: ✭ 32 (-52.24%)
Mutual labels:  rpc
Python-notes
Python related technologies used in work: crawler, data analysis, timing tasks, RPC, page parsing, decorator, built-in functions, Python objects, multi-threading, multi-process, asynchronous, redis, mongodb, mysql, openstack, etc.
Stars: ✭ 104 (+55.22%)
Mutual labels:  rpc
electron-ipc-bus
An IPC bus for Electron.
Stars: ✭ 23 (-65.67%)
Mutual labels:  rpc
Pudding
Pudding 是一款迷你级分布式服务框架
Stars: ✭ 24 (-64.18%)
Mutual labels:  rpc
tidalRPC
Discord Rich Presence for Tidal
Stars: ✭ 15 (-77.61%)
Mutual labels:  rpc
dwave-cloud-client
A minimal implementation of the REST interface used to communicate with D-Wave Solver API (SAPI) servers.
Stars: ✭ 51 (-23.88%)
Mutual labels:  quantum-computing
bloomfilter
Bloomfilter written in Golang, includes rotation and RPC
Stars: ✭ 61 (-8.96%)
Mutual labels:  rpc
csgo richpresence
Discord Rich Presence support for Counter-Strike: Global Offensive!
Stars: ✭ 16 (-76.12%)
Mutual labels:  rpc
eos-client
PHP library of simple and extensible to use eos rpc and offline signature.
Stars: ✭ 43 (-35.82%)
Mutual labels:  rpc
qosf.org
Web portal of Quantum Open Source Foundation
Stars: ✭ 103 (+53.73%)
Mutual labels:  quantum-computing

rpcq

pypi version conda-forge version docker pulls

The asynchronous RPC client-server framework and message specification for Rigetti Quantum Cloud Services (QCS).

Implements an efficient transport protocol by using ZeroMQ (ZMQ) sockets and MessagePack (msgpack) serialization.

Not intended to be a full-featured replacement for other frameworks like gRPC or Apache Thrift.

Python Installation

To install directly from the source, run pip install -e . from within the top-level directory of the rpcq repository. To additionally install the requirements for testing, make sure to run pip install -r requirements.txt.

To instead install the latest released verson of rpcq from the Python package manager PyPi, run pip install rpcq.

NOTE: We strongly encourage users of rpcq to install the software within a (Python) virtual environment (read up on virtualenv, pyenv, or conda for more info).

Lisp Installation

Installation is easier with QuickLisp. After placing the source for RPCQ within your local Lisp projects directory (cf. ql:*local-project-directories*), run (ql:quickload :rpcq) and QuickLisp will download the necessary Lisp dependencies.

In addition to the Lisp dependencies, RPCQ depends on ZeroMQ. Be sure to install both the library and its development headers (which are necessary for the Lisp foreign-function interface to get its bearings).

Using the Client-Server Framework

The following two code samples (first in Python, then in Lisp) demonstrate how to create a server, add a test handler, and spin it up.

from rpcq import Server

server = Server()

@server.rpc_handler
def test():
    return 'test'

server.run('tcp://*:5555')
(defun test ()
  "test")

(let ((dt (rpcq:make-dispatch-table)))
  (rpcq:dispatch-table-add-handler dt 'test)
  (rpcq:start-server :dispatch-table dt
                     :listen-addresses '("tcp://*:5555")))

In another window, we can (again first in Python, then in Lisp) create a client that points to the same socket, and call the test method.

from rpcq import Client

client = Client('tcp://localhost:5555')

client.call('test')
(rpcq:with-rpc-client (client "tcp://localhost:5555")
  (rpcq:rpc-call client "test"))

In all cases (including interoperating a client/server pair written in different languages), this will return the string 'test'.

Using the Message Spec

The message spec as defined in src/messages.lisp (which in turn produces rpcq/messages.py) is meant to be used with the Rigetti QCS platform. Therefore, these messages are used in pyquil, in order to allow users to communicate with the Rigetti Quil compiler and quantum processing units (QPUs). PyQuil provides utilities for users to interact with the QCS API and write programs in Quil, the quantum instruction language developed at Rigetti.

Thus, most users will not interact with rpcq.messages directly. However, for those interested in building their own implementation of the QCS API utilities in pyQuil, becoming acquainted with the client-server framework, the available messages in the message spec, and how they are used in the pyquil.api module would be a good place to start!

Updating the Python Message Bindings

Currently only Python bindings are available for the message spec, but more language bindings are in the works. To update the Python message bindings after editing src/messages.lisp, open rlwrap sbcl and run:

(ql:quickload :rpcq)
(with-open-file (f "rpcq/messages.py" :direction :output :if-exists :supersede)
  (rpcq:python-message-spec f))

NOTE: Requires pre-installed sbcl, quicklisp, and (optionally) rlwrap.

We can also use the rpcq docker container to update the message spec without to install the requirements.

./docker_update_python_spec.sh

Running the Unit Tests

The rpcq repository is configured with GitLab CI to automatically run the unit tests. The tests run within a container based off of the rigetti/lisp Docker image, which is pinned to a specific tag. If you need a more recent version of the image, update the tag in the .gitlab-ci.yml.

The Python unit tests can be executed locally by running pytest from the top-level directory of the repository (assuming you have installed the test requirements).

The Lisp unit tests can be run locally by doing the following from within rlwrap sbcl:

(ql:quickload :rpcq)
(asdf:test-system :rpcq)

There may be some instances of STYLE-WARNING, but if the test run successfully, there should be something near the bottom of the output that looks like:

RPCQ-TESTS (Suite)
  TEST-DEFMESSAGE                                                         [ OK ]

Automated Packaging with Docker

The CI pipeline for rpcq produces a Docker image, available at rigetti/rpcq. To get the latest stable version of rpcq, run docker pull rigetti/rpcq. The image is built from the rigetti/lisp Docker image, which is pinned to a specific tag. If you need a more recent version of the image, update the tag in the Dockerfile.

To learn more about the rigetti/lisp Docker image, check out the docker-lisp repository.

Release Process

  1. Update VERSION.txt and dependency versions (if applicable) and push the commit to master.
  2. Push a git tag vX.Y.Z that contains the same version number as in VERSION.txt.
  3. Verify that the resulting build (triggered by pushing the tag) completes successfully.
  4. Push the tagged commit to pypi and verify it appears here.
  5. Publish a release using the tag as the name.
  6. Close the milestone associated with this release, and migrate incomplete issues to the next one.

Authors

Developed at Rigetti Computing by Nikolas Tezak, Steven Heidel, Eric Peterson, Colm Ryan, Peter Karalekas, Guen Prawiroatmodjo, Erik Davis, and Robert Smith.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].