Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi region support #483

Merged
merged 29 commits into from Oct 18, 2021

Conversation

randomir
Copy link
Member

@randomir randomir commented Aug 28, 2021

@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2021

Codecov Report

Merging #483 (6019484) into master (d8b15e9) will increase coverage by 0.64%.
The diff coverage is 93.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #483      +/-   ##
==========================================
+ Coverage   85.51%   86.15%   +0.64%     
==========================================
  Files          24       24              
  Lines        3099     3244     +145     
==========================================
+ Hits         2650     2795     +145     
  Misses        449      449              
Impacted Files Coverage Δ
dwave/cloud/api/__init__.py 100.00% <ø> (ø)
dwave/cloud/api/exceptions.py 100.00% <ø> (ø)
dwave/cloud/api/client.py 91.60% <84.61%> (+2.01%) ⬆️
dwave/cloud/client/base.py 90.23% <88.70%> (-0.01%) ⬇️
dwave/cloud/api/resources.py 92.96% <93.54%> (+1.37%) ⬆️
dwave/cloud/api/constants.py 100.00% <100.00%> (ø)
dwave/cloud/api/models.py 97.67% <100.00%> (+0.11%) ⬆️
dwave/cloud/cli.py 60.91% <100.00%> (+0.24%) ⬆️
dwave/cloud/config.py 97.61% <100.00%> (+0.32%) ⬆️
dwave/cloud/exceptions.py 100.00% <100.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8b15e9...6019484. Read the comment docs.

@mdecandia
Copy link
Member

mdecandia commented Sep 29, 2021

It appears that specifying a region when instantiating the Client from config does not override the endpoint specified in dwave.conf. For example, if dwave.conf specifies 'https://eu-central-1... but the client is instantiated as Client.from_config(region="na-west-1"), the client will use the EU endpoint.


return data

def get_regions(self, refresh=False):
Copy link
Member Author

@randomir randomir Oct 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: make static after we refactor config (decouple from client construction).

Copy link

@silviacorbellaro silviacorbellaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DiskCache is approved from IP.

@randomir
Copy link
Member Author

@mdecandia, support for mutually exclusive config options (exclusive on different levels) should now be in.

So, for example, region in env will override endpoint in file. But endpoint in file will override region in file.

Copy link
Contributor

@JoelPasvolsky JoelPasvolsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few things that popped out at me while I was going through these updates.

dwave/cloud/api/client.py Outdated Show resolved Hide resolved
dwave/cloud/api/client.py Show resolved Hide resolved
dwave/cloud/api/resources.py Show resolved Hide resolved
dwave/cloud/client/base.py Show resolved Hide resolved
Copy link
Member

@mdecandia mdecandia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works well!

# Default SAPI endpoint
DEFAULT_API_ENDPOINT = 'https://cloud.dwavesys.com/sapi/'
# Default API endpoints
DEFAULT_SOLVER_API_ENDPOINT = 'https://cloud.dwavesys.com/sapi/'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be updated to https://na-west-1.cloud.dwavesys.com/sapi/v2?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both work. We can update the default once MR is GA.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will be deprecating the old one at some point - charles is arranging a meeting to discuss timing

@randomir randomir merged commit 4dee3ce into dwavesystems:master Oct 18, 2021
@randomir randomir deleted the add-multi-region-support branch October 18, 2021 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants