Home Blog Page 374

KubeCon Opening Keynote – Kelsey Hightower, Google

Kelsey Hightower, Developer Advocate at Google, kicked off the KubeCon + CloudNativeCon event in Austin with an opening keynote in which he demonstrated Kubernetes’ ease of use with the help of his smartphone. Apart from commending the audience for making Kubernetes the boring-in-a-good-way framework it is today, Hightower also warned about how Kubernetes should not be considered the end game, but a means to an end.

Read more

Kubernetes Secret Superpower – Chen Goldberg & Anthony Yeh, Google

https://www.youtube.com/watch?v=1kjgwXP_N7A” frameborder=”0″ allow=”autoplay; encrypted-media

The ability to extend Kubernetes is its secret superpower, said Chen Goldberg, Director of Engineering at Google, speaking at the recent KubeCon + CloudNativeCon in Austin.

In the race to build tools that help engineers become more productive, Goldberg talked about how she once led a team that developed a platform that did just that. Despite the fact the platform initially worked, it was not extensible, and it was also difficult to modify.

Read more

Writing Systemd Services for Fun and Profit

Let’s say you want to run a games server, a server that runs Minetest, a very cool and open source mining and crafting sandbox game. You want to set it up for your school or friends and have it running on a server in your living room. Because, you know, if that’s good enough for the kernel mailing list admins, then it’s good enough for you.

However, you soon realize it is a chore to remember to run the server every time you switch your computer on and a nuisance to power down safely when you want to switch off.

First, you have to run the server as a daemon:

minetest --server &

Take note of the PID (you’ll need it later).

Then you have to tell your friends the server is up by emailing or messaging them. After that you can start playing.

Suddenly it is 3 am. Time to call it a day! But you can’t just switch off your machine and go to bed. First, you have to tell the other players the server is coming down, locate the bit of paper where you wrote the PID we were talking about earlier, and kill the Minetest server gracefully…

kill -2 <PID>

…because just pulling the plug is a great way to end up with corrupted files. Then and only then can you power down your computer.

There must be a way to make this easier.

Systemd Services to the Rescue

Let’s start off by making a systemd service you can run (manually) as a regular user and build up from there.

Services you can run without admin privileges live in ~/.config/systemd/user/, so start by creating that directory:

cd
mkdir -p ~/.config/systemd/user/

There are several types of systemd units (the formal name of systemd scripts), such as timers, paths, and so on; but what you want is a service. Create a file in ~/.config/systemd/user/ called minetest.service and open it with your text editor and type the following into it:

# minetest.service

[Unit] 
Description= Minetest server 
Documentation= https://wiki.minetest.net/Main_Page 

[Service] 
Type= simple 
ExecStart= /usr/games/minetest --server

Notice how units have different sections: The [Unit] section is mainly informative. It contains information for users describing what the unit is and where you can read more about it.

The meat of your script is in the [Service] section. Here you start by stating what kind of service it is using the Type directive. There are several types of service. If, for example, the process you run first sets up an environment and then calls in another process (which is the main process) and then exits, you would use the forking type; if you needed to block the execution of other units until the process in your unit finished, you would use oneshot; and so on.

None of the above is the case for the Minetest server, however. You want to start the server, make it go to the background, and move on. This is what the simple type does.

Next up is the ExecStart directive. This directive tells systemd what program to run. In this case, you are going to run minetest as headless server. You can add options to your executables as shown above, but you can’t chain a bunch of Bash commands together. A line like:

ExecStart: lsmod | grep nvidia > videodrive.txt

Would not work. If you need to chain Bash commands, it is best to wrap them in a script and execute that.

Also notice that systemd requires you give the full path to the program. So, even if you have to run something as simple as ls you will have to use ExecStart= /bin/ls.

There is also an ExecStop directive that you can use to customize how your service should be terminated. We’ll be talking about this directive more in part two, but for now you must know that, if you don’t specify an ExecStop, systemd will take it on itself to finish the process as gracefully as possible.

There is a full list of directives in the systemd.directives man page or, if you prefer, you can check them out on the web and click through to see what each does.

Although only 6 lines long, your minetest.service is already a fully functional systemd unit. You can run it by executing

systemd --user start minetest

And stop it with

systemd --user stop minetest

The --user option tells systemd to look for the service in your own directories and to execute the service with your user’s privileges.

That wraps up this part of our server management story. In part two, we’ll go beyond starting and stopping and look at how to send emails to players, alerting them of the server’s availability. Stay tuned.

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

IPFire Open Source Firewall Linux Distribution Gets Cryptography Improvements

IPFire, the open-source and free firewall distribution based on the Linux kernel, has been updated today to version 2.19 Core Update 120, a release that adds new features, improvements, and updated components.

IPFire 2.19 Core Update 120 is packed with quite a lot of new features that promise to improve the overall security of the operating system, as well as to increase the performance of various cryptographic operations. For the latter, the new release ships with the OpenSSL 1.1.0 cryptography library, which adds support for new ciphers.

Read more at Softpedia

Learn more about IPFire in this review from Jack Wallen.

Cloud-Native Security Patching with DevOps Best Practices

In today’s world, the basic unit of deployment is a container image. Once you build a container image, it can’t be changed; if you want to update the image you need to rebuild a new version.

When you start a container running, it’s instantiated from a container image, with the file system starting up a duplicate of that image’s contents. It’s certainly possible — in theory — to treat that container as if it were a server in the old-fashioned way of doing things: You could set things up so you could SSH into a container, and apply patches to it. But it’s a much, much better idea to build a new image with the patches and restart the container, for several reasons:

  • Build once, and run as many instances as you want. You don’t need to patch each container individually; you only need to rebuild the image once, including the patched version of any packages that need to be updated, and then you can re-deploy the same code to all your container instances. Kubernetes and other orchestrators make it easy to do this with rolling upgrades.

Read more at The New Stack

A Test of Knowledge

Software testing is a form of learning. A set of tests can be considered a set of questions. The most obvious question a unit test poses is “Does the code pass?” to which there are two simple answers: yes or no. A test allows us to move from belief to knowledge — for example, to move from merely believing something works to knowing that, in a particular case, it does or does not. Even limiting the scope of testing to just this question and these two answers reveals more than a binary set of possible outcomes:

  • It passes, which is what we expected.
  • It passes and we are surprised, as this is not what we expected.
  • It fails, which is what we expected.
  • It fails and we are surprised and disappointed, as this is not what we had hoped or expected.

Read more at Medium

Fedora 28: The New Developers’ Linux Arrives

Is Fedora Linux for everyone? No. I recommend Mint or Ubuntu for most users. But, if you’re a Red Hat Enterprise Linux (RHEL) or CentOS user, or an open-source programmer, it’s another story. Then, Fedora should be your first choice.

The Fedora Project is Red Hat‘s community-driven open-source Linux. Fedora is also essentially RHEL’s test bed. As such, it uses cutting-edge software, such as the 4.16.3 Linux kernel. This latest version, Fedora 28, comes in three distinct editions: Fedora 28 Server, Fedora 26 Workstation, and Fedora 28 Atomic Host….

For developers, one of the most interesting of Fedora’s new features is its modular repository

Read more at ZDNet

How to Use find in Linux

In a recent Opensource.com article, Lewis Cowles introduced the find command.

find is one of the more powerful and flexible command-line programs in the daily toolbox, so it’s worth spending a little more time on it.

At a minimum, find takes a path to find things. For example:

find /

will find (and print) every file on the system. And since everything is a file, you will get a lot of output to sort through. This probably doesn’t help you find what you’re looking for. You can change the path argument to narrow things down a bit, but it’s still not really any more helpful than using the ls command. So you need to think about what you’re trying to locate.

Perhaps you want to find all the JPEG files in your home directory. The -name argument allows you to restrict your results to files that match the given pattern.

Read more at OpenSource.com

Turing Test 2

In 1950, Alan Turing wrote a paper entitled “Computing Machinery and Intelligence.”a He proposed a test in which a human attempts to distinguish between a human and a computer by exchanging text messages with each of them. If the human is unable to distinguish between the two, the computer is said to have passed the “Turing Test.”…

Much has been written about the increasingly sophisticated ability of computer programs to pass the CAPTCHA tests or a variation in which the program sends the image to a human on the Internet who is given some benefit or payment for solving the problem, which is then relayed by the imitating program to the computer program running the CAPTCHA test. This is not merely an amusing game. As computer programs have grown capable of more sophisticated behavior, they are being used to emulate humans to fool less-sophisticated programs into treating computer-generated actions as if they originate from a human. This is an important practical problem because failure to make this distinction may mean malicious programs can register millions of fake identities on an email system for purposes of sending phishingc email messages or making comments on social media Web pages.

Read more at Communications of the ACM

Cloud Computing in Focus: Serverless, Microservices, KubeCon + CloudNativeCon, and More

Cloud computing concepts can seem as nebulous as clouds themselves, but in April, we published several cloud-related articles to help clarify a few underlying ideas and look at some specific implementations.

This month, Swapnil Bhartiya tackled the subject of serverless computing with There’s a Server in Every Serverless Platform. According to a recent whitepaper from the Cloud Native Computing Foundation (CNCF) Serverless Working Group, “serverless computing refers to the concept of building and running applications that do not require server management.” However, as Bhartiya explains, there are still servers involved.

Also, with the rise of containers, many companies have started to break monoliths into microservices. In Microservices Explained, Bhartiya described how this approach offers a way to break down complex applications and allow components to evolve independently. He talked with Docker’s Patrick Chanezon, who said, “The idea is that you are building your application as a set of loosely coupled services that can be updated and scaled separately under the container infrastructure.”

In other cloud news, KubeCon + CloudNativeCon Europe is happening this week in Copenhagen, Denmark, and those in attendance can look forward to three days of talks, co-located events, and collaboration focused on cloud-native computing. Not everyone can be there in person, though, so Linux.com has been running a series of articles to preview a few of the featured conference talks.   

The following articles will give you a taste of the event and help you learn the latest about containers, cloud, Kubernetes, and more.

Put Wind into your Deployments with Kubernetes and Helm by Eldad Assis

Kubernetes is known for the ease with which you can spin up a cluster, deploy your applications to it, and scale it to your needs. This article shows how easy it can be to run and test your code in a production-like environment.

Extending the Kubernetes Cluster API by Henrik Schmidt

The Cluster API is a new working group under the umbrella of the sig-cluster-lifecycle that aims to enable you to create clusters and machines via a simple, declarative API. The working group is in the very early stages of defining all API types, but Henrik Schmidt has more details in this article.

CRI: The Second Boom of Container Runtimes by CNCF

Harry (Lei) Zhang and Xu Wang, will present “CRI: The Second Boom of Container Runtimes”  this week at KubeCon + CloudNativeCon Europe. In this article, Zhang provides some background on CRI, container runtimes, KataContainers, and how they all fit together.

Extending Kubernetes API for Complex Stateful Applications using Operator by Anil Kumar

Kubernetes 1.5 includes the new StatefulSet API object, which gives you a set of resources to deal with stateful containers, such as volumes and stable network ids. Learn more from CouchBase’s Anil Kumar.

Fluent Bit: Flexible Logging in Kubernetes by Eduardo Silva

Logging in containerized environments involves new challenges that need to be addressed. In this article, Treasure Data’s Eduardo Silva describes the current status of the Fluentd ecosystem and looks at improvements in the new Fluent Bit v0.13 release that will be of interest to Kubernetes users.

For more information, read the CNCF Working Group’s serverless whitepaper. And, check out the whole schedule of events at KubeCon + CloudNativeCon, happening May 2-4 in Copenhagen, Denmark.