Get logs inside a Unikernel instance

20 views
Skip to first unread message

robertob

unread,
Mar 7, 2019, 6:18:30 AM3/7/19
to OSv Development
I have two instances of a my Unikernel image. This image is built on top of a Cloudious JDK8 image and run a small simulator written in Java. 

The instances see each other through a different network and bridge configuration. So we use "-n bridge" and set the --e parameter with 10.0.0.x IPs with name server and gateway. 

Now we need to get the logs written by the Java application inside the running image. 

How to do this task?

Regards

r

Waldek Kozaczuk

unread,
Mar 7, 2019, 1:55:25 PM3/7/19
to OSv Development
Hi,

One way is to use REST api to get file from OSv. Just add httpserver-api module to your image.

Waldek

roberto battistoni

unread,
Mar 8, 2019, 8:53:45 AM3/8/19
to Waldek Kozaczuk, OSv Development
The problem is that the two instances run on a separate network and I do not understand how to reach them from the outside...

The startup command is this:

first instance: capstan run -n "bridge" -e "--ip=eth0,10.0.0.2,255.255.255.0 --defaultgw=10.0.0.1 --nameserver=10.0.0.1 /java.so -jar /my.jar"
second instance: capstan run -n "bridge" -e "--ip=eth0,10.0.0.3,255.255.255.0 --defaultgw=10.0.0.1 --nameserver=10.0.0.1 /java.so -jar /my.jar"  

And the Capstanfile is this:

base: cloudius/osv-openjdk8
cmdline: /java.so
files:
  /my.jar: my.jar

The problem is that I cannot reach the IP 10.0.0.2 o 10.0.0.3 from the outside.

regards

r

--
You received this message because you are subscribed to a topic in the Google Groups "OSv Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/osv-dev/1d_ZRZmn4P8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to osv-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

robertob

unread,
Mar 11, 2019, 7:01:50 AM3/11/19
to OSv Development
Any advice? 

regards


Il giorno venerdì 8 marzo 2019 14:53:45 UTC+1, robertob ha scritto:
The problem is that the two instances run on a separate network and I do not understand how to reach them from the outside...

The startup command is this:

first instance: capstan run -n "bridge" -e "--ip=eth0,10.0.0.2,255.255.255.0 --defaultgw=10.0.0.1 --nameserver=10.0.0.1 /java.so -jar /my.jar"
second instance: capstan run -n "bridge" -e "--ip=eth0,10.0.0.3,255.255.255.0 --defaultgw=10.0.0.1 --nameserver=10.0.0.1 /java.so -jar /my.jar"  

And the Capstanfile is this:

base: cloudius/osv-openjdk8
cmdline: /java.so
files:
  /my.jar: my.jar

The problem is that I cannot reach the IP 10.0.0.2 o 10.0.0.3 from the outside.

regards

r

Waldek Kozaczuk

unread,
Mar 11, 2019, 9:38:13 AM3/11/19
to OSv Development
Adding -f "10022:22" should expose the port to the host. Which hypervisor are you running it on - QEMU/KVM, VirtualBox, VMWare, Xen?

Waldek

roberto battistoni

unread,
Mar 12, 2019, 10:47:36 AM3/12/19
to Waldek Kozaczuk, OSv Development
I use the QEMU hypervisor. 

The problem is that in the Capstanfile the "base:" is "cloudius/osv-openjdk8" and I do not understand how add another base image like "httpserver" or "cloudius/osv" to activate the REST services. 

Any suggestion?

regards

r

Waldek Kozaczuk

unread,
Mar 13, 2019, 12:06:53 PM3/13/19
to OSv Development
Hi,

You can easily do this with newest mikelangelo capstan using compose-family-of-commands (https://github.com/mikelangelo-project/capstan/blob/master/Documentation/generated/CLI.md#working-with-application-packages - ala docker compose). 

My sense is that your are using old capstan with Capstan file. Which version of OSv is displayed when running it? As I mentioned in my other email I would strongly suggest using new capstan. Also new package mode vs Capstanfile.  

Lastly see this docket project for many examples of apps built using new capstan - https://github.com/wkozaczuk/docker_osv_runner. Look for require section in package.yaml in this example - https://github.com/wkozaczuk/docker_osv_runner/blob/7eb359addb9cd1ff5af18e2d0ac9c4c4fc9d2a29/apps/ffmpeg/meta/package.yaml

Waldek

PS. Some other docs that may help you:

Roberto Battistoni

unread,
Mar 16, 2019, 1:57:28 AM3/16/19
to Waldek Kozaczuk, OSv Development

Hi,

On 13/03/2019 17:06, Waldek Kozaczuk wrote:
Hi,

You can easily do this with newest mikelangelo capstan using compose-family-of-commands (https://github.com/mikelangelo-project/capstan/blob/master/Documentation/generated/CLI.md#working-with-application-packages - ala docker compose).
I suppose the same thing, but for my research I needed only the log inside the images and I didn't want to upgrade everything for a residual part.

My sense is that your are using old capstan with Capstan file. Which version of OSv is displayed when running it?
0.24
As I mentioned in my other email I would strongly suggest using new capstan. Also new package mode vs Capstanfile.  

Lastly see this docket project for many examples of apps built using new capstan - https://github.com/wkozaczuk/docker_osv_runner. Look for require section in package.yaml in this example - https://github.com/wkozaczuk/docker_osv_runner/blob/7eb359addb9cd1ff5af18e2d0ac9c4c4fc9d2a29/apps/ffmpeg/meta/package.yaml

thanks you so much Waldek you helped me a lot

r.

Reply all
Reply to author
Forward
0 new messages