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

Fully modular #107

Closed
wants to merge 17 commits into from
Closed

Fully modular #107

wants to merge 17 commits into from

Conversation

shlevy
Copy link
Member

@shlevy shlevy commented Jun 7, 2013

This branch is an attempt at solving #78. It (shouldn't) change any functionality at all yet, so it can go into master, though we can merge it into next as well. If/when we decide this is OK to merge I'll do the actual merge to avoid conflicts.

Note that currently there's no way to actually pass network-level modules to nixops yet. Adding that functionality will be trivial now that this is in place, but there are some interface/backwards-compatibility decisions to be made there that are orthogonal to using network-level modules internally.

This depends on NixOS/nixpkgs#598 or something equivalent.

shlevy added 17 commits May 31, 2013 15:38
Signed-off-by: Shea Levy <shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
…option

Signed-off-by: Shea Levy <shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
…happy

Signed-off-by: Shea Levy <shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
…ribute for imports not to be treated as an option

Signed-off-by: Shea Levy <shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
imports at the top level depending on config cause infinite recursion

Signed-off-by: Shea Levy <shea@shealevy.com>
The attributes that are still exported (nodes, info.machines,
info.network, info.resources, info.machines) are the same as before,
but they are built up from a two-stage import of the entire
network-level module with networkExprs set as
oldStyleNetworkExpressions (two-stage is needed for nixpkgs.config).

Signed-off-by: Shea Levy <shea@shealevy.com>
@edolstra
Copy link
Member

What are "old-style networks"?

@shlevy
Copy link
Member Author

shlevy commented Jun 11, 2013

The network expressions we currently use

@edolstra
Copy link
Member

Okay, I should have asked: what are "new-style networks".

@shlevy
Copy link
Member Author

shlevy commented Jun 11, 2013

Well currently they are only an internal implementation detail, though the point of this whole exercise is to eventually make them the normal way of specifying a network. Instead of the way we currently write them, they'd be modules like:

{ config, lib, ... }:

let
  resources = config.resources;
in {
  require = [ ./logical-module.nix ];

  resources.machines.machine = { pkgs, config }: {
    deployment.ec2.keyPair = resources.ec2KeyPairs."build-machine-provisioner-keypair".name;
  };
  resources.ec2KeyPairs.build-machine-provisioner-keypair = {
    region = "us-east-1";
  };
}

IOW, new-style networks are just modules that are evaluated with the base.nix module included in the evaluation.

@rbvermaa
Copy link
Member

Btw, config would be a terrible name for the network configuration...

@shlevy
Copy link
Member Author

shlevy commented Jun 11, 2013

What do you mean? The config argument to the module?

@edolstra
Copy link
Member

Yeah, all these config arguments might get a bit confusing. That's already the case with submodules...

@shlevy
Copy link
Member Author

shlevy commented Jun 11, 2013

Hmm OK. that's just the name used internally by the module system, we can alias it.

@shlevy
Copy link
Member Author

shlevy commented Jul 2, 2013

@edolstra If I bring this up-to-date and change the name from config, can we consider merging it?

@shlevy
Copy link
Member Author

shlevy commented Jul 12, 2013

@edolstra ping?

@rbvermaa
Copy link
Member

Did you change the config argument name already? If so, to what?

@shlevy
Copy link
Member Author

shlevy commented Jul 12, 2013

No, it will take some work to update this to master and I wasn't sure if there was interest in having this merged. As for what to change it to, I'm open for suggestions but was thinking subconfig or resourceConfig (or machineConfig/queueConfig/etc.)

@rbvermaa
Copy link
Member

I would leave config for machines, as that is the same as in NixOS. However, how about renamin the config at network level to network?

@shlevy
Copy link
Member Author

shlevy commented Jul 12, 2013

Sure, that works too.

@shlevy
Copy link
Member Author

shlevy commented Jul 29, 2013

@edolstra So is there interest in me updating this PR or should I close it?

@shlevy
Copy link
Member Author

shlevy commented Jul 29, 2013

This PR depends on NixOS/nixpkgs@8179bad I've updated #78, which this PR is a part of, to describe a bit what the benefits are. Note that this PR doesn't actually change any external behavior, it just sets up the scaffolding necessary for #78 to be doable and uses that scaffolding internally.

@aszlig
Copy link
Member

aszlig commented Aug 30, 2013

+1 on this. Though the problem I guess is that the mentioned nixpkgs dependency is quite new and thus will break with deployments using older nixpkgs. On the other side, people who want to switch over to new-style networks probably use newer nixpkgs, no?

@shlevy
Copy link
Member Author

shlevy commented Jun 10, 2014

Closed in favor of #187

@shlevy shlevy closed this Jun 10, 2014
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