Home Blog Page 618

Democratizing Distributed Systems with Metaparticle

The best way to take some of the difficulty out of distributed systems is to include the creation of infrastructure directly in code, rather than creating separate config files. Brendan Burns, a software engineer at Microsoft, presented his solution to this problem at KubeCon last November.

His project, called Metaparticle, is in its earliest stages, and so far Burns has been the only contributor. But, at its core, it’s the same as the compiler for a classic application.

“The basic idea is just like we had that compiler before for taking the source code and turning it into assembly language that then turns into machine instructions. We have the same kind of idea,” Burns said. “We have code, we turn it into an abstract syntax tree, we feed it into the orchestrator and the app pops out — the distributed app pops out the other side.”

During his presentation and demo, Burns said that as applications evolved into client/server applications, config files were separated from code. He said that “tortuous divorce” has led us to where we are now: creating distributed systems, like those with Kubernetes, has gotten too difficult.

“We’ve decided that abstraction is not worth our time,” Burns said. “It’s not that we can’t do it. It’s not that we’re not smart enough to figure out assembly language. It’s that if we were all still doing assembling language, I don’t think any of us would be in this room.

“Kubernetes literally would not exist if we were all still programming in assembly language and, yet, I think we’re writing our distributed systems in assembly,” Burns continued. “In talking about deploying this set of pods and this service and these pieces, the building blocks that we’re putting together, they’re not concepts. They’re just assembly language instructions. If we’re going to really build our systems and we’re gonna move on from where we are, it has to get easier. So the genesis for a lot of this work was to say, ‘How do we write our systems in code?’”

In his presentation, Burns used Node.js to demonstrate how distributed systems can be created in just a few lines of code. Through Metaparticle, Burns is hoping to make distributed systems easier to create and hoping more programmers will find ways to solve their problems using platforms like Kubernetes.

“We democratized mobile development,” Burns said. “We’ve democratized web development. We haven’t democratized distributed system development, and it’s time that we did.”

Watch the complete presentation below:

Want to learn more about Kubernetes? Pre-order now and save 50% on this new, online, self-paced Kubernetes Fundamentals course from The Linux Foundation. Sign Up Now >>

An Introduction to Linux Filesystems

This article is intended to be a very high-level discussion of Linux filesystem concepts. It is not intended to be a low-level description of how a particular filesystem type, such as EXT4, works, nor is it intended to be a tutorial of filesystem commands.

Every general-purpose computer needs to store data of various types on a hard disk drive (HDD) or some equivalent, such as a USB memory stick. There are a couple reasons for this. First, RAM loses its contents when the computer is switched off. There are non-volatile types of RAM that can maintain the data stored there after power is removed (such as flash RAM that is used in USB memory sticks and solid state drives), but flash RAM is much more expensive than standard, volatile RAM like DDR3 and other, similar types.

Read more at OpenSource.com

Using Grep-Like Commands for Non-Text Files

In the previous article, I showed how to use the grep command, which is great at finding text files that contain a string or pattern. The idea of directly searching in a “grep-like” way is so useful that there are additional commands to let you search right into PDF documents and handle XML files more naturally. Things do not stop there, as you could consider raw network traffic a collection of data that you want to “grep” for information, too.

Grep on PDF files

Packages are available in Debian and Fedora Linux for pdfgrep. For testing, I grabbed version 1.2 of the Open Document Format specification. Running the following command found the matches for “ruby” in the specification. Adding the -H option will print the filename for each match (just as the regular grep does). The -n option is slightly different to regular grep. In regular grep, -n prints the line number that matches; in pdfgrep, the -n option will instead show the page number.

$ pdfgrep ruby OpenDocument-v1.2.pdf 
  6.4 <text:ruby
     6.4.2 <text:ruby
     6.4.3 <text:ruby
 17.10 <style:ruby-properties>..................................................................................................
     19.874.30 <text:ruby
     19.874.31 <text:ruby-text>..................................................................................................
 20.303 style:layout-grid-ruby-below......................................................................................... 783
 20.304 style:layout-grid-ruby-height........................................................................................ 783
 20.341 style:ruby
 20.342 style:ruby

$ pdfgrep -Hn ruby OpenDocument-v1.2.pdf 
OpenDocument-v1.2.pdf:10:   6.4 <text:ruby
OpenDocument-v1.2.pdf:10:      6.4.2 <text:ruby
OpenDocument-v1.2.pdf:10:      6.4.3 <text:ruby
OpenDocument-v1.2.pdf:26:  17.10 <style:ruby

Many other command-line options in pdfgrep operate like the ones in regular grep. You can use -i to ignore the case when searching, -c to see just the number of times the pattern was found, -C to show a given amount of context around matches, -r/-R to recursively search, –include and –-exclude to limit recursive searches, and -m to stop searching a file after a given number of matches.

Because PDF files can be encrypted, pdfgrep also has the –password option to allow you to provide decryption keys. You might consider the –unac option to be somewhat logically grouped into the -i (case-insensitive) class of options. With this option, accents and ligatures are removed from both the search pattern and the content as it is considered. So the single character æ will be considered as “ae” instead. This makes it simpler to find things when typing at a console. Another interesting option in pdfgrep is -p, which shows the number of matches on a page.

Grep for XML

On Fedora Linux, you can dnf install xgrep to get access to the xgrep command. The first thing you might like to do with xgrep is search using -x to look for an XPath expression as shown below.

$ cat sample.xml 
<root>
 <sampledata>
   <foo>Foo Text</foo>
   <bar name="barname">Bar text</bar>
 </sampledata>
</root>

$ xgrep -x '//foo[contains(.,"Foo")]' sample.xml 
<!--         Start of node set (XPath: //foo[contains(.,"Foo")])                 -->
<!--         Node   0 in node set               -->

   <foo>Foo Text</foo>

<!--         End of node set                    -->

$ xgrep -x '//bar[@name="barname"]' sample.xml 
<!--         Start of node set (XPath: //bar[@name="barname"])                 -->
<!--         Node   0 in node set               -->

   <bar name="barname">Bar text</bar>

<!--         End of node set                    -->

The xgrep -s option lets you poke around in XML elements looking for a regular expression. This might work slightly differently from what you expect at the start. The format for the pattern is to pick the element you are interested in and then use one or more subelement/regex/ expressions to limit the matches.

The example below will always print an entire sampledata element, and we limit the search to only those with a bar subelement that matches the ‘Bar’ regular expression. I didn’t find a way to pick off just the bar element, so it seems you are always looking for a specific XML element and limiting the results based on matching the subelements.

$ xgrep -s 'sampledata:bar/Bar/' sample.xml 
<!--         Start of node set (Search: sampledata:bar/Bar/)                 -->
<!--         Node   0 in node set               -->

 <sampledata>
   <foo>Foo Text</foo>
   <bar name="barname">Bar text</bar>
 </sampledata>

<!--         End of node set                    -->

As you can see from this example, xgrep is more about finding matching structure in an XML document. As such it doesn’t implement many of the normal grep command line options. There is also no support for file system recursion built into xgrep, so you have to combine with the find command as shown in the previous article if you want to dig around.

grep your network with ngrep

The ngrep project provides many of the features of grep but works directly on network traffic instead of files. Just running ngrep with the pattern you are after will sift through network packets until something matching is seen, and then you will get a message showing the network packet that matched and the hosts and ports that were communicating. Unless you have specially set up network permissions, you will likely have to run ngrep as the root user to get full access to raw network traffic.

# ngrep foobar
interface: eth1 (192.168.10.0/255.255.255.0)
filter: ((ip || ip6) || (vlan && (ip || ip6)))
match: foobar
###########...######
T 192.168.10.2:738 -> 192.168.10.77:2049 [AP]
.......2...........foobar.. 
...
################################################################
464 received, 0 dropped

Note that the pattern is an extended regular expression, not just a string. So you could find many types of foo using for example fooba[rz].

Similar to regular grep, ngrep supports (-i) for case insensitive search, (-w) for whole word matching, (-v) to invert the result, only showing packets that do not match your pattern, and (-n) to match only a given number of packets before exiting.

The ngrep tool also supports options to timestamp the matching packets with -t to print a timestamp when a match occurs, or -T to show the time delta between matches. You can also shut down connections using the -K option to kill TCP connections that match your pattern. If you are looking at low-level packets you might like to use -x to dump the packet as hexadecimal.

A very handy use for ngrep is to ensure that the network communications that you think are secure really have any security to them at all. This can easily be the case with apps on a phone. If you start ngrep with a reasonably rare string like “mysecretsarehere” and then send that same string in the app, you shouldn’t see it being found by ngrep. Just because you can’t see it in ngrep doesn’t mean the app or communication is secure, but at least there is something being done by the app to try to protect your data that is sent over the Internet.

grep your mail

While the name might be a little misleading, mboxgrep can search mbox files and maildir folders. I found that I had to use the -m option to tell mboxgrep that I wanted to look inside a maildir folder instead of a mailbox. The following command will directly search for matching messages in a maildir folder.

$ cd ~/mail/.Software
$ mboxgrep -m maildir "open source program delight" .

The mboxgrep tool has options to search only the header or body of emails, and you can choose between fcntl, flock, or no file locking during the search depending on your needs. mboxgrep can also recurse into your mail, handy if you have many subfolders you would like to search.

Wrap up

The grep tool has been a go-to tool for finding text files for decades. There are now a growing collection of grep-like tools that allow you to use the same syntax to find other matching things. Those things might be specific file formats — like XML and PDF — or you might consider searching network traffic for interesting events.

Learn more about Linux through the free “Introduction to Linux” course from The Linux Foundation and edX.

Q&A with Arpit Joshipura, Head of Networking for The Linux Foundation

Arpit Joshipura became the Linux Foundation’s new general manager for networking and orchestration in December 2016. He’s tasked with a pretty tall order. He needs to harmonize all the different Linux Foundation open source groups that are working on aspects of network virtualization.

Joshipura may be the right person for the job as his 30 years of experience is broad — ranging from engineering, to management, to chief marketing officer (CMO) roles. Most recently he was VP of marketing with Prevoty, an application security company. Prior to that he served as VP of marketing at Dell after the company acquired Force10 Networks, where he had been CMO.

Read more at SDx Central

Kubernetes Logging As Easy As 1..2..3

If you’re considering or have already started using Kubernetes, one thing you absolutely cannot get around is having proper logging throughout your system to debug your applications in case of unexpected errors. 

 At Wercker, we use 3 technologies to set up our logging infrastructure:

  • AWS ElasticSearch Service to quickly and easily run logging aggregation infrastructure with minimal overhead above what we already manage
  • Fluentd to collect and aggregate our logs
  • Last but certainly not least, Wercker to bring everything together and deploy our brand spanking new logging infrastructure!

Read more at Wercker

A Complete Beginner’s Guide To Blockchain

A blockchain is a distributed database, meaning that the storage devices for the database are not all connected to a common processor.  It maintains a growing list of ordered records, called blocks. Each block has a timestamp and a link to a previous block.

Cryptography ensures that users can only edit the parts of the blockchain that they “own” by possessing the private keys necessary to write to the file. It also ensures that everyone’s copy of the distributed blockchain is kept in synch.

Imagine a digital medical record: each entry is a block.

Read more at Forbes

New to Programming? Check out these Outstanding Open Source Programming Books

Computer programming offers a fascinating career path. It’s full of challenges, a great way of collaborating, teaches you how to think, and most importantly offers a way to improve your life. Become more productive, efficient, and effective in life by learning the discipline of coding.

Anyone wanting to become a programmer needs a kick-start. There are so many questions to contemplate. What’s the best way of building a solid programming foundation? What’s the best way to learn? Should I read one of the ‘Teach yourself [insert programming language] in 24 hours’?

This is a compilation of useful free programming books. And free is in the sense of respecting freedom and community, as all of the books are released under an open source license. You are therefore free to copy, distribute, study, and display these books to your heart’s content.

Read the complete article
 

How to Set Up MariaDB SSL and Secure Connections from Clients

The number of hijacked database servers is growing every day. It is important that we secure communication between MariaDB server and client/webserver.

MariaDB is a database server that offers drop-in replacement functionality for MySQL server. MariaDB is built by some of the original authors of MySQL, with assistance from the broader community of Free and open source software developers. In addition to the core functionality of MySQL, MariaDB offers a rich set of feature enhancements including alternate storage engines, server optimizations, and patches. In this tutorial, I am going to give the instructions on how to setup MariaDB server with SSL, and how to establish secure connections from the console and PHP/Python scripts.

Read the complete article

6 Key Points about Intel’s Hot New Linux Distro

The great thing about Linux is is that anyone possessing the wherewithal and dedication can produce a distribution to satisfy their own needs. That’s also the bad thing, as it means many Linux distributions, even those with name backing, fight to distinguish themselves or to be recognized at all.

With Intel Clear Linux, the name-brand recognition is only a small part of what matters. Yes, it’s significant that the kingpin chipmaker is adding an entry to Linux Distro Makers Club, but why and to what end?

Intel wants Clear Linux to be known for high performance when running cloud workloads.

Read more at InfoWorld

OCI’s Push For Open Container Standards Continues in 2017

Chris Aniszczyk is The Linux Foundation’s Vice President of Developer Relations and Programs where he serves as the Executive Director of the Open Container Initiative and COO of the Cloud Native Computing Foundation.

As we kick off 2017 and look ahead to the coming year, I want to take some time to reflect back on what the Open Container Initiative (OCI) community accomplished in 2016 and how far we’ve come in a short time since we were founded as a Linux Foundation project a little over a year ago.

The community has been busy working toward our mission to create open industry standards around container formats and runtime! Last year the project saw 3000+ commits from 128 different authors across 36 different organizations. With the addition of the Image Format specification project, we expanded our initial scope from just the runtime specification. Our membership grew to nearly 50 members with the addition of Anchore, ContainerShip, EasyStack and Replicated, which add an even more diverse perspective to the community.  We also added new developer tools projects —runtime-tools and image-tools which serve as repositories for conformance testing tools and have been instrumental in gearing up for the upcoming v1.0 release.

xrLUtogS3eywm7G7oqJzD1MtblU_SSE-3JK0Hpu3

We’ve also recently created a new project within OCI called go-digest (which was donated and migrated from docker/go-digest). This provides a strong hash-identity implementation in Go and services as a common digest package to be used across the container ecosystem.

In terms of early adoption, we have seen Docker support the OCI technology in its container runtime (libcontainer) and contribute it to the OCI project. Additionally, Docker has committed to adopting OCI technology in its latest containerd announcement. The Cloud Foundry community has been an early consumer of OCI by embedding runc via Garden as the cornerstone of its container runtime technology. The Kubernetes project is incubating a new Container Runtime Interface (CRI) that adopts OCI components via implementations like CRI-O and rklet. The rkt community is adopting OCI technology already and is planning to leverage the reference OCI container runtime runc in 2017. The Apache Mesos community is currently building out support for the OCI image specification.

Speaking of the v1.0 release, we are getting close to launch! The milestone release of the OCI Runtime and Image Format Specifications version 1.0 will be available this first quarter of 2017, drawing the industry that much closer to standardization and true portability. To that end, we’ll be launching an official OCI Certification program once the v1.0 release is out. With OCI certification, folks can be confident that their OCI-certified solutions meet a high set of criteria that deliver agile, interoperable solutions.

We’ll be looking into the possibility of adding more projects in the coming year, and we hope to showcase even more demonstrations of the specs in action under different scenarios. We’ll be onsite at several industry events, so please be on the lookout and check out events page for details.

There is still much work to be done!  The success of our community depends on a wide array of contributions from all across the industry; the door is always open, so please come join us in shaping the future of container technology! In particular, if you’re interested in contributing to the technology, we recommend joining the OCI developer community which is open to everyone. If you’re building products on OCI technology, we recommend joining as a member and participating in the upcoming certification program.

Want to learn more about container standards? Watch the free re-play of The Linux Foundation webinar, “Container Standards on the Horizon.” Watch now!

This blog originally appeared on the OCI website.