-
Notifications
You must be signed in to change notification settings - Fork 516
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
Anoncreds - provide an "upgrade()" endpoint to upgrade a wallet from askar to askar-anoncreds #2808
Comments
Would it be appropriate to simply not respond, basically an indication the agent is not available? Correct me if I'm wrong, but wouldn't any other response require access to the wallet, which we are trying to avoid?
My vote is the upgrade process is triggered when the tenant explicitly updates the wallet type in their per-tenant configuration from |
Some comments:
I think it would be clearer to say an “Admin API endpoint” vs. Function, to differentiate between the ACA-Py “upgrade()” function we have today. In the meeting yesterday, the term “set wallet type” was used, and I think that is a good one.
To reiterate what @WadeBarnes already said, but in different (probably worse) words… 😄 : I think it would be sufficient (but @WadeBarnes would know better) would be to guide Controller DevOps folks to run the “set wallet type” only after dialing down old controller version instances to 0, and then starting a new controller version instances that all call the “set wallet type” endpoint such that only one gets to perform the process, and all wait until it is complete before proceeding (semaphore). That eliminates any other activity during the upgrade. People that call the endpoint in other ways, e.g., by running a new instance before all the old instances terminate, get what they get.
I think with the approach we are saying, the single instance / multi-tenant instances are the same — they are endpoints executed by the Controller. I don’t think the upgrade can happen automatically — the Contoller has to invoke it — but the “best practice” (only practice) is that the Controller SHOULD do it on starting the controller, during initialization, and before any processing. There are other initialization things needed — such as setting “per tenant settings” Upgrading the “base wallet” should be conceptually the same, but is a little more interesting since (AFAIK) there is no “base Controller” to invoke an endpoint. As such, I think that should be done by ACA-Py and on start up — with the guidance to be done the same way — bring down ACA-Py old version, bring up ACA-Py new version with new setting, and run any required upgrade process during initialization. |
The difference is that for a tenant, the settings are update by an API call, whereas for a single instance everything is set by aca-py startup params. So if we want to do a wallet upgrade by explicit API call only, then for the single aca-py instance scenario the |
I suggested in the other ticket that the tenant shouldn't be allowed to explicitly set their wallet type ( |
The logic/function to do the upgrade is still the same for tenants and the ACA-Py instance overall. When a single instance ACA-Py starts up, it could run a function to check its current “wallet-type” and carry out the same logic as a tenant explicitly setting — “is the setting wallet-type the same as we are running”, “if not, is the change allowed”, “if so, semaphore (upgrade)”. This is the same logic we are doing with a “version” update, but triggering it on the wallet-type. Presumably, this could be used for the base wallet in a multi-tenant. The thing we don’t (generally) want is for the ACA-Py settings to impact the wallet type of the tenant wallets, since that would require a coordinated upgrade of all tenants at the same time, which we agree is impossible to manage.
Not sure I’m understanding that comment. We have to allow the tenants to execute their upgrades (in this case to |
I've updated the main description per the comments, @swcurran @WadeBarnes @jamshale |
Add an Admin API endpoint to aca-py to upgrade a wallet from askar to askar-anoncreds. This needs to support a single wallet, which will be the aca-py wallet for a single-instance scenario; or the "base" wallet for a multi-tenant scenario; or the individual tenant wallet which is in scope when in multi-tenancy mode.
The specific wallet records to be updated are identified in issues #2384, #2385, #2386, #2389.
When upgrading a wallet:
The upgrade process itself will just iterate through the impacted record types (identified in the above tickets), read each record, convert to "anoncreds" format, and then write back to the database.
If the upgrade is aborted in process, then it can just be restarted and it should pick up where it left off (i.e. update the "old" format records and ignore anything already converted to "anoncreds" format.) If the upgrade endpoint is called after the upgrade has already been completed, it should return a success code (no error).
For multi-tenancy tenants, the upgrade should be invoked with a Admin API endpoint, when the wallet-type is changed from askar to askar-anoncreds.
For a single-instance aca-py, and for the multi-tenancy "base" wallet, the upgrade endpoint should be called to upgrade the database. To change the overall
--wallet-type
parameter, the deployer will need to:--wallet-type
configuration to specifyaskar-anoncreds
The text was updated successfully, but these errors were encountered: