-
-
Notifications
You must be signed in to change notification settings - Fork 363
Key/Value backend #865
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
Key/Value backend #865
Conversation
Needed to faclitate multiple backends (like sqlite3/other remote database)
… it in state file implementation to __db
For now it's just the underlying DB, but it resembles something that can roll back the current transaction.
I reduced the scope of this back to just the sqlite and json work. I will make another fork to add in mysql/postgresql support. What is here works. I also added a unit test for testing the json backend, but couldnt figure out how to run just it i tried
but it kept giving me libvirt errors. I didn't have interest in running all the tests on my laptop. is there a way to kick off the bot on it @grahamc I am done with this iteration unless others have requests I think it is good to go. |
@rbvermaas I also ran into those libvirt issues. I remember that you said that those have not worker properly at all? @mogorman could you check if those tests do, or do not work on the master branch? |
@moretea if im not mistaken ive fixed all the tests but i was hoping someone with gce, aws, etc could run them all |
As far as I can remember, I tried the local virtualbox backend, and GCE. Both worked. I could check out AWS & GCE later, but am on a holiday this weekend and don't have time 🙈 |
Hi @mogorman , VPC tests seem to be broken e.g:
|
I like using nixops-manager and ran into this issue. Seems like it has to do with escaping in JSON. [nix-shell:~/cloud]$ ./manage gce create '<cloud.nix>'
created deployment ‘56c8f9ee-14ef-11e8-aad6-00163e000000’
56c8f9ee-14ef-11e8-aad6-00163e000000
[nix-shell:~/cloud]$ ./manage gce deploy
error: getting status of ‘/home/dev/cloud/\<cloud.nix\>’: No such file or directory
error: evaluation of the deployment specification failed
[nix-shell:~/cloud]$ cat gce.json
{
"schemaVersion": 0,
"deployments": {
"56c8f9ee-14ef-11e8-aad6-00163e000000": {
"attributes": {
"nixExprs": "[\"/home/dev/cloud/\\\\<cloud.nix\\\\>\"]",
"name": "gce"
},
"resources": {}
}
}
} using a normal (non bracketed path) seems to work well for gce [nix-shell:~/cloud]$ ./manage gce create './cloud.nix'
created deployment ‘d3fcdf3d-14ef-11e8-900d-00163e000000’
d3fcdf3d-14ef-11e8-900d-00163e000000
[nix-shell:~/cloud]$ ./manage gce deploy
bootstrap> creating GCE image 'n-d3fcdf3d14ef11e8900d00163e000000-bootstrap'...
...
[nix-shell:~/cloud]$ ./manage gce destroy
warning: are you sure you want to destroy GCE machine 'n-d3fcdf3d14ef11e8900d00163e000000-single'? (y/N) y
single...> destroying the GCE machine...
... |
Thanks I'll look at these now |
@AmineChikhaoui I believe i fixed these unit test failures with my last round of commits, they fail for me stil as I don't have aws keys but they do correctly update the attrs and get past the failure point you posted. @tomberek Your issue is coming from nix-shell over escaping things. probably because you were in the dev-shell and then executed another deeper nix-shell. can you try installing this fork of nixops and running without the nested shells? this error does not happen to me when i used <> directly
|
@mogorman Thanks, so the previous errors are gone but I still see some errors during the deployment tear down in the unit tests, can't post them now because it exposes some resources IDs and AWS debug output but I'll re-run it later this week and look at the errors. |
@AmineChikhaoui did you ever get a chance to get me more info as to what is broken? or can anyone help me understand how to run the test framework better? the only errors i get when running tests are those caused by lack of aws gce etc credentials so i assume the other tests passed? |
Could someone explain the rationale for this change? what is the point? |
the point of providing a plugable state backend is to make it easier for people to work with nixops. In the case of the json one, it makes it much easier to commit these things to git and share them among a team, in the future I want to make a mysql/postgresql backend as well so that I can manage the state there. Others have requested a backend using s3 and simpledb. this work makes it easier to do all these things. |
Having a json file is the starting point to prove that we can use any K/V store. Once that's done, adding e.g. mysql, or S3 + DynamoDB should just work fine. |
👍 to these changes. These would help us share the workload of managing our deployments in the team. |
What's the state currently? Do you only need testers for the 3 remaining backends? |
@nh2 talking to me? And which backends are you referring to? |
To whomever would like this PR in, really. I was referring to
in the issue description. |
What is needed for this? Do you need user reports and testing? |
See #1264 |
Hello! Thank you for this PR. In the past several months, some major changes have taken place in
This is all accumulating in to what I hope will be a NixOps 2.0 My hope is that by adding types and more thorough automated testing, However, because of the major changes, it has become likely that this If you would like to see this merge, please bring it up to date with Thank you again for the work you've done here, I am sorry to be Graham |
This is just the same as #624 I will make the other hundred refrence changes needed but i just wanted to get this started.
There are quite some ideas in the issue tracker about how we could improve nixops radically.
I would like to start out with a feasible iterative plan. As far as I can see, only very trivial SQL operations are every executed against the sqlite3 database; the main use case is to use transactions to support rollback in the case of exceptions. This should not be to hard to implement ourselves in memory, in combination with a key/value server that supports locking certain keys.