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

Closed
wants to merge 2 commits into from

Conversation

adisbladis
Copy link
Member

@adisbladis 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
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 grahamc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@grahamc
Copy link
Member

grahamc commented Mar 22, 2020

I just force-pushed a rebase on to master.

@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
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/tweag-nix-dev-update/6525/1

@adisbladis
Copy link
Member Author

#1264 which builds on this is a better and more comprehensive solution. Closing.

@adisbladis adisbladis closed this Apr 15, 2020
@grahamc grahamc added this to the 2.0 milestone Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants