- Dec 06, 2013
-
-
Tomasz Grabiec authored
Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Tomasz Grabiec authored
Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 04, 2013
-
-
Tomasz Grabiec authored
== Description of the problem == Currently modules can only specify files which need to be copied. There is a need for a module to also declare ways it can be run, so that we can automatically prepare a runnable image. It should be easy to switch between run configurations. Currently it is enough for image configuration to happen at the time of image make process. In future this should be allowed on the already built image. We also need to be able to combine multiple modules in one image. For example in addition to the main application one might want to start various services like CLI, management API server, etc. Java apps should be able to specify JVM arguments, which must be passed to the JVM upon its creation, as well as regular run-java arguments (classpath, main classes, main arguments, etc.) == Solution == This is not intended to be a permanent solution. The aim is to solve immediate need to have a fully modularized build in a scalable way. Every module has a new kind of file in its root directory which holds its configuration. The file is named 'module.py' and is a python script which uses osv's api for declaring run configurations. Using python as config language has several advantages: - more expresiveness, unlike json it allows for expression reuse - it's easier to extend the config language - we don't need as much parsing, gluing, error checking, error reporting code because we have it already There are currently two kinds of applications which can be declared: run(cmdline) <- basic .so application run_java(jvm_args=[], classpath=[], args=[]) <- java applications Run configurations can be declared as simple module attributes which can be referenced from the image configuration file. Image configuration There is a new configuration file kind, which defines which modules and which run configurations should be included in the image. Files are located using path: ${OSV_BASE}/images/$(image-name).py Syntax: require(module) <-- declares that module should be included in the image and returns an object which allows to access module's attributes. run = [] <-- list of run configurations Example: _mgmt = require('mgmt') run = [ _mgmt.shell ] To use a particular image configuration run make like this: make image=fancy-tomcat The default configuration is named 'default'. This patch extracts mgmt into a module, which is embedded under ${OSV_BASE}/modules/mgmt The purpose of ${OSV_BASE}/config.json has been changed. It does not list modules which should be included anymore, image config file does that. It's a module look-up configuration which tells the build where to look for modules. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
We have an intermediate bare.img now. Rename usr.raw to bare.raw to make the naming more consistent: bare.raw -> bare.img -> usr.img. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 03, 2013
-
-
Benoît Canet authored
This will allow the users to populate /usr with simples binaries like haproxy and their config at runtime. It's intented to be combined with the loader ability to run multiple binaries in a sequential way. For example -e '/tools/cpiod.so; /usr/haproxy.so -f /usr/haproxy.conf' Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Benoît Canet authored
This pave the way for the creation of bare images that the user can populate using cpiod when he need it. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Benoît Canet authored
A ';' at the end of a parameter mark the end of a program's arguments list. The goal of this patch is to be able to split mkfs.so in to parts mkfs.so and cpiod.so. The patch uses a full spirit parser to escape "" and split commands around ';'. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 01, 2013
-
-
Pekka Enberg authored
Add a simple test case for "/dev/random" which just reads from the file and prints out the random bytes. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
This adds the virtio-rng driver to OSv. The implementation is simple: - Start a thread that keeps 64 byte of entropy cached in internal buffer. Entropy is gathered from the host with virtio-rng. - Create device nodes for "/dev/random" and "/dev/urandom" that both use the same virtio_rng_read() hook. - Use the entropy buffer for virtio_rng_read(). If we exhaust the buffer, wake up the thread and wait for more entropy to appear. We eventually should move device node creation to separate drivers/random.c that multiplexes between different hardware RNG implementations. However, as we only support virtio-rng, I'm leaving that to whomever implements support for the next RNG. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 29, 2013
-
-
Tomasz Grabiec authored
This patch changes module.py so that it generates both manifests at once. We do not need to have it split. Doing it in one step makes we also need to resolve modules once. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 27, 2013
-
-
Tomasz Grabiec authored
There is a race between "usr.manifest" and "bootfs.manifest" rules which both call module.py. The script does complex stuff wrt module preparation like fetching module files, calling make, etc. and should not be run concurrently. This change fixes the problem by moving the calls into one rule. This is not the end of the story, more refactoring will follow. The module.py script should be split into parts, one that fetches modules and one that generates manifests. This way the dependencies could be made more fine grained and jobs paralellized. This fixes issue #100. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
This patch adds tst-scheduler.cc, containing a few tests for the fairness of scheduling of several threads on one CPU (for scheduling issues involving load-balancing across multiple CPUs, check out the existing tst-loadbalance). The test is written in standard C++11, so it can be compiled and run on both Linux and OSv, to compare their scheduler behaviors. It is actually more a benchmark then a test (it doesn't "succeed" or "fail"). The test begins with several tests of the long-term fairness of the schduler when threads of different or identical priorities are run for 10 seconds, and we look at how much work each thread got done in those 10 seconds. This test only works on OSv (which supports float priorities). The second part of the test again tests long-term fairness of the scheduler when all threads have the default priority (so this test is standard C++11): We run a loop which takes (when run alone) 10 seconds, on 2 or 3 threads in parallel. We expect to see that all 2 or 3 threads finish at (more-or-less) exactly the same time - after 20 or 30 seconds. Both OSv and Linux pass this test with flying colors. The third part of the test runs two different threads concurrently: 1. One thread wants to use all available CPU to loop for 10 seconds. 2. The second thread wants to loop in an amount that takes N milliseconds, and then sleep for N milliseconds, and so on, until completing the same number of loop iterations that (when run alone) takes 10 seconds. The "fair" behavior of the this test is that both threads get equal CPU time and finish together: Thread 2 runs for N milliseconds, then while it is sleeping for N more, Thread 1 gets to run. This measure this for N=1 through 32ms. In OSv's new scheduler, indeed both threads get an almost fair share (with N=32ms, one thread finishes in 19 seconds, the second in 21.4 seconds; we don't expect total fairness because of the runtime decay). Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 26, 2013
-
-
Avi Kivity authored
Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Some functions (strerror_r()) are defined differently based on the source dialect. We need to provide both dialects since we have mixed source. Add a source-dialect macro (defaulting to _GNU_SOURCE) and override it as appropriate. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Raphael S. Carvalho authored
v2: Let's convert everything to std::chrono::timepoint (Avi Kivity) v3: Use the to_timeptr approach suggested by Nadav Har'El This test checks the functionality of the utimes support. Signed-off-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 25, 2013
-
-
Amnon Heiman authored
Start up shell and management web in parallel to make boot faster. Note that we also switch to latest mgmt.git which decouples JRuby and CRaSH startup. Signed-off-by:
Amnon Heiman <amnon@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
This adds a simple mmap microbenchmark that can be run on both OSv and Linux. The benchmark mmaps memory for various sizes and touches the mmap'd memory in 4K increments to fault in memory. The benchmark also repeats the same tests using MAP_POPULATE for reference. OSv page faults are slightly slower than Linux on first iteration but faster on subsequent iterations after host operating system has faulted in memory for the guest. I've included full numbers on 2-core Sandy Bridge i7 for a OSv guest, Linux guest, and Linux host below: OSv guest --------- Iteration 1 time (seconds) MiB demand populate 1 0.004 0.000 2 0.000 0.000 4 0.000 0.000 8 0.001 0.000 16 0.003 0.000 32 0.007 0.000 64 0.013 0.000 128 0.024 0.000 256 0.052 0.001 512 0.229 0.002 1024 0.587 0.005 Iteration 2 time (seconds) MiB demand populate 1 0.001 0.000 2 0.000 0.000 4 0.000 0.000 8 0.001 0.000 16 0.002 0.000 32 0.004 0.000 64 0.010 0.000 128 0.019 0.001 256 0.036 0.001 512 0.069 0.002 1024 0.137 0.005 Iteration 3 time (seconds) MiB demand populate 1 0.001 0.000 2 0.000 0.000 4 0.000 0.000 8 0.001 0.000 16 0.002 0.000 32 0.005 0.000 64 0.010 0.000 128 0.020 0.000 256 0.039 0.001 512 0.087 0.002 1024 0.138 0.005 Iteration 4 time (seconds) MiB demand populate 1 0.001 0.000 2 0.000 0.000 4 0.000 0.000 8 0.001 0.000 16 0.002 0.000 32 0.004 0.000 64 0.012 0.000 128 0.025 0.001 256 0.040 0.001 512 0.082 0.002 1024 0.138 0.005 Iteration 5 time (seconds) MiB demand populate 1 0.001 0.000 2 0.000 0.000 4 0.000 0.000 8 0.001 0.000 16 0.002 0.000 32 0.004 0.000 64 0.012 0.000 128 0.028 0.001 256 0.040 0.001 512 0.082 0.002 1024 0.166 0.005 Linux guest ----------- Iteration 1 time (seconds) MiB demand populate 1 0.001 0.000 2 0.001 0.000 4 0.002 0.000 8 0.003 0.000 16 0.005 0.000 32 0.008 0.000 64 0.015 0.000 128 0.151 0.001 256 0.090 0.001 512 0.266 0.003 1024 0.401 0.006 Iteration 2 time (seconds) MiB demand populate 1 0.000 0.000 2 0.000 0.000 4 0.001 0.000 8 0.001 0.000 16 0.002 0.000 32 0.005 0.000 64 0.009 0.000 128 0.019 0.001 256 0.037 0.001 512 0.072 0.003 1024 0.144 0.006 Iteration 3 time (seconds) MiB demand populate 1 0.000 0.000 2 0.001 0.000 4 0.001 0.000 8 0.001 0.000 16 0.002 0.000 32 0.005 0.000 64 0.010 0.000 128 0.019 0.001 256 0.037 0.001 512 0.072 0.003 1024 0.143 0.006 Iteration 4 time (seconds) MiB demand populate 1 0.000 0.000 2 0.001 0.000 4 0.001 0.000 8 0.001 0.000 16 0.003 0.000 32 0.005 0.000 64 0.010 0.000 128 0.020 0.001 256 0.038 0.001 512 0.073 0.003 1024 0.143 0.006 Iteration 5 time (seconds) MiB demand populate 1 0.000 0.000 2 0.001 0.000 4 0.001 0.000 8 0.001 0.000 16 0.003 0.000 32 0.005 0.000 64 0.010 0.000 128 0.020 0.001 256 0.037 0.001 512 0.072 0.003 1024 0.144 0.006 Linux host ---------- Iteration 1 time (seconds) MiB demand populate 1 0.000 0.000 2 0.001 0.000 4 0.001 0.000 8 0.001 0.000 16 0.002 0.000 32 0.005 0.000 64 0.009 0.000 128 0.019 0.001 256 0.035 0.001 512 0.152 0.003 1024 0.286 0.011 Iteration 2 time (seconds) MiB demand populate 1 0.000 0.000 2 0.000 0.000 4 0.001 0.000 8 0.001 0.000 16 0.002 0.000 32 0.004 0.000 64 0.010 0.000 128 0.018 0.001 256 0.035 0.001 512 0.192 0.003 1024 0.334 0.011 Iteration 3 time (seconds) MiB demand populate 1 0.000 0.000 2 0.000 0.000 4 0.001 0.000 8 0.001 0.000 16 0.002 0.000 32 0.004 0.000 64 0.010 0.000 128 0.018 0.001 256 0.035 0.001 512 0.194 0.003 1024 0.329 0.011 Iteration 4 time (seconds) MiB demand populate 1 0.000 0.000 2 0.000 0.000 4 0.001 0.000 8 0.001 0.000 16 0.002 0.000 32 0.004 0.000 64 0.010 0.000 128 0.018 0.001 256 0.036 0.001 512 0.138 0.003 1024 0.341 0.011 Iteration 5 time (seconds) MiB demand populate 1 0.000 0.000 2 0.000 0.000 4 0.001 0.000 8 0.001 0.000 16 0.002 0.000 32 0.004 0.000 64 0.010 0.000 128 0.018 0.001 256 0.035 0.001 512 0.135 0.002 1024 0.324 0.011 Reviewed-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 21, 2013
-
-
Avi Kivity authored
The test creates and destroys threads, each of which creates a random number of connections, each transferring a random number of bytes to an echo server. This is used to stress the tcp/ip stack. The test is portable, and builds on the host with the command g++ -O2 -g3 -pthread -std=gnu++11 -lboost_program_options -lboost_system tests/tst-tcp.cc Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 14, 2013
-
-
Pekka Enberg authored
Commit 0dcf1f8f ("OSv module support") didn't add a dependency to bootfs.manifest.skel and usr.manifest.skel which causes image not to be rebuilt if the files are changed. Fix that up. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 13, 2013
-
-
Tomasz Grabiec authored
Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Takuya ASADA authored
The idea of the patch is basically described in prevoius post: https://groups.google.com/d/msg/osv-dev/RL2S3AL9TNE/l4XZJo3-lI0J Whis this patch, you will be able to install OSv apps into disk image on "make all" stage. These apps does not require to exist in OSv repository, you can install apps which is on any git repository or svn repository, or on local directory. You'll need to write a config file to add apps, format of the file is JSON. Here's a sample of the file: { "modules":[ { "name":"osv-mruby", "type":"git", "path":"https://github.com/syuu1228/osv-mruby.git", "branch":"master" } ] } If you add "module" on config file, make all calls script/module.py. This scripts perform "git clone" to fetch repository to $(out)/module, and invoke "make module" on each module. "make module" should outputs bootfs.manifest/usr.manifest on module directory, the script merge bootfs.manifest.skel/usr.manifest.skel and module local manifests to single file $(out)/bootfs.manifest/$(out)/usr.manifest. Here's app Makefile example: https://github.com/syuu1228/osv-mruby/blob/master/Makefile It have "module" target, and the target builds all binaries and generates *.manifest. Signed-off-by:
Takuya ASADA <syuu@dokukino.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 11, 2013
-
-
Dmitry Fleytman authored
Default image format stays QCOW2 as before. May be changed via img_format variable: make img_fomat=raw all This option is required by release-ec2 script as EC2 does not support QCOW2. Also will be useful for other hypervisors like VMWARE. Signed-off-by:
Dmitry Fleytman <dmitry@daynix.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 07, 2013
-
-
Avi Kivity authored
Dead code, and boost::signals2::signal<> does the job better. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 05, 2013
-
-
Benoît Canet authored
Make use of the python nbd client. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Nov 04, 2013
-
-
Avi Kivity authored
Consolidates generated files, and makes it easier to maintain the eclipse index. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Tomasz Grabiec authored
I dismissed the idea to configure the bridge in default JVM configuration because having a default like this would force all apps to use particular slf4j-api version. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
- Oct 30, 2013
-
-
Nadav Har'El authored
This patch simplifies the host-side work in the new /usr zfs filesystem build process. Previously, we copied the files to a temporary directory, used "cpio" to archive them and sent its output to the guest with "netcat". With this patch, we no longer have a temporary directory, and do not need either cpio or netcat on the build machine. Rather, mkzfs.py itself, using python (instead of a separate "nc" process), connects to the guest and sends it the files - still using the CPIO format. Rather than arbitrarily sleep for 3 seconds before the host tries to connect to the guest (which might not be enough for some, or a waste of time for others), with this patch the host looks at the guest's output and connects when it sees the message "Waiting for connection". Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
Pekka Enberg authored
The tst-zfs-simple.so test case has serverd its purpose for bringup. As OSv build relies on working ZFS now, there's no need to run the tests. Furthermore, we have the full ztest stress test in the tree: bsd/cddl/contrib/opensolaris/cmd/ztest/ztest.c which we can use if needed. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Oct 29, 2013
-
-
Tomasz Grabiec authored
The call to namei("/dir/file/") currently fails with ENOENT when "/dir/file" exists. A more standard way is to return ENOTDIR instead. This way calls to stat, open, rename, etc. will be in line with the POSIX spec. It is also useful to rename() implementation which needs to differentiate behaviour between the case in which target does not exist and the case in which it does but the path has trailing slash and the last component is not a directory. In addition to that the check was performed in an inconsistent matter - only when dentry lookup failed. This change makes the check performed always. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Avi Kivity authored
When converting a source file from .c to .cc, make will complain that the old source file was missing. This is annoying, especially when bisecting or compile-testing a patch set. Fix by removing the source file dependency. Since the dependency is alread specified explicitly by the makefile, no information is lost. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Oct 28, 2013
-
-
Pekka Enberg authored
Add 'werror' option to Makefile that can be used to disable the -Werror GCC option temporarily as follows: make werror=0 This is useful when fixing up build breakage caused by addition of new default compiler warnings. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Oct 25, 2013
-
-
Or Cohen authored
Some distributions have enabled gcc -Wformat-security by default. This causes the build to raise format warnings even though -Wformat=0 is used. Setting no-format-security for build consistency between distros. Signed-off-by:
Or Cohen <orc@fewbytes.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Oct 24, 2013
-
-
Benoît Canet authored
Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Benoît Canet authored
Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Tomasz Grabiec authored
For example, assuming the following file exists: /tmp/dir/x ..the following was sondiered absent: /tmp/dir/ ..this was considered present: /tmp/dir Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
- Oct 23, 2013
-
-
Tomasz Grabiec authored
Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Tomasz Grabiec authored
Needed to link with boost_filesystem. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Pekka Enberg authored
This patch adds version numbering to the loader. We use "git tag" for generating an unique version number with a little bit of shell script magic to make sure version number is always up-to-date. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-