<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Juan Pablo Genovese on Medium]]></title>
        <description><![CDATA[Stories by Juan Pablo Genovese on Medium]]></description>
        <link>https://medium.com/@jaypg?source=rss-44d13f521cbf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*x15LqqaD3uXwwI0I.</url>
            <title>Stories by Juan Pablo Genovese on Medium</title>
            <link>https://medium.com/@jaypg?source=rss-44d13f521cbf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 17:59:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jaypg/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using OpenWhisk Outside IBM Bluemix — OpenWhisk]]></title>
            <link>https://medium.com/@jaypg/using-openwhisk-outside-ibm-bluemix-openwhisk-7368bb840a6e?source=rss-44d13f521cbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/7368bb840a6e</guid>
            <category><![CDATA[serverless-architecture]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Juan Pablo Genovese]]></dc:creator>
            <pubDate>Tue, 28 Jun 2016 19:59:58 GMT</pubDate>
            <atom:updated>2017-09-19T16:42:15.653Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/240/0*4y03MUhZt91vdQ5r.png" /></figure><p><a href="https://developer.ibm.com/openwhisk/">OpenWhisk</a> is a fantastic addition to the IBM Bluemix ecosystem and to the constellation of cloud-ready, open-source software. At a recent meetup that the IBM Bluemix group organized in Austin, TX, I gave a lightning talk on OpenWhisk, explaining its general concepts and how to install it wherever you want without signing up for Bluemix. If you want to know more about OpenWhisk and its inner workings, you can read <a href="https://developer.ibm.com/openwhisk/2016/04/01/ibm-bluemix-openwhisk-whats-under-the-hood/">this</a> and <a href="http://blog.altoros.com/introduction-to-ibm-bluemix-openwhisk.html">this</a> posts that go a long way to explain what OpenWhisk is and how it works.</p><p>In this post, we will explore how to install, deploy, and run OpenWhisk in a local environment.</p><h3>Preparing your environment</h3><p>A very good way to test and try new software is using a virtual machine, and Vagrant is absolutely awesome at providing the virtual machine we need. I have prepared a Vagrantfile ready for you to use, so let’s grab it:</p><pre>mkdir openwhisk &amp;&amp; cd openwhisk wget <a href="https://raw.githubusercontent.com/eljuanchosf/openwhisk-setup/master/Vagrantfile">https://raw.githubusercontent.com/eljuanchosf/openwhisk-setup/master/Vagrantfile</a></pre><p>Now you are ready to power on your virtual machine with the well-known vagrant up command. When it is up and running, use the vagrant ssh command to get inside. Once inside the server, you will need to install Git and then clone the OpenWhisk repository:</p><pre>sudo apt-get install git -y git clone <a href="https://github.com/openwhisk/openwhisk.git">https://github.com/openwhisk/openwhisk.git</a> cd openwhisk</pre><h3>Setting up the persistence layer</h3><p>OpenWhisk requires a database to persist the actions, rules, dictionaries, etc. If you are in Bluemix, it is logical to use Cloudant; however, if you are in your local machine or working with a custom deployment, <a href="http://couchdb.apache.org/">CouchDB</a> is a very good option.</p><p>Since the OpenWhisk installation script and the Ant build are customized for Ubuntu (or any Debian-based distro, in fact), the first step is to add the repository for CouchDB and install it:</p><pre>sudo add-apt-repository ppa:couchdb/stable -y sudo apt-get update sudo apt-get install couchdb -y</pre><p>Now, we are going to define a couple of environment variables that will make our life so much easier later on:</p><pre>export DB_USER=iamkyloren export DB_PASSWORD=ILoveYouGrandPa export DB_HOST=$(ip route get 8.8.8.8 | awk &#39;{print $NF; exit}&#39;) export DB_PORT=5984</pre><h4>CouchDB for everybody</h4><p>OpenWhisk is shipped with a script that starts a Dockerized CouchDB instance, but because it is a container, it will be gone when you reboot your VM. Setting up an external database server is easy, but this small security step is often overlooked and can result in a very frustrating exercise. What you need to do is to configure CouchDB to bind to the right IP address so that OpenWhisk will be able to connect from its container to the database.</p><p>CouchDB has a config file that specifies the configuration values for a local instance. In a standard Ubuntu setup, you can find it at /etc/couchdb/local.ini. Inside this file, there is a line containing the ;bind_address = 127.0.0.1 text. Uncomment that line (remove the semicolon) and then change 127.0.0.1 (listen on the localhost only) to the public IP address of the server that is running CouchDB. In this case, and because we started up the Vagrant image with default values, it is going to be 192.168.33.13, which we have already defined in the DB_HOST environment variable.</p><p>In one line (all right, all right, two lines), you can do it as:</p><pre>sudo sed -i -- &quot;s/;bind_address = 127.0.0.1/bind_address = $DB_HOST/g&quot; /etc/couchdb/local.ini sudo service couchdb restart</pre><h4>The basics</h4><p>Now, it is time to set up the basic structure for the database. CouchDB uses an HTTP API to manage all of its structure and data. First, create an admin user:</p><pre>curl -X PUT <a href="http://$DB_HOST:$DB_PORT/_config/admins/$DB_USER">http://$DB_HOST:$DB_PORT/_config/admins/$DB_USER</a> -d &#39;&quot;&#39;&quot;$DB_PASSWORD&quot;&#39;&quot;&#39; curl -X GET <a href="http://$DB_USER:$DB_PASSWORD@$DB_HOST:$DB_PORT/_config">http://$DB_USER:$DB_PASSWORD@$DB_HOST:$DB_PORT/_config</a></pre><p>The second command will get the information about the CouchDB configuration. If the user creation is successful, you’ll see a JSON object with CouchDB settings.</p><p>Next, we should tell OpenWhisk how to connect to our database server. For this purpose, the couchdb-local.env file must be created, and OpenWhisk comes with a template that is easy to edit:</p><pre>cp template-couchdb-local.env couchdb-local.env</pre><p>Now, replace the variables in couchdb-local.env:</p><pre>sed -i -- &quot;s/OPEN_WHISK_DB_PROTOCOL=/OPEN_WHISK_DB_PROTOCOL=http/g&quot; couchdb-local.env sed -i -- &quot;s/OPEN_WHISK_DB_HOST=/OPEN_WHISK_DB_HOST=$DB_HOST/g&quot; couchdb-local.env sed -i -- &quot;s/OPEN_WHISK_DB_PORT=/OPEN_WHISK_DB_PORT=$DB_PORT/g&quot; couchdb-local.env sed -i -- &quot;s/OPEN_WHISK_DB_USERNAME=/OPEN_WHISK_DB_USERNAME=$DB_USER/g&quot; couchdb-local.env sed -i -- &quot;s/OPEN_WHISK_DB_PASSWORD=/OPEN_WHISK_DB_PASSWORD=$DB_PASSWORD/g&quot; couchdb-local.env</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*C3MubvxZgWMDofp5tE-44Q.png" /></figure><h4>It is all about the structure</h4><p>OpenWhisk requires creating a basic table structure, and the guys who developed it are kind enough to provide a script that does exactly that:</p><pre>tools/db/createImmortalDBs.sh</pre><p>The script will create a couple of tables and insert data, and prepare your database for OpenWhisk. Remember that it will ask you to enter the DROPIT word for confirming that you want to set up the database structure from scratch.</p><h3>Installation time!</h3><p>Installing OpenWhisk is easy due to the provided script. But first, and just to be sure, download and add Docker’s new GPG:</p><pre>curl -fsSL <a href="https://get.docker.com/gpg">https://get.docker.com/gpg</a> | sudo apt-key add -</pre><p>And now, let the magic happen:</p><pre>(cd tools/ubuntu-setup &amp;&amp; source all.sh)</pre><p>Yeah. That’s all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3W3WpK-Lh5GC7RJiUDfM-w.png" /></figure><h3>Build</h3><p>After OpenWhisk has been installed, we have to build, deploy, and run it. First, exit your Vagrant SSH session. Then, run the vagrant reload command (this ensures that the operating system has all the latest values that came from the installation up and running) and SSH back in using the vagrant ssh command.</p><p>Now, we need to build. OpenWhisk is developed in <a href="http://www.scala-lang.org/">Scala</a>, which runs on the JVM, and the build tool of choice is <a href="http://ant.apache.org/">Ant</a>:</p><pre>cd openwhisk &amp;&amp; ant build clean deploy run</pre><p>After some time (the build process is quite long) and after the required tests pass, you will have a working OpenWhisk server!</p><p>OpenWhisk is not difficult to set up, but it has its nuances. You can easily deploy it on any IaaS of your choice following this guide.</p><p>For more on using OpenWhisk on IBM Bluemix, you may also check out these how-tos: “<a href="http://blog.altoros.com/bluemix-openwhisk-101-developing-a-microservice.html">Developing a Microservice with OpenWhisk</a>” and “<a href="http://blog.altoros.com/how-to-use-openwhisk-docker-actions-in-ibm-bluemix.html">Creating Docker Actions</a>.”</p><p>Also, you might want to check <a href="https://github.com/eljuanchosf/openwhisk-setup">this repo</a> for an easy way of deploying OpenWhisk.</p><p><em>Originally published at </em><a href="https://developer.ibm.com/openwhisk/2016/06/28/using-openwhisk-outside-ibm-bluemix/"><em>developer.ibm.com</em></a><em> on June 28, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7368bb840a6e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>