Welcome to the Linux Foundation Forum!

ops Unikernels: curl hanging after request to ops pkg load demo.js

Hi, I'm going trough chapter 8 and tried to follow the part about creating a unikernel with ops, but curl is hanging. The Vanilla Network security feature was triggered when I tried to submit the whole procedure of what I did here, but I will try to describe the situation as best as I can.

Following the instructions, I installed ops:
curl verbose option (minus v) https://ops.city/get.sh pipe sh # If I actually type the command Vanilla Site Security will be triggered.

Then created a demo.js file with the content:

var http = require('http');
http.createServer(function (req, res) {
    res.writeHead(200, {
        'Content-Type': 'text/plain'});
}).listen(8083, "0.0.0.0");
console.log('Server at http://127.0.0.1:8083');

Then I did:

$ ops pkg load eyberg/node:20.5.0 -p 8083 -a demo.js
running local instance
booting /home/marco/.ops/images/node ...
en1: assigned 10.0.2.15
Server at http://127.0.0.1:8083

Finally, in another terminal:

$ curl -v 127.0.0.1:8083
*   Trying 127.0.0.1:8083...
* Connected to 127.0.0.1 (127.0.0.1) port 8083 (#0)


  GET / HTTP/1.1

No matter how much time I wait, I will get nothing from localhost or 127.0.0.1. nmap -p 8083 localhost reveals the port is open and it closes when I stop the ops command.

Am I doing something wrong?

Answers

  • Silly mistake of mine... I was just missing the line: res.end('Hello from unikernel VM\n');

    Sorry and thanks

Categories

Upcoming Training