Releases: Qiskit/qiskit-serverless
v0.27.1
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-runtimepackage: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
Release Notes
New Features
-
A new utility
get_runtime_service()is now available to simplify the instantiation of
aQiskitRuntimeServicewithin 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, includingtoken,instance,channelandurl. 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()andjob.runtime_sessions().
These methods return lists of job/session IDs that can be used to fetch job objects from a
QiskitRuntimeServiceor access IQP dashboards.job.runtime_jobs()accepts an optional
runtime_sessionparameter 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 theis_activeparameter. -
Enhanced
job.cancel()behavior to use the newly introduced features.job.cancel()now attempts
to instantiate aQiskitRuntimeServiceusing the credentials from theServerlessClient,
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 usingget_runtime_service()
with no additional inputs.To support local testing or non-standard runtime URLs (e.g., staging environments), where the
ServerlessClientdon't match those in theQiskitRuntimeServiceused 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
ServerlessRuntimeServiceclass has been updated to support changes introduced in
qiskit_ibm_runtime>=0.42, unlocking compatibility of theqiskit-serverless>=0.27.0package with
qiskit_ibm_runtime>=0.42. For older versions ofqiskit-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
variableFUNCTIONS_LOGS_SIZE_LIMITwill be in charge of
the maximum size that the system will allow to store. -
Enhanced
client.jobs()andfunction.jobs()behavior with
new filters to improve the management of the different jobs. Now you
can filter bystatusand bycreated_afterto 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
- Modify docs publishing to support renos @ElePT (#1746)
- Add release notes infra @ElePT (#1744)
- Create changelog for filters @Tansito (#1742)
- Enable/Disable deployments @Tansito (#1739)
- Refactor gpu job configuration @Tansito (#1738)
- Update dynamic dependencies @Tansito (#1740)
- Remove public group env var @Tansito (#1741)
- Update the limits for logs storage @Tansito (#1735)
- fix: arguments not saved in db @paaragon (#1736)
- Add provider to the api filters for jobs @korgan00 (#1720)
- Improve the management for deactivated users @Tansito (#1734)
- Improve integration with QiskitIBMRuntime @ElePT (#1707)
- fix: swagger serializer name collision @paaragon (#1727)
- Remove Catalog end-points @Tansito (#1712)
- Fix pylint tests due to a new major version @Tansito (#1732)
- fix: set substatus retry @paaragon (#1728)
- Update integration tests to inspect result contents @ElePT (#1730)
- fix save_result @paaragon (#1729)
- Fix helm publish action @Tansito (#1718)
- Allow compatibility with runtime>=0.42.0 @ElePT (#1725)
- Filter by status correctly @korgan00 (#1721)
- Feat migrate all jobs endpoints @paaragon (#1708)
- Update base images @Tansito (#1722)
- Fix version of runtime to 0.41.x @Tansito (#1723)
v0.26.1
v0.26.0
Changes
- update-version-0.26.0 @github-actions (#1713)
- Update ubi-9 base image & setuptools @Tansito (#1710)
- Remove
ibm_quantumchannel to support runtime 0.41+ @ElePT (#1705) - Update docker images version @Tansito (#1706)
- Improve get jobs and get job logic with new search parameters @paaragon (#1695)
- Remove Storage class @Tansito (#1698)
- Migrate files endpoints @korgan00 (#1696)
- Update action versions in client-verify @Tansito (#1704)
- Feat/arguments migration to cos @paaragon (#1671)
v0.25.4
v0.25.3
v0.25.2
Changes
- update-version-0.25.2 @github-actions (#1689)
- fix name con route registry register @korgan00 (#1688)
- Add mthree external dependency @Tansito (#1687)
- Update runtime url value in the charts @Tansito (#1684)
- Improve error reporting after failed
run@ElePT (#1681) - Update default value of
QISKIT_IBM_URL@ElePT (#1683) - Dep version end point @korgan00 (#1669)
v0.25.1
v0.25.0
Changes
- update-version-0.25.0 @github-actions (#1677)
- Fix incompatibility with old authentication processes @Tansito (#1675)
- Use
AccountManagerinIBMServerlessClient@ElePT (#1672) - Configure node affinity for the gateway @Tansito (#1674)
- modify min public methods in lint @korgan00 (#1673)
- Improve probe configuration @Tansito (#1670)
- Enable instance initialization @Tansito (#1666)
- Allow running multiple jobs @korgan00 (#1664)
- Upgrade autoscaling to v2 @Tansito (#1667)
- fix pretty error bug @korgan00 (#1668)
- Prettify error message on jobs @korgan00 (#1662)
- Include qpy-compat option from Qsikit 2.1.0 @Tansito (#1663)
v0.24.0
Changes
- update-version-0.24.0 @github-actions (#1661)
- Improve cluster name support @Tansito (#1660)
- Improved support for Runtime 0.40.0 @Tansito (#1657)
- format error messages correctly @korgan00 (#1656)
- Update docker base images versions @Tansito (#1658)
- Feat/pre commit @paaragon (#1616)
- Improve Windows support for the client @paaragon (#1655)
- Update to Django 5 @Tansito (#1642)
- Update upload-artifact to 4.4.3 @Tansito (#1654)
- Update setup-python action to 5.3.0 @Tansito (#1653)