Skip to content

Commit f9ecc98

Browse files
committed
Basic supervisor working
1 parent 1e920c9 commit f9ecc98

File tree

18 files changed

+147
-96
lines changed

18 files changed

+147
-96
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ runlist.json
44
broker/
55
.tmp/
66
.pid
7+
.mongo_pid
8+
stdout.log
79

810
# Test app
911
test_app/

Gemfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
source 'http://rubygems.org'
22

3-
gem 'semantic', '~> 1.4'
43
gem "ansi", "~> 1.5"
4+
gem 'bson', '~> 3.0'
55
gem 'git', '~> 1.2'
6+
gem 'nutella_lib','~>0.4', '>=0.4.24'
7+
gem 'nokogiri', '~>1.6'
8+
gem 'slop', '~>4.0'
9+
gem 'semantic', '~> 1.4'
610
gem 'sinatra', '~>1.4'
711
gem 'sinatra-cross_origin', '~> 0.3.2'
812
gem 'thin', '~>1.6'
9-
gem 'nokogiri', '~>1.6'
10-
gem 'slop', '~>4.0'
11-
gem 'nutella_lib','~>0.4', '>=0.4.24'
12-
gem 'activesupport', '~>4.2'
13-
gem 'bson', '~> 3.0'
13+
gem "xmlrpc", "~> 0.3.0"
1414

1515
group :development do
1616
gem 'yard', '~> 0.9.11'
@@ -24,5 +24,3 @@ group :test do
2424
gem 'rspec', '~> 3.8'
2525
gem 'fuubar', '~> 2.4'
2626
end
27-
28-

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ nutella is a framework to build and run Macroworlds. The original prototype was
77
# Installing
88
nutella works on OSX and Linux (tested on Ubuntu) and it depends on a couple other things to work correctly. You will need:
99

10-
1. _ruby_ (version >= 2.1.0). Do yourself a favor and use [RVM](https://rvm.io/rvm/install) to install Ruby.
10+
1. _ruby_ (version >= 2.3.0). Do yourself a favor and use [RVM](https://rvm.io/rvm/install) to install Ruby.
1111
1. _git_ (version >= 1.8.0). Should come with the OS, yay!
12-
1. _tmux_ (version >= 1.8.0). Do yourself a favor and use [Homebrew](http://brew.sh/) to install tmux, if you are on OSX.
13-
1. _Docker_ (version >= 17.03.0). We use Docker to run the broker that handles all communications between all the pieces of the framework. Do yourself a favor and use [Docker for mac](https://store.docker.com/editions/community/docker-ce-desktop-mac), if you are on OSX.
12+
1. _supervisor_ (version >= 4.1.0). You can use [Homebrew](http://brew.sh/) to install supervisor on OSX.
13+
1. _docker_ (version >= 17.03.0). We use Docker to run the broker that handles all communications between all the pieces of the framework. Do yourself a favor and use [Docker for mac](https://store.docker.com/editions/community/docker-ce-desktop-mac), if you are on OSX.
1414

15-
Once you have all of installed, simply do:
15+
Once you have all of thi stuff installed you can do:
1616
```
1717
gem install nutella_framework
1818
```
1919
Once the installation is complete you should be able to type `nutella` in your shell and get a welcome message.
2020

2121
## nutella checkup
22-
If you are reading this you probably already saw the warning: "Looks like this is a fresh installation of nutella. Please run `nutella checkup` to check all dependencies are installed".
22+
If you are reading this you probably already saw the warning: "Looks like this is a fresh installation of nutella. Please run `nutella checkup` to check all dependencies are installed correctly". **Please follow the prompt!**
2323

2424
```
2525
nutella checkup

lib/bots/binary-files-manager/startup

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
$stdout.sync = true ## nutella woudl do this
2+
# $stdout.sync = true
3+
puts "Hi, I'm a basic ruby bot and all I do is idle and print stuff"
4+
$stderr.puts "certainly first param is set #{ARGV[0]}"
5+
6+
7+
begin
8+
i = 0
9+
while true
10+
puts "#{i} A log line!"
11+
i = i + 1
12+
sleep 1
13+
end
14+
rescue SignalException => e
15+
puts "HEY I WAS KILLED!!!"
16+
$stderr.puts "AND I COMPLAIN IN STDERR"
17+
puts e
18+
end

lib/bots/commands_server/startup

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
BASEDIR=$(dirname $0)
4+
ruby $BASEDIR/commands_server.rb

lib/bots/main_interface/main_interface_bot.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
require 'sinatra'
33
require 'nokogiri'
44

5-
require_relative '../../lib/config/runlist'
6-
require_relative '../../lib/config/config'
7-
require_relative '../../nutella_lib/framework_core'
5+
require_relative '../../config/config'
6+
require_relative '../../config/runlist'
87

98

109
# Set Sinatra to run in production mode
1110
set :environment, :production
1211

1312
# Set Sinatra's port to nutella's main_interface_port
14-
set :port, Nutella.config['main_interface_port']
13+
set :port, Nutella::Config.file['main_interface_port']
1514
# Disable X-Frame-Options header to allow iframes
1615
set :protection, :except => :frame_options
1716

@@ -63,7 +62,7 @@
6362
# If the index file doesn't exist, render error page
6463
return erb( :not_found_404, :locals => {:not_found_type => 'idx'} ) unless File.exist? index_file_path
6564
# If the index file exists, compose query string and redirect
66-
index_with_query_url = "#{request.path}/index.html?broker=#{Nutella.config['broker']}&app_id=#{app_id}&run_id=#{run_id}"
65+
index_with_query_url = "#{request.path}/index.html?broker=#{Nutella::Config.file['broker']}&app_id=#{app_id}&run_id=#{run_id}"
6766
redirect index_with_query_url
6867
end
6968

lib/bots/main_interface/startup

Lines changed: 0 additions & 5 deletions
This file was deleted.

lib/bots/order.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

lib/bots/runs_list_bot/startup

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)