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
451319e4
Commit
451319e4
authored
Jan 28, 2020
by
nilanjandaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoupled constants
parent
b7908d29
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
+17
-5
constants.json
constants.json
+6
-0
dispatch_daemon/index.js
dispatch_daemon/index.js
+8
-2
dispatcher/index.js
dispatcher/index.js
+3
-3
No files found.
constants.json
0 → 100644
View file @
451319e4
{
"mqtt_url"
:
"10.129.6.5"
,
"registry_url"
:
"10.129.6.5:5000/"
,
"master_port"
:
8080
,
"master_address"
:
"10.129.6.5"
}
\ No newline at end of file
dispatch_daemon/index.js
View file @
451319e4
'
use strict
'
;
const
mqtt
=
require
(
'
mqtt
'
)
const
client
=
mqtt
.
connect
(
'
mqtt://localhost
'
)
const
constants
=
require
(
"
.././constants.json
"
)
console
.
log
(
constants
.
mqtt_url
);
const
client
=
mqtt
.
connect
(
'
mqtt://
'
+
constants
.
mqtt_url
)
const
libSupport
=
require
(
'
./lib
'
)
const
execute
=
require
(
'
./execute
'
)
const
fs
=
require
(
'
fs
'
)
const
node_id
=
"
20sez54hq8
"
const
local_repository
=
__dirname
+
"
/local_repository/
"
const
host_url
=
'
http://127.0.0.1:8080/
'
const
host_url
=
"
http://
"
+
constants
.
master_address
+
"
:
"
+
constants
.
master_port
client
.
on
(
'
connect
'
,
function
()
{
client
.
subscribe
(
node_id
,
function
(
err
)
{
if
(
!
err
)
{
...
...
dispatcher/index.js
View file @
451319e4
...
...
@@ -3,12 +3,12 @@
const
express
=
require
(
'
express
'
)
const
bodyParser
=
require
(
'
body-parser
'
)
const
fileUpload
=
require
(
'
express-fileupload
'
);
const
constants
=
require
(
'
.././constants.json
'
)
const
fs
=
require
(
'
fs
'
)
const
{
spawn
}
=
require
(
'
child_process
'
);
const
morgan
=
require
(
'
morgan
'
)
const
mqtt
=
require
(
'
mqtt
'
)
const
client
=
mqtt
.
connect
(
'
mqtt://
localhost
'
)
const
client
=
mqtt
.
connect
(
'
mqtt://
'
+
constants
.
mqtt_url
)
const
app
=
express
()
const
libSupport
=
require
(
'
./lib
'
)
...
...
@@ -26,7 +26,7 @@ let requestQueue = []
const
node_id
=
"
20sez54hq8
"
const
WINDOW_SIZE
=
10
const
port
=
8080
const
registry_url
=
"
10.129.6.5:5000/
"
const
registry_url
=
constants
.
registry_url
app
.
post
(
'
/serverless/deploy
'
,
(
req
,
res
)
=>
{
...
...
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