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:

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

Then I did:

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

Finally, in another terminal:

  1. $ curl -v 127.0.0.1:8083
  2. * Trying 127.0.0.1:8083...
  3. * Connected to 127.0.0.1 (127.0.0.1) port 8083 (#0)
  4.  
  5.  
  6. 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

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training