From 0f6699882316676fe114e7e7bda61a01bd647fca Mon Sep 17 00:00:00 2001 From: notgne2 Date: Mon, 28 Sep 2020 16:35:27 -0700 Subject: add README.md --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..4580a42 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# deploy-rs +#### A candidate for [serokell/deploy](https://github.com/serokell/deploy) + +**This is very early development software, you should expect to find issues** + +## Usage examples + +Example Nix expressions/configurations are in the [examples folder](./examples), here are various ways to deploy + +- `nix run github:notgne2/deploy-rs your-flake#node.profile` +- `nix run github:notgne2/deploy-rs your-flake#node` +- `nix run github:notgne2/deploy-rs your-flake` + +## Idea + +`deploy-rs` is a simple Rust program that will take a Nix flake and use it to deploy any of your defined profiles to your nodes. This is _strongly_ based off of [serokell/deploy](https://github.com/serokell/deploy), with the intention of eventually replacing it. + +This type of design (as opposed to more traditional tools like NixOps or morph) allows for lesser-privileged deployments, and the ability to update different things independently of eachother. + +## Things to work on + +- ~~Ordered profiles~~ +- Automatic rollbacks if one profile on node failed to deploy (partially implemented) +- UI (?) \ No newline at end of file -- cgit v1.2.3 From 8d21dd335e5259dadf832a5d1a7c72b9dd1f4400 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Tue, 29 Sep 2020 15:10:06 -0700 Subject: Add license information, reformat Nix files, clean up --- README.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 4580a42..74b96be 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,26 @@ + + # deploy-rs -#### A candidate for [serokell/deploy](https://github.com/serokell/deploy) + +A Simple multi-profile Nix-flake deploy tool. **This is very early development software, you should expect to find issues** -## Usage examples +## Usage -Example Nix expressions/configurations are in the [examples folder](./examples), here are various ways to deploy - `nix run github:notgne2/deploy-rs your-flake#node.profile` - `nix run github:notgne2/deploy-rs your-flake#node` - `nix run github:notgne2/deploy-rs your-flake` +## API + +Example Nix expressions/configurations are in the [examples folder](./examples). + ## Idea `deploy-rs` is a simple Rust program that will take a Nix flake and use it to deploy any of your defined profiles to your nodes. This is _strongly_ based off of [serokell/deploy](https://github.com/serokell/deploy), with the intention of eventually replacing it. @@ -21,4 +31,11 @@ This type of design (as opposed to more traditional tools like NixOps or morph) - ~~Ordered profiles~~ - Automatic rollbacks if one profile on node failed to deploy (partially implemented) -- UI (?) \ No newline at end of file +- UI (?) + +## About Serokell + +deploy-rs is maintained and funded with ❤️ by [Serokell](https://serokell.io/). +The names and logo for Serokell are trademark of Serokell OÜ. + +We love open source software! See [our other projects](https://serokell.io/community?utm_source=github) or [hire us](https://serokell.io/hire-us?utm_source=github) to design, develop and grow your idea! \ No newline at end of file -- cgit v1.2.3 From 1de1ad5ff893bfcabdf2bfa20d8c93a8cdbb0156 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Mon, 5 Oct 2020 19:55:01 -0700 Subject: Update GitHub URL in README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 74b96be..15877d1 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ A Simple multi-profile Nix-flake deploy tool. ## Usage -- `nix run github:notgne2/deploy-rs your-flake#node.profile` -- `nix run github:notgne2/deploy-rs your-flake#node` -- `nix run github:notgne2/deploy-rs your-flake` +- `nix run github:serokell/deploy-rs your-flake#node.profile` +- `nix run github:serokell/deploy-rs your-flake#node` +- `nix run github:serokell/deploy-rs your-flake` ## API -- cgit v1.2.3 From 518f7f5b4f1db83cab61941ab8887b0df76ce8d8 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Thu, 8 Oct 2020 18:13:26 -0700 Subject: Update documentation --- README.md | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 82 insertions(+), 6 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 15877d1..e622250 100644 --- a/README.md +++ b/README.md @@ -6,20 +6,93 @@ SPDX-License-Identifier: MPL-2.0 # deploy-rs -A Simple multi-profile Nix-flake deploy tool. +A Simple, multi-profile Nix-flake deploy tool. -**This is very early development software, you should expect to find issues** +**This is very early development software, you should expect to find issues, and things will change** ## Usage +Basic usage: `deploy [options] `. -- `nix run github:serokell/deploy-rs your-flake#node.profile` -- `nix run github:serokell/deploy-rs your-flake#node` +The given flake can be just a source `my-flake`, specify the node to deploy `my-flake#my-node`, or specify a profile too `my-flake#my-node.my-profile`. + +You can try out this tool easily with `nix run`: - `nix run github:serokell/deploy-rs your-flake` +If your require a signing key to push closures to your server, specify the path to it in the `LOCAL_KEY` environment variable. + +Check out `deploy --help` for CLI flags! Remember to check there before making one-time changes to things like hostnames. + ## API -Example Nix expressions/configurations are in the [examples folder](./examples). +### Profile + +This is the core of how `deploy-rs` was designed, any number of these can run on a node, as any user (see further down for specifying user information). If you want to mimick the behaviour of traditional tools like NixOps or Morph, try just defining one `profile` called `system`, as root, containing a nixosSystem. + +```nix +{ + # ...generic options... (see below) + + # The command to bootstrap your profile, this is optional + bootstrap = "mkdir xyz"; + + # A derivation containing your required software, and a script to activate it in `${path}/activate` + # For ease of use, `deploy-rs` provides a function to easy all this required activation script to any derivation + path = deploy-rs.lib.x86_64-linux.setActivate pkgs.hello "./bin/hello"; +} +``` + +### Node + +This defines a single node/server, and the profiles you intend it to run. + +```nix +{ + # ...generic options... (see below) + + # The hostname of your server, don't worry, this can be overridden at runtime if needed + hostname = "my.server.gov"; + + # An optional list containing the order you want profiles to be deployed. + profilesOrder = [ "something" "system" ]; + + profiles = { + system = {}; # Definition shown above + something = {}; # Definition shown above + }; +} +``` + +### Deploy + +This is the top level attribute containing all of the options for this tool + +```nix +{ + # ...generic options... (see below) + + nodes = { + my-node = {}; # Definition shown above + another-node = {}; # Definition shown above + }; +} +``` + +#### Generic options + +This is a set of options that can be put in any of the above definitions, with the priority being `profile > node > deploy` + +```nix +{ + sshUser = "admin"; # This is the user that deploy-rs will use when connecting + user = "root"; # This is the user that the profile will be deployed to (will use sudo if not the same as above) + sshOpts = [ "-p" "2121" ]; # These are arguments that will be passed to SSH + fastConnection = false; # Fast connection to the node. If this is true, copy the whole closure instead of letting the node substitute + autoRollback = true; # If the previous profile should be re-activated if activation fails +} +``` + +A stronger definition of the schema is in the [interface directory](./interface), and full working examples Nix expressions/configurations are in the [examples folder](./examples). ## Idea @@ -30,8 +103,11 @@ This type of design (as opposed to more traditional tools like NixOps or morph) ## Things to work on - ~~Ordered profiles~~ -- Automatic rollbacks if one profile on node failed to deploy (partially implemented) +- ~~Automatic rollbacks~~ - UI (?) +- automatic kexec lustration of servers (maybe) +- Remote health checks +- Rollback on reconnection failure (technically, rollback if not reconnected to) ## About Serokell -- cgit v1.2.3 From 219d55e99e792a093c12dbc045bed88a4bfe1916 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Thu, 8 Oct 2020 20:01:01 -0700 Subject: Minor flake and documentation fixes --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index e622250..2710183 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,12 @@ A Simple, multi-profile Nix-flake deploy tool. Basic usage: `deploy [options] `. -The given flake can be just a source `my-flake`, specify the node to deploy `my-flake#my-node`, or specify a profile too `my-flake#my-node.my-profile`. +The given flake can be just a source `my-flake`, or optionally specify the node to deploy `my-flake#my-node`, or specify a profile too `my-flake#my-node.my-profile`. You can try out this tool easily with `nix run`: - `nix run github:serokell/deploy-rs your-flake` -If your require a signing key to push closures to your server, specify the path to it in the `LOCAL_KEY` environment variable. +If you require a signing key to push closures to your server, specify the path to it in the `LOCAL_KEY` environment variable. Check out `deploy --help` for CLI flags! Remember to check there before making one-time changes to things like hostnames. @@ -27,18 +27,18 @@ Check out `deploy --help` for CLI flags! Remember to check there before making o ### Profile -This is the core of how `deploy-rs` was designed, any number of these can run on a node, as any user (see further down for specifying user information). If you want to mimick the behaviour of traditional tools like NixOps or Morph, try just defining one `profile` called `system`, as root, containing a nixosSystem. +This is the core of how `deploy-rs` was designed, any number of these can run on a node, as any user (see further down for specifying user information). If you want to mimick the behaviour of traditional tools like NixOps or Morph, try just defining one `profile` called `system`, as root, containing a nixosSystem, and you can even similarly use [home-manager](https://github.com/nix-community/home-manager) on any non-privileged user. ```nix { - # ...generic options... (see below) - # The command to bootstrap your profile, this is optional bootstrap = "mkdir xyz"; # A derivation containing your required software, and a script to activate it in `${path}/activate` # For ease of use, `deploy-rs` provides a function to easy all this required activation script to any derivation path = deploy-rs.lib.x86_64-linux.setActivate pkgs.hello "./bin/hello"; + + # ...generic options... (see lower section) } ``` @@ -48,8 +48,6 @@ This defines a single node/server, and the profiles you intend it to run. ```nix { - # ...generic options... (see below) - # The hostname of your server, don't worry, this can be overridden at runtime if needed hostname = "my.server.gov"; @@ -60,6 +58,8 @@ This defines a single node/server, and the profiles you intend it to run. system = {}; # Definition shown above something = {}; # Definition shown above }; + + # ...generic options... (see lower section) } ``` @@ -69,16 +69,16 @@ This is the top level attribute containing all of the options for this tool ```nix { - # ...generic options... (see below) - nodes = { my-node = {}; # Definition shown above another-node = {}; # Definition shown above }; + + # ...generic options... (see lower section) } ``` -#### Generic options +### Generic options This is a set of options that can be put in any of the above definitions, with the priority being `profile > node > deploy` @@ -96,7 +96,7 @@ A stronger definition of the schema is in the [interface directory](./interface) ## Idea -`deploy-rs` is a simple Rust program that will take a Nix flake and use it to deploy any of your defined profiles to your nodes. This is _strongly_ based off of [serokell/deploy](https://github.com/serokell/deploy), with the intention of eventually replacing it. +`deploy-rs` is a simple Rust program that will take a Nix flake and use it to deploy any of your defined profiles to your nodes. This is _strongly_ based off of [serokell/deploy](https://github.com/serokell/deploy), designed to replace it and expand upon it. This type of design (as opposed to more traditional tools like NixOps or morph) allows for lesser-privileged deployments, and the ability to update different things independently of eachother. -- cgit v1.2.3 From 867438bfc011e63b633b9d6fa2b0edb3367ea253 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Sat, 10 Oct 2020 10:42:14 -0700 Subject: Document `profilePath` option --- README.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 2710183..cbc312d 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,9 @@ This is the core of how `deploy-rs` was designed, any number of these can run on # For ease of use, `deploy-rs` provides a function to easy all this required activation script to any derivation path = deploy-rs.lib.x86_64-linux.setActivate pkgs.hello "./bin/hello"; + # An optional path to where your profile should be installed to, this is useful if you want to use a common profile name across multiple users, but would have conflicts in your node's profile list. + profilePath = "/nix/var/nix/profiles/per-user/someuser/someprofile"; + # ...generic options... (see lower section) } ``` -- cgit v1.2.3 From 75449025beb621f2219b99b52b1287af3a6d1676 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Tue, 13 Oct 2020 19:10:58 -0700 Subject: Mark magic rollback off the checklist --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index cbc312d..edaf144 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ This type of design (as opposed to more traditional tools like NixOps or morph) - UI (?) - automatic kexec lustration of servers (maybe) - Remote health checks -- Rollback on reconnection failure (technically, rollback if not reconnected to) +- ~~Rollback on reconnection failure (technically, rollback if not reconnected to)~~ ## About Serokell -- cgit v1.2.3 From 32cd88fdc00c7258a21314a3fcec29d14a624280 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Fri, 23 Oct 2020 15:05:56 -0700 Subject: Add note about `activate` in README --- README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index edaf144..009cd7f 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ If you require a signing key to push closures to your server, specify the path t Check out `deploy --help` for CLI flags! Remember to check there before making one-time changes to things like hostnames. +There is also an `activate` binary though this should be ignored, it is only used internally and for testing/hacking purposes. + ## API ### Profile -- cgit v1.2.3 From 73d14d456f288b98b9e0874d74a5a48d8a86e2b7 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Fri, 23 Oct 2020 22:45:05 -0700 Subject: Add TODO for remote building --- README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'README.md') diff --git a/README.md b/README.md index 009cd7f..f5a6458 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,7 @@ This type of design (as opposed to more traditional tools like NixOps or morph) - automatic kexec lustration of servers (maybe) - Remote health checks - ~~Rollback on reconnection failure (technically, rollback if not reconnected to)~~ +- Optionally build on remote server ## About Serokell -- cgit v1.2.3