Skip to content
Snippets Groups Projects
  1. Dec 15, 2013
  2. Dec 04, 2013
    • Tomasz Grabiec's avatar
      modules: Add support for run configurations · ccc51b6f
      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: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      ccc51b6f
  3. Nov 27, 2013
  4. Nov 13, 2013
    • Takuya ASADA's avatar
      OSv module support · 0dcf1f8f
      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: default avatarTakuya ASADA <syuu@dokukino.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      0dcf1f8f
  5. Nov 05, 2013
  6. Oct 18, 2013
  7. Oct 15, 2013
  8. Oct 13, 2013
  9. Oct 01, 2013
  10. Sep 30, 2013
  11. Sep 25, 2013
  12. Sep 24, 2013
  13. Sep 23, 2013
    • Nadav Har'El's avatar
      Makefile: Don't hide Gradle's progress · c0ae1bbe
      Nadav Har'El authored
      
      Currently, OSv's "make" builds both the kernel, using a normal Makefile,
      and the sample management framework, using the "Gradle" tool.
      
      We carefully hid Gradle's progress under one output line "GRADLE", but
      this leads to the "make" process hanging for a long time - up to several
      minutes, and all the puzzled user sees is the line "GRADLE". Users who
      didn't go for coffee will likely kill the build at this point ;-) Even
      worse, when Gradle fails, or just hangs (e.g., a bad or slow network
      connection), the user won't even know why.
      
      So let's just run Gradle normally, and let the user see its full output.
      This output is rather pretty and organized, so no real reason to hide it.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      c0ae1bbe
    • Nadav Har'El's avatar
      Clean up "tags" and "TAGS" target · ea6a0dca
      Nadav Har'El authored
      
      Each of the "tags" and "TAGS" make targets was done in a different way,
      causing each to have a different problem:
      
       1. "tags" (ctags) used the "-L" option which turns out is nonportable
          (only available in Exuberant Ctags).
       2. "TAGS" (etags) ran the etags command separately for each source file,
          slowing it down.
      
      The best of both worlds is to use xargs to have ctags/etags operate on
      multiple files in each run using xargs. Because we cannot be sure xargs
      will run ctags/etags only once, we must delete the file first and use
       the "-a" (append) option.
      
      Also, this patch reduces code duplication - there is now one rule for
      both "tags" and "TAGS" targets that uses the correct tool (ctags or etags,
      respectively).
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      ea6a0dca
  14. Sep 20, 2013
  15. Sep 17, 2013
    • Pekka Enberg's avatar
      Makefile: Add target for generating tags · 05264097
      Pekka Enberg authored
      
      Running "ctags -R" takes a long time because of git submodules:
      
        [penberg@localhost osv]$ time ctags -R
      
        real	0m35.076s
        user	0m18.770s
        sys	0m3.929s
      
      Add a "make tags" target that's much faster to run:
      
        [penberg@localhost osv]$ time make tags
        find . -name "*.cc" -o -name "*.hh" -o -name "*.h" -o -name "*.c" | ctags -L -
      
        real	0m0.980s
        user	0m1.033s
        sys	0m0.158s
      
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      05264097
  16. Sep 16, 2013
  17. Sep 14, 2013
  18. Aug 29, 2013
  19. Jun 18, 2013
  20. May 31, 2013
  21. Apr 22, 2013
    • Nadav Har'El's avatar
      Add build framework for Java classes and JNI · 448a1d51
      Nadav Har'El authored
      Added build ("make") framework for compiling Java code we want to run in
      OSv (in/with the Java payload), as well as JNI, i.e., OSv-specific C code
      we want to run from the above Java code.
      
      The Java source files in java/src/ are now all compiled during build
      (see java/build.xml for the Ant file doing this compilation) and the
      result is one JAR, build/$mode/java/cloudius.jar (/cloudius.jar in bootfs).
      We can easily change build.xml to create more than one if we want.
      
      As an example of JNI, I used the not-working-yet balloon feature.
      java/src/com/cloudius/balloon/Balloon.java is the class
      com.cloudius.balloon.Balloon which is supposed to have one "native"
      (implemented in C) function giveup(). This function's implementation is
      in java/jni/balloon.c. We get this file to compile to balloon.so (put
      in /usr/lib/jni in the bootfs) by adding java/jni/balloon.so to the
      "jni" list in build.mak.
      
      If you don't know how write the ugly function signature as seen in
      java/jni/balloon.c, you can run "javah com.cloudius.balloon.Balloon"
      to build the empty functions needed for implementing the native functions
      defined in the above class.
      448a1d51
  22. Apr 02, 2013
    • Avi Kivity's avatar
      build: delete targets on error · 4ad1c842
      Avi Kivity authored
      If a target fails to build, it is probably corrupted.  Delete it.
      
      Fixes misbuild after a second make with an incorrect bootfs.manifest.
      4ad1c842
  23. Mar 19, 2013
  24. Jan 30, 2013
  25. Jan 27, 2013
  26. Jan 11, 2013
  27. Dec 28, 2012
  28. Dec 27, 2012
Loading