mrsk 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: feb2c373300543bf704e62d0cf8c545d32a65e1427691fdb01587c86003d4768
4
- data.tar.gz: 9f849d3d40a610480ee6deddd146ca25331e9058a7b309a717467ccc089cfbfc
3
+ metadata.gz: 72714468cef4a41762f0da7a7a1af4b63a09181ae8ce73839b642ff0f91dd7ab
4
+ data.tar.gz: 147c1b2ca7bca7b0a5e91489b0cfa5d4efec52a9233978c50e5e4c3b6079b1d0
5
5
  SHA512:
6
- metadata.gz: 16cd77975eef8b0e4a17fcf1ae1db7a94affb93748453660600b9017e6a3cb4709f21c25a266d664bd61348def6a171f7da9d0ac01465ceaa470cecaf075a9fd
7
- data.tar.gz: 0271c9bd94849d630949c5d768984c33d69b72922d3cf8b63116ff33df6a973fad17a35735f09cf038ce9853dd257866b3657333a200e7b755ae18febd4cdb13
6
+ metadata.gz: e69b26849eedbc5fe5a17870b7184e8f73bfa2ac9b8c802ceedfab9fd688427445422e1709037548b87d06478aae49e681a5250195b111ff4d6f3560c56db02e
7
+ data.tar.gz: dbbda93a73d43820ac11c184b5ce838eb95216f54fae27961fbd3e735066cc01906960da9759818a994b6d9629ef538319577e9c48d3cb1925c94cd09c33b1e4
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MRSK
2
2
 
3
- MRSK deploys web apps in containers to servers running Docker with zero downtime. It uses the dynamic reverse-proxy Traefik to hold requests while the new application container is started and the old one is stopped. It works seamlessly across multiple hosts, using SSHKit to execute commands.
3
+ MRSK deploys web apps in containers to servers running Docker with zero downtime. It uses the dynamic reverse-proxy Traefik to hold requests while the new application container is started and the old one is stopped. It works seamlessly across multiple hosts, using SSHKit to execute commands. It was built for Rails applications, but works with any type of web app that can be bundled with Docker.
4
4
 
5
5
  ## Installation
6
6
 
@@ -43,6 +43,16 @@ This will:
43
43
 
44
44
  Voila! All the servers are now serving the app on port 80. If you're just running a single server, you're ready to go. If you're running multiple servers, you need to put a load balancer in front of them.
45
45
 
46
+ ## Vision
47
+
48
+ In the past decade+, there's been an explosion in commercial offerings that make deploying web apps easier. Heroku kicked it off with an incredible offering that stayed ahead of the competition seemingly forever. These days we have excellent alternatives like Fly.io and Render. And hosted Kubernetes is making things easier too on AWS, GCP, Digital Ocean, and elsewhere. But these are all offerings that have you renting computers in the cloud at a premium. If you want to run on our own hardware, or even just have a clear migration path to do so, you need to carefully consider how locked in you get to these commercial platforms. Preferably before the bills swallow your business whole!
49
+
50
+ MRSK seeks to bring the advance in ergonomics pioneered by these commercial offerings to deploying web apps anywhere. Whether that's low-cost cloud options without the managed-service markup from the likes of Digital Ocean, Hetzner, OVH, etc, or it's your own colocated metal. To MRSK, it's all the same. Feed the config file a list of IP addresses with vanilla Ubuntu servers that have seen no prep beyond an added SSH key, and you'll be running in literally minutes.
51
+
52
+ This structure also gives you enormous portability. You can have your web app deployed on several clouds at ease like this. Or you can buy the baseline with your own hardware, then deploy to a cloud before a big seasonal spike to get more capacity. When you're not locked into a single provider from a tooling perspective, there's a lot of compelling options available.
53
+
54
+ Ultimately, MRSK is meant to compress the complexity of going to production using open source tooling that isn't tied to any commercial offering. Not to zero, though. You're probably still better off with a fully managed service if basic Linux or Docker is still difficult, but from an early stage when those concepts are familiar.
55
+
46
56
  ## Why not just run Capistrano, Kubernetes or Docker Swarm?
47
57
 
48
58
  MRSK basically is Capistrano for Containers, which allow us to use vanilla servers as the hosts. No need to ensure that the servers have just the right version of Ruby or other dependencies you need. That all lives in the Docker image now. You can boot a brand new Ubuntu (or whatever) server, add it to the deploy servers of MRSK, and it'll be auto-provisioned with Docker, and run right away. Docker's layer caching also allows for quicker deployments with less mucking about on the server. And the images built for MRSK can be used for CI or later introspection.
@@ -5,19 +5,27 @@ class Mrsk::Commands::Builder::Base < Mrsk::Commands::Base
5
5
  docker :pull, config.absolute_image
6
6
  end
7
7
 
8
- def build_args
9
- argumentize "--build-arg", args, redacted: true
8
+ def build_options
9
+ [ *build_tags, *build_labels, *build_args, *build_secrets ]
10
10
  end
11
11
 
12
- def build_secrets
13
- argumentize "--secret", secrets.collect { |secret| [ "id", secret ] }
14
- end
12
+ private
13
+ def build_tags
14
+ [ "-t", config.absolute_image, "-t", config.latest_image ]
15
+ end
15
16
 
16
- def build_tags
17
- [ "-t", config.absolute_image, "-t", config.latest_image ]
18
- end
17
+ def build_labels
18
+ argumentize "--label", { service: config.service }
19
+ end
20
+
21
+ def build_args
22
+ argumentize "--build-arg", args, redacted: true
23
+ end
24
+
25
+ def build_secrets
26
+ argumentize "--secret", secrets.collect { |secret| [ "id", secret ] }
27
+ end
19
28
 
20
- private
21
29
  def args
22
30
  (config.builder && config.builder["args"]) || {}
23
31
  end
@@ -12,9 +12,7 @@ class Mrsk::Commands::Builder::Multiarch < Mrsk::Commands::Builder::Base
12
12
  "--push",
13
13
  "--platform", "linux/amd64,linux/arm64",
14
14
  "--builder", builder_name,
15
- *build_tags,
16
- *build_args,
17
- *build_secrets,
15
+ *build_options,
18
16
  "."
19
17
  end
20
18
 
@@ -16,9 +16,7 @@ class Mrsk::Commands::Builder::Native::Remote < Mrsk::Commands::Builder::Native
16
16
  "--push",
17
17
  "--platform", platform,
18
18
  "--builder", builder_name,
19
- *build_tags,
20
- *build_args,
21
- *build_secrets,
19
+ *build_options,
22
20
  "."
23
21
  end
24
22
 
@@ -9,7 +9,7 @@ class Mrsk::Commands::Builder::Native < Mrsk::Commands::Builder::Base
9
9
 
10
10
  def push
11
11
  combine \
12
- docker(:build, *build_tags, *build_args, *build_secrets, "."),
12
+ docker(:build, *build_options, "."),
13
13
  docker(:push, config.absolute_image)
14
14
  end
15
15
 
@@ -6,11 +6,10 @@ class Mrsk::Commands::Prune < Mrsk::Commands::Base
6
6
  PRUNE_CONTAINERS_AFTER = 3.days.in_hours.to_i
7
7
 
8
8
  def images
9
- docker :image, :prune, "-f", "--filter", "until=#{PRUNE_IMAGES_AFTER}h"
9
+ docker :image, :prune, "--all", "--force", "--filter", "label=service=#{config.service}", "--filter", "until=#{PRUNE_IMAGES_AFTER}h"
10
10
  end
11
11
 
12
12
  def containers
13
- docker :image, :prune, "-f", "--filter", "until=#{PRUNE_IMAGES_AFTER}h"
14
- docker :container, :prune, "-f", "--filter", "label=service=#{config.service}", "--filter", "'until=#{PRUNE_CONTAINERS_AFTER}h'"
13
+ docker :container, :prune, "--force", "--filter", "label=service=#{config.service}", "--filter", "until=#{PRUNE_CONTAINERS_AFTER}h"
15
14
  end
16
15
  end
data/lib/mrsk/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mrsk
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mrsk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-11 00:00:00.000000000 Z
11
+ date: 2023-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport