SQLite using ops #1619
Replies: 5 comments 13 replies
-
what exactly are you wanting to do? you can do something like this:
but you should know that running sqlite (w/out sql) and just passing a test.db will put you into an interactive mode which we don't support as these are intended to run as servers/daemons or non-interactive jobs that do work and spin down if you want to incorporate sqlite into your application all languages have bindings for that, if you want to run a sqlite server |
Beta Was this translation helpful? Give feedback.
-
I tried a new approach with c, so this is csqlite.c file. I tried to run it using // config.json
usr folder :
I am getting this error: ` *** signal 11 received by tid 2, errno 0, code 2 *** Thread context:
active_cpu: 00000000ffffffff
frame trace: kernel load offset ffffffffa14d8000 loaded klibs: stack trace: core dump |
Beta Was this translation helpful? Give feedback.
-
so there are a handful of issues you are running into here:
you'll want to specify the proper arch for what the pkg is if it's not the architecture that you are currently on (being detected)
by default, while you can do a '-s' or '--skipbuild' that will prevent new you have to copy the files out of it to get your results; considering your use-case is that
|
Beta Was this translation helpful? Give feedback.
-
Hi, this actually gives me the whole lifecycle time of the vm, which is not good. I want to have just the boot up time. is there any way I could do this, I could not find anything related to this on docs and discussion forum? I went through this fork https://github.com/felixmoebius/nanos/tree/faas as one of the paper https://arxiv.org/abs/2403.00515 used this approach "The vm is passed a callback URL and when it gets ready, it sends a get request to the url. " but the codebase seems to have changed a lot since then. |
Beta Was this translation helpful? Give feedback.
-
Next time to help other people find this, I'd probably start a new discussion as this is somewhat different from your original post. You are correct that using time here is not going to give you good results. For one, you are timing both the building of the image and the running of it and you really only want the running part. Furthermore, ops spawns a qemu process which you probably just want the booting portion of qemu itself - not the spawning. The callback url option doesn't sound like a great idea either. In the past we've used the perf tool for this as described in https://stefano-garzarella.github.io/posts/2019-08-24-qemu-linux-boot-time/ (Note: I had to build perf from kernel source as libtraceevent was not provided in the deb pkg for some reason - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2019247 ). Essentially you'll need to modify nanos to write out to the i/o port when it hits like so:
Here i'm writing to 0xf4 the values of 10 and 200 which translate to 0xa and 0xc8 respectively. Using whatever guest program you want, such as a simple c hello world, first create your image with 'ops run myprogram' and then I just grabbed the output of that to plug into the qemu section of this script (for example):
After is has gotten the data i convert to plain text:
and now you can see your values:
(16464943.692615 - 16464943.623384) * 1000 = ~69ms which seems about right to me (on this machine i'm on) There are a handful of optimizations one can do to lower this number down. While it is interesting to look at these numbers, I view the boot time, at a certain point to be a vanity metric because there are so few workloads that can actually make use of a lower number. In fact the majority of apps will have 'real' boot times measured in seconds (eg: setup a db connection, load some static assets, etc.) and that doesn't even account for the fact that most workloads want to run for more than a few seconds anyways (like hours or days), be it a persistent webserver or even a recurring one-shot cronjob. Also, if you are trying to go for a super low number (such as <10ms) you are probably starting to carve out a ton of essential capabilities that normal workloads might have so it would be wise to figure out what that list actually is. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am trying to build SQLite image locally using the SQLite ELF.
I used this command:
ops pkg from-run --name <name of pkg> --version <version> <path to ELF>
it created a local pkg for me:
which I tried executing using :
ops pkg load --local <name_version> -a test.db
Terminal output:
so the sqlite cli is not running.. please help
Beta Was this translation helpful? Give feedback.
All reactions