legionio 0.3.2 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +27 -10
  3. data/.gitignore +1 -0
  4. data/.rubocop.yml +7 -2
  5. data/CHANGELOG.md +21 -0
  6. data/Dockerfile +9 -0
  7. data/README.md +157 -45
  8. data/Rakefile +0 -6
  9. data/bitbucket-pipelines.yml +16 -52
  10. data/docker_deploy.rb +10 -0
  11. data/exe/legion +3 -51
  12. data/exe/legionio +53 -0
  13. data/exe/lex_gen +5 -0
  14. data/{legion.gemspec → legionio.gemspec} +25 -20
  15. data/lib/legion.rb +4 -0
  16. data/lib/legion/cli.rb +56 -0
  17. data/lib/legion/cli/chain.rb +35 -0
  18. data/lib/legion/cli/cohort.rb +10 -0
  19. data/lib/legion/cli/function.rb +41 -0
  20. data/lib/legion/cli/lex/actor.rb +31 -0
  21. data/lib/legion/cli/lex/exchange.rb +32 -0
  22. data/lib/legion/cli/lex/message.rb +32 -0
  23. data/lib/legion/cli/lex/queue.rb +45 -0
  24. data/lib/legion/cli/lex/runner.rb +70 -0
  25. data/lib/legion/cli/lex/templates/actor.erb +6 -0
  26. data/{docs/_build/html/_sources/overview.rst.txt → lib/legion/cli/lex/templates/actor_spec.erb} +0 -0
  27. data/lib/legion/cli/lex/templates/base/bitbucket.yml.erb +69 -0
  28. data/lib/legion/cli/lex/templates/base/gemfile.erb +3 -0
  29. data/lib/legion/cli/lex/templates/base/gemspec.erb +26 -0
  30. data/lib/legion/cli/lex/templates/base/gitignore.erb +11 -0
  31. data/lib/legion/cli/lex/templates/base/lex.erb +9 -0
  32. data/lib/legion/cli/lex/templates/base/lex_spec.erb +5 -0
  33. data/lib/legion/cli/lex/templates/base/lic.erb +21 -0
  34. data/lib/legion/cli/lex/templates/base/rakefile.erb +6 -0
  35. data/lib/legion/cli/lex/templates/base/readme.md.erb +2 -0
  36. data/lib/legion/cli/lex/templates/base/rubocop.yml.erb +15 -0
  37. data/lib/legion/cli/lex/templates/base/spec_helper.rb.erb +11 -0
  38. data/lib/legion/cli/lex/templates/base/version.erb +7 -0
  39. data/lib/legion/cli/lex/templates/exchange.erb +11 -0
  40. data/lib/legion/cli/lex/templates/exchange_spec.erb +0 -0
  41. data/lib/legion/cli/lex/templates/message.erb +23 -0
  42. data/lib/legion/cli/lex/templates/message_spec.erb +0 -0
  43. data/lib/legion/cli/lex/templates/queue.erb +12 -0
  44. data/lib/legion/cli/lex/templates/queue_helper.erb +24 -0
  45. data/lib/legion/cli/lex/templates/queue_spec.erb +11 -0
  46. data/lib/legion/cli/lex/templates/runner.erb +11 -0
  47. data/lib/legion/cli/lex/templates/runner_spec.erb +11 -0
  48. data/lib/legion/cli/relationship.rb +22 -0
  49. data/lib/legion/cli/task.rb +49 -0
  50. data/lib/legion/cli/trigger.rb +88 -0
  51. data/lib/legion/cli/version.rb +5 -0
  52. data/lib/legion/extensions.rb +35 -1
  53. data/lib/legion/extensions/actors/base.rb +0 -2
  54. data/lib/legion/extensions/actors/poll.rb +0 -1
  55. data/lib/legion/extensions/actors/subscription.rb +1 -0
  56. data/lib/legion/extensions/core.rb +9 -4
  57. data/lib/legion/extensions/helpers/base.rb +3 -3
  58. data/lib/legion/extensions/helpers/logger.rb +3 -6
  59. data/lib/legion/extensions/helpers/task.rb +1 -1
  60. data/lib/legion/lex.rb +89 -0
  61. data/lib/legion/service.rb +34 -3
  62. data/lib/legion/version.rb +1 -1
  63. metadata +196 -82
  64. data/bin/console +0 -16
  65. data/bin/legion +0 -49
  66. data/bin/setup +0 -8
  67. data/bin/test +0 -32
  68. data/docs/Makefile +0 -20
  69. data/docs/_build/doctrees/environment.pickle +0 -0
  70. data/docs/_build/doctrees/index.doctree +0 -0
  71. data/docs/_build/doctrees/overview.doctree +0 -0
  72. data/docs/_build/html/.buildinfo +0 -4
  73. data/docs/_build/html/_sources/index.rst.txt +0 -28
  74. data/docs/_build/html/_static/alabaster.css +0 -701
  75. data/docs/_build/html/_static/basic.css +0 -855
  76. data/docs/_build/html/_static/custom.css +0 -1
  77. data/docs/_build/html/_static/doctools.js +0 -315
  78. data/docs/_build/html/_static/documentation_options.js +0 -12
  79. data/docs/_build/html/_static/file.png +0 -0
  80. data/docs/_build/html/_static/jquery-3.5.1.js +0 -10872
  81. data/docs/_build/html/_static/jquery.js +0 -2
  82. data/docs/_build/html/_static/language_data.js +0 -297
  83. data/docs/_build/html/_static/minus.png +0 -0
  84. data/docs/_build/html/_static/plus.png +0 -0
  85. data/docs/_build/html/_static/pygments.css +0 -82
  86. data/docs/_build/html/_static/searchtools.js +0 -514
  87. data/docs/_build/html/_static/underscore-1.3.1.js +0 -999
  88. data/docs/_build/html/_static/underscore.js +0 -31
  89. data/docs/_build/html/genindex.html +0 -101
  90. data/docs/_build/html/index.html +0 -117
  91. data/docs/_build/html/objects.inv +0 -6
  92. data/docs/_build/html/overview.html +0 -98
  93. data/docs/_build/html/search.html +0 -110
  94. data/docs/_build/html/searchindex.js +0 -1
  95. data/docs/conf.py +0 -54
  96. data/docs/index.rst +0 -28
  97. data/docs/make.bat +0 -35
  98. data/lib/legion/exceptions/handled_task.rb +0 -6
  99. data/lib/legion/exceptions/invalidjson.rb +0 -5
  100. data/lib/legion/exceptions/missingargument.rb +0 -6
  101. data/lib/legion/exceptions/wrongtype.rb +0 -10
  102. data/lib/legion/exceptions/wrongtypes/array.rb +0 -8
  103. data/lib/legion/exceptions/wrongtypes/hash.rb +0 -8
  104. data/lib/legion/exceptions/wrongtypes/integer.rb +0 -8
  105. data/lib/legion/exceptions/wrongtypes/string.rb +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a64a174cc967d97433e0fa569c4da77213fc776846b5bfc6c46d4e6887f42c5
4
- data.tar.gz: b0cbf64bf7f4139ac878a5bb8ffdab0cead2066eb647ebac1d04e3c0ce7b2fa8
3
+ metadata.gz: d87e4d2b2e7a4d84b7e8b53ae35d2c85176afa044e84a6dbc05de94117ad55ba
4
+ data.tar.gz: 39eade16268f74203877de223b2d180784b835d4ae461a9de77f2af9eb93a2a8
5
5
  SHA512:
6
- metadata.gz: a83de46e58e9cfa4afb709bfdaa68f906afe107285b98ca5e925b8f34674fa58380b18a64d3b8fb73b208f52e8801739032bbf878c28142c378a3450e941379b
7
- data.tar.gz: b7d79b0bb560f7d87a724958ad681688a60e7141579fce3618401af8934a6927ea9199905a272e337da4598a53eabab49b1057c3444147f9dd762cc3bb37f80f
6
+ metadata.gz: cc2ec872756beab5f237253fc8afc1382e320ddf72b2e92188a58bc48c4583222e18e24264b6c4b3d68cb51f82a77cc254f69284baebd0301e89cdcac9946675
7
+ data.tar.gz: 0fb0073dbfbf8ae687e8cd19027c672a31768f4e07513207f56e5bed97d5f4e3541ad92d58c79b3c696ded6a2e8bc22312ccb0a59bc05b0eaaf9f0d5fee932b8
@@ -5,16 +5,15 @@ jobs:
5
5
  - image: circleci/ruby:2.5-node
6
6
  steps:
7
7
  - checkout
8
- - run: gem install rubocop
8
+ - run: gem install rubocop rubocop-rspec rubocop-rake
9
9
  - run:
10
10
  name: Run Rubocop
11
11
  command: rubocop
12
12
  - store_test_results:
13
13
  path: test_results
14
-
15
- "ruby-two-seven":
14
+ "ruby-three":
16
15
  docker:
17
- - image: circleci/ruby:2.7-node
16
+ - image: circleci/ruby:3-node
18
17
  - image: mysql:5.7
19
18
  environment:
20
19
  MYSQL_DATABASE: 'legion'
@@ -24,6 +23,9 @@ jobs:
24
23
  - image: rabbitmq:3.7
25
24
  steps:
26
25
  - checkout
26
+ - run:
27
+ name: bundle update
28
+ command: gem update bundler
27
29
  - run:
28
30
  name: Bundle Install
29
31
  command: bundle install
@@ -33,9 +35,9 @@ jobs:
33
35
  when: always
34
36
  - store_test_results:
35
37
  path: test-results
36
- "ruby-two-five":
38
+ "ruby-two-seven":
37
39
  docker:
38
- - image: circleci/ruby:2.5-node
40
+ - image: circleci/ruby:2.7-node
39
41
  - image: mysql:5.7
40
42
  environment:
41
43
  MYSQL_DATABASE: 'legion'
@@ -45,6 +47,9 @@ jobs:
45
47
  - image: rabbitmq:3.7
46
48
  steps:
47
49
  - checkout
50
+ - run:
51
+ name: bundle update
52
+ command: gem update bundler
48
53
  - run:
49
54
  name: Bundle Install
50
55
  command: bundle install
@@ -54,9 +59,9 @@ jobs:
54
59
  when: always
55
60
  - store_test_results:
56
61
  path: test-results
57
- "ruby-two-six":
62
+ "ruby-two-five":
58
63
  docker:
59
- - image: circleci/ruby:2.6-node
64
+ - image: circleci/ruby:2.5-node
60
65
  - image: mysql:5.7
61
66
  environment:
62
67
  MYSQL_DATABASE: 'legion'
@@ -66,6 +71,9 @@ jobs:
66
71
  - image: rabbitmq:3.7
67
72
  steps:
68
73
  - checkout
74
+ - run:
75
+ name: bundle update
76
+ command: gem update bundler
69
77
  - run:
70
78
  name: Bundle Install
71
79
  command: bundle install
@@ -75,9 +83,9 @@ jobs:
75
83
  when: always
76
84
  - store_test_results:
77
85
  path: test-results
78
- "jruby-nine-two":
86
+ "ruby-two-six":
79
87
  docker:
80
- - image: circleci/jruby:9.2-jra
88
+ - image: circleci/ruby:2.6-node
81
89
  - image: mysql:5.7
82
90
  environment:
83
91
  MYSQL_DATABASE: 'legion'
@@ -87,6 +95,9 @@ jobs:
87
95
  - image: rabbitmq:3.7
88
96
  steps:
89
97
  - checkout
98
+ - run:
99
+ name: bundle update
100
+ command: gem update bundler
90
101
  - run:
91
102
  name: Bundle Install
92
103
  command: bundle install
@@ -117,3 +128,9 @@ workflows:
117
128
  filters:
118
129
  branches:
119
130
  only: /\bdevelop\b|\bmaster\b/
131
+ - ruby-three:
132
+ requires:
133
+ - ruby-two-five
134
+ filters:
135
+ branches:
136
+ only: /\bdevelop\b|\bmaster\b/
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  *.key
13
13
  # rspec failure tracking
14
14
  .rspec_status
15
+ legionio.key
@@ -1,3 +1,8 @@
1
+ require:
2
+ - rubocop-rspec
3
+
4
+ RSpec/FilePath:
5
+ Enabled: false
1
6
  Layout/LineLength:
2
7
  Max: 160
3
8
  IgnoredPatterns:
@@ -19,7 +24,7 @@ Metrics:
19
24
  - .trace
20
25
  Metrics/MethodLength:
21
26
  Max: 50
22
- ExcludedMethods:
27
+ IgnoredMethods:
23
28
  - .unknown
24
29
  - .fatal
25
30
  - .error
@@ -33,7 +38,7 @@ Metrics/ModuleLength:
33
38
  Max: 1500
34
39
  Metrics/BlockLength:
35
40
  Max: 40
36
- ExcludedMethods:
41
+ IgnoredMethods:
37
42
  - .unknown
38
43
  - .fatal
39
44
  - .error
@@ -1,5 +1,26 @@
1
1
  # Legion Changelog
2
2
 
3
+ ## v0.4.0
4
+ * Moving all legion-cli code to inside the legion gem instead of a seperate gem
5
+ * Removing bundled Legion::Data gem from LegionIO(must be installed with gem install legion-data)
6
+ * Removing JRuby support
7
+ * Removing the following gems from gemspec, hashdiff, legion-data, mysql2, sequel, bunny, bundler, codecov
8
+ * Skipping auto install if using bundler. It only works with the binary
9
+ * Adding new docker_deploy.rb script to automatically push a new docker tag with a deployment
10
+ * Adding multiple version dependencies to previously open ended gems
11
+ * Updating Dockerfile to have `--no-document --no-prerelease` flags
12
+ * Updating README
13
+ * Enabling rubocop-rspec
14
+ * Adding support to specify a LEX version to automatically install
15
+ * Updating `legion-transport` gem min version to 1.1.8
16
+
17
+ ## v0.3.6
18
+ * Updating executables to use Legion::CLI
19
+ * Updating bitbucket-pipelines
20
+ * Changing base legion command to legionio and updating Dockerfile
21
+ * Blocking truffleruby from using Legion:Data as it's slow for unknown reasons
22
+ * Changing task update reverting to RMQ message to level debug
23
+
3
24
  ## v0.3.0
4
25
  * Updating dependencies based on if we are using `JRUBY` or not
5
26
  * Cleaning up some files and rubocop errors
@@ -0,0 +1,9 @@
1
+ FROM ruby:2.7-alpine
2
+ LABEL maintainer="Matthew Iverson <matthewdiverson@gmail.com>"
3
+
4
+ RUN mkdir /etc/legionio
5
+ RUN apk update && apk add build-base postgresql-dev mysql-client mariadb-dev tzdata gcc git
6
+
7
+ COPY . ./
8
+ RUN gem install legionio tzinfo-data tzinfo --no-document --no-prerelease
9
+ CMD legionio
data/README.md CHANGED
@@ -1,49 +1,161 @@
1
- # Legion
1
+ # LegionIO
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library
4
- into a gem. Put your Ruby code in the file `lib/legion`. To experiment with that code, run `bin/console` for
5
- an interactive prompt.
3
+ LegionIO is a framework for automating and connecting things. You can see all the docs inside confluence
4
+ https://legionio.atlassian.net/wiki/spaces/LEGION/overview
5
+ https://legionio.atlassian.net/wiki/spaces/LEX/pages/7864551/Extensions
6
6
 
7
-
8
- ## Installation
9
-
10
- Add this line to your application's Gemfile:
11
-
12
- ```ruby
13
- gem 'legion'
7
+ ### What does it do?
8
+ LegionIO is an async job engine designed for scheduling tasks and creating relationships between things that wouldn't
9
+ otherwise be connected. Relationships do not have to be a single path. Both of these would work
10
+ * `foo bar cat → dog`
14
11
  ```
12
+ a → b → c
13
+ b → e → z
14
+ e → g
15
+ ```
16
+ In the second scenario, when a runs, it causes b to run which then causes both c and e to run in parallel
17
+
18
+ It supports both conditions and transformation. The idea of a transformation is you can't connect two indepedent services
19
+ and expect them to know how to talk to each other.
20
+
21
+ ### Running
22
+ Run `gem install legionio` to install legion. If you want to use database features, you will need to
23
+ run `gem install legion-data` also.
24
+
25
+ After installing gem you can use the commands `legionio` to start legion, `legion` to access things
26
+ and `lex_gen` to generate a new legion extension
27
+
28
+ ### Example Legion Extensions(LEX)
29
+ * [lex-http](https://bitbucket.org/legion-io/lex-http/src/master/) - Gives legion the ability to make http requests, [docs](https://legionio.atlassian.net/wiki/spaces/LEX/pages/12910593/Lex+Http)
30
+ * [lex-influxdb](https://bitbucket.org/legion-io/lex-influxdb/src/master/) - Write, read, and manage influxdb nodes, [docs](https://legionio.atlassian.net/wiki/spaces/LEX/pages/614891774/Lex+Influxdb)
31
+ * [lex-log](https://bitbucket.org/legion-io/lex-log/src/master/) - Send log items to either stdout or a file with lex-log, [docs](https://legionio.atlassian.net/wiki/spaces/LEX/pages/614858995/Lex+Log)
32
+ * [lex-memcache](https://bitbucket.org/legion-io/lex-memcached/src/master/) - run memcached commands like set, add, append, delete, flush, reset_stats against memcached servers, [docs](https://legionio.atlassian.net/wiki/spaces/LEX/pages/614858753/Lex+Memcached)
33
+ * [lex-pihole](https://bitbucket.org/legion-io/lex-pihole/src/master/) - Allows Legion to interact with [Pi-Hole](https://pi-hole.net/). Can do things like get status, add/remove domains from the list, etc
34
+ * [lex-ping](https://bitbucket.org/legion-io/lex-ping/src/master/) - You can ping things?, [docs](https://legionio.atlassian.net/wiki/spaces/LEX/pages/631373895/Lex+Ping)
35
+ * [lex-pushover](https://bitbucket.org/legion-io/lex-pushover/src/master/) - Connects Legion to [Pushover](https://pushover.net/), [docs]()
36
+ * [lex-redis](https://bitbucket.org/legion-io/lex-redis/src/master/) - similiar to lex-memcached but for redis
37
+ * [lex-sleepiq](https://bitbucket.org/legion-io/lex-sleepiq/src/master/) - Control your SleepIQ bed with Legion!
38
+ * [lex-ssh](https://bitbucket.org/legion-io/lex-ssh/src/master/) - Send commands to a server via SSH in an async fashion, [docs](https://legionio.atlassian.net/wiki/spaces/LEX/pages/614891551/Lex+SSH)
39
+
40
+ Bitbucket repos for extensions that are active or being worked on
41
+ [lex list](https://bitbucket.org/legion-io/workspace/projects/LEX)
42
+ A nice list in the wiki to view all the extensions, their docs and status
43
+ [Legion Extensions](https://legionio.atlassian.net/wiki/spaces/LEX/pages/7864551/Extensions)
44
+
45
+ ### Scheduling Tasks
46
+ 1) Ensure you have the Legion::Data gem installed and configured
47
+ 2) Make sure to have `lex-scheduler` extension installed so that it generates the schedules table in the database
48
+ 3) From there you can add a function to be run at a given cron syntax or interval
49
+ 4) Setting the interval column will make the job run X seconds after the last time it is completed and will ignore the cron colum
50
+ 5) Setting the cron column will ensure the job runs at the given times regardless of when it was run last, only works if interval is null
51
+ 6) Cron supports both `*/5 * * * *` style and verbose like `every minute` and `every day at noon`
52
+
53
+ ### Creating Relationships
54
+ *To be populated*
55
+
56
+ ### Conditions
57
+ You can create complex conditional statements to ensure that when a triggers b, b only runs if certain conditions
58
+ are met. Example conditional statement
59
+ ```json
60
+ {
61
+ "all": [{
62
+ "fact": "pet.type",
63
+ "value": "dog",
64
+ "operator": "equal"
65
+ },{
66
+ "fact":"pet.hungry",
67
+ "operator":"is_true"
68
+ }]
69
+ }
15
70
 
16
- And then execute:
17
-
18
- $ bundle
19
-
20
- Or install it yourself as:
21
-
22
- $ gem install legion
23
-
24
- ## Usage
25
- #### Runing With Bundler
26
-
27
-
28
- #### Installing binary with gem install
29
-
30
-
31
- ## Development
32
-
33
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests.
34
- You can also run `bin/console` for an interactive prompt that will allow you to experiment.
35
-
36
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version,
37
- update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git
38
- tag for the version, push git commits and tags, and push the `.gem` file
39
- to [rubygems.org](https://rubygems.org).
40
-
41
- ## Contributing
42
-
43
- Bug reports and pull requests are welcome on GitHub at https://bitbucket.org/whonodes/legion/issues.
44
- This project is intended to be a safe, welcoming space for collaboration, and contributors are
45
- expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
46
-
47
- ## License
48
-
49
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
71
+ ```
72
+ You can nest conditions in an unlimited fashion to create and/or scenarios to meet your needs
73
+ ```json
74
+ {
75
+ "all": [
76
+ "any":[
77
+ {"fact":"pet.type", "value":"dog","operator":"equal"},
78
+ {"fact":"pet.type", "value":"cat","operator":"equal"}
79
+ ],
80
+ {
81
+ "fact": "pet.hungry",
82
+ "operator": "is_true"
83
+ },{
84
+ "fact":"pet.overweight",
85
+ "operator":"is_false"
86
+ }]
87
+ }
88
+ ```
89
+ *Conditions are supported by the `lex-conditioner` extension and are not required to be run inside the legion framework*
90
+ You can read the docs with more examples in the [wiki](https://legionio.atlassian.net/wiki/spaces/LEX/pages/614957181/Lex+Conditioner)
91
+
92
+
93
+ ### Transformations
94
+ Transformations are a critical piece of interconnecting two independent items. Without it, service B doesn't know what
95
+ to do with the result from service A
96
+ `lex-conditioner` uses a combination of the [tilt](https://rubygems.org/gems/tilt) gem and erb style syntax.
97
+ ##### Examples
98
+ Creating a new pagerduty incident
99
+ ```json
100
+ {"message":"New PagerDuty incident assigned to <%= assignee %> with a priority of <%= severity %>","from":"PagerDuty"}
101
+ ```
102
+ Example transformation to make the `lex-log` extension output a message
103
+ ```json
104
+ {"message":"transform2","level":"fatal"}
105
+ ```
106
+ You can also call Legion services to get the data you need, example sending a pushover message
107
+ ```json
108
+ {"message":"This is my pushover body", "title": "this is my title", "token":"<%= Legion::Settings['lex']['pushover']['token'] %>" }
109
+ ```
110
+ Or if you wanted to make a real time call via `Legion::Crypt` to get a [Hashicorp Vault](https://www.vaultproject.io/) value
111
+ ```json
112
+ {"message":"this is another body", "title":"vault token example", "token":"<%= Legion::Crypt.read('pushover/token') %> "}
113
+ ```
114
+ *Transformations are supported by the `lex-transformation` extension and are not "technically" required to be run inside the legion framework*
115
+ You can read the docs with more examples in the [wiki](https://legionio.atlassian.net/wiki/spaces/LEX/pages/612270222/Lex+Transformer)
116
+
117
+ ## FAQ
118
+ ### Does it scale?
119
+ Yes. Actually quite well. The framework uses RabbitMQ to ensure jobs are scheduled and run in a FIFO order. As you add
120
+ more works, it just subscribes to the queues the workers can support and does more work. It is really geared towards a
121
+ docker/K8 type of environment however it can be run locally, on a VM, etc.
122
+
123
+ As of right now, it has been tested to around 100 workers running in docker without any performance issues. You will
124
+ likely see performance issues on the DB or RabbitMQ side before Legion has issues.
125
+
126
+ Another benefit is that you can run multiple LEXs in one worker or you could have dedicated workers that only run a single LEX.
127
+ In example if you have to make a ton of ssh connections via `lex-ssh`, maybe you want to run 10 pods with no other extensions in them
128
+ but then run a pod with `lex-pagerduty`, `lex-log` and `lex-http` to send out notifications after each ssh task is completed
129
+
130
+ ### High Availability
131
+ Because you can run this thing with multiple processes and it will distribute the work, it is naturally HA oriented.
132
+ if a worker goes down for some reason, another one should pick it up(assuming another work has that LEX enabled). There
133
+ are no hidden features, pay walls, etc to get HA. Just run more instances of LegionIO
134
+
135
+ ### Price and License
136
+ LegionIO is completely free. It was build using free time. There are no features held back, no private repos.
137
+ Everything is under an MIT license to keep it as open as possible. With that, the devs can't always help with support,
138
+ well because it's free.
139
+
140
+ ### Who is it geared for?
141
+ Anyone? Everyone? It could be used in a homelab to automate updating VMs. It could be used by someone to take ESPHome
142
+ sensor data and pipe it to influxdb. At least that is what @Esity does. It could also be used by a company or enterprise looking
143
+ to replace other tools.
144
+
145
+ ### But it is written in ruby
146
+ Yep.
147
+
148
+ ### Similiar projects
149
+ There are multiple projects that are similiar. Some things like IFTTT are great(but is it?) but then again, cost money.
150
+ * [Node-Red](https://nodered.org/) - No HA but has some good features and a great drag and drop interface
151
+ * [n8n.io](https://n8n.io/) - Working on HA but [not there yet](https://github.com/n8n-io/n8n/pull/1294)
152
+ * [StackStorm](https://stackstorm.com/) - Written in Python, has potential but I feel they are removing features to convince you to pay for it
153
+ * [Jenkins](https://www.jenkins.io/) - It's jenkins. I don't need to say anything else
154
+ * [Huginn]() - Another IFTTT style app written in ruby. Not sure on this one but it doesn't have HA from what I can tell [github issue](https://github.com/huginn/huginn/issues/2198)
155
+
156
+ ### Other fun facts
157
+ * Supports Hashicorp vault for storing secrets/settings/etc
158
+ * Can enable global message encryption so that all messages going through RMQ are encrypted with aes-256-cbc
159
+ * Each worker generates a private/public key that can be used for internode communication, it also will generate a cluster secret
160
+ for all nodes to have so they can share data accross the entire cluster. The cluster secret by default is stored only in memory and
161
+ and is generated when the first worker starts
data/Rakefile CHANGED
@@ -29,10 +29,4 @@ namespace :deploy do
29
29
  puts Gem.methods(false)
30
30
  puts Legion::VERSION
31
31
  end
32
-
33
- task :staging do
34
- end
35
-
36
- task :production do
37
- end
38
32
  end
@@ -1,55 +1,19 @@
1
- image: ruby:2.5.0
1
+ image: ruby:2.7
2
2
 
3
3
  pipelines:
4
4
  tags:
5
- '0.1.0':
6
- - step:
7
- caches:
8
- - bundler
9
- deployment: rubygems
10
- script:
11
- - mkdir -p ~/.gem/credentials
12
- - (umask 077 ; echo $gem_creds | base64 --decode > ~/.gem/credentials)
13
- - gem build legion.gemspec
14
- - gem push legionio-*.gem
15
- branches:
16
- master:
17
- - step:
18
- caches:
19
- - bundler
20
- script:
21
- - gem install bundle rubocop
22
- - bundle install
23
- - rubocop
24
- - rake
25
- services:
26
- - mysql
27
- - broker
28
- default:
29
- - step:
30
- caches:
31
- - bundler
32
- script:
33
- - gem install bundle rubocop
34
- - bundle install
35
- - rubocop
36
- - rake
37
- services:
38
- - mysql
39
- - broker
40
- definitions:
41
- caches:
42
- bundler: vendor/bundle
43
- services:
44
- mysql:
45
- image: mysql:5.7
46
- environment:
47
- MYSQL_DATABASE: 'legion'
48
- MYSQL_ROOT_PASSWORD: 'legion'
49
- MYSQL_USER: 'legion'
50
- MYSQL_PASSWORD: 'legion'
51
- broker:
52
- image: rabbitmq:3
53
- environment:
54
- RABBITMQ_DEFAULT_USER: guest
55
- RABBITMQ_DEFAULT_PASS: guest
5
+ "v*":
6
+ - step:
7
+ name: Push to RubyGems
8
+ deployment: RubyGems
9
+ script:
10
+ - gem install gem-release
11
+ - (umask 077 ; echo $gem_creds | base64 --decode > ~/.gem/credentials)
12
+ - gem release
13
+ artifacts:
14
+ - pkg/**
15
+ - step:
16
+ name: Push to Docker
17
+ deployment: Docker
18
+ script:
19
+ - './docker_deploy.rb'