Skip to content

Releases: Qiskit/qiskit-serverless

v0.27.1

06 Nov 16:15
060eec0

Choose a tag to compare

Release Notes

Upgrade Notes

  • The scheduling logic that was managing non GPU and GPU jobs was improved. Now the scheduler manages both type of jobs independently so you can adjust separately where each of these jobs are run.

  • Qiskit Serverless now supports the latest version of the qiskit-ibm-runtime package: qiskit-ibm-runtime==0.43.

Bug Fixes

  • Fixed a bug in the scheduler that was preventing it from stopping jobs automatically after the timeout threshold specified with the environment variable PROGRAM_TIMEOUT.

v0.27.0

28 Oct 17:44
79ef935

Choose a tag to compare

Release Notes

New Features

  • A new utility get_runtime_service() is now available to simplify the instantiation of
    a QiskitRuntimeService within a function. It automatically pulls credentials from environment
    variables, reducing boilerplate code and improving usability for function developers.

    Example usage:

    from qiskit_serverless import get_runtime_service
    service = get_runtime_service()
    backend = service.backend("ibm_fez")
    

    This is equivalent to:

    import os
    from qiskit_serverless import get_arguments, save_result
    from qiskit_ibm_runtime import QiskitRuntimeService
    service = QiskitRuntimeService(
      channel=os.environ["QISKIT_IBM_CHANNEL"],
      instance=os.environ["QISKIT_IBM_INSTANCE"],
      token=os.environ["QISKIT_IBM_TOKEN"],
    )
    backend = service.backend("ibm_fez")
    

    This function also enables automatic tracking of runtime job and session IDs created during function
    execution. It's important to note that tracking will only be possible if the function runtime jobs
    are submitted through a service instantiated with this function.

    On top of the default credentials, function developers can customize the call to get_runtime_service()
    with custom input parameters, including token, instance, channel and url. For example:

       from qiskit_serverless import get_runtime_service
       service = get_runtime_service(channel="ibm_quantum_platform", 
                                     token="staging_token", 
                                     instance="staging_crn", 
                                     url="staging_url")
       backend = service.backend("staging_backend")
    
  • When using get_runtime_service() inside a serverless function, the resulting job object now
    supports two new methods: job.runtime_jobs() and job.runtime_sessions().
    These methods return lists of job/session IDs that can be used to fetch job objects from a
    QiskitRuntimeService or access IQP dashboards. job.runtime_jobs() accepts an optional
    runtime_session parameter that allows to filter the returned jobs by associated session id.
    For example:

    job = function.run(...)
  
    runtime_ids = job.runtime_jobs()
    # out = ["job_id_1", "job_id_2", "job_id_3"...]
    runtime_sessions =  job.runtime_sessions()
    # out = ["session_id_1", "session_id_2"]
  
    # a specific session id can be passed to the runtime_jobs() method to filter by session:
  
    session_id = job.runtime_sessions()[0]
    # out = "session_id_1"
    session_job_ids =  job.runtime_jobs(session_id)
    # in this example, only job ids 1 and 3 correspond to session_id_1:
    # out = ["job_id_1", "job_id_3"]

Upgrade Notes

  • Added a new AccessPolicy for User model to be able to allow or
    not the access to the service by the is_active parameter.

  • Enhanced job.cancel() behavior to use the newly introduced features. job.cancel() now attempts
    to instantiate a QiskitRuntimeService using the credentials from the ServerlessClient,
    allowing automatic canceling of associated runtime jobs. This works when the credentials used in
    the function match those in the client, which happens by default when using get_runtime_service()
    with no additional inputs.

    To support local testing or non-standard runtime URLs (e.g., staging environments), where the
    ServerlessClient don't match those in the QiskitRuntimeService used to submit the jobs,
    job.cancel() accepts a service parameter:

        service = QiskitRuntimeService(
          channel="ibm_quantum_platform",
          token="MY_TOKEN",
          instance="MY_CRN",
          url="my.staging.url.com"
        )
        job.cancel(service)
  • The ServerlessRuntimeService class has been updated to support changes introduced in
    qiskit_ibm_runtime>=0.42, unlocking compatibility of the qiskit-serverless>=0.27.0 package with
    qiskit_ibm_runtime>=0.42. For older versions of qiskit-serverless, qiskit_ibm_runtime<0.42
    will still be required.

  • The Scheduler will start to manage the size of the logs
    generated by the Qiskit Functions. The environment
    variable FUNCTIONS_LOGS_SIZE_LIMIT will be in charge of
    the maximum size that the system will allow to store.

  • Enhanced client.jobs() and function.jobs() behavior with
    new filters to improve the management of the different jobs. Now you
    can filter by status and by created_after to retrieve those
    specific jobs. For example:

    # Filtering by status it will retrieve all the jobs with that status
    client.jobs(status="SUCCEEDED")
    
    # The same it will apply after a specific date
    time_filter = datetime.now(timezone.utc)
    client.jobs(created_after=time_filter)
    
    # And all these new filters can be combined with the Qiskit Function filter
    # to be able to return running jobs from the specific Qiskit Function
    function.jobs(status="RUNNING")
    

Changelog

v0.26.1

19 Sep 15:12
741ae00

Choose a tag to compare

Changes

v0.26.0

17 Sep 14:14
4d25c90

Choose a tag to compare

Changes

v0.25.4

06 Aug 18:38
cea1d65

Choose a tag to compare

Changes

v0.25.3

31 Jul 14:16
ceab772

Choose a tag to compare

Changes

v0.25.2

23 Jul 12:24
4ca867c

Choose a tag to compare

Changes

v0.25.1

14 Jul 16:27
5d035fa

Choose a tag to compare

Changes

  • update-version-0.25.1 @github-actions (#1680)
  • Update external dependencies @Tansito (#1679)

v0.25.0

07 Jul 12:41
160c864

Choose a tag to compare

Changes

v0.24.0

17 Jun 19:14
347db12

Choose a tag to compare

Changes