index.js 20.8 KB
Newer Older
nilanjandaw's avatar
nilanjandaw committed
1
"use strict";
2

3
const express = require('express');
nilanjandaw's avatar
nilanjandaw committed
4
const fileUpload = require('express-fileupload');
5 6 7 8
const constants = require('.././constants.json');
const chainHandler = require('./explicit_chain_handler');
const secrets = require('./secrets.json');
const fs = require('fs');
nilanjandaw's avatar
nilanjandaw committed
9
const { spawn } = require('child_process');
10 11
const morgan = require('morgan');
const heap = require('heap');
12
const fetch = require('node-fetch');
Nilanjan Daw's avatar
Nilanjan Daw committed
13 14
const swStats = require('swagger-stats');
const apiSpec = require('./swagger.json');
15
const util = require('util')
16

17 18 19
/**
 * URL to the couchdb database server used to store function metadata
 */
20
let metadataDB = `http://${secrets.couchdb_username}:${secrets.couchdb_password}@${constants.couchdb_host}`
Nilanjan Daw's avatar
Nilanjan Daw committed
21
metadataDB = metadataDB + "/" + constants.function_db_name + "/"
Nilanjan Daw's avatar
Nilanjan Daw committed
22

23 24 25
let metricsDB = `http://${secrets.couchdb_username}:${secrets.couchdb_password}@${constants.couchdb_host}`
metricsDB = metricsDB + "/" + constants.metrics_db_name + "/"

nilanjandaw's avatar
nilanjandaw committed
26
const app = express()
27
const libSupport = require('./lib')
Nilanjan Daw's avatar
Nilanjan Daw committed
28
const logger = libSupport.logger
Nilanjan Daw's avatar
Nilanjan Daw committed
29
let date = new Date();
30
let log_channel = constants.topics.log_channel
Nilanjan Daw's avatar
Nilanjan Daw committed
31

32 33 34
let usedPort = new Map(), // TODO: remove after integration with RM
    db = new Map(), // queue holding request to be dispatched
    resourceMap = new Map(), // map between resource_id and resource details like node_id, port, associated function etc
35
    functionToResource = new Map(), // a function to resource map. Each map contains a minheap of
36
                                   // resources associated with the function
37 38
    workerNodes = new Map(), // list of worker nodes currently known to the DM
    functionBranchTree = new Map() // a tree to store function branch predictions
Nilanjan Daw's avatar
Nilanjan Daw committed
39
    
nilanjandaw's avatar
nilanjandaw committed
40

41 42 43
let kafka = require('kafka-node'),
    Producer = kafka.Producer,
    client = new kafka.KafkaClient({ 
44
        kafkaHost: constants.network.external.kafka_host,
45 46 47 48 49 50
        autoConnect: true
    }),
    producer = new Producer(client),
    Consumer = kafka.Consumer,
    consumer = new Consumer(client,
        [
51 52 53 54 55
            { topic: constants.topics.heartbeat }, // receives heartbeat messages from workers, also acts as worker join message
            { topic: constants.topics.deployed }, // receives deployment confirmation from workers
            { topic: constants.topics.remove_worker }, // received when a executor environment is blown at the worker
            { topic: constants.topics.response_rm_2_dm }, // receives deployment details from RM
            { topic: constants.topics.hscale } // receives signals for horizontal scaling
56 57
        ],
        [
58
            { autoCommit: true }
59 60
        ])

Nilanjan Daw's avatar
Nilanjan Daw committed
61 62 63
app.use(morgan('combined', {
    skip: function (req, res) { return res.statusCode < 400 }
}))
64 65
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
66
const file_path = __dirname + "/repository/"
67

68
app.use('/repository', express.static(file_path)); // file server hosting deployed functions
nilanjandaw's avatar
nilanjandaw committed
69
app.use(fileUpload())
70 71
app.use(swStats.getMiddleware({ swaggerSpec: apiSpec })); // statistics middleware
app.use('/serverless/chain', chainHandler); // chain router (explicit_chain_handler.js) for handling explicit chains
72 73
let requestQueue = []

74
const WINDOW_SIZE = 10
nilanjandaw's avatar
nilanjandaw committed
75
const port = constants.master_port
nilanjandaw's avatar
nilanjandaw committed
76
const registry_url = constants.registry_url
77

Nilanjan Daw's avatar
Nilanjan Daw committed
78 79 80
/**
 * REST API to receive deployment requests
 */
nilanjandaw's avatar
nilanjandaw committed
81 82 83 84 85 86
app.post('/serverless/deploy', (req, res) => {
    
    let runtime = req.body.runtime
    let file = req.files.serverless

    let functionHash = file.md5
87

88
    file.mv(file_path + functionHash, function (err) { // move function file to repository
89
        functionHash = libSupport.generateExecutor(file_path, functionHash)
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
        /**
         * Adding meta caching via couchdb
         * This will create / update function related metadata like resource limits etc
         * on a database named "serverless".
         */
        fetch(metadataDB + functionHash).then(res => res.json())
            .then(json => {
                if (json.error === "not_found") {
                    logger.warn("New function, creating metadata")
                    fetch(metadataDB + functionHash, {
                        method: 'put',
                        body: JSON.stringify({
                            memory: req.body.memory
                        }),
                        headers: { 'Content-Type': 'application/json' },
                    }).then(res => res.json())
                    .then(json => console.log(json));
                } else {
                    logger.warn('Repeat deployment, updating metadata')
                    fetch(metadataDB + functionHash, {
                        method: 'put',
                        body: JSON.stringify({
                            memory: req.body.memory,
                            _rev: json._rev
                        }),
                        headers: { 'Content-Type': 'application/json' },
                    }).then(res => res.json())
                    .then(json => console.log(json));
                }
        });
nilanjandaw's avatar
nilanjandaw committed
120
        if (err) {
Nilanjan Daw's avatar
Nilanjan Daw committed
121
            logger.error(err)
nilanjandaw's avatar
nilanjandaw committed
122 123 124 125
            res.send("error").status(400)
        }
        else {
            if (runtime === "container") {
126
                deployContainer(file_path, functionHash)
nilanjandaw's avatar
nilanjandaw committed
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
                    .then(() => {
                        res.json({
                            status: "success",
                            function_id: functionHash
                        })
                    })
                    .catch(err => {
                        res.json({
                            status: "error",
                            reason: err}).status(400)
                    })
            } else {
                res.json({
                    status: "success",
                    function_id: functionHash
                })
            }
        }
    })
    
})

Nilanjan Daw's avatar
Nilanjan Daw committed
149 150 151 152 153
/**
 * Create the docker file, build and push image to remote repository
 * @param {String: Path from where to extract function executor} path 
 * @param {String: Name of the image} imageName 
 */
nilanjandaw's avatar
nilanjandaw committed
154 155 156
function deployContainer(path, imageName) {
    return new Promise((resolve, reject) => {
        let buildStart = Date.now()
157 158 159
        /**
         * Generating dockerfile for the received function
         */
nilanjandaw's avatar
nilanjandaw committed
160
        fs.writeFile('./repository/Dockerfile',
nilanjandaw's avatar
nilanjandaw committed
161 162
            `FROM node:latest
            WORKDIR /app
163 164 165
            COPY ./worker_env/package.json /app
            ADD ./worker_env/node_modules /app/node_modules
            COPY ${imageName}.js /app
166
            ENTRYPOINT ["node", "${imageName}.js"]`
nilanjandaw's avatar
nilanjandaw committed
167
            , function (err) {
168
                if (err) {
Nilanjan Daw's avatar
Nilanjan Daw committed
169 170
                    logger.error("failed", err);

171 172 173
                    
                    reject(err);
                }
nilanjandaw's avatar
nilanjandaw committed
174
                else {
Nilanjan Daw's avatar
Nilanjan Daw committed
175
                    logger.info('Dockerfile created');
176
                    const process = spawn('docker', ["build", "-t", registry_url + imageName, path]); // docker build
177

nilanjandaw's avatar
nilanjandaw committed
178
                    process.stdout.on('data', (data) => {
Nilanjan Daw's avatar
Nilanjan Daw committed
179
                        logger.info(`stdout: ${data}`);
nilanjandaw's avatar
nilanjandaw committed
180 181 182 183

                    });

                    process.stderr.on('data', (data) => {
Nilanjan Daw's avatar
Nilanjan Daw committed
184
                        logger.error(`stderr: ${data}`);
nilanjandaw's avatar
nilanjandaw committed
185
                    });
186

nilanjandaw's avatar
nilanjandaw committed
187
                    process.on('close', (code) => {
Nilanjan Daw's avatar
Nilanjan Daw committed
188
                        logger.warn(`child process exited with code ${code}`);
nilanjandaw's avatar
nilanjandaw committed
189
                        let timeDifference = Math.ceil((Date.now() - buildStart))
Nilanjan Daw's avatar
Nilanjan Daw committed
190
                        logger.info("image build time taken: ", timeDifference);
191
                        const process_push = spawn('docker', ["push", registry_url + imageName]); // docker push image to local registry
192 193 194 195 196 197 198

                        process_push.stdout.on('data', (data) => {
                            console.log(`stdout: ${data}`);

                        });

                        process_push.stderr.on('data', (data) => {
Nilanjan Daw's avatar
Nilanjan Daw committed
199
                            logger.error(`stderr: ${data}`);
200 201 202
                        });

                        process_push.on('close', (code) => {
Nilanjan Daw's avatar
Nilanjan Daw committed
203
                            logger.info("image pushed to repository");
204 205 206
                            resolve();
                        })
                        
nilanjandaw's avatar
nilanjandaw committed
207 208
                    });
                }
209
            });
nilanjandaw's avatar
nilanjandaw committed
210 211 212
    })
}

Nilanjan Daw's avatar
Nilanjan Daw committed
213 214 215
/**
 * REST API to receive execute requests
 */
216
app.post('/serverless/execute/:id', (req, res) => {
217

nilanjandaw's avatar
nilanjandaw committed
218
    let runtime = req.body.runtime
219
    let id = req.params.id + runtime
220
    res.timestamp = Date.now() 
221
    if (functionToResource.has(id)) {
Nilanjan Daw's avatar
Nilanjan Daw committed
222
        res.start = 'warmstart'
223
        libSupport.reverseProxy(req, res, functionToResource, resourceMap, functionBranchTree)
nilanjandaw's avatar
nilanjandaw committed
224
    } else {
Nilanjan Daw's avatar
Nilanjan Daw committed
225
        res.start = 'coldstart'
226
        /**
227 228 229
         * Requests are queued up before being dispatched. To prevent requests coming in for the 
         * same function from starting too many workers, they are grouped together
         * and one worker is started per group.
230
         */
231 232 233 234
        if (db.has(req.params.id + runtime)) {
            db.get(req.params.id + runtime).push({ req, res })
            return;
        }
nilanjandaw's avatar
nilanjandaw committed
235
        requestQueue.push({ req, res })
Nilanjan Daw's avatar
Nilanjan Daw committed
236 237 238 239
        /**
         * We store functions for function placement heuristics purposes. This lets us look into the function
         * patterns being received and make intelligent deployment decisions based on it.
         */
nilanjandaw's avatar
nilanjandaw committed
240 241 242
        if (requestQueue.length >= WINDOW_SIZE)
            dispatch()
    }
243
})
nilanjandaw's avatar
nilanjandaw committed
244

Nilanjan Daw's avatar
Nilanjan Daw committed
245
/**
246
 * Send dispatch signal to Worker nodes and deploy resources after consultation with the RM
Nilanjan Daw's avatar
Nilanjan Daw committed
247
 */
248
function dispatch() {
249 250 251 252
    /**
     * The lookahead window will be used for optimisation purposes
     * Ex. It might be used to co-group similar runtimes on same machines
     */
253 254
    let lookbackWindow = Math.min(WINDOW_SIZE, requestQueue.length)
    for (let i = 0; i < lookbackWindow; i++) {
255
        let {req, res} = requestQueue.shift()
256
        
257
	    // logger.info(req.body)
258 259
        let runtime = req.body.runtime
        let functionHash = req.params.id
260 261
        if (!db.has(functionHash + runtime)) {
            db.set(functionHash + runtime, [])
262
            db.get(functionHash + runtime).push({ req, res })
263
            
264 265 266
            let payload = [{
                topic: constants.topics.hscale,
                messages: JSON.stringify({ runtime, functionHash })
Nilanjan Daw's avatar
Nilanjan Daw committed
267
            }]
268
            producer.send(payload, function () { })
269

270
            speculative_deployment(req, runtime)
Nilanjan Daw's avatar
Nilanjan Daw committed
271 272 273 274 275
        } else {
            logger.info("deployment process already started waiting")
            db.get(functionHash + runtime).push({ req, res })
        }

276 277 278 279
        
    }
}

280 281 282 283
/**
 * Handles post deployment metadata updates and starts reverse-proxying
 * @param {string} message Message received from DD after deployment
 */
284 285
function postDeploy(message) {
    logger.info("Deployed Resource: " + JSON.stringify(message));
286
    let id = message.functionHash + message.runtime
287
    if (message.status == false) {
288
        let sendQueue = db.get(id)
289 290 291 292 293
        // TODO: handle failure
        while (sendQueue && sendQueue.length != 0) {
            let { req, res } = sendQueue.shift()
            res.status(400).json({ reason: message.reason })
        }
294
        db.delete(id)
295 296 297
        
        return;
    }
298 299
    if (functionToResource.has(id)) {
        let resourceHeap = functionToResource.get(id)
300 301
        heap.push(resourceHeap, {
            resource_id: message.resource_id,
Nilanjan Daw's avatar
Nilanjan Daw committed
302
            open_request_count: 0
303 304
        }, libSupport.compare)
        logger.warn("Horizontally scaling up: " +
305
            JSON.stringify(functionToResource.get(id)));
306 307 308 309 310 311 312 313 314 315

    } else {
        /**
        * function to resource map - holds a min heap of resources associated with a function
        * the min heap is sorted based on a metric [TBD] like CPU usage, request count, mem usage etc
        * TODO: decide on metric to use for sorting.
        */
        let resourceHeap = []
        heap.push(resourceHeap, {
            resource_id: message.resource_id,
Nilanjan Daw's avatar
Nilanjan Daw committed
316
            open_request_count: 0
317
        }, libSupport.compare)
318
        functionToResource.set(id, resourceHeap)
319
        logger.warn("Creating new resource pool"
320
            + JSON.stringify(functionToResource.get(id)));
321 322

    }
323
    
Nilanjan Daw's avatar
Nilanjan Daw committed
324
    try {
325 326
        let resource = resourceMap.get(message.resource_id)
        resource.deployed = true
327 328 329 330
        libSupport.logBroadcast({
            entity_id: message.entity_id,
            "reason": "deployment",
            "status": true,
Nilanjan Daw's avatar
Nilanjan Daw committed
331
            starttime: (Date.now() - resource.deploy_request_time)
332
        }, message.resource_id, resourceMap)
333
        
334 335
        if (db.has(id)) {
            let sendQueue = db.get(id)
Nilanjan Daw's avatar
Nilanjan Daw committed
336 337 338
            logger.info("forwarding request via reverse proxy to: " + JSON.stringify(resource));
            while (sendQueue && sendQueue.length != 0) {
                let { req, res } = sendQueue.shift()
339
                libSupport.reverseProxy(req, res, functionToResource, resourceMap, functionBranchTree)
Nilanjan Daw's avatar
Nilanjan Daw committed
340
                    .then(() => {
341

Nilanjan Daw's avatar
Nilanjan Daw committed
342 343
                    })
            }
344
            db.delete(id)
345
        }
346 347
        
        libSupport.metrics.collectMetrics({type: "scale", value: 
348 349 350
            functionToResource.get(id).length, 
            functionHash: message.functionHash, runtime: message.runtime, 
            starttime: (Date.now() - resource.deploy_request_time)})
Nilanjan Daw's avatar
Nilanjan Daw committed
351 352
    } catch (e) {
        logger.error(e.message)
353 354 355 356
    }

}

357
consumer.on('message', function (message) {
Nilanjan Daw's avatar
Nilanjan Daw committed
358
    
359 360
    let topic = message.topic
        message = message.value
Nilanjan Daw's avatar
Nilanjan Daw committed
361
    // console.log(topic, message)
362
    if (topic === "response") {
363
        logger.info("response " + message);
Nilanjan Daw's avatar
Nilanjan Daw committed
364
        
Nilanjan Daw's avatar
Nilanjan Daw committed
365
        
366
    } else if (topic === constants.topics.heartbeat) {
367
        message = JSON.parse(message)
368
        if (Date.now() - message.timestamp < 1000)
369 370 371 372
            if (!workerNodes.has(message.address))  {
                workerNodes.set(message.address, message.timestamp)
                logger.warn("New worker discovered. Worker List: ")
                logger.warn(workerNodes)
Nilanjan Daw's avatar
Nilanjan Daw committed
373
            }
374
    } else if (topic == constants.topics.deployed) {
375 376 377 378 379
        try {
            message = JSON.parse(message)
        } catch (e) {
            // process.exit(0)
        }
380
        postDeploy(message)
nilanjandaw's avatar
nilanjandaw committed
381
        
382
    } else if (topic == constants.topics.remove_worker) {
383
        logger.warn("Worker blown: Removing Metadata " + message);
384 385 386 387 388
        try {
            message = JSON.parse(message)
        } catch(e) {
            // process.exit(0)
        }
nilanjandaw's avatar
nilanjandaw committed
389
        usedPort.delete(message.port)
390 391 392
        let id = message.functionHash + message.runtime
        if (functionToResource.has(id)) {
            let resourceArray = functionToResource.get(id)
393 394 395 396 397 398 399
            for (let i = 0; i < resourceArray.length; i++)
                if (resourceArray[i].resource_id === message.resource_id) {
                    resourceArray.splice(i, 1);
                    break;
                }

            heap.heapify(resourceArray, libSupport.compare)
400 401
            libSupport.metrics.collectMetrics({type: "scale", value: 
                resourceArray.length, 
Nilanjan Daw's avatar
Nilanjan Daw committed
402
                functionHash: message.functionHash, runtime: message.runtime})
403 404 405 406 407 408 409 410 411
            libSupport.logBroadcast({
                entity_id: message.entity_id,
                "reason": "terminate",
                "total_request": message.total_request,
                "status": true
            }, message.resource_id, resourceMap)
            .then(() => {
                resourceMap.delete(message.resource_id)
                if (resourceArray.length == 0)
412
                    functionToResource.delete(id)
413
            })
414 415
            
        }
416

417 418
        

419
    } else if (topic == constants.topics.hscale) {
420
        message = JSON.parse(message)
421
        let resource_id = libSupport.makeid(constants.id_size), // each function resource request is associated with an unique ID
422 423
            runtime = message.runtime,
            functionHash = message.functionHash
424
        logger.info(`Generated new resource ID: ${resource_id} for runtime: ${runtime}`);
Nilanjan Daw's avatar
Nilanjan Daw committed
425 426
        console.log("Resource Status: ", functionToResource);
        
427 428 429
        /**
         * Request RM for resource
         */
430 431 432 433 434 435
        logger.info("Requesting RM " + JSON.stringify({
            resource_id,
            "memory": 332,
        }))

        resourceMap.set(resource_id, {
436
            runtime, functionHash, port: null, node_id: null,
437
            deployed: false, deploy_request_time: Date.now()
438
        })
Nilanjan Daw's avatar
Nilanjan Daw committed
439 440 441


        let payloadToRM = [{
442
            topic: constants.topics.request_dm_2_rm, // changing from REQUEST_DM_2_RM
Nilanjan Daw's avatar
Nilanjan Daw committed
443 444 445 446 447 448 449 450 451 452
            messages: JSON.stringify({
                resource_id,
                "memory": 332,
            }),
            partition: 0
        }]
        producer.send(payloadToRM, () => {
            // db.set(functionHash + runtime, { req, res })
            console.log("sent rm");

453
        })
454
    } else if (topic == constants.topics.response_rm_2_dm) {
Nilanjan Daw's avatar
Nilanjan Daw committed
455
        
Nilanjan Daw's avatar
Nilanjan Daw committed
456
        logger.info("Response from RM: " + message);
Nilanjan Daw's avatar
Nilanjan Daw committed
457
        message = JSON.parse(message)
Nilanjan Daw's avatar
Nilanjan Daw committed
458
        let resourceChoice = message.nodes[0]
Nilanjan Daw's avatar
Nilanjan Daw committed
459 460
        if (resourceMap.has(message.resource_id)) {
            let resource = resourceMap.get(message.resource_id)
Nilanjan Daw's avatar
Nilanjan Daw committed
461 462 463 464 465 466 467 468
            if (typeof resourceChoice === 'string') {
                resource.port = libSupport.getPort(usedPort)
                resource.node_id = resourceChoice
            } else {
                resource.port = (resourceChoice.port) ? resourceChoice.port : libSupport.getPort(usedPort)
                resource.node_id = resourceChoice.node_id
            }
            
Nilanjan Daw's avatar
Nilanjan Daw committed
469 470 471 472 473 474
            let payload = [{
                topic: resource.node_id,
                messages: JSON.stringify({
                    "type": "execute", // Request sent to Dispatch Daemon via Kafka for actual deployment at the Worker
                    resource_id: message.resource_id,
                    runtime: resource.runtime, functionHash: resource.functionHash,
475 476 477
                    port: resource.port, resources: {
                        memory: resource.memory
                    }
Nilanjan Daw's avatar
Nilanjan Daw committed
478 479 480
                }),
                partition: 0
            }]
481
            // logger.info(resourceMap);
Nilanjan Daw's avatar
Nilanjan Daw committed
482 483 484
            producer.send(payload, () => {
                logger.info(`Resource Deployment request sent to Dispatch Agent`)
            })
485
        } else {
Nilanjan Daw's avatar
Nilanjan Daw committed
486
            logger.error("something went wrong, resource not found in resourceMap")
487
        }
Nilanjan Daw's avatar
Nilanjan Daw committed
488
        
489
    }
490
});
491

492 493 494
function autoscalar() {
    functionToResource.forEach((resourceList, functionKey, map) => {
        
495 496
        if (resourceList.length > 0 && 
            resourceList[resourceList.length - 1].open_request_count > constants.autoscalar_metrics.open_request_threshold) {
497 498 499
            let resource = resourceMap.get(resourceList[resourceList.length - 1].resource_id)
            logger.warn(`resource ${resourceList[resourceList.length - 1]} exceeded autoscalar threshold. Scaling up!`)
            let payload = [{
500
                topic: constants.topics.hscale,
501 502 503 504 505 506 507 508
                messages: JSON.stringify({ "runtime": resource.runtime, "functionHash": resource.functionHash })
            }]
            producer.send(payload, function () { })
        }
    });

}

509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555
/**
 * Speculative deployment:
 * If function MLE path is present then deploy those parts of the path which are
 * not already running
 * 
 * FIXME: Currently supports homogenous runtime chain i.e takes runtime as a param. 
 * Change it to also profile runtime
 */
async function speculative_deployment(req, runtime) {
    if (constants.speculative_deployment && req.headers['x-resource-id'] === undefined) {
        console.log(functionBranchTree, req.params.id);

        if (functionBranchTree.has(req.params.id)) {
            let branchInfo = functionBranchTree.get(req.params.id)
            console.log("mle_path", branchInfo.mle_path);

            if (branchInfo.mle_path && branchInfo.mle_path.length > 1) {
                for (let node of branchInfo.mle_path)
                    node.id = node.node
                let metrics = await libSupport.fetchData(metricsDB + "_bulk_get", {
                    method: 'post',
                    body: JSON.stringify({
                        docs: branchInfo.mle_path
                    }),
                    headers: { 'Content-Type': 'application/json' },
                })
                console.log(util.inspect(metrics, false, null, true /* enable colors */))
                
                for (let node of branchInfo.mle_path) {
                    // console.log(functionToResource);

                    if (!functionToResource.has(node.node + runtime) && !db.has(node.node + runtime)) {
                        console.log("Deploying according to MLE path: ", node.node);

                        let payload = [{
                            topic: constants.topics.hscale,
                            messages: JSON.stringify({ "runtime": "container", "functionHash": node.node })
                        }]
                        producer.send(payload, function () { })
                        db.set(node.node + runtime, [])
                    }
                }
            }
        }
    }
}

556
setInterval(libSupport.viterbi, 1000, functionBranchTree)
557 558
setInterval(autoscalar, 1000);
setInterval(dispatch, 1000);
559
app.listen(port, () => logger.info(`Server listening on port ${port}!`))