public
Fork of KirinDave/fuzed
Description: A new revision of Fuzed, the Erlang-based frontend for web apps.
Clone URL: git://github.com/mojombo/fuzed.git
Search Repo:
getting close to a full roundtrip
mojombo (author)
Sun May 04 20:33:26 -0700 2008
commit  84159d727f2ae308bcb1518c66420e17e790bec7
tree    9f0a478b8f0ce7e87d821d0bd2c6c76ab993ebf1
parent  aac45964081d8d0ec8a423f1f536c722284ca91f
...
1
2
3
 
...
1
2
3
4
0
@@ -1,3 +1,4 @@
0
 test/app/log/*.log
0
 *~
0
 \#*
0
+erl_crash.dump
...
13
14
15
16
17
18
19
...
13
14
15
 
16
17
18
0
@@ -13,7 +13,6 @@ $:.unshift(CMD_LINE_PATH)
0
 
0
 DEFAULT_NODE_NAME = `hostname -s`.chomp + "-#{rand(9999)}"
0
 DEFAULT_MASTER_NODE = "master@fuzed-dev.powerset.com"
0
-DEFAULT_REMOTE_RUBY = "http://fuzed-dev.powerset.com:9001/code"
0
 DEFAULT_ERLANG_CODEPATHS = %w[ebin/yaws ebin/eunit etest ebin]
0
 DEFAULT_BOOT_DIR = "/p/conf/fuzed/"
0
 
...
14
15
16
17
 
 
18
19
 
20
21
22
...
88
89
90
91
 
 
92
...
14
15
16
 
17
18
19
 
20
21
22
23
...
89
90
91
 
92
93
94
0
@@ -14,9 +14,10 @@ out404(A, _GC, SC) ->
0
                                          details()) of
0
     {result, R} ->
0
       convert_response(R);
0
- {error, _R} ->
0
+ {error, R} ->
0
+ error_logger:info_msg("500 Internal Server Error: ~p~n", [R]),
0
       [{status, 500}, {html, "Sumpin fucked."}]
0
- end.
0
+ end.
0
 
0
 parse_arg(Request, ServerOptions) ->
0
   Headers = Request#arg.headers,
0
@@ -88,5 +89,6 @@ prep(A) -> A.
0
 
0
 details() ->
0
   {ok, Details} =
0
- application:get_env(frontend, details),
0
+ application:get_env(fuzed_frontend, details),
0
+ error_logger:info_msg("Using frontend details ~p~n", [Details]),
0
   Details.
...
35
36
37
38
 
 
 
 
39
...
35
36
37
 
38
39
40
41
42
0
@@ -35,5 +35,8 @@ init([]) ->
0
        permanent, 10000, worker, [pool_sweeper]},
0
      {fuzed_code_monitor,
0
        {fuzed_code_monitor, start_link, []},
0
- permanent, 10000, worker, [fuzed_code_monitor]}
0
+ permanent, 10000, worker, [fuzed_code_monitor]},
0
+ {logger,
0
+ {logger, start_link, ["/var/log/fuzed"]},
0
+ permanent, 10000, worker, [logger]}
0
     ]}}.
...
1
2
3
4
5
6
 
 
 
7
8
9
10
11
...
27
28
29
30
31
32
33
...
54
55
56
57
58
59
60
61
62
63
64
65
 
66
67
68
...
73
74
75
76
77
78
79
80
81
82
...
109
110
111
112
113
114
115
116
...
1
2
 
 
 
 
3
4
5
6
 
7
8
9
...
25
26
27
 
28
29
30
...
51
52
53
 
 
 
 
54
55
56
57
 
58
59
60
61
...
66
67
68
 
 
 
 
69
70
71
...
98
99
100
 
 
101
102
103
0
@@ -1,11 +1,9 @@
0
 def create_spec_list(options)
0
   spec_list = []
0
- result = ""
0
- result.concat("/p/bin/xlew ") if options[:xlew]
0
- result.concat("ruby -I/p/libexec/fuzed #{FUZED_ROOT + "/rlibs/pontoon.rb "}")
0
- raise "You must specify an fuzed file to join the fuzed cluster!" unless options[:fuzedfile]
0
+ result = "ruby "
0
+ result.concat("-I#{FUZED_ROOT + "/rlibs "}")
0
+ raise "You must specify a fuzed file to join the fuzed cluster!" unless options[:fuzedfile]
0
   result.concat(options[:fuzedfile] + " ")
0
- result.concat(%{#{options[:remote_ruby] || DEFAULT_REMOTE_RUBY} })
0
   result.concat(%{--tags="#{options[:tags]}" }) if options[:tags]
0
   roles = []
0
   roles << "production" if options[:production]
0
@@ -27,7 +25,6 @@ OptionParser.new do |opts|
0
   
0
   opts.on("-z HOSTNAME", "--magic HOSTNAME", "Set smart details based off of a hostname") do |n|
0
     options[:master_name] = "master@#{n}"
0
- options[:remote_ruby] = "http://#{n}:9001/code"
0
   end
0
   
0
   opts.on("-n NAME", "--name NAME", "Node name") do |n|
0
@@ -54,15 +51,11 @@ OptionParser.new do |opts|
0
     options[:tags] = n
0
   end
0
   
0
- opts.on("-x", "--xlew", "Make sure to run the node in the powerset nl environment") do |n|
0
- options[:xlew] = true
0
- end
0
-
0
   opts.on("-d", "--detached", "Run as a daemon") do
0
     options[:detached] = true
0
   end
0
   
0
- opts.on("-p", "--produciton", "Classify these nodes as production") do
0
+ opts.on("-p", "--production", "Classify these nodes as production") do
0
     options[:production] = true
0
   end
0
   
0
@@ -73,10 +66,6 @@ OptionParser.new do |opts|
0
   opts.on("-i", "--inet", "Load code over internet via master code server") do
0
     options[:inet] = true
0
   end
0
-
0
- opts.on("--remote_ruby LOCATION", "Load Ruby code from the given URL or file location") do |x|
0
- options[:remote_ruby] = x
0
- end
0
 
0
   opts.on("-h", "--heartbeat", "Start with a heartbeat.") do
0
     $stderr.puts "WARNING! Heartbeats not supported with this build!"
0
@@ -109,8 +98,6 @@ else
0
   ""
0
 end
0
 
0
-remote_ruby = options[:remote_ruby] || DEFAULT_REMOTE_RUBY
0
-
0
 cmd = %Q{erl -boot start_sasl \
0
              #{detached} \
0
              +Bc \
...
147
148
149
150
 
151
152
153
...
147
148
149
 
150
151
152
153
0
@@ -147,7 +147,7 @@ class RailsHandler < Chassis
0
 
0
   details("rails" => "default")
0
 
0
- handle(:handle_request) do |args|
0
+ handle(:handle_request, :request) do |args|
0
     service(args[:request])
0
   end
0
 end
...
 
 
 
 
 
...
1
2
3
4
5
0
@@ -0,0 +1,5 @@
0
+bin/fuzed start -n master@volcano.local
0
+
0
+bin/fuzed frontend -z volcano.local -r test/app/public -s 'kind=rails|roles=production' -n f1@volcano.local
0
+
0
+bin/fuzed join -z volcano.local -f rlibs/rails_node.rb -n n1@volcano.local -p

Comments

    No one has commented yet.