Yuneta

_images/yuneta.png

What is Yuneta?

Yuneta is a C development framework.

Internal features:
  • asynchronous I/O, based in libuv library.
  • structured data, based in ASN.1 standard.
  • json data, based in jansson library.
  • finite state machine, based in ginsfsm library.
  • communication between yunos by json messages.

Yuneta goal is create daemons or cli’s, also called yunos.

Yuneta also give you a platform for deploy and operation of yunos.

Yuneta allows you to organize the yunos in realms of yunos.

A yuno can be a standalone program, ie, a utility, or can be a collaborator program, ie, a service, living in a realm sharing the world with others yunos.

Realms of yunos can be easily cloned, even running realms with all his persistent data.

Installation

Introduction

Yuneta uses a fixed directory for develop and deploy/operation, associated with a shared group (yuneta). This name are fixed, although it has been chosen to rarely match other names:

  • /yuneta

    Shared group directory for development, deploy and operation of realms and yunos.

Note

You can read about Linux permissions in Linux permissions demystified.

To install Yuneta follow the next instructions in order.

AS SUDO

These commands must be executed by a sudo user.

download this script.

  • Create the file /etc/profile.d/yuneta.sh and add the next content:

    # By default, we want umask to get set. This sets it for login shell
    # Current threshold for system reserved uid/gids is 200
    # You could check uidgid reservation validity in
    # /usr/share/doc/setup-*/uidgid file
    if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
        umask 002
        ulimit -c unlimited
    fi
    

ulimit -c unlimited to set core unlimited.

umask 002 to set group write permission for new files and directories.

  • Add the following line to /etc/sysctl.conf:

    kernel.core_pattern = core.%e
    
  • Load sysctl settings:

    sysctl -p
    
  • Create the shared user/group yuneta:

    adduser --home=/yuneta yuneta
    chmod 775 /yuneta/
    chmod g+s /yuneta/
    
  • Install next packages:

    • With apt-get:

      apt-get -y install autotools-dev automake autogen libtool
      apt-get -y install libpython-all-dev python-setuptools
      apt-get -y install texlive-full
      apt-get -y install tree vim
      apt-get -y install libpcre3-dev zlib1g-dev
      apt-get -y install libcurl4-openssl-dev libssl-dev libldap2-dev libidn11-dev librtmp-dev
      apt-get -y install libreadline-dev libeditline-dev liblzma-dev libbz2-dev
      apt-get -y install libgcrypt20-dev
      apt-get -y install libncurses5-dev libncursesw5-dev ncurses-doc
      apt-get -y install python-ldap libsasl2-dev
      easy_install -U sphinx
      
    • With yum:

      yum -y install python-tools python-devel
      yum -y install textlive texlive-latex
      yum -y install mercurial git cvs
      yum -y install automake libtool
      yum -y install tree
      yum -y install cmake
      yum -y install pcre-devel
      yum -y install libcurl-devel openssl openssl-devel openssl-static
      yum -y install openldap openldap-devel xz-libs xz-devel libidn-devel libssh2 libssh2-devel
      yum -y install readline-devel libedit-devel bzip2-devel
      yum -y install zlib-devel
      yum -y install libgcrypt-devel
      yum -y install ncurses-devel ncurses-term ncurses-libs ncurses
      yum -y install python-ldap libsasl2-dev
      
      yum -y install rpmdevtools rpmlint
      
  • Create the users that you want they belong to the yuneta group:

    adduser *username*
    
    usermod -a -G yuneta *username*
    

Warning

Remember re-login if you are the user executing this script and added as a new member of yuneta.

AS USER member of yuneta group (NO SUDO PLEASE!)

These commands must be executed by a user member of yuneta group.

dowload this script.

Create development directories:

mkdir /yuneta/development
mkdir /yuneta/development/bin
mkdir /yuneta/development/projects
mkdir /yuneta/development/output
mkdir /yuneta/development/yuneta

Create operation directories:

mkdir /yuneta/bin
mkdir /yuneta/realms
mkdir /yuneta/repos
mkdir /yuneta/store

Clone gobj-ecosistema:

mkdir -p /yuneta/development/yuneta/^gobj-ecosistema-v2/
hg clone ssh://hg@yuneta.io/yuneta/gobj-ecosistema-v2/docs             /yuneta/development/yuneta/^gobj-ecosistema-v2/docs
hg clone ssh://hg@yuneta.io/yuneta/gobj-ecosistema-v2/external-libs    /yuneta/development/yuneta/^gobj-ecosistema-v2/external-libs
hg clone ssh://hg@yuneta.io/yuneta/gobj-ecosistema-v2/ghelpers         /yuneta/development/yuneta/^gobj-ecosistema-v2/ghelpers
hg clone ssh://hg@yuneta.io/yuneta/gobj-ecosistema-v2/ginsfsm          /yuneta/development/yuneta/^gobj-ecosistema-v2/ginsfsm

Clone yuneta:

mkdir -p /yuneta/development/yuneta/^yuneta-v2/
hg clone ssh://hg@yuneta.io/yuneta/yuneta-v2/c-core                 /yuneta/development/yuneta/^yuneta-v2/c-core
hg clone ssh://hg@yuneta.io/yuneta/yuneta-v2/docs                   /yuneta/development/yuneta/^yuneta-v2/docs
hg clone ssh://hg@yuneta.io/yuneta/yuneta-v2/js-core                /yuneta/development/yuneta/^yuneta-v2/js-core
hg clone ssh://hg@yuneta.io/yuneta/yuneta-v2/yuno-skeleton          /yuneta/development/yuneta/^yuneta-v2/yuno-skeleton
hg clone ssh://hg@yuneta.io/yuneta/yuneta-v2/yuno_agent             /yuneta/development/yuneta/^yuneta-v2/yuno_agent
hg clone ssh://hg@yuneta.io/yuneta/yuneta-v2/yuno_cli               /yuneta/development/yuneta/^yuneta-v2/yuno_cli

Build gobj-ecosistema:

cd /yuneta/development/yuneta/^gobj-ecosistema-v2/external-libs
./configure-libs.sh
./make-libs.sh
./install-libs.sh

cd /yuneta/development/yuneta/^gobj-ecosistema-v2/ghelpers
mkdir build
cd build
cmake ..
make
make install

cd /yuneta/development/yuneta/^gobj-ecosistema-v2/ginsfsm
mkdir build
cd build
cmake ..
make
make install

Build yuneta:

cd /yuneta/development/yuneta/^yuneta-v2/c-core
mkdir build
cd build
cmake ..
make
make install

cd /yuneta/development/yuneta/^yuneta-v2/yuno_agent
mkdir build
cd build
cmake ..
make
make install

cd /yuneta/development/yuneta/^yuneta-v2/yuno_cli
mkdir build
cd build
cmake ..
make
make install

cd /yuneta/development/yuneta/^yuneta-v2/yuno-skeleton
mkdir build
cd build
cmake ..
make
make install

Install the agent:

cd /yuneta/development/output/agent/
/bin/bash ./deploy_agent.sh

cd /yuneta/agent/service
sudo ./install-yuneta-service.sh

Development Realm

Factory of Yunos

  • /yuneta/development

    Shared group directory for development.

    Include the Yuneta source code and your projects.

Development Realm Organization

  • /yuneta/development

    It’s a linux shared group (drwxrwsr-x).

    All files and directories have write permission for all members of group.

    The group name is and must be yuneta.

    The propietary of directories and files can be any member of the group.

    The directories in /yuneta/development are:

    /bin

    Development utilities, like yuno-skeleton.

    /skeletons

    Skeletons for yuno projects and gclass source code.

    /gclass_child

    /gclass_simple

    /gclass_timer

    /yuno_simple

    /yuno_user

    ...

    /output

    The product of Yuneta framework: includes, libraries and yunos.

    /agent

    binaries of agent and scripts to install as service.

    /bin

    binaries of external libraries.

    /include

    include files.

    /lib

    library files.

    /man

    generated by external libraries.

    /share

    generated by external libraries.

    /yunos

    binary files.

    /projects

    Your Yuneta projects.

    /yuneta

    The source code of Yuneta:

    /^gobj-ecosistema-v2

    gobj-ecosistema source code.

    /^yuneta-v2 /

    Yuneta source code.

    /^yunos

    some yunos supplied by Yuneta.

Yuneta Realm

Deploy and Operation of Yunos

Yuneta Realm Organization

  • /yuneta

    It’s a linux shared group (drwxrwsr-x).

    All files and directories have write permission for all members of group.

    The group name is and must be yuneta.

    The propietary of directories and files can be any member of the group.

    /agent

    non-persistent.

    yuneta_agent yuneta agent.

    yuneta_agent.json yuneta agent configuration.

    /service

    Utilities to install the yuneta_agent service:

    - install-yuneta-service.sh
    - remove-yuneta-service.sh
    - yuneta_agent
    
    /bin

    non-persistent.

    yuneta command line interface. StandAlone yunos. Utilities of deploy and operation.

    /public

    non-persistent.

    Public files.

    /realms

    non-persistent.

    /domain
    /bin

    Scripts to run the yunos.

    /data

    Data valid while realm live.

    /temp

    Temporal data files. Can be delete in a machine restart.

    /logs

    Log files.

    /repos

    persistent.

    Local repository of yuno‘s binaries and yuno‘s configurations.

    /store

    persistent.

    Home of agent.db.

    /backup

    Backup of databases in json format files.

    /service

    Databases of yuno’s services.

Note

To clone a living realm you must to copy the persistent directories.

The agent yuno supports by default the next sizes:

  • maximum yuno binary size: 50M.
  • maximum configuration element size: 50M.
  • maximum memory used by yuneta_agent and yuneta yunos: 200M.

These limits are actually set by the maximum memory block that are configurated in yuneta_agent and yuneta yunos.

Contents

Indices and tables