tag:blogger.com,1999:blog-18763798832889208262024-03-13T21:17:42.845-07:00MatriksDataUnknownnoreply@blogger.comBlogger5125tag:blogger.com,1999:blog-1876379883288920826.post-42507688857076892732015-05-26T00:12:00.001-07:002015-05-26T00:13:09.238-07:00Howto Update Coreos with Update Engine<div class="highlight" style="box-sizing: border-box; color: rgba(0, 0, 0, 0.74902); font-family: 'Source Sans Pro', sans-serif; font-size: 16px; line-height: 24px;">
<div>
Get engine options:<br />
<i><b>update_engine_client -help</b></i><br />
<br />
Get update status<br />
<i><b>update_engine_client -status</b></i><br />
<br />
Force Coreos an immediate update check:<br />
<i><b>update_engine_client -update</b></i><br />
<br />
If the update fails you can check the logs of the update engine by running:<br />
<i><b>journalctl -u update-engine -o cat</b></i><br />
<br />
If you want to download another update you may need to clear the reboot pending status:<br />
<span style="font-family: Times;"><code class="language-sh" data-lang="sh" style="background-attachment: initial; background-clip: initial; background-image: none; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 3px; border: 0px; box-shadow: none; box-sizing: border-box; display: inline-block; padding: 2px 4px;"></code></span><br />
<i><b>update_engine_client -reset_status</b></i></div>
</div>
Koray Saritekehttp://www.blogger.com/profile/03202522086833217027noreply@blogger.com0tag:blogger.com,1999:blog-1876379883288920826.post-50641739861289098402015-03-30T03:40:00.001-07:002015-03-30T03:48:04.392-07:00Getting SSH_AUTH_SOCK environment variable Error for Fleetctl journal command at CoreOSOne way is it to put private key to ssh-agent<br />
<br />
Append commands below to .bash_profile<br />
<br />
eval `ssh-agent -s`<br />
ssh-add ~/.ssh/id_rsa<br />
<br />
<br />
Then fleetctl journal command will run as expected.<br />
<br />
<br />Koray Saritekehttp://www.blogger.com/profile/03202522086833217027noreply@blogger.com0tag:blogger.com,1999:blog-1876379883288920826.post-74033697311435545722015-03-30T02:10:00.002-07:002015-03-30T02:10:58.212-07:00Overrride cloud-config parameters installed by coreos-install<div>
<br /></div>
<div>
If you invested a lot of time to override config param that comes through installation, then carry on reading.</div>
<div>
<br /></div>
The installation script will process your cloud-config.yaml file specified with the -c flag and place it onto disk.<b><u> It will be installed to /var/lib/coreos-install/user_data and evaluated on every boot.</u></b><br />
<div>
<span style="background-color: white; color: rgba(0, 0, 0, 0.74902); font-family: 'Source Sans Pro', sans-serif; font-size: 16px; letter-spacing: 0.100000001490116px; line-height: 24px;"><br /></span></div>
<div>
For instance, there is a simple config for coreos-install<br />
<br />
<div>
#cloud-config</div>
<div>
<br /></div>
<div>
<div>
coreos:</div>
<div>
etcd:</div>
<div>
name: node001</div>
<div>
addr: 192.168.100.1:4001</div>
<div>
peer-addr: 192.168.100.1:7001</div>
<div>
discovery: <discoveriy ip></div>
</div>
</div>
<div>
<div>
units:</div>
<div>
- name: etcd.service</div>
<div>
command: start</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
There are two way to override config parameter:</div>
<div>
<ol>
<li>Override systemd service by etcd.service.d/override.conf:</li>
<li>Override coreos installation script under /var/lib/coreos-install/user_data</li>
</ol>
<div>
<br /></div>
<div>
I prefer to edit /var/lib/coreos-install/user_data and run coreos-cloudinit to update configurations. </div>
<div>
<br /></div>
</div>
<div>
<br /></div>
Koray Saritekehttp://www.blogger.com/profile/03202522086833217027noreply@blogger.com0tag:blogger.com,1999:blog-1876379883288920826.post-73414485125401533022014-07-15T02:31:00.002-07:002014-07-15T02:31:50.434-07:00RESTful API Modelling Language, RAML and beyond.<div class="p1">
<br /></div>
<div class="p1">
When you want to provide an API to your customers, no matter how complex your backend code might be, you can design your API as a series of Restful web services to ensure simple information exchange in an organised manner.</div>
<div class="p1">
Although it may be easy to design Restful web services for projects offering limited number of APIs</div>
<div class="p1">
as your service interface complexity increases, it is a good idea to consider better alternatives for your Restful API presentation, this is where RAML (<a href="http://raml.org/"><span class="s1">http://raml.org</span></a> ) comes in to the picture.</div>
<div class="p2">
<br /></div>
<div class="p1">
RAML, RESTful API Modelling Language, is built on YAML, and it is a nifty way of designing your API model for complex service structures.</div>
<div class="p1">
RAML is strict as an old school teacher, and picky when it comes to syntax. But it is actually a good thing because this picky nature of RAML lets you design APIs that are human readable, standardised and easily “parsable”. </div>
<div class="p1">
By parsing a RAML document you can create HTML API documents with a single command which then can be used as a source of reference for your API users. Since, you used a solid model for your API architecture, generated Apı document will be sufficiently detailed and faithful to your design.</div>
<div class="p2">
<br /></div>
<div class="p1">
API designer for RAML (<a href="http://api-portal.anypoint.mulesoft.com/raml/api-designer"><span class="s1">http://api-portal.anypoint.mulesoft.com/raml/api-designer</span></a>) is an IDE like web based api designer application which you can use to develop your RESTful APIs as well as RAML documents. You can also grab your very own clone of the designer from GitHub (<a href="https://github.com/mulesoft/api-designer"><span class="s1">https://github.com/mulesoft/api-designer</span></a>)</div>
<div class="p2">
<br /></div>
<div class="p1">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbEKt_59xGfBBnIgWdX26wCE_vl1dQ2qnMEVdGEg9_is4gdMVgFlkXjVQJE9Y52QYV3S3yEZD9eQ8MOmBRUsHA7u4W_Q03izI4j0pJBgNG7FrOkFcDC5DW60Wyc4dX5Nwjj9ehZXx4fU0X/s1600/Ads%C4%B1z1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img alt="RAML GUI" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbEKt_59xGfBBnIgWdX26wCE_vl1dQ2qnMEVdGEg9_is4gdMVgFlkXjVQJE9Y52QYV3S3yEZD9eQ8MOmBRUsHA7u4W_Q03izI4j0pJBgNG7FrOkFcDC5DW60Wyc4dX5Nwjj9ehZXx4fU0X/s1600/Ads%C4%B1z1.png" height="275" title="RAML GUI" width="640" /></a></div>
To get started you can find a good tutorial on <a href="http://raml.org/docs.html"><span class="s1">http://raml.org/docs.html</span></a> on RAML API design. </div>
<div class="p1">
First things first, RAML parser checks your RAML version before executing so make sure to include the RAML version in your document. </div>
<div class="p1">
The root section of your document is where you define general information of your API such as title, version, baseURI , Schemas , ResourceTypes, traits and other information which will be used on the rest of your document can be described here.</div>
<div class="p1">
Resources section defines the behaviours of your path(s) and resources. This is where you define your parameters, methods , security and include your predefined Schemas etc... in your resource.</div>
<div class="p2">
<br /></div>
<div class="p1">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkEJFG59uu-1WMXYRb72WAv8KycMt-aoxSq13DOlClbTqoaMXRwbUa7oSENSQAqbDU9yZB0au3j51nHoelHumGwvzYvGy9ZXmH0S4Wjt8kVgUvEHbQ_9Yg2Q2MJbnSmeDj7J5Gyqjoj5nu/s1600/Ads%C4%B1z_Fotor.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkEJFG59uu-1WMXYRb72WAv8KycMt-aoxSq13DOlClbTqoaMXRwbUa7oSENSQAqbDU9yZB0au3j51nHoelHumGwvzYvGy9ZXmH0S4Wjt8kVgUvEHbQ_9Yg2Q2MJbnSmeDj7J5Gyqjoj5nu/s1600/Ads%C4%B1z_Fotor.jpg" height="320" width="211" /></a>While designing your API, the API designer also does error checking and offers feedbacks concerning parameter values, methods etc... which make your learning experience less painful. Clicking the “Mocking Service” button which is on the right hand side of the design page gives you a fancy presentation of how your API document may look like as an html page . Since the API designer uses a RAML parser while converting our design to html format, if there are some errors in the design document, some parts of our design appears to be missing, this is an other way to make sure that our RAML design or syntax is correct.<br />
<br /></div>
<div class="p1">
Remember the fancy HTML page ? When you are satisfied with your design, RAML2HTML (<a href="https://github.com/kevinrenskers/raml2html"><span class="s1">https://github.com/kevinrenskers/raml2html</span></a>) is a good tool which you can use to convert your .RAML document to html. After you install the tool, converting your RAML document to html is as simple as running the following command: raml2html example.raml > example.html</div>
<div class="p1">
Kevin’s tool creates a beautiful looking HTML page presentation of your API design which can be used as your api document to be presented to your customers or users.</div>
<div class="p2">
<br /></div>
<div class="p1">
For our current project we need to use a considerable large number of REST APIs. RAML helps us design these APIs in a consistent way, plus basically generates our design documents in HTML for us. But why stop there? So we grabbed our favourite RAML parser (a good RAML parser <a href="https://github.com/raml-org/raml-js-parser"><span class="s1">https://github.com/raml-org/raml-js-parser</span></a> ) and started writing our own code generator for both the client side and the server side in javascript and nodejs.</div>
<div class="p2">
<br /></div>
<div class="p1">
By parsing our own API design from the RAML we generate the web server code according to path , query parameters and parameter definitions. </div>
<div class="p1">
We then create our client code which is created with the requirements of our resource. We embrace the modular approach while generating our code where each resource has it’s own function. Test functions are created in jasmine along with the generated code.</div>
<div class="p1">
Code generator also cross checks our generated server and client code back and forth after creation tom make sure everything works perfectly.</div>
<div class="p2">
<br /></div>
<div class="p1">
It is a work in progress, but by the time it is done it will be able to generate RESTful services code for both the client from our RAML documents and the server side which will even be tested back and forth during creation.</div>
<div class="p1">
Generated service declaration functions will be standardised and it will be perfectly aligned with the API definition reducing the complexity of the overall code. </div>
<div class="p2">
<br /></div>
<div class="p1">
So at the end of the day, we used RAML to Design our Restful web-service APIs, document our API functionality and even used it to generate our server/client code for us.<br />
<br />
Kivanc Gulbas & Nilufer Bidik<br />
<br /></div>
<!-- Blogger automated replacement: "https://images-blogger-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2F4.bp.blogspot.com%2F-P7o-A5lAiGs%2FU8TytLqjejI%2FAAAAAAAAABg%2FlMAXPKrnX5o%2Fs1600%2FAds%25C4%25B1z1.png&container=blogger&gadget=a&rewriteMime=image%2F*" with "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbEKt_59xGfBBnIgWdX26wCE_vl1dQ2qnMEVdGEg9_is4gdMVgFlkXjVQJE9Y52QYV3S3yEZD9eQ8MOmBRUsHA7u4W_Q03izI4j0pJBgNG7FrOkFcDC5DW60Wyc4dX5Nwjj9ehZXx4fU0X/s1600/Ads%C4%B1z1.png" -->Anonymoushttp://www.blogger.com/profile/02955027621580996790noreply@blogger.com1tag:blogger.com,1999:blog-1876379883288920826.post-42733265576178914142011-12-10T08:37:00.001-08:002011-12-10T08:37:20.425-08:00MatriksDataUnknownnoreply@blogger.com0