目录
Alberto Vilches

Access policies using FunctionAccessResult and access manager (#2041)

  • adding FunctionAccessClient and constants

  • refactor tests

  • rename action to permission

  • feat: add accessible_functions + permission to with_permission and get_function_by_permission

  • fix: code quality issues in functions model manager

  • fix: add AbstractUser type annotation to get_function_by_permission user param

  • feat: add accessible_functions + permission to ProviderAccessPolicy.can_access

  • fix: move imports to top of test_providers.py

  • feat: add accessible_functions to JobAccessPolicies.can_access and can_read_provider_logs

  • fix: move FunctionAccessEntry and FunctionAccessResult to core/domain/authorization to satisfy import contracts

  • linter

  • refactor: ProviderAccessPolicy con métodos nombrados por operación

  • linter

  • refine provider access checks to function level when client responds

  • update phase 2 plan with function-level access design decision

  • remove planning doc from git tracking

  • reorder ProviderAccessPolicy params: provider, function_title, accessible_functions

  • update can_read_provider_logs docstring to match can_access style

  • rename PLATFORM_PERMISSION_VIEW to PLATFORM_PERMISSION_READ

  • improve PLATFORM_PERMISSION_* comments

  • per-function access in provider job list; add is_provider_admin fallback

  • Apply suggestions from code review

Co-authored-by: Alberto Vilches 194074+avilches@users.noreply.github.com

  • refactor provider job list use case; remove duplicate api/domain/authorization

  • fix trailing whitespace

  • clarify ProviderAccessPolicy docstrings: both auth paths

  • better comments

  • refactor methods

  • rename field

  • integration tests

  • reorganize test_functions into classes

  • silence pylint unused-argument on base client stub

  • integration tests

  • integration tests

  • normalize business_model to uppercase; fix pylint warnings in conftest

  • added logs

  • Added feature flag

  • Added feature flag k8s

  • use env var override in FunctionAccessClient to bypass stale DB config

  • Fix feature flag in tests

  • Enable flag in tests only

  • Enable flag in tests only k8s

  • comment

  • added url to k8s

  • rename permission_name to legacy_permission_name in FunctionsQuerySet

  • rename platform permission constants to function-namespaced values

  • Apply suggestion from @avilches

  • Apply suggestion from @avilches

  • rename PLATFORM_PERMISSION_JOB_RETRIEVE to PLATFORM_PERMISSION_JOB_READ

  • refactor

  • rollback integration tests

  • remove endpoint wiring from PR2, keep as infra-only

  • decouple FunctionsQuerySet from authorization layer

  • restore api/domain/authorization as tracked files

  • move filter_function_names logic to PR3 branch

  • refactor tests

  • refactor tests

  • refactor access policy tests with parametrize

2天前1389次提交

Stability License Code style: Black Python Qiskit

Qiskit Serverless

Qiskit Serverless is a user-friendly tool that enables you to easily run complex quantum computing tasks. With this software, you can execute Qiskit Functions as long running jobs and distribute them across multiple CPUs, GPUs, and QPUs. This means you can take on more complex quantum-classical programs and run them with ease. You don’t have to worry about configuration or scaling up computational resources, as Qiskit Serverless takes care of everything for you.

diagram

Table of Contents

  1. Quickstart
    1. Using Docker
    2. Using Kubernetes
  2. Modules
    1. Client
    2. Gateway
    3. Charts
  3. How to Give Feedback
  4. Contribution Guidelines
  5. Deprecation Policy
  6. References and Acknowledgements
  7. License

Quickstart

This Quickstart section guides users to easily deploy Qiskit Serverless infrastructure and run a simple example.

Docker

For user convenience, this section assumes that users will deploy the infrastructure in a local environment using Docker following the next steps.

  1. Prepare local Qiskit Serverless infrastructure

    1. Install Docker You can use any runtime that you prefer to run Docker on your machine: Docker Desktop, podman… If you are using a MacOS with ARM processors we highly recommend to use Colima as your container runtime to avoid problems with that architecture.

      This is a project that takes advantage of distributed computing, so it places a high demand on resources. We recommend increasing the assigned resources to these runtimes. In case of Colima for example we typically use:

      colima start --cpu 4 --memory 8 --disk 100
    2. Install qiskit-serverless on your local system (we recommend using a virtual environment).

      pip install qiskit-serverless
    3. Clone the Qiskit Serverless repository

      git clone https://github.com/Qiskit/qiskit-serverless.git
    4. Run Qiskit Serverless infrastructure Execute Docker Compose using the following commands.

      cd qiskit-serverless/
      sudo docker compose up

      The output should resemble the following.

      ~/qiskit-serverless$ sudo docker compose --profile jupyter up
      [+] Running 5/0
       ✔ Network public-qiskit-serverless_safe-tier     Created                                           0.0s
       ✔ Container ray-head                              Created                                           0.0s
       ✔ Container public-qiskit-serverless-postgres-1  Created                                           0.0s
       ✔ Container gateway                               Created                                           0.0s
       ✔ Container scheduler                             Created                                           0.0s
      Attaching to gateway, public-qiskit-serverless-postgres-1, ray-head, scheduler
  2. Write your first Qiskit Function following our hello-world example in the tutorial section.

    That’s all!

Kubernetes

For user convenience, this section assumes that users will deploy the infrastructure in a local environment using Kind following the next steps.

  1. Prepare local Qiskit Serverless infrastructure

    1. Install Docker You can use any runtime that you prefer to run Docker on your machine: Docker Desktop, podman… If you are using a MacOS with ARM processors we highly recommend to use Colima as your container runtime to avoid problems with that architecture.

      This is a project that takes advantage of distributed computing, so it places a high demand on resources. We recommend increasing the assigned resources to these runtimes. In case of Colima for example we typically use:

      colima start --cpu 4 --memory 8 --disk 100
    2. Install Kind To simplify the process to deploy a k8s cluster locally we use Kind as the main tool to create a cluster.

    3. Install qiskit-serverless on your local system (we recommend using a virtual environment).

      pip install qiskit-serverless
    4. Clone the Qiskit Serverless repository

      git clone https://github.com/Qiskit/qiskit-serverless.git
    5. Run Qiskit Serverless infrastructure Execute the script to setup the cluster

      tox -e cluster-deploy

      The creation process can take some minutes.

  2. Write your first Qiskit Function following our hello-world example in the tutorial section.

    That’s all!

For more detailed examples and explanations refer to the Guide:

  1. Getting Started
  2. Example Qiskit Functions
  3. Infrastructure
  4. Migrating from Qiskit Runtime programs

How to Give Feedback

We encourage your feedback! You can share your thoughts with us by:

  • Opening an issue in the repository

Contribution Guidelines

For information on how to contribute to this project, please take a look at our contribution guidelines.


Deprecation Policy

This project is meant to evolve rapidly and, as such, do not follow Qiskit’s deprecation policy. We may occasionally make breaking changes in order to improve the user experience. When possible, we will keep old interfaces and mark them as deprecated, as long as they can co-exist with the new ones. Each substantial improvement, breaking change, or deprecation will be documented in release notes.


References and Acknowledgements

[1] Qiskit
https://github.com/Qiskit/qiskit

[2] Client for IBM Qiskit Runtime
https://github.com/Qiskit/qiskit-ibm-runtime


License

Apache License 2.0

邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号