{"id":401,"date":"2016-11-01T00:36:35","date_gmt":"2016-10-31T16:36:35","guid":{"rendered":"http:\/\/finaldie.com\/blog\/?p=401"},"modified":"2017-08-27T20:48:07","modified_gmt":"2017-08-28T03:48:07","slug":"skull-engine-getting-started","status":"publish","type":"post","link":"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/","title":{"rendered":"Skull-Engine: Getting Started"},"content":{"rendered":"<p><a href=\"\"><img decoding=\"async\" src=\"https:\/\/github.com\/finaldie\/skull\/wiki\/images\/get_started.jpg\" alt=\"Halloween\" \/><\/a><\/p>\n<p>After <a href=\"https:\/\/finaldie.com\/blog\/?p=338\">introducing <em>Skull<\/em><\/a>, this time let&#8217;s see how to install and use <a href=\"https:\/\/github.com\/finaldie\/skull\"><em>Skull<\/em><\/a> to create a <em>Skull<\/em> project.<\/p>\n<h2>Install <em>Skull<\/em><\/h2>\n<p>As mentioned in <strong>Introduction<\/strong>, <em>Skull<\/em> includes 3 majors parts: <em>skull-core<\/em>, <em>skull-apis<\/em> and <em>skull-scripts<\/em>. To play with it, we need to install <em>Skull<\/em> first, then use <em>Skull<\/em> commands to create\/manage a <em>Skull<\/em> project.<\/p>\n<p>And as we expected, <em>Skull<\/em> can not only work in the big data center, but also in the resource very limited environment(embedded device), like <strong>Raspberry Pi<\/strong>, follow me to see how to do that :)<\/p>\n<p><!--more--><\/p>\n<h3>Install Dependencies<\/h3>\n<p><a href=\"\"><img decoding=\"async\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/5\/5d\/BalticServers_data_center.jpg\" alt=\"datacenter\" \/><\/a><\/p>\n<p>In generally <em>Skull<\/em> is working in the <em>Data Center<\/em>, with powerful x86 CPUs and enough RAM. For example, here we use <em>Ubuntu14.04<\/em> as an example.<\/p>\n<pre><code class=\"console\">sudo apt-get install autoconf valgrind expect libyaml-dev python-dev python-pip libprotobuf-dev protobuf-compiler libprotobuf-c0-dev protobuf-c-compiler\n\nsudo pip install PyYAML protobuf pympler WebOb\n\ngit clone git@github.com:finaldie\/skull.git\ncd skull\ngit submodule update --init --recursive\nmake dep\nsudo make install-dep\n<\/code><\/pre>\n<h3>Build and Install<\/h3>\n<pre><code class=\"console\">make -j4\nsudo make install\n<\/code><\/pre>\n<p>After that, <em>Skull<\/em> has installed into the system, type <span style=\"color: #3366ff;\"><strong>skull<\/strong><\/span> we would see:<\/p>\n<pre><code class=\"console\">final@ubuntu1404: ~&gt;skull\nSkull 0.9.10 - A fast to start, easy to maintain, high productive serving framework.\nMore information see https:\/\/github.com\/finaldie\/skull\n\nusage:\n\\_ skull create\n\\_ skull config\n\\_ skull common\n\\_ skull workflow\n\\_ skull module\n\\_ skull service\n\\_ skull build\n\\_ skull deploy\n\\_ skull start\n\\_ skull version\n\\_ skull help\n<\/code><\/pre>\n<p>Now, <em>Skull<\/em> is ready to play with it then :)<\/p>\n<h2>Install <em>Skull<\/em> in <em>Raspberry Pi<\/em><\/h2>\n<p><a href=\"\"><img decoding=\"async\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/7\/72\/Raspberry_Pi_2_Model_B_v1.1_rear_angle_new.jpg\/2560px-Raspberry_Pi_2_Model_B_v1.1_rear_angle_new.jpg\" alt=\"raspberry pi\" \/><\/a><\/p>\n<p>Above shows <em>Skull<\/em> is working fine in normal <em>Linux<\/em> releases, but in the embedded device, like <strong>Raspberry Pi<\/strong>, the situation is totally different. It only has a <em>ARMv6<\/em> processor(32bit) with only 384MB RAM(Model B), the good news is, <em>Skull<\/em> is totally 32bit compatible, it&#8217;s working perfectly in this environment, let&#8217;s see how to fit <em>Skull<\/em> into <em>Raspberry<\/em> :)<\/p>\n<p>To make it works, we have to disable the <strong>jemalloc<\/strong> memorypool, since it has some compiling problems in this environment, the rests are simple and easy:<\/p>\n<pre><code class=\"console\"># Install dependencies packages\nsudo apt-get install autoconf valgrind expect libyaml-dev python-dev python-pip libprotobuf-dev protobuf-compiler libprotobuf-c0-dev protobuf-c-compiler\n\nsudo pip install PyYAML protobuf pympler WebOb\n\n# Clone Skull\ngit clone git@github.com:finaldie\/skull.git\ncd skull\ngit submodule update --init --recursive\n\n# Build Skull dependency libraries\nmake dep disable_jemalloc=true\nsudo make install-dep\n\n# Build Skull itself\nmake -j4 disable_jemalloc=true\nsudo make install\n<\/code><\/pre>\n<p>OK, right now we are all set, type <strong>skull<\/strong> to verify the <em>Skull<\/em> commands are working fine here.<\/p>\n<h2>Basic flow<\/h2>\n<p>After installing <em>Skull<\/em>, let&#8217;s create a basic <em>Skull<\/em> project, which only need few steps:<\/p>\n<ul>\n<li><code>skull create project<\/code><\/li>\n<li><code>skull workflow --add<\/code><\/li>\n<li><code>skull module --add<\/code><\/li>\n<li><code>skull service --add<\/code> (optional)<\/li>\n<\/ul>\n<p>OK, here we created an simple example project with one default module with it:<\/p>\n<p><iframe class=\"giphy-embed\" src=\"\/\/giphy.com\/embed\/3o6ZtjatOAy1As1jdm\" width=\"480\" height=\"203\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h2>Play With It<\/h2>\n<p>After we created above, by default the <em>Skull<\/em> project is a echo-back server, we can play with it by running:<\/p>\n<ul>\n<li><code>skull build<\/code><\/li>\n<li><code>skull deploy<\/code><\/li>\n<li><code>skull start<\/code><\/li>\n<\/ul>\n<p><iframe class=\"giphy-embed\" src=\"\/\/giphy.com\/embed\/l0HlGwKs2QYY87Ruw\" width=\"480\" height=\"175\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h2>Last<\/h2>\n<p>From above we can see, it&#8217;s really easy and fast to create a <em>Skull<\/em> project, the default <em>Module<\/em> is a good start point of exploring the basic functionality of <em>Skull<\/em>.<\/p>\n<p>Further more, we can create more modules\/services, timers\/endpoints, to communicate them with each other, use the background IO and monitoring, etc. A lot of funs are waiting there. For more information we can find it <a href=\"https:\/\/github.com\/finaldie\/skull\/wiki\/How-To-Start\">here<\/a>, and welcome to send me some feedbacks, let&#8217;s do it better :)<\/p>\n<p><a href=\"https:\/\/github.com\/finaldie\/skull\">Project Link<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>After introducing Skull, this time let&#8217;s see how to install and use Skull to create a Skull project. Install Skull As mentioned in Introduction, Skull includes 3 majors parts: skull-core, skull-apis and skull-scripts. To play with it, we need to install Skull first, then use Skull commands to create\/manage a Skull project. And as we &#8230; <a title=\"Skull-Engine: Getting Started\" class=\"read-more\" href=\"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/\" aria-label=\"More on Skull-Engine: Getting Started\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":583,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[24],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Skull-Engine: Getting Started - Final Blog<\/title>\n<meta name=\"description\" content=\"After introducing Skull, this time let&#039;s see how to install and use Skull to create a Skull project.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Skull-Engine: Getting Started - Final Blog\" \/>\n<meta property=\"og:description\" content=\"After introducing Skull, this time let&#039;s see how to install and use Skull to create a Skull project.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/\" \/>\n<meta property=\"og:site_name\" content=\"Final Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hu.yuzhang\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-31T16:36:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-08-28T03:48:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/finaldie.com\/blog\/wp-content\/uploads\/2016\/11\/skull_get_start.png\" \/>\n\t<meta property=\"og:image:width\" content=\"772\" \/>\n\t<meta property=\"og:image:height\" content=\"514\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"final\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hyzwowtools\" \/>\n<meta name=\"twitter:site\" content=\"@hyzwowtools\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"final\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/\",\"url\":\"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/\",\"name\":\"Skull-Engine: Getting Started - Final Blog\",\"isPartOf\":{\"@id\":\"https:\/\/finaldie.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/finaldie.com\/blog\/wp-content\/uploads\/2016\/11\/skull_get_start.png\",\"datePublished\":\"2016-10-31T16:36:35+00:00\",\"dateModified\":\"2017-08-28T03:48:07+00:00\",\"author\":{\"@id\":\"https:\/\/finaldie.com\/blog\/#\/schema\/person\/2d4c840d6e8e197f8ade98af2bd2fab3\"},\"description\":\"After introducing Skull, this time let's see how to install and use Skull to create a Skull project.\",\"breadcrumb\":{\"@id\":\"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/#primaryimage\",\"url\":\"https:\/\/finaldie.com\/blog\/wp-content\/uploads\/2016\/11\/skull_get_start.png\",\"contentUrl\":\"https:\/\/finaldie.com\/blog\/wp-content\/uploads\/2016\/11\/skull_get_start.png\",\"width\":772,\"height\":514},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/finaldie.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Skull-Engine: Getting Started\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/finaldie.com\/blog\/#website\",\"url\":\"https:\/\/finaldie.com\/blog\/\",\"name\":\"Final Blog\",\"description\":\"As simple as possible...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/finaldie.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/finaldie.com\/blog\/#\/schema\/person\/2d4c840d6e8e197f8ade98af2bd2fab3\",\"name\":\"final\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/finaldie.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4c720545b79ddb0f23b527e0bbcfd9bc?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4c720545b79ddb0f23b527e0bbcfd9bc?s=96&r=g\",\"caption\":\"final\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Skull-Engine: Getting Started - Final Blog","description":"After introducing Skull, this time let's see how to install and use Skull to create a Skull project.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/","og_locale":"en_US","og_type":"article","og_title":"Skull-Engine: Getting Started - Final Blog","og_description":"After introducing Skull, this time let's see how to install and use Skull to create a Skull project.","og_url":"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/","og_site_name":"Final Blog","article_publisher":"https:\/\/www.facebook.com\/hu.yuzhang","article_published_time":"2016-10-31T16:36:35+00:00","article_modified_time":"2017-08-28T03:48:07+00:00","og_image":[{"width":772,"height":514,"url":"https:\/\/finaldie.com\/blog\/wp-content\/uploads\/2016\/11\/skull_get_start.png","type":"image\/png"}],"author":"final","twitter_card":"summary_large_image","twitter_creator":"@hyzwowtools","twitter_site":"@hyzwowtools","twitter_misc":{"Written by":"final","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/","url":"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/","name":"Skull-Engine: Getting Started - Final Blog","isPartOf":{"@id":"https:\/\/finaldie.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/#primaryimage"},"image":{"@id":"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/#primaryimage"},"thumbnailUrl":"https:\/\/finaldie.com\/blog\/wp-content\/uploads\/2016\/11\/skull_get_start.png","datePublished":"2016-10-31T16:36:35+00:00","dateModified":"2017-08-28T03:48:07+00:00","author":{"@id":"https:\/\/finaldie.com\/blog\/#\/schema\/person\/2d4c840d6e8e197f8ade98af2bd2fab3"},"description":"After introducing Skull, this time let's see how to install and use Skull to create a Skull project.","breadcrumb":{"@id":"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/#primaryimage","url":"https:\/\/finaldie.com\/blog\/wp-content\/uploads\/2016\/11\/skull_get_start.png","contentUrl":"https:\/\/finaldie.com\/blog\/wp-content\/uploads\/2016\/11\/skull_get_start.png","width":772,"height":514},{"@type":"BreadcrumbList","@id":"https:\/\/finaldie.com\/blog\/skull-engine-getting-started\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/finaldie.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Skull-Engine: Getting Started"}]},{"@type":"WebSite","@id":"https:\/\/finaldie.com\/blog\/#website","url":"https:\/\/finaldie.com\/blog\/","name":"Final Blog","description":"As simple as possible...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/finaldie.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/finaldie.com\/blog\/#\/schema\/person\/2d4c840d6e8e197f8ade98af2bd2fab3","name":"final","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/finaldie.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4c720545b79ddb0f23b527e0bbcfd9bc?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4c720545b79ddb0f23b527e0bbcfd9bc?s=96&r=g","caption":"final"}}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/finaldie.com\/blog\/wp-content\/uploads\/2016\/11\/skull_get_start.png","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/finaldie.com\/blog\/wp-json\/wp\/v2\/posts\/401"}],"collection":[{"href":"https:\/\/finaldie.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/finaldie.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/finaldie.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/finaldie.com\/blog\/wp-json\/wp\/v2\/comments?post=401"}],"version-history":[{"count":42,"href":"https:\/\/finaldie.com\/blog\/wp-json\/wp\/v2\/posts\/401\/revisions"}],"predecessor-version":[{"id":584,"href":"https:\/\/finaldie.com\/blog\/wp-json\/wp\/v2\/posts\/401\/revisions\/584"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/finaldie.com\/blog\/wp-json\/wp\/v2\/media\/583"}],"wp:attachment":[{"href":"https:\/\/finaldie.com\/blog\/wp-json\/wp\/v2\/media?parent=401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/finaldie.com\/blog\/wp-json\/wp\/v2\/categories?post=401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/finaldie.com\/blog\/wp-json\/wp\/v2\/tags?post=401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}