singnet / snet-sdk-python

Make gRPC calls to SingularityNET services programmatically using Python
MIT License
0 stars 1 forks source link

Optional protobuf compilation when it already exists #39

Closed Necr0x0Der closed 1 week ago

Necr0x0Der commented 1 month ago

It seems that the service information is requested each time from the platform, and protobuf compilation is done each time. Running the same script two times in a row produces the following messages each time:

~/.snet/naint/image-generation/python/Generation.proto removed.
client libraries for service with id "image-generation" in org with id "naint" generated at ~/.snet/naint/image-generation/python

This process requires several seconds. It should not be done each time. This can be achieved in different ways:

PAY2109 commented 1 week ago

Dear @Necr0x0Der, Thank you for reporting this issue. We appreciate your feedback and apologize for any inconvenience caused. After thorough investigation, we have resolved this issue in the v3.3.0 of our app. The config now supports optional force_update key. If set to False (default) it will not re-download the proto file and re-generate the gRPC stubs if they already present in the .snet directory. Please update to the most recent release, and if you encounter any further problems, feel free to reopen this issue or create a new one. Best regards, Paul, SingularityNET

Necr0x0Der commented 1 week ago

Thanks. It seems to work. The only question is what is the parameter for forcing proto files to be reloaded and recompiled? I'm not sure if this parameter should be True or False by default, but we may need control over it in any case

PAY2109 commented 1 week ago

@Necr0x0Der if force_update is set to True, the SDK will always reload and recompile the proto files

Necr0x0Der commented 1 week ago

Thanks! I see that it is in README, so I'm closing the issue.