-
Notifications
You must be signed in to change notification settings - Fork 22
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 Api Configuration #1064
Add Api Configuration #1064
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as previously discussed, this is a good direction but please see my comments,
especially about separation of subnet-tag
and payment variables from the ApiConfig
... they don't have too much in common and should not be put in the same container...
most importantly neither the subnet, nor the payment parameters are required to instantiate any of the APIs
277a865
to
1f4833e
Compare
|
||
|
||
@dataclass | ||
class ApiConfig: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, sorry if this is OT, but.
Will the ApiConfig
work separate from all of the other yapapi
stuff? E.g. can I do in my (otherwise non-yapapi) code do from yapapi.config import ApiConfig
and use it?
If yes, that would be nice :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was not intended but yes.
IDK if you would want to add yapapi dependency just to use a dataclass 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, maybe for development purposes at least?
Also, that might not be the only imported thing:
(gc) jbetley:~/golem-core-python {jb/yacat-v2} $ grep -rIh 'from yapapi' golem_core/
from yapapi.payload import Payload as YapapiPayload, vm
from yapapi import rest
from yapapi.engine import DEFAULT_DRIVER, DEFAULT_NETWORK, DEFAULT_SUBNET
from yapapi.props.builder import DemandBuilder
from yapapi import props
from yapapi.storage import Destination, Source
from yapapi.storage.gftp import GftpProvider
from yapapi.engine import NoPaymentAccountError
from yapapi.log import _YagnaDatetimeFormatter
from yapapi.engine import DEFAULT_NETWORK, DEFAULT_DRIVER, DEFAULT_SUBNET
from yapapi.props.base import constraint
from yapapi.props import inf
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm :)
btw, please add budget
to GolemFactory
so that it doesn't need to be provided in each case...
api_config
pydocApiConfig