Appearance
CI/CD Integration with Kipu Quantum Hub
You can integrate the platform with your CI/CD pipelines to continuously deploy and update your services running on the platform using the CLI to setup a deploy stage. In the following, the general strategy is described how to leverage the CLI along with the required prerequisites. You can use this strategy as a blueprint to develop your own CI/CD integrations, nevertheless, we provide also directly usable templates for several CI/CD systems as listed by the table below.
General Strategy
Prerequisites
- Setup a git repository and clone it to your machine, note that the following steps assume that you are in the folder of the git repository on your local machine
- Install the CLI
- Create an Access Token
General Setup to automate the Deployment of your code to Kipu Quantum Hub Services
To automate the deployment of your code to a service on the platform, you have to setup your codebase and wire it with the targeted service. This can easily be done by using the CLI to initially create a service from your codebase, which automatically saves the serviceId of the created service in the planqk.json of your codebase. The following steps show how you can scaffold an initial service implementation and create a service on the platform, which is then wired with the service implementation.
- Authorize the CLI with your Access Token via
planqk login -t <your-token> - Setup a project using
planqk initof the CLI - Choose the context the service shall be deployed to on the platform via
planqk set-context <context-id>(you can list your available contexts viaplanqk list-contexts) - Create the service on the platform via
planqk up - Commit this state to your git repository (
git add . && git commit -m "initial commit") and push it to your remote (git push)
You will recognize that the service is created on the platform and that the ID of the created service is set as serviceId in the planqk.json in your codebase. This way, your codebase is wired with a specific service on the platform and whenever you execute planqk up again, the service will be updated with the state of your codebase. You can make use of this mechanism in your CI/CD pipeline to create a deploy job that can be triggered on events like new releases or even pushes to your codebase. Thereby, assure that your install the CLI in your deploy job, provide it with the respective Access Token and context-id. Then, the deploy job can deploy an updated version of your service via planqk up.

