cuboid 0.0.3 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +0 -2
- data/README.md +14 -13
- data/cuboid.gemspec +0 -4
- data/lib/cuboid/application.rb +10 -10
- data/lib/cuboid/option_groups/agent.rb +54 -0
- data/lib/cuboid/option_groups/paths.rb +13 -4
- data/lib/cuboid/options.rb +1 -1
- data/lib/cuboid/processes/{dispatchers.rb → agents.rb} +40 -26
- data/lib/cuboid/processes/executables/agent.rb +5 -0
- data/lib/cuboid/processes/helpers/agents.rb +23 -0
- data/lib/cuboid/processes/helpers/instances.rb +4 -4
- data/lib/cuboid/processes/helpers.rb +1 -1
- data/lib/cuboid/processes/instances.rb +22 -10
- data/lib/cuboid/processes/schedulers.rb +16 -3
- data/lib/cuboid/processes.rb +2 -2
- data/lib/cuboid/report.rb +1 -0
- data/lib/cuboid/rest/server/instance_helpers.rb +13 -13
- data/lib/cuboid/rest/server/routes/dispatcher.rb +11 -11
- data/lib/cuboid/rest/server/routes/grid.rb +8 -8
- data/lib/cuboid/rest/server/routes/instances.rb +1 -1
- data/lib/cuboid/rest/server.rb +5 -5
- data/lib/cuboid/rpc/client/{dispatcher.rb → agent.rb} +4 -4
- data/lib/cuboid/rpc/client/instance.rb +2 -2
- data/lib/cuboid/rpc/client.rb +1 -1
- data/lib/cuboid/rpc/server/agent/node.rb +247 -0
- data/lib/cuboid/rpc/server/{dispatcher → agent}/service.rb +13 -13
- data/lib/cuboid/rpc/server/{dispatcher.rb → agent.rb} +62 -32
- data/lib/cuboid/rpc/server/application_wrapper.rb +6 -4
- data/lib/cuboid/rpc/server/instance.rb +4 -4
- data/lib/cuboid/rpc/server/scheduler.rb +13 -12
- data/lib/cuboid.rb +0 -3
- data/lib/version +1 -1
- data/spec/cuboid/option_groups/dispatcher_spec.rb +2 -2
- data/spec/cuboid/option_groups/paths_spec.rb +6 -3
- data/spec/cuboid/rest/server_spec.rb +46 -46
- data/spec/cuboid/rpc/client/dispatcher_spec.rb +2 -2
- data/spec/cuboid/rpc/server/dispatcher/node_spec.rb +65 -65
- data/spec/cuboid/rpc/server/dispatcher/service_spec.rb +16 -16
- data/spec/cuboid/rpc/server/dispatcher_spec.rb +187 -72
- data/spec/cuboid/rpc/server/scheduler_spec.rb +8 -8
- data/spec/support/fixtures/executables/node.rb +3 -3
- data/spec/support/fixtures/mock_app/test_service.rb +8 -8
- data/spec/support/fixtures/mock_app.rb +1 -1
- data/spec/support/fixtures/services/echo.rb +6 -6
- data/spec/support/helpers/resets.rb +1 -1
- data/spec/support/lib/web_server_client.rb +2 -2
- data/spec/support/lib/web_server_dispatcher.rb +1 -1
- data/spec/support/logs/Agent - 2486896-44236.log +6 -0
- data/spec/support/logs/Agent - 2487229-16390.log +6 -0
- data/spec/support/logs/Agent - 2487520-2511.log +6 -0
- data/spec/support/logs/Agent - 2487522-24008.log +6 -0
- data/spec/support/logs/Agent - 2487526-3383.log +6 -0
- data/spec/support/logs/Agent - 2487528-23713.log +10 -0
- data/spec/support/logs/Agent - 2487530-42875.log +10 -0
- data/spec/support/logs/Agent - 2487533-14182.log +10 -0
- data/spec/support/logs/Agent - 2487535-32486.log +10 -0
- data/spec/support/logs/Agent - 2487537-30578.log +10 -0
- data/spec/support/logs/Agent - 2487539-65402.log +10 -0
- data/spec/support/logs/Agent - 2493974-23066.log +6 -0
- data/spec/support/logs/Agent - 2501716-11729.log +6 -0
- data/spec/support/logs/Agent - 2501724-48638.log +6 -0
- data/spec/support/logs/Agent - 2501961-60077.log +6 -0
- data/spec/support/logs/Agent - 2501976-10941.log +10 -0
- data/spec/support/logs/Agent - 2502050-45312.log +10 -0
- data/spec/support/logs/Agent - 2502131-45940.log +10 -0
- data/spec/support/logs/Agent - 2502139-59848.log +10 -0
- data/spec/support/logs/Agent - 2502262-46629.log +10 -0
- data/spec/support/logs/Agent - 2502298-28395.log +10 -0
- data/spec/support/logs/Scheduler - 2486608-59709.log +3 -0
- data/spec/support/logs/Scheduler - 2486612-44110.log +27 -0
- data/spec/support/logs/Scheduler - 2486723-50393.log +3 -0
- data/spec/support/logs/Scheduler - 2486727-21620.log +27 -0
- data/spec/support/logs/Scheduler - 2486877-37845.log +3 -0
- data/spec/support/logs/Scheduler - 2486881-3624.log +1 -0
- data/spec/support/logs/Scheduler - 2486911-24752.log +3 -0
- data/spec/support/logs/Scheduler - 2486919-48535.log +27 -0
- data/spec/support/logs/Scheduler - 2486985-8897.log +1 -0
- data/spec/support/logs/Scheduler - 2487211-7516.log +3 -0
- data/spec/support/logs/Scheduler - 2487215-2831.log +1 -0
- data/spec/support/logs/Scheduler - 2487246-7826.log +3 -0
- data/spec/support/logs/Scheduler - 2487256-35669.log +6 -0
- data/spec/support/logs/Scheduler - 2487272-11542.log +4 -0
- data/spec/support/logs/Scheduler - 2487278-9621.log +1 -0
- data/spec/support/logs/Scheduler - 2487291-24094.log +3 -0
- data/spec/support/logs/Scheduler - 2487299-60095.log +6 -0
- data/spec/support/logs/Scheduler - 2487368-7706.log +3 -0
- data/spec/support/logs/Scheduler - 2487378-9859.log +6 -0
- data/spec/support/logs/Scheduler - 2487396-17812.log +3 -0
- data/spec/support/logs/Scheduler - 2487407-25543.log +6 -0
- data/spec/support/logs/Scheduler - 2487451-44767.log +4 -0
- data/spec/support/logs/Scheduler - 2487506-1422.log +6 -0
- data/spec/support/logs/Scheduler - 2487541-38068.log +1 -0
- data/spec/support/logs/Scheduler - 2487544-21866.log +1 -0
- data/spec/support/logs/Scheduler - 2487548-15245.log +1 -0
- data/spec/support/logs/Scheduler - 2487551-34905.log +1 -0
- data/spec/support/logs/Scheduler - 2487554-22142.log +1 -0
- data/spec/support/logs/Scheduler - 2487562-35113.log +1 -0
- data/spec/support/logs/Scheduler - 2487565-55125.log +3 -0
- data/spec/support/logs/Scheduler - 2487569-48845.log +6 -0
- data/spec/support/logs/Scheduler - 2487576-57192.log +4 -0
- data/spec/support/logs/Scheduler - 2487583-17991.log +1 -0
- data/spec/support/logs/Scheduler - 2487586-30014.log +1 -0
- data/spec/support/logs/Scheduler - 2487591-6472.log +1 -0
- data/spec/support/logs/Scheduler - 2487594-2195.log +1 -0
- data/spec/support/logs/Scheduler - 2487598-55808.log +3 -0
- data/spec/support/logs/Scheduler - 2487605-7400.log +1 -0
- data/spec/support/logs/Scheduler - 2487607-4337.log +1 -0
- data/spec/support/logs/Scheduler - 2487610-25835.log +1 -0
- data/spec/support/logs/Scheduler - 2493623-45209.log +3 -0
- data/spec/support/logs/Scheduler - 2493714-59407.log +1 -0
- data/spec/support/logs/Scheduler - 2494470-61696.log +3 -0
- data/spec/support/logs/Scheduler - 2494723-2810.log +6 -0
- data/spec/support/logs/Scheduler - 2495458-22112.log +4 -0
- data/spec/support/logs/Scheduler - 2496034-4076.log +1 -0
- data/spec/support/logs/Scheduler - 2496119-62253.log +3 -0
- data/spec/support/logs/Scheduler - 2496210-50380.log +6 -0
- data/spec/support/logs/Scheduler - 2497536-24922.log +3 -0
- data/spec/support/logs/Scheduler - 2497786-13515.log +6 -0
- data/spec/support/logs/Scheduler - 2498774-16911.log +3 -0
- data/spec/support/logs/Scheduler - 2498961-4742.log +6 -0
- data/spec/support/logs/Scheduler - 2500340-16045.log +4 -0
- data/spec/support/logs/Scheduler - 2500980-26158.log +6 -0
- data/spec/support/logs/Scheduler - 2502381-26435.log +1 -0
- data/spec/support/logs/Scheduler - 2502463-62965.log +1 -0
- data/spec/support/logs/Scheduler - 2502547-53434.log +1 -0
- data/spec/support/logs/Scheduler - 2502628-43720.log +1 -0
- data/spec/support/logs/Scheduler - 2502643-58379.log +1 -0
- data/spec/support/logs/Scheduler - 2502873-64893.log +1 -0
- data/spec/support/logs/Scheduler - 2502954-43885.log +3 -0
- data/spec/support/logs/Scheduler - 2503039-52147.log +6 -0
- data/spec/support/logs/Scheduler - 2503768-28831.log +4 -0
- data/spec/support/logs/Scheduler - 2504259-24533.log +1 -0
- data/spec/support/logs/Scheduler - 2504343-56967.log +1 -0
- data/spec/support/logs/Scheduler - 2504502-25085.log +1 -0
- data/spec/support/logs/Scheduler - 2504587-30789.log +1 -0
- data/spec/support/logs/Scheduler - 2504608-56601.log +3 -0
- data/spec/support/logs/Scheduler - 2504760-36374.log +1 -0
- data/spec/support/logs/Scheduler - 2504841-49675.log +1 -0
- data/spec/support/logs/Scheduler - 2504923-15781.log +1 -0
- data/spec/support/reports/18be00bff4371738c7c7013b284b415b.crf +0 -0
- data/spec/support/reports/1ca39d410c2cf1f652eb8c320d6682bd.crf +0 -0
- data/spec/support/reports/266a09d73152ce2f3d2951f1dab133f3.crf +0 -0
- data/spec/support/reports/2929bee9c126b2695dc569b693fef574.crf +0 -0
- data/spec/support/reports/2b9ce956f7060163d7a0b78603dc05ca.crf +0 -0
- data/spec/support/reports/46bcffd844008e71c7d90a76baf8597d.crf +0 -0
- data/spec/support/reports/620287cfdc373595385cf2471e1d4523.crf +0 -0
- data/spec/support/reports/75fecdd5e006942292e02e6a223e7279.crf +0 -0
- data/spec/support/reports/81cca53163bbab5ccf4d5f0401d5adcd.crf +0 -0
- data/spec/support/reports/8c204ee129fe1bd6c5964d29ae5d03ae.crf +0 -0
- data/spec/support/reports/aadbf2c1544b0e11174853fb4883a38c.crf +0 -0
- data/spec/support/reports/c360a2833f3e635e69036916010edeac.crf +0 -0
- data/spec/support/reports/e96abea937f1ed3f89bc2ec5397522db.crf +0 -0
- data/spec/support/reports/f3d542036e17f6a66e11bfacb2fb3366.crf +0 -0
- data/spec/support/snapshots/Cuboid 2022-02-01 13_10_28 +0200 a06d9bd7db81b1b4fb077ceadcc3895f.csf +0 -0
- data/spec/support/snapshots/Cuboid 2022-02-01 13_10_42 +0200 36c68859faf144eed9ff9c01ae754217.csf +0 -0
- data/spec/support/snapshots/Cuboid 2022-02-01 13_24_42 +0200 5a26112a913330ee8763b2982a4d42df.csf +0 -0
- data/spec/support/snapshots/Cuboid 2022-02-01 13_24_56 +0200 190856b98ac7099eb553ed3abcfbcb87.csf +0 -0
- metadata +306 -768
- data/lib/cuboid/option_groups/dispatcher.rb +0 -38
- data/lib/cuboid/processes/executables/dispatcher.rb +0 -5
- data/lib/cuboid/processes/helpers/dispatchers.rb +0 -23
- data/lib/cuboid/rpc/server/dispatcher/node.rb +0 -247
- data/logs/error-3207383.log +0 -106
- data/logs/error-3207482.log +0 -106
- data/logs/error-3208344.log +0 -109
- data/logs/error-3208460.log +0 -106
- data/logs/error-903730.log +0 -105
- data/logs/error-903846.log +0 -105
- data/logs/error-904783.log +0 -108
- data/logs/error-905101.log +0 -105
- data/spec/support/logs/Dispatcher - 3204062-27546.log +0 -6
- data/spec/support/logs/Dispatcher - 3207166-30195.log +0 -6
- data/spec/support/logs/Dispatcher - 3207418-16491.log +0 -6
- data/spec/support/logs/Dispatcher - 3207420-23797.log +0 -6
- data/spec/support/logs/Dispatcher - 3207424-64333.log +0 -6
- data/spec/support/logs/Dispatcher - 3207427-50621.log +0 -10
- data/spec/support/logs/Dispatcher - 3207429-15351.log +0 -10
- data/spec/support/logs/Dispatcher - 3207432-3685.log +0 -10
- data/spec/support/logs/Dispatcher - 3207436-43126.log +0 -10
- data/spec/support/logs/Dispatcher - 3207438-58131.log +0 -10
- data/spec/support/logs/Dispatcher - 3207440-32187.log +0 -10
- data/spec/support/logs/Dispatcher - 3207654-42085.log +0 -6
- data/spec/support/logs/Dispatcher - 3207769-16303.log +0 -6
- data/spec/support/logs/Dispatcher - 3207771-31196.log +0 -6
- data/spec/support/logs/Dispatcher - 3207773-53419.log +0 -6
- data/spec/support/logs/Dispatcher - 3207775-17015.log +0 -6
- data/spec/support/logs/Dispatcher - 3207787-56572.log +0 -6
- data/spec/support/logs/Dispatcher - 3207799-41227.log +0 -6
- data/spec/support/logs/Dispatcher - 3207815-49397.log +0 -6
- data/spec/support/logs/Dispatcher - 3207817-13826.log +0 -6
- data/spec/support/logs/Dispatcher - 3207819-46821.log +0 -6
- data/spec/support/logs/Dispatcher - 3207821-37991.log +0 -6
- data/spec/support/logs/Dispatcher - 3207825-52955.log +0 -6
- data/spec/support/logs/Dispatcher - 3207829-12122.log +0 -6
- data/spec/support/logs/Dispatcher - 3207831-58485.log +0 -16
- data/spec/support/logs/Dispatcher - 3207833-47083.log +0 -14
- data/spec/support/logs/Dispatcher - 3207837-53679.log +0 -10
- data/spec/support/logs/Dispatcher - 3207847-12037.log +0 -16
- data/spec/support/logs/Dispatcher - 3207852-64296.log +0 -14
- data/spec/support/logs/Dispatcher - 3207858-56473.log +0 -10
- data/spec/support/logs/Dispatcher - 3207864-26736.log +0 -6
- data/spec/support/logs/Dispatcher - 3207866-24113.log +0 -6
- data/spec/support/logs/Dispatcher - 3207870-6896.log +0 -6
- data/spec/support/logs/Dispatcher - 3207873-16434.log +0 -6
- data/spec/support/logs/Dispatcher - 3207885-31058.log +0 -6
- data/spec/support/logs/Dispatcher - 3207891-19927.log +0 -6
- data/spec/support/logs/Dispatcher - 3207897-41533.log +0 -6
- data/spec/support/logs/Dispatcher - 3207903-26815.log +0 -6
- data/spec/support/logs/Dispatcher - 3207909-25294.log +0 -6
- data/spec/support/logs/Dispatcher - 3207929-51610.log +0 -6
- data/spec/support/logs/Dispatcher - 3207990-8943.log +0 -16
- data/spec/support/logs/Dispatcher - 3208000-30657.log +0 -14
- data/spec/support/logs/Dispatcher - 3208010-54017.log +0 -10
- data/spec/support/logs/Dispatcher - 3208041-58792.log +0 -16
- data/spec/support/logs/Dispatcher - 3208047-50811.log +0 -14
- data/spec/support/logs/Dispatcher - 3208051-52018.log +0 -10
- data/spec/support/logs/Dispatcher - 3208067-46852.log +0 -6
- data/spec/support/logs/Dispatcher - 3208075-56209.log +0 -6
- data/spec/support/logs/Dispatcher - 3208088-4783.log +0 -6
- data/spec/support/logs/Dispatcher - 3208100-47518.log +0 -6
- data/spec/support/logs/Dispatcher - 3208115-25109.log +0 -6
- data/spec/support/logs/Dispatcher - 3208127-46551.log +0 -6
- data/spec/support/logs/Dispatcher - 3208133-2576.log +0 -6
- data/spec/support/logs/Dispatcher - 3208138-25988.log +0 -6
- data/spec/support/logs/Dispatcher - 3208299-19611.log +0 -6
- data/spec/support/logs/Dispatcher - 3208330-35076.log +0 -6
- data/spec/support/logs/Dispatcher - 3208340-32759.log +0 -6
- data/spec/support/logs/Dispatcher - 903393-34771.log +0 -6
- data/spec/support/logs/Dispatcher - 903765-19862.log +0 -6
- data/spec/support/logs/Dispatcher - 903767-43611.log +0 -6
- data/spec/support/logs/Dispatcher - 903770-34337.log +0 -6
- data/spec/support/logs/Dispatcher - 903774-7484.log +0 -10
- data/spec/support/logs/Dispatcher - 903777-5256.log +0 -10
- data/spec/support/logs/Dispatcher - 903780-12391.log +0 -10
- data/spec/support/logs/Dispatcher - 903782-54621.log +0 -10
- data/spec/support/logs/Dispatcher - 903786-46071.log +0 -10
- data/spec/support/logs/Dispatcher - 903794-48819.log +0 -10
- data/spec/support/logs/Dispatcher - 903906-54562.log +0 -6
- data/spec/support/logs/Dispatcher - 904068-37293.log +0 -6
- data/spec/support/logs/Dispatcher - 904070-53492.log +0 -6
- data/spec/support/logs/Dispatcher - 904073-27607.log +0 -6
- data/spec/support/logs/Dispatcher - 904075-41641.log +0 -6
- data/spec/support/logs/Dispatcher - 904099-53541.log +0 -6
- data/spec/support/logs/Dispatcher - 904112-10508.log +0 -6
- data/spec/support/logs/Dispatcher - 904132-5791.log +0 -6
- data/spec/support/logs/Dispatcher - 904141-56406.log +0 -6
- data/spec/support/logs/Dispatcher - 904147-21550.log +0 -6
- data/spec/support/logs/Dispatcher - 904149-20120.log +0 -6
- data/spec/support/logs/Dispatcher - 904155-33639.log +0 -6
- data/spec/support/logs/Dispatcher - 904161-53730.log +0 -6
- data/spec/support/logs/Dispatcher - 904169-49991.log +0 -16
- data/spec/support/logs/Dispatcher - 904172-39635.log +0 -14
- data/spec/support/logs/Dispatcher - 904192-9525.log +0 -10
- data/spec/support/logs/Dispatcher - 904206-3529.log +0 -16
- data/spec/support/logs/Dispatcher - 904211-16856.log +0 -14
- data/spec/support/logs/Dispatcher - 904216-49974.log +0 -10
- data/spec/support/logs/Dispatcher - 904228-16891.log +0 -6
- data/spec/support/logs/Dispatcher - 904231-34999.log +0 -6
- data/spec/support/logs/Dispatcher - 904236-50872.log +0 -6
- data/spec/support/logs/Dispatcher - 904238-25464.log +0 -6
- data/spec/support/logs/Dispatcher - 904251-43339.log +0 -6
- data/spec/support/logs/Dispatcher - 904256-18461.log +0 -6
- data/spec/support/logs/Dispatcher - 904266-59699.log +0 -6
- data/spec/support/logs/Dispatcher - 904279-17401.log +0 -6
- data/spec/support/logs/Dispatcher - 904289-48953.log +0 -6
- data/spec/support/logs/Dispatcher - 904309-22599.log +0 -6
- data/spec/support/logs/Dispatcher - 904386-44447.log +0 -16
- data/spec/support/logs/Dispatcher - 904409-51015.log +0 -14
- data/spec/support/logs/Dispatcher - 904420-34336.log +0 -10
- data/spec/support/logs/Dispatcher - 904455-24852.log +0 -16
- data/spec/support/logs/Dispatcher - 904459-54769.log +0 -14
- data/spec/support/logs/Dispatcher - 904464-49280.log +0 -10
- data/spec/support/logs/Dispatcher - 904490-41571.log +0 -6
- data/spec/support/logs/Dispatcher - 904495-62362.log +0 -6
- data/spec/support/logs/Dispatcher - 904517-14314.log +0 -6
- data/spec/support/logs/Dispatcher - 904529-30060.log +0 -6
- data/spec/support/logs/Dispatcher - 904538-61870.log +0 -6
- data/spec/support/logs/Dispatcher - 904553-59343.log +0 -6
- data/spec/support/logs/Dispatcher - 904563-59027.log +0 -6
- data/spec/support/logs/Dispatcher - 904576-62144.log +0 -6
- data/spec/support/logs/Dispatcher - 904742-2935.log +0 -6
- data/spec/support/logs/Dispatcher - 904771-62183.log +0 -6
- data/spec/support/logs/Dispatcher - 904780-13353.log +0 -6
- data/spec/support/logs/Instance - 3208178-11741.error.log +0 -106
- data/spec/support/logs/Instance - 3208181-15143.error.log +0 -106
- data/spec/support/logs/Instance - 3208183-7742.error.log +0 -106
- data/spec/support/logs/Instance - 904628-41184.error.log +0 -105
- data/spec/support/logs/Instance - 904631-38626.error.log +0 -105
- data/spec/support/logs/Instance - 904634-37879.error.log +0 -105
- data/spec/support/logs/Scheduler - 3203309-65225.log +0 -3
- data/spec/support/logs/Scheduler - 3203315-52999.log +0 -6
- data/spec/support/logs/Scheduler - 3204127-50400.log +0 -3
- data/spec/support/logs/Scheduler - 3204138-29313.log +0 -6
- data/spec/support/logs/Scheduler - 3204154-9476.log +0 -4
- data/spec/support/logs/Scheduler - 3204163-52855.log +0 -1
- data/spec/support/logs/Scheduler - 3204175-31574.log +0 -3
- data/spec/support/logs/Scheduler - 3204194-7097.log +0 -6
- data/spec/support/logs/Scheduler - 3204251-11724.log +0 -3
- data/spec/support/logs/Scheduler - 3204262-10820.log +0 -4
- data/spec/support/logs/Scheduler - 3207131-48958.log +0 -3
- data/spec/support/logs/Scheduler - 3207138-8974.log +0 -6
- data/spec/support/logs/Scheduler - 3207187-62652.log +0 -3
- data/spec/support/logs/Scheduler - 3207197-19207.log +0 -6
- data/spec/support/logs/Scheduler - 3207218-27080.log +0 -4
- data/spec/support/logs/Scheduler - 3207228-4393.log +0 -1
- data/spec/support/logs/Scheduler - 3207240-7381.log +0 -3
- data/spec/support/logs/Scheduler - 3207252-53772.log +0 -6
- data/spec/support/logs/Scheduler - 3207306-56622.log +0 -3
- data/spec/support/logs/Scheduler - 3207318-9939.log +0 -6
- data/spec/support/logs/Scheduler - 3207342-36988.log +0 -3
- data/spec/support/logs/Scheduler - 3207352-31746.log +0 -6
- data/spec/support/logs/Scheduler - 3207383-56973.log +0 -4
- data/spec/support/logs/Scheduler - 3207400-19390.log +0 -6
- data/spec/support/logs/Scheduler - 3207442-63021.log +0 -1
- data/spec/support/logs/Scheduler - 3207445-42476.log +0 -1
- data/spec/support/logs/Scheduler - 3207450-45489.log +0 -1
- data/spec/support/logs/Scheduler - 3207453-18262.log +0 -1
- data/spec/support/logs/Scheduler - 3207458-47234.log +0 -1
- data/spec/support/logs/Scheduler - 3207462-5628.log +0 -1
- data/spec/support/logs/Scheduler - 3207464-14620.log +0 -3
- data/spec/support/logs/Scheduler - 3207468-4793.log +0 -6
- data/spec/support/logs/Scheduler - 3207482-45268.log +0 -4
- data/spec/support/logs/Scheduler - 3207494-44991.log +0 -1
- data/spec/support/logs/Scheduler - 3207498-21429.log +0 -1
- data/spec/support/logs/Scheduler - 3207503-54136.log +0 -1
- data/spec/support/logs/Scheduler - 3207507-43714.log +0 -1
- data/spec/support/logs/Scheduler - 3207512-38735.log +0 -3
- data/spec/support/logs/Scheduler - 3207516-64075.log +0 -1
- data/spec/support/logs/Scheduler - 3207523-26974.log +0 -1
- data/spec/support/logs/Scheduler - 3207527-30807.log +0 -1
- data/spec/support/logs/Scheduler - 3208261-26059.log +0 -16
- data/spec/support/logs/Scheduler - 3208278-13735.log +0 -6
- data/spec/support/logs/Scheduler - 3208287-55638.log +0 -6
- data/spec/support/logs/Scheduler - 3208303-38465.log +0 -6
- data/spec/support/logs/Scheduler - 3208334-43532.log +0 -3
- data/spec/support/logs/Scheduler - 3208344-20376.log +0 -5
- data/spec/support/logs/Scheduler - 3208351-38224.log +0 -1
- data/spec/support/logs/Scheduler - 3208355-9843.log +0 -1
- data/spec/support/logs/Scheduler - 3208357-43942.log +0 -1
- data/spec/support/logs/Scheduler - 3208360-58330.log +0 -1
- data/spec/support/logs/Scheduler - 3208363-23807.log +0 -1
- data/spec/support/logs/Scheduler - 3208366-29256.log +0 -1
- data/spec/support/logs/Scheduler - 3208369-25684.log +0 -1
- data/spec/support/logs/Scheduler - 3208372-28479.log +0 -3
- data/spec/support/logs/Scheduler - 3208382-34006.log +0 -3
- data/spec/support/logs/Scheduler - 3208396-57942.log +0 -3
- data/spec/support/logs/Scheduler - 3208402-34617.log +0 -3
- data/spec/support/logs/Scheduler - 3208406-31477.log +0 -4
- data/spec/support/logs/Scheduler - 3208418-25154.log +0 -1
- data/spec/support/logs/Scheduler - 3208423-3948.log +0 -4
- data/spec/support/logs/Scheduler - 3208428-21648.log +0 -1
- data/spec/support/logs/Scheduler - 3208434-64685.log +0 -1
- data/spec/support/logs/Scheduler - 3208440-58157.log +0 -16
- data/spec/support/logs/Scheduler - 3208460-6293.log +0 -4
- data/spec/support/logs/Scheduler - 3208467-29409.log +0 -1
- data/spec/support/logs/Scheduler - 3208470-12825.log +0 -1
- data/spec/support/logs/Scheduler - 3208473-52401.log +0 -1
- data/spec/support/logs/Scheduler - 3208476-6567.log +0 -1
- data/spec/support/logs/Scheduler - 3208480-28476.log +0 -3
- data/spec/support/logs/Scheduler - 3208488-36893.log +0 -1
- data/spec/support/logs/Scheduler - 3208490-11932.log +0 -1
- data/spec/support/logs/Scheduler - 3208493-56676.log +0 -1
- data/spec/support/logs/Scheduler - 3208509-46176.log +0 -1
- data/spec/support/logs/Scheduler - 3208513-14321.log +0 -1
- data/spec/support/logs/Scheduler - 3208517-10539.log +0 -1
- data/spec/support/logs/Scheduler - 3208521-30079.log +0 -2
- data/spec/support/logs/Scheduler - 903345-9616.log +0 -3
- data/spec/support/logs/Scheduler - 903353-58507.log +0 -6
- data/spec/support/logs/Scheduler - 903417-55835.log +0 -3
- data/spec/support/logs/Scheduler - 903427-18261.log +0 -6
- data/spec/support/logs/Scheduler - 903439-36633.log +0 -4
- data/spec/support/logs/Scheduler - 903455-41936.log +0 -1
- data/spec/support/logs/Scheduler - 903506-60484.log +0 -3
- data/spec/support/logs/Scheduler - 903519-10519.log +0 -6
- data/spec/support/logs/Scheduler - 903593-8109.log +0 -3
- data/spec/support/logs/Scheduler - 903614-61308.log +0 -6
- data/spec/support/logs/Scheduler - 903667-39623.log +0 -3
- data/spec/support/logs/Scheduler - 903683-35117.log +0 -6
- data/spec/support/logs/Scheduler - 903730-34262.log +0 -4
- data/spec/support/logs/Scheduler - 903747-57287.log +0 -6
- data/spec/support/logs/Scheduler - 903798-40499.log +0 -1
- data/spec/support/logs/Scheduler - 903801-5479.log +0 -1
- data/spec/support/logs/Scheduler - 903806-11293.log +0 -1
- data/spec/support/logs/Scheduler - 903811-52201.log +0 -1
- data/spec/support/logs/Scheduler - 903813-54636.log +0 -1
- data/spec/support/logs/Scheduler - 903827-5581.log +0 -1
- data/spec/support/logs/Scheduler - 903830-48439.log +0 -3
- data/spec/support/logs/Scheduler - 903835-17198.log +0 -6
- data/spec/support/logs/Scheduler - 903846-28718.log +0 -4
- data/spec/support/logs/Scheduler - 903855-45172.log +0 -1
- data/spec/support/logs/Scheduler - 903864-11909.log +0 -1
- data/spec/support/logs/Scheduler - 903869-1794.log +0 -1
- data/spec/support/logs/Scheduler - 903873-59405.log +0 -1
- data/spec/support/logs/Scheduler - 903880-3155.log +0 -3
- data/spec/support/logs/Scheduler - 903887-52240.log +0 -1
- data/spec/support/logs/Scheduler - 903889-27541.log +0 -1
- data/spec/support/logs/Scheduler - 903895-16003.log +0 -1
- data/spec/support/logs/Scheduler - 904706-61946.log +0 -16
- data/spec/support/logs/Scheduler - 904725-2441.log +0 -6
- data/spec/support/logs/Scheduler - 904736-12992.log +0 -6
- data/spec/support/logs/Scheduler - 904744-61626.log +0 -6
- data/spec/support/logs/Scheduler - 904774-45665.log +0 -3
- data/spec/support/logs/Scheduler - 904783-51443.log +0 -5
- data/spec/support/logs/Scheduler - 904791-45170.log +0 -1
- data/spec/support/logs/Scheduler - 904793-58901.log +0 -1
- data/spec/support/logs/Scheduler - 904801-2336.log +0 -1
- data/spec/support/logs/Scheduler - 904803-10954.log +0 -1
- data/spec/support/logs/Scheduler - 904806-25343.log +0 -1
- data/spec/support/logs/Scheduler - 904810-23633.log +0 -1
- data/spec/support/logs/Scheduler - 904814-27547.log +0 -1
- data/spec/support/logs/Scheduler - 904819-53508.log +0 -3
- data/spec/support/logs/Scheduler - 904826-41103.log +0 -3
- data/spec/support/logs/Scheduler - 904835-20113.log +0 -3
- data/spec/support/logs/Scheduler - 904866-61722.log +0 -3
- data/spec/support/logs/Scheduler - 904878-18373.log +0 -4
- data/spec/support/logs/Scheduler - 904999-46113.log +0 -1
- data/spec/support/logs/Scheduler - 905011-23507.log +0 -4
- data/spec/support/logs/Scheduler - 905017-8299.log +0 -1
- data/spec/support/logs/Scheduler - 905028-51728.log +0 -1
- data/spec/support/logs/Scheduler - 905031-16092.log +0 -16
- data/spec/support/logs/Scheduler - 905101-65244.log +0 -4
- data/spec/support/logs/Scheduler - 905224-20698.log +0 -1
- data/spec/support/logs/Scheduler - 905234-53973.log +0 -1
- data/spec/support/logs/Scheduler - 905241-48042.log +0 -1
- data/spec/support/logs/Scheduler - 905334-30796.log +0 -1
- data/spec/support/logs/Scheduler - 905337-14399.log +0 -3
- data/spec/support/logs/Scheduler - 905350-31560.log +0 -1
- data/spec/support/logs/Scheduler - 905353-63541.log +0 -1
- data/spec/support/logs/Scheduler - 905359-22685.log +0 -1
- data/spec/support/logs/Scheduler - 905362-31483.log +0 -1
- data/spec/support/logs/Scheduler - 905365-28301.log +0 -1
- data/spec/support/logs/Scheduler - 905369-51335.log +0 -1
- data/spec/support/logs/Scheduler - 905373-43552.log +0 -2
- data/spec/support/logs/error-3206970.log +0 -801
- data/spec/support/logs/error-903103.log +0 -797
- data/spec/support/logs/output_spec_3206970.log +0 -390
- data/spec/support/logs/output_spec_903103.log +0 -390
- data/spec/support/reports/010223f6102d7d7ef50d7061f5a7c120.crf +0 -0
- data/spec/support/reports/0efcc0441bc58e27299737fc0e8bdb4a.crf +0 -0
- data/spec/support/reports/1444c78cae8a70d9a8f64a5b84579248.crf +0 -0
- data/spec/support/reports/16d1cdae64bbcf0b2083bc1870940fe8.crf +0 -0
- data/spec/support/reports/22cd328dd5adf2e5830db3eaf3e6d2fa.crf +0 -0
- data/spec/support/reports/26f5f97b84015ea1b3ebfaa04e6863f2.crf +0 -0
- data/spec/support/reports/40d544db82e9be4328c8bb16f2abbe96.crf +0 -0
- data/spec/support/reports/432466f64ec7b3a9e3a51e6c0c0f2b68.crf +0 -0
- data/spec/support/reports/493d52465fdd74388e1c1769e738fe0a.crf +0 -0
- data/spec/support/reports/49593f3c7dcff9466cebd4a3f71df16e.crf +0 -0
- data/spec/support/reports/4a875ccf578b82ea8af0661d09a0c9a2.crf +0 -0
- data/spec/support/reports/4fe265d0f318a758fff8f9c117d85c70.crf +0 -0
- data/spec/support/reports/5405af2d7e6bdba82761b3deb0316abb.crf +0 -0
- data/spec/support/reports/5801342bc5e7553ca065d9fc76b80a31.crf +0 -0
- data/spec/support/reports/5ca817d21692604d643a1ec4b9d698f8.crf +0 -0
- data/spec/support/reports/60a48dd87c16aaba48705cfa1102e6f0.crf +0 -0
- data/spec/support/reports/61b93d5be434e58e8286bc24375df5a6.crf +0 -0
- data/spec/support/reports/62ae63c7a653ccc450a042c83be6272e.crf +0 -0
- data/spec/support/reports/6dfba35f84478f2f8740989650e5c9b2.crf +0 -0
- data/spec/support/reports/72d8ff7e33ea0a4fa3208de46060ecb4.crf +0 -0
- data/spec/support/reports/7e73587e8be563c70f2864bb9982d4ac.crf +0 -0
- data/spec/support/reports/8a20cd9e7ea1f083c463f85990e48b9d.crf +0 -0
- data/spec/support/reports/8e22c8f69d18bfdc387ac2e2c73fd994.crf +0 -0
- data/spec/support/reports/99de7d4c926e154d9df18bbb66044360.crf +0 -0
- data/spec/support/reports/a8cda3f125d6de78da7e601e17ae02e0.crf +0 -0
- data/spec/support/reports/aa6b3e0cabbfa8f622cc3faa5e70d82d.crf +0 -0
- data/spec/support/reports/ad7582cad690ca1f6ec5529766dacecd.crf +0 -0
- data/spec/support/reports/af253c3c9e54c7efc1eb19a1ba0bc45b.crf +0 -0
- data/spec/support/reports/b57af832ae733e1a4182138f8373029d.crf +0 -0
- data/spec/support/reports/c266644ae90cff19058101b06c2410bd.crf +0 -0
- data/spec/support/reports/c684686518f8bb5af1fc05632b2ee3a1.crf +0 -0
- data/spec/support/reports/d0de163911157b30b56076653a01bd04.crf +0 -0
- data/spec/support/reports/d11cb8c19f0ef398e393e461d48fab49.crf +0 -0
- data/spec/support/reports/d29486b6155119827e12d512f38cf1a5.crf +0 -0
- data/spec/support/reports/d6348fa0f269cef7861d8a55ccb817b8.crf +0 -0
- data/spec/support/reports/d68cddd22874664f66ea296768de93cb.crf +0 -0
- data/spec/support/reports/d73172a30f03f6e4f73e77a379876368.crf +0 -0
- data/spec/support/reports/e0113960b4015876416519d1e36c6174.crf +0 -0
- data/spec/support/reports/e684ad3b2061330bf8016b0cda4c8aeb.crf +0 -0
- data/spec/support/reports/e6bec3c23e6367f309a43b6faec6c1af.crf +0 -0
- data/spec/support/reports/eadbebf5e6e8a2b325cdc82a4a667d1a.crf +0 -0
- data/spec/support/reports/fe4ca4a133464c018e8405dd73064f04.crf +0 -0
- data/spec/support/snapshots/Cuboid 2021-11-28 11_34_27 +0200 7757c257352bfa7abdfc764fa978115c.csf +0 -0
- data/spec/support/snapshots/Cuboid 2021-11-28 11_34_41 +0200 30367c49c18c17b84f6cdbfad6fe8209.csf +0 -0
- data/spec/support/snapshots/Cuboid 2021-11-28 11_35_24 +0200 0faa83c7ec023eca9e68e959b2b6a991.csf +0 -0
- data/spec/support/snapshots/Cuboid 2021-11-28 11_35_38 +0200 e61c3dae449133e330c24f9d1d34bc17.csf +0 -0
- data/spec/support/snapshots/Cuboid 2021-11-28 11_45_36 +0200 ef5b013868ce241f47ebef4f0ee96d23.csf +0 -0
- data/spec/support/snapshots/Cuboid 2021-11-28 11_45_42 +0200 ae63b2e851a211039d4dfa999bfc1f79.csf +0 -0
- data/spec/support/snapshots/Cuboid 2021-11-28 11_45_45 +0200 59a5d8a5ef5de0937e0d8a697d3a06cb.csf +0 -0
- data/spec/support/snapshots/Cuboid 2021-12-26 08_10_45 +0200 7534324302d1127f33460417057c0d99.csf +0 -0
- data/spec/support/snapshots/Cuboid 2021-12-26 08_10_59 +0200 2e45425f623e46a876531b65ff3319d4.csf +0 -0
- data/spec/support/snapshots/Cuboid 2021-12-26 08_14_43 +0200 d570989be752d5e9f930379a7f861028.csf +0 -0
- data/spec/support/snapshots/Cuboid 2021-12-26 08_14_57 +0200 37fe4c6328f04448257e962065d49d05.csf +0 -0
- data/spec/support/snapshots/Cuboid 2021-12-26 08_25_10 +0200 728fc33e7947c9dc606d69d7b9202dbc.csf +0 -0
- data/spec/support/snapshots/Cuboid 2021-12-26 08_25_15 +0200 cde4edd9a05a4183ff301d157654cb30.csf +0 -0
- data/spec/support/snapshots/Cuboid 2021-12-26 08_25_17 +0200 e47c2b6d6354bca5f07fd2903aefd262.csf +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edae28c56b33bd872843de41aaaa5babbe2ae9e24a127357c1e3d9fdcd347d72
|
4
|
+
data.tar.gz: 75d6a47a8eea4743c393a4f64468baf0f986f87ec488f971a83ebc649d3b6aa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fea2bee694338842dcd1e21f6e8be63b0b61cf7efe6b9a3ac83122cfd4249bda373d40c8f884716b1ddccbe4c8a40d9d655c9e46cac0da802278d354c2d09622
|
7
|
+
data.tar.gz: e9f9ee9c1e3ad4d5710d9d4d587ad91f3bcf5cd71eb8dd2d94789a36760dcf7aa8e3d57816671b1c9d3a071d59c54b8d9fa2fd27466340c928684e47a641c6d7
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -10,10 +10,11 @@ _Cloud_ within a _Cloud_.
|
|
10
10
|
|
11
11
|
It offers:
|
12
12
|
|
13
|
-
* Load-balancing of _**Instances**_ via a
|
14
|
-
* No need to setup a topology manually, _**
|
13
|
+
* Load-balancing of _**Instances**_ via a network (_**Grid**_) of _**Agents**_.
|
14
|
+
* No need to setup a topology manually, _**Agents**_ will reach
|
15
15
|
convergence on their own, just point them to an existing _**Grid**_ member.
|
16
16
|
* Scaling up and down can be easily achieved by _plugging_ or _unplugging_ nodes.
|
17
|
+
* Horizontal (`default`) and vertical workload distribution strategies available.
|
17
18
|
* Fault tolerant -- one application per process (_**Instance**_).
|
18
19
|
* Self-healing -- keeps an eye out for disappearing and also re-appearing members.
|
19
20
|
* A clean and simple framework for application development.
|
@@ -57,7 +58,7 @@ framework:
|
|
57
58
|
* `:restore`
|
58
59
|
* `instance_service_for( Symbol, Class )` -- Adds a custom _**Instance**_ RPC API.
|
59
60
|
* `rest_service_for( Symbol, Module )` -- Hooks-up to the _**REST**_ service to provide a custom REST API.
|
60
|
-
* `
|
61
|
+
* `agent_service_for( Symbol, Class )` -- Hooks-up to the _**Agent**_ to provide a custom RPC API.
|
61
62
|
* `serialize_with( Module )` -- A serializer to be used for:
|
62
63
|
* `#options`
|
63
64
|
* `Report#data`
|
@@ -83,10 +84,10 @@ This is in order to enforce isolation (_state_, _data_, _fault_) between
|
|
83
84
|
_**Applications**_, take advantage of _OS_ task management and generally keep
|
84
85
|
things simple.
|
85
86
|
|
86
|
-
###
|
87
|
+
### Agent
|
87
88
|
|
88
|
-
A _**
|
89
|
-
(`
|
89
|
+
A _**Agent**_ is a server which awaits for _**Instance**_ spawn requests
|
90
|
+
(`spawn` calls) upon which it spawns and passes the _**Instance**_'s
|
90
91
|
connection info to the client.
|
91
92
|
|
92
93
|
The client can then proceed to use the _**Instance**_ to run and generally manage
|
@@ -94,7 +95,7 @@ the contained _**Application**_.
|
|
94
95
|
|
95
96
|
#### Grid
|
96
97
|
|
97
|
-
A _**
|
98
|
+
A _**Agent**_ _**Grid**_ is a software mesh network of _**Agent**_
|
98
99
|
servers, aimed towards providing automated _load-balancing_ based on available
|
99
100
|
system resources and each _**Application**_'s provisioning configuration.
|
100
101
|
|
@@ -103,11 +104,11 @@ providing any existing _**Grid**_ member upon start-up and the rest will be
|
|
103
104
|
sorted out automatically.
|
104
105
|
|
105
106
|
The network is _self-healing_ and will monitor _node_ connectivity, taking steps
|
106
|
-
to ensure that neither server nor network conditions will disrupt
|
107
|
+
to ensure that neither server nor network conditions will disrupt spawning.
|
107
108
|
|
108
109
|
##### Scalability
|
109
110
|
|
110
|
-
_**
|
111
|
+
_**Agents**_ can be easily _plugged_ to or _unplugged_ from the _**Grid**_
|
111
112
|
to scale up or down as necessary.
|
112
113
|
|
113
114
|
_Plugging_ happens at boot-time and _unplugging_ can take place via the available
|
@@ -124,12 +125,12 @@ The _**Scheduler**_ is a server which:
|
|
124
125
|
5. Upon _**Application**_ completion stores report to disk.
|
125
126
|
6. Shuts down the _**Instance**_.
|
126
127
|
|
127
|
-
####
|
128
|
+
#### Agent
|
128
129
|
|
129
|
-
The _**Scheduler**_ can be configured with a _**
|
130
|
+
The _**Scheduler**_ can be configured with a _**Agent**_, upon which case,
|
130
131
|
it will use it to spawn _**Instances**_.
|
131
132
|
|
132
|
-
If the _**
|
133
|
+
If the _**Agent**_ is a _**Grid**_ member then the _**Scheduler**_ will
|
133
134
|
also enjoy _load-balancing_ features.
|
134
135
|
|
135
136
|
## APIs
|
@@ -153,7 +154,7 @@ RPC interface.
|
|
153
154
|
A REST API is also available, taking advantage of HTTP sessions to make progress
|
154
155
|
tracking easier.
|
155
156
|
|
156
|
-
The REST interface is basically a web _**
|
157
|
+
The REST interface is basically a web _**Agent**_ and centralised point of
|
157
158
|
management for the rest of the entities.
|
158
159
|
|
159
160
|
Each _**Application**_ can extend upon this and expose an API via its _**REST**_
|
data/cuboid.gemspec
CHANGED
data/lib/cuboid/application.rb
CHANGED
@@ -103,15 +103,15 @@ class Application
|
|
103
103
|
@max_memory ||= 0
|
104
104
|
end
|
105
105
|
|
106
|
-
def provision_disk(
|
107
|
-
@max_disk =
|
106
|
+
def provision_disk( disk )
|
107
|
+
@max_disk = disk
|
108
108
|
end
|
109
109
|
|
110
110
|
def max_disk
|
111
|
-
@
|
111
|
+
@max_disk ||= 0
|
112
112
|
end
|
113
113
|
|
114
|
-
def instance_service_for(name, service )
|
114
|
+
def instance_service_for( name, service )
|
115
115
|
instance_services[name] = service
|
116
116
|
end
|
117
117
|
|
@@ -127,12 +127,12 @@ class Application
|
|
127
127
|
@rest_services ||= {}
|
128
128
|
end
|
129
129
|
|
130
|
-
def
|
131
|
-
|
130
|
+
def agent_service_for( name, service )
|
131
|
+
agent_services[name] = service
|
132
132
|
end
|
133
133
|
|
134
|
-
def
|
135
|
-
@
|
134
|
+
def agent_services
|
135
|
+
@agent_services ||= {}
|
136
136
|
end
|
137
137
|
|
138
138
|
def handler_for( signal, handler )
|
@@ -183,8 +183,8 @@ class Application
|
|
183
183
|
case type
|
184
184
|
when :instance
|
185
185
|
const = :Instances
|
186
|
-
when :
|
187
|
-
const = :
|
186
|
+
when :agent
|
187
|
+
const = :Agents
|
188
188
|
when :scheduler
|
189
189
|
const = :Schedulers
|
190
190
|
when :rest
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module Cuboid::OptionGroups
|
2
|
+
|
3
|
+
# Holds options for {RPC::Server::Agent} servers.
|
4
|
+
#
|
5
|
+
# @author Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
|
6
|
+
class Agent < Cuboid::OptionGroup
|
7
|
+
|
8
|
+
STRATEGIES = Set.new([:horizontal, :vertical])
|
9
|
+
|
10
|
+
# @return [String]
|
11
|
+
# URL of a {RPC::Server::Agent}.
|
12
|
+
attr_accessor :url
|
13
|
+
|
14
|
+
# @return [Array<Integer>]
|
15
|
+
# Range of ports to use when spawning instances, first entry should be
|
16
|
+
# the lowest port number, last the max port number.
|
17
|
+
attr_accessor :instance_port_range
|
18
|
+
|
19
|
+
# @return [String]
|
20
|
+
# The URL of a peering {RPC::Server::Agent}, applicable when
|
21
|
+
# {RPC::Server::Agent} are connected to each other to form a Grid.
|
22
|
+
#
|
23
|
+
# @see RPC::Server::Agent::Node
|
24
|
+
attr_accessor :peer
|
25
|
+
|
26
|
+
# @return [Float]
|
27
|
+
# How regularly to check for peer statuses.
|
28
|
+
attr_accessor :ping_interval
|
29
|
+
|
30
|
+
# @return [String]
|
31
|
+
# Agent name.
|
32
|
+
attr_accessor :name
|
33
|
+
|
34
|
+
attr_accessor :strategy
|
35
|
+
|
36
|
+
set_defaults(
|
37
|
+
strategy: :horizontal,
|
38
|
+
ping_interval: 5.0,
|
39
|
+
instance_port_range: [1025, 65535]
|
40
|
+
)
|
41
|
+
|
42
|
+
def strategy=( type )
|
43
|
+
return @strategy = defaults[:strategy] if !type
|
44
|
+
|
45
|
+
type = type.to_sym
|
46
|
+
if !STRATEGIES.include? type
|
47
|
+
fail ArgumentError, "Unknown strategy type: #{type}"
|
48
|
+
end
|
49
|
+
|
50
|
+
@strategy = type
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
@@ -70,20 +70,25 @@ class Paths < Cuboid::OptionGroup
|
|
70
70
|
|
71
71
|
# @!attribute executables
|
72
72
|
# @return [String]
|
73
|
-
# System processes (instance,
|
73
|
+
# System processes (instance, agent, browser, etc.).
|
74
74
|
|
75
75
|
def initialize
|
76
76
|
@root = self.root_path
|
77
|
+
FileUtils.mkdir_p home_path
|
77
78
|
|
78
|
-
@snapshots = self.config['snapshots'] ||
|
79
|
-
|
79
|
+
@snapshots = self.config['snapshots'] || home_path + 'snapshots/'
|
80
|
+
FileUtils.mkdir_p @snapshots
|
81
|
+
|
82
|
+
@reports = self.config['reports'] || home_path + 'reports/'
|
83
|
+
FileUtils.mkdir_p @reports
|
80
84
|
|
81
85
|
if ENV['CUBOID_LOGDIR'].to_s != ''
|
82
86
|
@logs = "#{ENV['CUBOID_LOGDIR']}/"
|
83
87
|
elsif self.config['logs']
|
84
88
|
@logs = self.config['logs']
|
85
89
|
else
|
86
|
-
@logs = "#{
|
90
|
+
@logs = "#{home_path}logs/"
|
91
|
+
FileUtils.mkdir_p @logs
|
87
92
|
end
|
88
93
|
|
89
94
|
@lib = @root + 'lib/cuboid/'
|
@@ -98,6 +103,10 @@ class Paths < Cuboid::OptionGroup
|
|
98
103
|
tmpdir
|
99
104
|
end
|
100
105
|
|
106
|
+
def home_path
|
107
|
+
@home_path ||= "#{ENV['HOME']}/.cuboid/"
|
108
|
+
end
|
109
|
+
|
101
110
|
def root_path
|
102
111
|
self.class.root_path
|
103
112
|
end
|
data/lib/cuboid/options.rb
CHANGED
@@ -2,28 +2,28 @@ module Cuboid
|
|
2
2
|
module Processes
|
3
3
|
|
4
4
|
#
|
5
|
-
# Helper for managing {RPC::Server::
|
5
|
+
# Helper for managing {RPC::Server::Agent} processes.
|
6
6
|
#
|
7
7
|
# @author Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
|
8
8
|
#
|
9
|
-
class
|
9
|
+
class Agents
|
10
10
|
include Singleton
|
11
11
|
include Utilities
|
12
12
|
|
13
|
-
# @return [Array<String>] URLs of all running
|
13
|
+
# @return [Array<String>] URLs of all running Agents.
|
14
14
|
attr_reader :list
|
15
15
|
|
16
16
|
def initialize
|
17
17
|
@list = []
|
18
|
-
@
|
18
|
+
@agent_connections = {}
|
19
19
|
end
|
20
20
|
|
21
|
-
# Connects to a
|
21
|
+
# Connects to a Agent by URL.
|
22
22
|
#
|
23
|
-
# @param [String] url URL of the
|
23
|
+
# @param [String] url URL of the Agent.
|
24
24
|
# @param [Hash] options Options for the RPC client.
|
25
25
|
#
|
26
|
-
# @return [RPC::Client::
|
26
|
+
# @return [RPC::Client::Agent]
|
27
27
|
def connect( url, options = nil )
|
28
28
|
Arachni::Reactor.global.run_in_thread if !Arachni::Reactor.global.running?
|
29
29
|
|
@@ -33,37 +33,51 @@ class Dispatchers
|
|
33
33
|
end
|
34
34
|
|
35
35
|
if fresh
|
36
|
-
@
|
36
|
+
@agent_connections[url] = RPC::Client::Agent.new( url, options )
|
37
37
|
else
|
38
|
-
@
|
38
|
+
@agent_connections[url] ||= RPC::Client::Agent.new( url, options )
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
# @param [Block] block Block to pass an RPC client for each
|
42
|
+
# @param [Block] block Block to pass an RPC client for each Agent.
|
43
43
|
def each( &block )
|
44
44
|
@list.each do |url|
|
45
45
|
block.call connect( url )
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
# Spawns a {RPC::Server::
|
49
|
+
# Spawns a {RPC::Server::Agent} process.
|
50
50
|
#
|
51
51
|
# @param [Hash] options
|
52
52
|
# To be passed to {Cuboid::Options#set}. Allows `address` instead of
|
53
53
|
# `rpc_server_address` and `port` instead of `rpc_port`.
|
54
54
|
#
|
55
|
-
# @return [RPC::Client::
|
55
|
+
# @return [RPC::Client::Agent]
|
56
56
|
def spawn( options = {} )
|
57
|
+
options = options.dup
|
57
58
|
fork = options.delete(:fork)
|
58
59
|
|
60
|
+
options[:ssl] ||= {
|
61
|
+
server: {},
|
62
|
+
client: {}
|
63
|
+
}
|
64
|
+
|
59
65
|
options = {
|
60
|
-
|
61
|
-
|
66
|
+
agent: {
|
67
|
+
name: options[:name],
|
68
|
+
peer: options[:peer],
|
69
|
+
strategy: options[:strategy],
|
62
70
|
},
|
63
71
|
rpc: {
|
64
72
|
server_port: options[:port] || Utilities.available_port,
|
65
73
|
server_address: options[:address] || '127.0.0.1',
|
66
|
-
server_external_address: options[:external_address]
|
74
|
+
server_external_address: options[:external_address],
|
75
|
+
|
76
|
+
ssl_ca: options[:ssl][:ca],
|
77
|
+
server_ssl_private_key: options[:ssl][:server][:private_key],
|
78
|
+
server_ssl_certificate: options[:ssl][:server][:certificate],
|
79
|
+
client_ssl_private_key: options[:ssl][:client][:private_key],
|
80
|
+
client_ssl_certificate: options[:ssl][:client][:certificate],
|
67
81
|
},
|
68
82
|
paths: {
|
69
83
|
application: options[:application] || Options.paths.application
|
@@ -74,11 +88,11 @@ class Dispatchers
|
|
74
88
|
options[:rpc].delete :server_external_address
|
75
89
|
end
|
76
90
|
|
77
|
-
if options[:
|
78
|
-
options[:
|
91
|
+
if options[:agent][:peer].nil?
|
92
|
+
options[:agent].delete :peer
|
79
93
|
end
|
80
94
|
|
81
|
-
pid = Manager.spawn( :
|
95
|
+
pid = Manager.spawn( :agent, options: options, fork: fork )
|
82
96
|
|
83
97
|
url = "#{options[:rpc][:server_address]}:#{options[:rpc][:server_port]}"
|
84
98
|
while sleep( 0.1 )
|
@@ -96,26 +110,26 @@ class Dispatchers
|
|
96
110
|
|
97
111
|
def grid_spawn( options = {} )
|
98
112
|
d = spawn( options )
|
99
|
-
spawn( options.merge
|
113
|
+
spawn( options.merge peer: d.url )
|
100
114
|
end
|
101
115
|
|
102
|
-
# @note Will also kill all Instances started by the
|
116
|
+
# @note Will also kill all Instances started by the Agent.
|
103
117
|
#
|
104
|
-
# @param [String] url URL of the
|
118
|
+
# @param [String] url URL of the Agent to kill.
|
105
119
|
def kill( url )
|
106
|
-
|
107
|
-
Manager.kill_many
|
108
|
-
Manager.kill
|
120
|
+
agent = connect( url )
|
121
|
+
Manager.kill_many agent.statistics['consumed_pids']
|
122
|
+
Manager.kill agent.pid
|
109
123
|
rescue => e
|
110
124
|
#ap e
|
111
125
|
#ap e.backtrace
|
112
126
|
nil
|
113
127
|
ensure
|
114
128
|
@list.delete( url )
|
115
|
-
@
|
129
|
+
@agent_connections.delete( url )
|
116
130
|
end
|
117
131
|
|
118
|
-
# Kills all {
|
132
|
+
# Kills all {Agents #list}.
|
119
133
|
def killall
|
120
134
|
@list.dup.each do |url|
|
121
135
|
kill url
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# @param (see Cuboid::Processes::Agents#spawn)
|
2
|
+
# @return (see Cuboid::Processes::Agents#spawn)
|
3
|
+
def agent_spawn( *args )
|
4
|
+
Cuboid::Processes::Agents.spawn( *args )
|
5
|
+
end
|
6
|
+
|
7
|
+
# @param (see Cuboid::Processes::Agents#kill)
|
8
|
+
# @return (see Cuboid::Processes::Agents#kill)
|
9
|
+
def agent_kill( *args )
|
10
|
+
Cuboid::Processes::Agents.kill( *args )
|
11
|
+
end
|
12
|
+
|
13
|
+
# @param (see Cuboid::Processes::Agents#killall)
|
14
|
+
# @return (see Cuboid::Processes::Agents#killall)
|
15
|
+
def agent_killall
|
16
|
+
Cuboid::Processes::Agents.killall
|
17
|
+
end
|
18
|
+
|
19
|
+
# @param (see Cuboid::Processes::Agents#connect)
|
20
|
+
# @return (see Cuboid::Processes::Agents#connect)
|
21
|
+
def agent_connect( *args )
|
22
|
+
Cuboid::Processes::Agents.connect( *args )
|
23
|
+
end
|
@@ -10,10 +10,10 @@ def instance_grid_spawn( *args )
|
|
10
10
|
Cuboid::Processes::Instances.grid_spawn( *args )
|
11
11
|
end
|
12
12
|
|
13
|
-
# @param (see Cuboid::Processes::Instances#
|
14
|
-
# @return (see Cuboid::Processes::Instances#
|
15
|
-
def
|
16
|
-
Cuboid::Processes::Instances.
|
13
|
+
# @param (see Cuboid::Processes::Instances#agent_spawn)
|
14
|
+
# @return (see Cuboid::Processes::Instances#agent_spawn)
|
15
|
+
def instance_agent_spawn( *args )
|
16
|
+
Cuboid::Processes::Instances.agent.spawn( *args )
|
17
17
|
end
|
18
18
|
|
19
19
|
def instance_kill( url )
|
@@ -21,7 +21,7 @@ class Instances
|
|
21
21
|
#
|
22
22
|
# Connects to a Instance by URL.
|
23
23
|
#
|
24
|
-
# @param [String] url URL of the
|
24
|
+
# @param [String] url URL of the Agent.
|
25
25
|
# @param [String] token
|
26
26
|
# Authentication token -- only need be provided once.
|
27
27
|
#
|
@@ -61,16 +61,28 @@ class Instances
|
|
61
61
|
# @return [RPC::Client::Instance, Integer]
|
62
62
|
# RPC client and PID.
|
63
63
|
def spawn( options = {}, &block )
|
64
|
+
options = options.dup
|
64
65
|
token = options.delete(:token) || Utilities.generate_token
|
65
66
|
fork = options.delete(:fork)
|
66
67
|
|
67
68
|
port_range = options.delete( :port_range )
|
68
69
|
|
70
|
+
options[:ssl] ||= {
|
71
|
+
server: {},
|
72
|
+
client: {}
|
73
|
+
}
|
74
|
+
|
69
75
|
options = {
|
70
76
|
rpc: {
|
71
77
|
server_socket: options[:socket],
|
72
78
|
server_port: options[:port] || Utilities.available_port( port_range ),
|
73
|
-
server_address: options[:address] || '127.0.0.1'
|
79
|
+
server_address: options[:address] || '127.0.0.1',
|
80
|
+
|
81
|
+
ssl_ca: options[:ssl][:ca],
|
82
|
+
server_ssl_private_key: options[:ssl][:server][:private_key],
|
83
|
+
server_ssl_certificate: options[:ssl][:server][:certificate],
|
84
|
+
client_ssl_private_key: options[:ssl][:client][:private_key],
|
85
|
+
client_ssl_certificate: options[:ssl][:client][:certificate],
|
74
86
|
},
|
75
87
|
paths: {
|
76
88
|
application: options[:application] || Options.paths.application
|
@@ -113,10 +125,10 @@ class Instances
|
|
113
125
|
end
|
114
126
|
end
|
115
127
|
|
116
|
-
# Starts {RPC::Server::
|
128
|
+
# Starts {RPC::Server::Agent} grid and returns a high-performance Instance.
|
117
129
|
#
|
118
130
|
# @param [Hash] options
|
119
|
-
# @option options [Integer] :grid_size (3) Amount of
|
131
|
+
# @option options [Integer] :grid_size (3) Amount of Agents to spawn.
|
120
132
|
#
|
121
133
|
# @return [RPC::Client::Instance]
|
122
134
|
def grid_spawn(options = {} )
|
@@ -124,23 +136,23 @@ class Instances
|
|
124
136
|
|
125
137
|
last_member = nil
|
126
138
|
options[:grid_size].times do |i|
|
127
|
-
last_member =
|
128
|
-
|
139
|
+
last_member = Agents.spawn(
|
140
|
+
peer: last_member ? last_member.url : last_member,
|
129
141
|
pipe_id: Utilities.available_port.to_s + Utilities.available_port.to_s
|
130
142
|
)
|
131
143
|
end
|
132
144
|
|
133
145
|
info = nil
|
134
|
-
info = last_member.
|
146
|
+
info = last_member.spawn while !info && sleep( 0.1 )
|
135
147
|
|
136
148
|
connect( info['url'], info['token'] )
|
137
149
|
end
|
138
150
|
|
139
|
-
# Starts {RPC::Server::
|
151
|
+
# Starts {RPC::Server::Agent} and returns an Instance.
|
140
152
|
#
|
141
153
|
# @return [RPC::Client::Instance]
|
142
|
-
def
|
143
|
-
info =
|
154
|
+
def agent_spawn
|
155
|
+
info = Agents.spawn.spawn
|
144
156
|
connect( info['url'], info['token'] )
|
145
157
|
end
|
146
158
|
|
@@ -52,16 +52,29 @@ class Schedulers
|
|
52
52
|
#
|
53
53
|
# @return [RPC::Client::Queue]
|
54
54
|
def spawn( options = {} )
|
55
|
+
options = options.dup
|
55
56
|
fork = options.delete(:fork)
|
56
57
|
|
58
|
+
options[:ssl] ||= {
|
59
|
+
server: {},
|
60
|
+
client: {}
|
61
|
+
}
|
62
|
+
|
57
63
|
options = {
|
58
|
-
|
59
|
-
url:
|
64
|
+
agent: {
|
65
|
+
url: options[:agent],
|
66
|
+
strategy: options[:strategy]
|
60
67
|
},
|
61
68
|
rpc: {
|
62
69
|
server_port: options[:port] || Utilities.available_port,
|
63
70
|
server_address: options[:address] || '127.0.0.1',
|
64
|
-
server_external_address: options[:external_address]
|
71
|
+
server_external_address: options[:external_address],
|
72
|
+
|
73
|
+
ssl_ca: options[:ssl][:ca],
|
74
|
+
server_ssl_private_key: options[:ssl][:server][:private_key],
|
75
|
+
server_ssl_certificate: options[:ssl][:server][:certificate],
|
76
|
+
client_ssl_private_key: options[:ssl][:client][:private_key],
|
77
|
+
client_ssl_certificate: options[:ssl][:client][:certificate],
|
65
78
|
},
|
66
79
|
paths: {
|
67
80
|
application: options[:application] || Options.paths.application
|
data/lib/cuboid/processes.rb
CHANGED
@@ -3,11 +3,11 @@ require 'ostruct'
|
|
3
3
|
|
4
4
|
lib = Cuboid::Options.paths.lib
|
5
5
|
require lib + 'rpc/client/instance'
|
6
|
-
require lib + 'rpc/client/
|
6
|
+
require lib + 'rpc/client/agent'
|
7
7
|
require lib + 'rpc/client/scheduler'
|
8
8
|
|
9
9
|
lib = Cuboid::Options.paths.lib + 'processes/'
|
10
10
|
require lib + 'manager'
|
11
|
-
require lib + '
|
11
|
+
require lib + 'agents'
|
12
12
|
require lib + 'instances'
|
13
13
|
require lib + 'schedulers'
|
data/lib/cuboid/report.rb
CHANGED
@@ -5,10 +5,10 @@ class Server
|
|
5
5
|
module InstanceHelpers
|
6
6
|
|
7
7
|
@@instances = {}
|
8
|
-
@@
|
8
|
+
@@agents = {}
|
9
9
|
|
10
10
|
def get_instance
|
11
|
-
if
|
11
|
+
if agent
|
12
12
|
options = {
|
13
13
|
owner: self.class.to_s,
|
14
14
|
helpers: {
|
@@ -18,7 +18,7 @@ module InstanceHelpers
|
|
18
18
|
}
|
19
19
|
}
|
20
20
|
|
21
|
-
if (info =
|
21
|
+
if (info = agent.spawn( options ))
|
22
22
|
connect_to_instance( info['url'], info['token'] )
|
23
23
|
end
|
24
24
|
else
|
@@ -26,24 +26,24 @@ module InstanceHelpers
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
def
|
30
|
-
@@
|
29
|
+
def agents
|
30
|
+
@@agents.keys
|
31
31
|
end
|
32
32
|
|
33
|
-
def
|
34
|
-
return if !Options.
|
35
|
-
@
|
33
|
+
def agent
|
34
|
+
return if !Options.agent.url
|
35
|
+
@agent ||= connect_to_agent( Options.agent.url )
|
36
36
|
end
|
37
37
|
|
38
|
-
def
|
39
|
-
|
38
|
+
def unplug_agent( url )
|
39
|
+
connect_to_agent( url ).node.unplug
|
40
40
|
|
41
|
-
c = @@
|
41
|
+
c = @@agents.delete( url )
|
42
42
|
c.close if c
|
43
43
|
end
|
44
44
|
|
45
|
-
def
|
46
|
-
@@
|
45
|
+
def connect_to_agent( url )
|
46
|
+
@@agents[url] ||= RPC::Client::Agent.new( url )
|
47
47
|
end
|
48
48
|
|
49
49
|
def connect_to_instance( url, token )
|