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

WIP: Add deploy without creating a state file #1248

Open
wants to merge 2 commits into
base: master
from

Conversation

@adisbladis
Copy link
Member

adisbladis commented Mar 11, 2020

Create an in-memory SQLite db if --no-state is passed to deploy.
This is probably the easiest way possible for us to add support for deployments without using a state file.

If --no-state is passed a create is implicitly done in the same process.

While this works perfectly fine with the none backend it's marked WIP because it needs docs.

Based on top of #1240 since they touch a lot of the same code & meant to be used together with #1247.

@cleverca22

This comment has been minimized.

Copy link
Contributor

cleverca22 commented Mar 11, 2020

main thing i can see being lost with this change, is that the stateVersion is normally queried on the first deploy and held in the state file, to deploy compatible nixos's in the future

but the user must now manage stateVersion themselves, in the deployment files

nixops rollbacks also require the uuid of the deployment to remain constant, so it can find the generations

Copy link
Member

grahamc left a comment

Overall, I like this a lot.

I think --no-state should not be an option. Instead, I think it should be a property of the network.nix itself. For example, a user who creates a network which spawns a bunch of wildly expensive boxes, but passes --no-state... and then NixOps fires-and-forgets a big bill for them.

In cases like this, I think the NixOps should refuse to do things like create resources when state is disabled. Thus, always be applied (or not applied), thus part of the network definition.

@adisbladis adisbladis force-pushed the adisbladis:smash-the-state branch 2 times, most recently from c26ccde to 02001ca Mar 12, 2020
@grahamc grahamc force-pushed the adisbladis:smash-the-state branch from 02001ca to 1398e9b Mar 22, 2020
@grahamc

This comment has been minimized.

Copy link
Member

grahamc commented Mar 22, 2020

I just force-pushed a rebase on to master.

@grahamc grahamc force-pushed the adisbladis:smash-the-state branch from 1398e9b to 9f19b30 Mar 22, 2020
@adisbladis adisbladis changed the title WIP: Add deploy without creating a state file Add deploy without creating a state file Mar 23, 2020
@adisbladis adisbladis changed the title Add deploy without creating a state file WIP: Add deploy without creating a state file Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.