Code Monkey home page Code Monkey logo

Comments (6)

jyu00 avatar jyu00 commented on August 19, 2024

Do we really need to add RUNTIME to it? Or can we just do QISKIT_IBM_API_TOKEN for all qiskit-ibm-nnn repos, and maybe QISKIT_IBM_CLOUD_TOKEN for cloud services?

from qiskit-ibm-runtime.

rathishcholarajan avatar rathishcholarajan commented on August 19, 2024

@jyu00 Yes, we can do that if we want to share env variables between packages.

from qiskit-ibm-runtime.

rathishcholarajan avatar rathishcholarajan commented on August 19, 2024

I've updated description as per the suggestion. Thanks @jyu00!

from qiskit-ibm-runtime.

daka1510 avatar daka1510 commented on August 19, 2024

We discussed this briefly in Slack before but I want to bring this up again in the right context. With the proposed approach the number of environment variables we need to support in our code scales with the number of supported test environments (currently: 2, planned: 4, future: ?). I am not sure if this is needed.

Alternative Proposal

To make sure we can handle additional test environments transparently, I propose to move to a single set of environment variables, i.e.

  • not use QISKIT_IBM_CLOUD_API_..., QISKIT_IBM_CLOUD_STAGING_API_..., QISKIT_IBM_API_... , QISKIT_IBM_STAGING_API_...
  • instead use QISKIT_IBM_API_... and set it to different values depending on the targeted environment

Example Usage

CI/CD

image
image

Local Development

VSCode also supports different run configurations and can be set up in a similar way.
image

from qiskit-ibm-runtime.

rathishcholarajan avatar rathishcholarajan commented on August 19, 2024

@daka1510 The environment variables are not just required for CI. There is another use case for internal users.
As an internal user who has access to both staging and production environments, I should be able to store my staging and production credentials as environment variables and then switch to using one vs the other using QISKIT_IBM_CLOUD_USE_STAGING_CREDENTIALS for cloud and QISKIT_IBM_USE_STAGING_CREDENTIALS for legacy. If we use the same env variables then I'd have to setup two different conda environments locally, one for staging and one for production, which is not the end of the world, but needs educating internal users. Also I don't know if everyone uses conda. Once we have the ability to save multiple credentials in qiskit-ibm.json (See #31), people can use that to store staging credentials as well. But again not sure if everyone would want to use this method to save the credentials vs just setting env variables.

Also I don't see us having more than these 4 envs in the near future.

@jyu00 Do you see anything for or for having a single set of env variables?

from qiskit-ibm-runtime.

daka1510 avatar daka1510 commented on August 19, 2024

As per discussions in Slack and during our daily, I plan to give it a try with a reduced set of environment variables:

# Legacy / Cloud
QISKIT_IBM_API_LOCATOR=<http://auth.quantum-computing.ibm.com/api> or <CRN>
QISKIT_IBM_API_TOKEN=<Legacy API Token> or <Cloud API Key>
QISKIT_IBM_DEVICE=...

# Legacy Only (differentiation between HGP and PRIVATE_HGP no longer needed)
QISKIT_IBM_HGP=...

from qiskit-ibm-runtime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.