Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xanadu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
SYNERG
xanadu
Commits
9d97bdfa
Commit
9d97bdfa
authored
Feb 10, 2020
by
Nilanjan Daw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor bug fixed
Fixed minor bugs introduced due to code streamlining
parent
8a98481f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
6 deletions
+6
-6
.gitignore
.gitignore
+1
-2
dispatch_module/dispatch_daemon/config.json
dispatch_module/dispatch_daemon/config.json
+1
-1
dispatch_module/dispatch_daemon/index.js
dispatch_module/dispatch_daemon/index.js
+2
-2
dispatch_module/dispatch_daemon/lib.js
dispatch_module/dispatch_daemon/lib.js
+1
-1
dispatch_module/dispatcher/index.js
dispatch_module/dispatcher/index.js
+1
-0
No files found.
.gitignore
View file @
9d97bdfa
...
@@ -4,5 +4,4 @@ node_modules
...
@@ -4,5 +4,4 @@ node_modules
package-lock.json
package-lock.json
firecracker*
firecracker*
secrets.json
secrets.json
resource_manager/bin/**
resource_manager/bin/**
\ No newline at end of file
dispatch_module/dispatch_daemon/config.json
View file @
9d97bdfa
{
"id"
:
"192.168.31.51"
,
"master_node"
:
"10.129.6.5"
}
{
"id"
:
"192.168.1.103"
,
"master_node"
:
"10.129.6.5"
}
\ No newline at end of file
\ No newline at end of file
dispatch_module/dispatch_daemon/index.js
View file @
9d97bdfa
...
@@ -41,7 +41,7 @@ libSupport.makeTopic(node_id).then(() => {
...
@@ -41,7 +41,7 @@ libSupport.makeTopic(node_id).then(() => {
if
(
message
.
type
===
"
execute
"
)
{
if
(
message
.
type
===
"
execute
"
)
{
console
.
log
(
"
function_id
"
,
function_id
);
console
.
log
(
"
function_id
"
,
function_id
);
libSupport
.
download
(
host_url
+
"
/repository/
"
+
functionHash
,
local_repository
+
functionHash
).
then
(()
=>
{
libSupport
.
download
(
host_url
+
"
/repository/
"
+
functionHash
,
local_repository
+
functionHash
).
then
(()
=>
{
startWorker
(
local_repository
,
functionHash
,
producer
,
runtime
)
startWorker
(
local_repository
,
functionHash
,
function_id
,
producer
,
runtime
)
})
})
}
}
...
@@ -51,7 +51,7 @@ libSupport.makeTopic(node_id).then(() => {
...
@@ -51,7 +51,7 @@ libSupport.makeTopic(node_id).then(() => {
})
})
function
startWorker
(
local_repository
,
functionHash
,
producer
,
runtime
)
{
function
startWorker
(
local_repository
,
functionHash
,
function_id
,
producer
,
runtime
)
{
if
(
runtime
===
"
isolate
"
)
if
(
runtime
===
"
isolate
"
)
execute
.
runIsolate
(
local_repository
+
functionHash
).
then
(
result
=>
{
execute
.
runIsolate
(
local_repository
+
functionHash
).
then
(
result
=>
{
producer
.
send
([{
producer
.
send
([{
...
...
dispatch_module/dispatch_daemon/lib.js
View file @
9d97bdfa
...
@@ -46,7 +46,7 @@ function makeTopic(id) {
...
@@ -46,7 +46,7 @@ function makeTopic(id) {
var
download
=
function
(
url
,
dest
,
cb
)
{
var
download
=
function
(
url
,
dest
,
cb
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
url
);
console
.
log
(
url
);
if
(
!
fs
.
existsSync
(
local_repository
+
functionHash
))
{
if
(
!
fs
.
existsSync
(
dest
))
{
var
file
=
fs
.
createWriteStream
(
dest
);
var
file
=
fs
.
createWriteStream
(
dest
);
var
request
=
http
.
get
(
url
,
function
(
response
)
{
var
request
=
http
.
get
(
url
,
function
(
response
)
{
response
.
pipe
(
file
);
response
.
pipe
(
file
);
...
...
dispatch_module/dispatcher/index.js
View file @
9d97bdfa
...
@@ -222,6 +222,7 @@ consumer.on('message', function (message) {
...
@@ -222,6 +222,7 @@ consumer.on('message', function (message) {
db
.
delete
(
message
.
function_id
)
db
.
delete
(
message
.
function_id
)
}
else
if
(
topic
===
"
heartbeat
"
)
{
}
else
if
(
topic
===
"
heartbeat
"
)
{
message
=
JSON
.
parse
(
message
)
message
=
JSON
.
parse
(
message
)
if
(
workerNodes
.
indexOf
(
message
.
address
)
===
-
1
)
{
if
(
workerNodes
.
indexOf
(
message
.
address
)
===
-
1
)
{
workerNodes
.
push
(
message
.
address
)
workerNodes
.
push
(
message
.
address
)
console
.
log
(
workerNodes
);
console
.
log
(
workerNodes
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment