The V4L2 (Video for Linux 2) API has long offered an open source alternative to proprietary camera/computer interfaces, but it’s beginning to show its age. At the Embedded Linux Conference Europe in October, the V4L2 project unveiled a successor called libcamera. V4L2 co-creator and prolific Linux kernel contributor Laurent Pinchart outlined the early-stage libcamera project in a presentation called “Why Embedded Cameras are Difficult, and How to Make Them Easy.”
V4l and V4L2 were developed when camera-enabled embedded systems were far simpler. “Maybe you had a camera sensor connected to a SoC, with maybe a scaler, and everything was exposed via the API,” said Pinchart, who runs an embedded Linux firms called Ideas on Board and is currently working for Renesas. “But when hardware became more complex, we disposed of the traditional model. Instead of exposing a camera as a single device with a single API, we let userspace dive into the device and expose the technology to offer more fine-grained control.”
LINUX CONFERANCE
These improvements were extensively documented, enabling experienced developers implement more use cases than before. Yet, the spec placed much of the burden of controlling the complex API on developers, with few resources available to ease the learning curve. In other words, “V4L2 became more complex for userspace,” explained Pinchart.
The project planned to add a layer called libv4l to address this. The libv4l userspace library was designed to mimic the V4L2 kernel API and expose it to apps “so it could be completely transparent in tracking the code to libc,” said Pinchart. “The plan was to have device specific plugins provided by the vendor and it would all be part of the libv4l file, but it never happened. Even if it had, it would not have been enough.”
Libcamera, which Pinchart describes as “not only a camera library but a full camera stack in user space,” aims to ease embedded camera application development, improving both on V4L2 and libv4l. The core piece is a libcamera framework, written in C++, that exposes kernel driver APIs to userspace. On top of the framework are optional language bindings for languages such as C.
The next layer up is a libcamera application layer that translates to existing camera APIs, including V4L2, Gstreamer, and the Android Camera Framework, which Pinchart said would not contain the usual vendor specific Android HAL code. As for V4L2, “we will attempt to maintain compatibility as a best effort, but we won’t implement every feature,” said Pinchart. There will also be a native libcamera app format, as well as plans to support Chrome OS.
Libcamera keeps the kernel level hidden from the upper layers. The framework is built around the concept of a camera device, “which is what you would expect from a camera as an end user,” said Pinchart. “We will want to implement each camera’s capabilities, and we’ll also have a concept of profiles, which is a higher view of features. For example, you could choose a video or point-and-shoot profile.”
Libcamera will support multiple video streams from a single camera. “In videoconferencing, for example, you might want a different resolution and stream than what you encode over the network,” said Pinchart. “You may want to display the live stream on the screen and, at the same time, capture stills or record video, perhaps at different resolutions.”
Per-frame controls and a 3A API
One major new feature is per-frame controls. “Cameras provide controls for things like video stabilization, flash, or exposure time which may change under different lighting conditions,” said Pinchart. “V4L2 supports most of these controls but with one big limitation. Because you’re capturing a video stream with one frame after another, if you want to increase exposure time you never know precisely at what frame that will take effect. If you want to take a still image capture with flash, you don’t want to activate a flash and receive an image that is either before or after the flash.”
With libcamera’s per-frame controls, you can be more precise. “If you want to ensure you always have the right brightness and exposure time, you need to control those features in a way that is tied to the video stream,” explained Pinchart. “With per-frame controls you can modify all the frames that are being captured in a way that is synchronized with the stream.”
Libcamera also offers a novel approach to a given camera’s 3A controls, such as auto exposure, autofocus, and auto white balance. To provide a 3A control loop, “you can have a simple implementation with 100 lines of code that will give you barely usable results or an implementation based on two or three years of development by device vendors where they really try to optimize the image quality,” said Pinchart. Because most SoC vendors refuse to release the 3A algorithms that run in their ISPs with an open source license, “we want to create a framework and ecosystem in which open source re-implementations of proprietary 3A algorithms will be possible,” said Pinchart.
Libcamera will provide a 3A API that will translate between standard camera code and a vendor specific component. “The camera needs to communicate with kernel drivers, which is a security risk if the image processing code is closed source,” said Pinchart. “You’re running untrusted 3A vendor code, and even if they’re not doing something behind your back, it can be hacked. So we want to be able to isolate the closed source component and make it operate within a sandbox. The API can be marshaled and unmarshaled over IPC. We can limit the system calls that are available and prevent the sandboxed component from directly accessing the kernel driver. Sandboxing will ensure that all the controls will have to go through our API.”
The 3A API combined with libcamera’s sandboxing approach, may encourage more SoC vendors to further expose their ISPs just as some are have begun to open up their GPUs. “We want the vendors to publish open source camera drivers that expose and document every control on the device,” he said. “When you are interacting with a camera, a large part of that code is device agnostic. Vendors implement a completely closed source camera HAL and supply their own buffer management and memory location and other tasks that don’t add any value. It’s a waste of resources. We want as much code as possible that can be reused and shared with vendors.”
Pinchart went on to describe libcamera’s cam device manager, which will support hot plugging and unplugging of cameras. He also explained libcamera’s pipeline handler, which controls memory buffering and communications between MIPI-CSI or other camera receiver interfaces and the camera’s ISP.
“Our pipeline handler takes care of the details so the application doesn’t have to,” said Pinchart. “It handles scheduling, configuration, signal routing, the number of streams, and locating and passing buffers.” The pipeline handler is flexible enough to support an ISP with an integrated CSI receiver (and without a buffer pool) or other complicated ISPs that can have a direct pipeline to memory.
Posted by: xSicKxBot - 12-04-2018, 01:35 PM - Forum: Windows
- No Replies
Microsoft Simple Encrypted Arithmetic Library goes open source
Today we are extremely excited to announce that our Microsoft Simple Encrypted Arithmetic Library (Microsoft SEAL), an easy-to-use homomorphic encryption library developed by researchers in the Cryptography Research group at Microsoft, is open source on GitHub under an MIT License for free use. The library has already been adopted by Intel to implement the underlying cryptography functions in HE-Transformer, the homomorphic encryption back end to its neural network compiler nGraph.
As we increasingly move our data to the cloud, there is a clear concern that arises: How can we balance convenience and privacy? We all love to get practical guidance on how to, for example, maximize our investments, improve our workouts, or reach our destinations as efficiently as possible. In exchange, we share personal information with service providers because we have few other options. With traditional encryption schemes, it is impossible to run any computation on encrypted data. So either we store our data encrypted in the cloud and download it to perform any useful operations, which can be logistically inconvenient, or we provide the decryption key to service providers, risking our privacy. Until now. Homomorphic encryption, which allows processing of encrypted data, gives us the ability to use these services without exposing our private information.
In 2015, Microsoft Research released the first version of Microsoft SEAL with the specific goal of providing a well-engineered and documented homomorphic encryption library, free of external dependencies, that would be easy for both cryptography experts and novice practitioners to use. In 2016, we demonstrated CryptoNets, showing that deep learning on homomorphically encrypted data is indeed feasible, revolutionizing our approach to responsible AI.
In addition to having no external dependencies, Microsoft SEAL is written in standard C++, making it easy to compile in many different environments. We are looking forward to engaging with the open-source community in continuing to develop our library. If you are interested, we warmly invite you to join us on GitHub or to participate in discussions on StackOverflow tag-SEAL.
As it does every year, Apple on Tuesday released a list of the year’s “best” digital content up for offer on its various digital storefronts, from the iOS App Store to Apple Books.
Apple’s Best of 2018.
Apple announced the “Best of 2018” awards in a press release posted to its website. Like recent years, the list is heavy on apps and games, but also includes highlights from Apple Music, the iTunes Movie Store, Podcasts and Apple Books.
Starting with its bread-and-butter App Store offerings, Apple crowned Procreate Pocket as 2018’s iPhone App of the Year, with Froggipedia and Pixelmator Pro taking top honors for iPad and Mac, respectively. Workout app Sweat took the No. 1 spot on Apple TV.
Physics-based puzzler Donut County was named iPhone Game of the Year, while point-and-click puzzle title Gorogoa won the same honor for iPad. Story-driven adventure-puzzle title The Gardens Between was named Mac Game of the Year and Alto’s Odyssey took home the award for Apple TV.
Battle royale-style games like Fortnite and PUBG Mobile were cited as Game Trend of the Year, though no title in the category made the cut for best game. So-called self-care apps — health and fitness apps like Calm and 10% Happier: Meditation — featured as 2018’s app Trend of the Year.
Apple also shared a link to this year’s Top App Charts, expectedly populated with stalwart apps like YouTube, Instagram, Snapchat and Facebook. Beyond breakout franchise Fortnite, the Top Games Charts was less predictable, led by the likes of HQ Trivia and Helix Jump, among others.
A smattering of watchOS apps are featured in a “favorites” section that feels more like a consolation than an distinct category.
Frequent Apple collaborator Drake was named Artist of the Year, while Juice WRLD rated Breakout Artist of the Year honors. Song of the Year went to “I Like It” by Cardi B featuring Bad Bunny and J. Balvin, as Kacey Musgraves’ Golden Hour took home Album of the Year.
Apple shined a light on podcasts with a list heavy on investigative reporting and storytelling, examples being “This American Life,””Slow Burn” and “Wolverine: The Long Night.” The company said podcasts focusing on news and politics gained traction this year, presumably thanks to a tumultuous domestic news cycle and the midterm elections.
Critically-acclaimed movies like “Crazy Rich Asians” and TV shows like “The Handmaid’s Tale” topped Apple’s picks for Apple TV and iTunes.
Finally, Apple noted top offerings from the recently revamped — and renamed — Apple Books, including Book of the Year “American Marriage.”
A lot has happened since the debut of the Command and Conquer: Rivals teaser a couple of months ago. EA released a blog for the game. There have been tons of videos, both on the merits of the game itself and showing gameplay to the prospective players. Remasters for the original Command and Conquer and Red Alert have been announced. There’s been a lot of movement in Command and Conquer circles over the past couple months.
And now, it’s out in the wild. The whole world can, for better or worse, go out to Google Play or the Apple Store and try out Rivals if they want. To decide if it’s a pay-to-win cash grab (we wrote a bit about the game’s pay model back in November), or if, maybe, something interesting has been created here. Let’s dive in and take a look.
Broad Strokes
First off, what is Command and Conquer: Rivals? There’s been a lot of hot air blown about the internet on the topic of this game, but it still feels right to cover the basics before digging into the details.
Command and Conquer: Rivals is a Real Time Strategy game designed from the ground up to be played on mobile devices: phones, and laptops. It seeks to stand out from the innumerable Clash Royale clones that exist in a couple of key ways. Unlike virtually every game of this genre, Rivals lets players directly control all of their units in real time – most games like this strip gameplay down to just placing units onto a game map and watching their interactions play out. Rivals brings real RTS sensibilities of controlling your own army along to bear.
Another way that Rivals seeks to differentiate itself from other mobile strategy games is actual strategically different map selection. Instead of just re-skinning a single pre-existing arena design, Rivals is again taking a nod from traditional RTS gaming in having a variety of different maps with slightly different Point of Interest configurations that change how the map is approached tactically and strategically.
Players load into one of these game maps, and train units and harvest resources as they attempt to hold more capture points than their enemy in order to be the first to destroy their opponent’s base. You can do this indirectly, by holding the capture points and using them to direct the missile on the map to shoot at the base, or directly, by attacking their base with units.
That should be enough to get started with. Let’s get down to details.
As hilarious as it might be to leave this section blank, it wouldn’t be true. If you can leave out the “Command and Conquer” part, and just evaluate it based on the gameplay, you find a surprisingly fun strategy game that’s well-suited to mobile formats.
The game’s actual in-match, minute-to-minute gameplay is surprisingly engaging. There’s kind of a modified rock-paper-scissors going on, where the 2 players in the match are jockeying their units around trying to put the units, they’ve trained next to targets they’re good at hurting, while avoiding enemy units that are designed to kill them. As a for-instance: early in a match, you might have fielded a squad of Nod Militants, and a Laser Trooper squad. You’d want to put those Militants next to an enemy GDI Rocket squad, as Militants are an anti-infantry unit, and the Rocket squad is designed to fight vehicles and aircraft.
Likewise, you want to get your tanks firing on enemy vehicles, and your anti-vehicle Orcas to attack tanks, while keeping them away from anti-vehicle and anti-air unit attacks, respectively.
It’s a simple formula that’s made far more interesting with the advent of unit abilities and unique attributes. Hard-hitting GDI units often have ‘ammunition’ – they fire a volley of shells, then can’t attack until the shells reload. Some Nod units have a laser that ramps up damage after they remain focused on one target for a while: their Giga cannon unit’s laser actually splits to multiple targets if allowed to attack one enemy for long enough.
Some units can attack 2 tiles away, like the GDI sniper. Some can attack multiple tiles in a line, or an area. Some leave persistent pools of fire or chemical gas that persist on the battlefield, damaging any units that move across them.
There are units that have to set up to fire. Units that move more quickly after attacking, to be able to get away from enemies. With a simple, easy to grok damage/counter system and movement rules, they’ve still managed to put in a lot of variety and, yeah, combat depth.
It might not be “real”Command and Conquer, but Redwood studios did a good job of paring the RTS down to an experience that’s incredibly rewarding and interesting on mobile. Kudos to them on that.
This is, well. This is the stuff that’s a little harder to accept on the palette, as it were. The stuff outside of the match is what might give more players pause than the actual moment-by-moment gameplay.
Like most free to play games these days, units are acquired in random ‘packs’ like cards. Additionally, you acquire multiple ‘cards’ and spend them (along with in-game currency, which of course can be purchased in the game’s store via another currency that’s mostly generated via real money transactions).
So, units can ‘level up’ when you have enough cards. Each unit has 3 ‘sub levels’ that are accessed purely by in-game cash, which means that if you’re waiting to level up one troop type you like using while waiting for more cards, you can improve its performance incrementally.
I don’t think any game has been objectively improved with the addition of the grind of unit unlocks and card collecting or any of that. This isn’t an ideal pay model. It can get annoying. It can be frustrating and feel unfair and grindy and like it’s asking you to pay into the game in exchange for filthy, pay-to-win rewards. But, I’m a realist about this stuff. You need to monetize your game to be successful, and similar models are widely used all over the mobile space.
The real question, as I see it, is: How and how much does it impact the actual game experience? The answer, of course, is ‘it’s complicated’.
It’s possible to win with lower level units, due to the counter system. An air unit that deals damage to tanks is always going to beat a tank (that can’t shoot back). However, a higher level GDI Jump Trooper squad is going to do higher proportional damage to an enemy harvester, whose level and HP is determined by the level commander the player’s chosen. So, there’s a definite, if often marginal and difficult to notice, benefit to having higher level units. But the counter system is just enough to tip things in favor of a ‘mostly fair’ verdict.
As new units come out, bundles are released that let players ‘catch up’ with the unit. And the pricing of these, as well as the pay-only random crates, is excessive. $20 for a new unit is a lot, and one had sold briefly for $50 USD. That sometimes hurts to see in the game store.
It’s always pricing that hurts these games. But it’s entirely possible to spend little if anything on the game and enjoy it, up to a point.
Also, regarding balance: there’s always a counter, but some of these heavy hitters can feel overwhelming the first time you see them. The Brotherhood of Nod’s Inferno bomber is *murder* on ground units, for instance, and the GDI’s Sandstorm is a damage machine against air and enemy vehicles. They’re able to be countered, but some ‘death combos’ may exist if allowed to come out on the field.
The game has some decent player reward systems. The Bounty system gives you bonus (in game) cash for playing a certain number of matches a day, or for training certain unit types, killing harvesters, and the suchlike. Do 5 of these Bounties, and you get a loot crate. It’s a Skinner box, but for all that it can serve as an adequate incentive.
There’s a decent clan system with the requisite card sharing with clan members. There’s a truly excellent public replays system (though I keep hoping for improvements to the replay UI, I’ll be honest). Competitive, esports style content is apparently on the way. It’s got a good supporting feature set, everything you’d kind of expect from a game of this type.
I like the core gameplay with its depth in simplicity. I love the control you have over your units, and the way that EA has managed to preserve the idea of resource gathering and base building. Many of the units are fun. But Fairplay might be the big clincher for me.
At its core, Fairplay is a band-aid. The card collecting, unit leveling system introduces inherent imbalances: pour enough cash into the system, and you’re going to eventually end up with better stuff than other players. And you’ll eventually go up against players that haven’t done that, and whose stuff is way lower level than you.
Also, the way of the world is, matchmaking systems can make mistakes. They can have a bad match-up where the only person available to play against you is in a higher MMR bracket than you are. Like, by a lot.
The Fairplay system attempts to address this, and it’s a gesture that I really appreciate (being a realist about the need to monetize this game, and the observation that loot box driven card leveling has worked for a number of games). How does it work? I’m glad you asked.
if you’re put up against a player with units that are significantly higher level than yours, or who have a large MMR gap against, you won’t be able to lose MMR. You’re exempt from that penalty. But, if you win, you gain bonus MMR for the challenge.
It’s not a perfect system. It’s a band aid on top of the game’s monetization system. But it’s also a heck of a lot more than many other mobile games with similar pay models do to make the game less frustrating for free players with less time.
How you feel about C&C Rivals will probably, ultimately, come down to how you feel about mobile gaming in general. If the idea of free-play models with loot boxes or card levels is a turn off, this is one of many games you’ll want to avoid, even though EA is actually taking steps to mitigate the impact of the system on the gameplay.
How you feel about C&C Rivals will probably also come down to how you feel about RTS games. If you’re looking for a deep campaign with FMV cutscenes and Joe Kucan in a black robe, with an extensive tech tree and huge maps covered with Tiberium, this is also probably not a game that’s going to fit your needs.
But if you’re looking for a satisfying RTS you can play on the toilet at work or getting your kids to sleep (I do this almost every night) and still feel like you’re executing some goddamn tactics and actual strategy, Rivals is definitely worth a look.
But I’ve made my case. All I can do now is ask that you give it a try. It might just surprise you.
Big Bash Boom is this summer's arcade blast for the whole family. Fully licensed with all your favourite Big Bash heroes, teams, and mascots, Big Bash Boom is all about whacking spectacular sixes... and then doing a little dance just to rub it in. Use powerups to get an edge on the field, or bling out your favourite team with a rich assortment of hilarious unlockable equipment options. Play along with Australia's biggest competition as it happens, and dominate your living room!
Posted by: xSicKxBot - 12-04-2018, 06:03 AM - Forum: Lounge
- No Replies
Spider-Man And Fortnite Lead To Rising Game Industry Sales, Says NPD
Video game spending in the US increased in the third quarter of 2018 over the previous year, according to a report by the NPD Group. The sales tracking firm said the games having the biggest impact on the figures were Candy Crush Saga, Fortnite, Madden NFL 19, Spider-Man, and NBA 2K19.
Altogether the firm says that total spending on video games increased 24% from July-September, over the same period in 2017. It reached a total of $9.1 billion. "Video game content" accounted for $7.9 billion, but that broad category includes full games, DLC, and subscriptions. Mobile games and digital content sales had the highest growth.
Hardware grew by 11% to $737 million, while accessories like headsets grew by 44%. Game cards had a particularly sharp increase of 63%, marking the first time they've beaten accessories during this period of the year.
This isn't the first we've heard of games like Spider-Man and Fortnite lifting the industry up. Earlier this year NPD announced similarly rising figures on the back of Fortnite and God of War. Similarly, Sony boasted in September that Spider-Man had broken sales records set by God of War, and sales have apparently been so strong that the PlayStation business lifted Sony's financial forecast as a whole.
"The Video Game market in the U.S. continues to thrive with compelling gaming content expanding the market, driving higher spending of hardware, accessory and software," said Mat Piscatella, games industry analyst at The NPD Group. "And with the sales strength of recent releases such as Marvel's Spider-Man and NBA 2K19, combined with cross-platform titles such as Fortnite, there appears to be no slowing down as we head into the final stretch of the holiday shopping season."
Review: NAIRI: Tower Of Shirin – A Lovingly-Made Point-And-Click Adventure
Of all the genres out there in the wonderful world of video games, very few games showcase the heart and soul of their creators quite like the point-and-click adventure. Perhaps it’s the slower pace or the need for memorable characters and an engrossing story, but everything from background art to dialogue becomes a canvas on which a developer can really showcase the personality that makes the game distinctly theirs.
NAIRI: Tower of Shirin – the latest addition to the growing number of titles representing this still very niche genre on Nintendo Switch – is a perfect example. From the tense moments of its opening to the humorous interactions and eye-opening revelations that are woven through its story, this plucky indie offering never stops excitedly trying to show you another beautiful piece of hand-painted art, a clever puzzle design or a pithy line of dialogue. Even with its faults, you’re almost always going to be charmed by its childlike enthusiasm.
The story, alongside the puzzles, is the core of any adventure game, and NAIRI’s is full of surprises. It starts out innocently enough, with the titular Nairi finding her life among the city of Shirin’s elite suddenly turned on its head as she flees an attack on her family. Thrown into a world of bandits, conspiracies and forgotten civilisations, the once detached young girl slowly grows into a confident heroine determined to solve the mystery behind the Tower of Shirin once and for all. It’s a plot that keeps changing its stripes the further you progress, morphing from coming of age story to fantastical mystery and beyond.
Talking of puzzles, NAIRI never strays too far from the formula that’s served the likes of Broken Sword and Grim Fandango Remastered before it. You’ll collect items as you explore different areas, which can be combined to complete quests or solve certain riddles. The sheer variety of puzzles to solve – ranging from pressing a series of buttons in a single room to conundrums with multiple parts that span myriad rooms – means you’ll find plenty of brainteasers to break up the non-voiced-over dialogue and animated cutscenes. Some of these puzzles can get a little obtuse, especially towards the end of the game, but they’re nowhere near as frustrating as some of Riven or King’s Quest’s toughest head-scratchers.
Talking of animation, one of NAIRI’s biggest selling points is its quaint art style. Rather than using rendered assets, every single frame is hand-painted to create a storybook quality with a colour palette that really sells the dingy poor quarters or Shirin, the elitist rich district and the hidden world below. The simplistic approach to animation isn’t going to be everyone’s tastes, but there’s a lot to like about the game’s low-fi presentation, such as how characters fade from view when they leave a scene, or how cutscenes move from one static image to another like the turning the pages of a book. Considering the art style was also the work of one talented artist, it’s impossible to fault its aesthetic ambitions.
The whole game has a consistently chill vibe about it, which even extends to the eclectic soundtrack that mixes together a variety of styles into one relaxing score. It suits the bedtime story style Home Bear Studio is going for with this whimsically little indie, and it makes for a low-intensity and relaxing experience overall. Some voice-over dialogue would have helped sell the broad cast of witty anthropomorphic characters, but this is an indie title built by a small team on a tiny budget, so it’s a concession we can live with.
Home Bear Studio has also taken full advantage of Switch’s unique hardware traits and offered three ways to play. You can play with the analog sticks and face buttons on your Joy-Con or simply rely on the console’s touchscreen to fully interact with NAIRI’s world. Or, if you want to go one better, you can hark back to the good old days of the Wii and point your Joy-Con at your TV while in docked mode. There’s even the option for a left-handed version. It’s great to see a developer making an effort to really embrace Switch’s qualities, and being able to use your Joy-Con as a cursor on-screen turns NAIRI into an even more engrossing experience for younger players.
Conclusion
There’s a good chance you’ve probably never heard of NAIRI: Tower of Shirin, but that doesn’t mean this hidden gem should pass you buy. Sure, it doesn’t have the pedigree of a Double Fine game or the licence exposure of something from TellTale’s back catalogue, but it still offers up a safe and engaging world full of quirky characters, challenging puzzles and all the screen-tapping backgrounds you could ask for. It’s no great reimagining of the genre, but it’s still a curio worth playing nonetheless.
Demystifying Kubernetes Operators with the Operator SDK: Part 1
You may have heard about the concept of custom Operators in Kubernetes. You may have even read about the CoreOS operator-sdk, or tried walking through the setup. The concept is cool: Operators can help you extend Kubernetes functionality to include managing any stateful applications your organization uses. They can ideally help you move away from manual human intervention at runtime for things like upgrades, node recovery, and resizing a cluster. But after reading a bit on the topic, you may secretly still be mystified as to what operators exactly do, and how all the components work together.
In this article, we will demystify what an operator is, and how the CoreOS operator-sdk translates its input to the code that is then run as an operator. In this step-by-step tutorial, we will create a general example of an operator, with a few bells and whistles beyond the functionality shown in the operator-sdk user guide. By the end, you will have a solid foundation for how to build a custom operator that can be applied to real-world use cases.
Hello Operator, could you tell me what an Operator is?
To describe what an operator does, let’s go back to Kubernetes architecture for a bit. Kubernetes is essentially a desired state manager. You give it a desired state for your application (number of instances, disk space, image to use, etc.) and it attempts to maintain that state should anything get out of wack. Kubernetes uses what’s called a control plane on it’s master node. The control plane includes a number of controllerswhose job is to reconcile against the desired state in the following way:
Monitor existing K8s objects (Pods, Deployments, etc.) to determine their state
Compare it to the K8s yaml spec for the object
If the state is not the same as the spec, the controller will attempt to remedy this
A common scenario where reconciling takes place is a Pod is defined with three replicas. One goes down, and with K8s’ controller watching, it recognizes that there should be three Pods running, not two. It then works to create a new instance of the Pod.
This simplified diagram shows the role of controllers in Kubernetes architecture as follows.
The Kubectl CLI sends an object spec (Pod, Deployment, etc.) to the API server on the Master Node to run on the cluster
The Master Node will schedule the object to run (not shown)
Once running, a Controller will continuously monitor the object and reconcile it against the spec
In this way, Kubernetes works great to take much of the manual work out of maintaining the runtime for stateless applications. Yet it is limited in the number of object types (Pods, Deployments, Namespaces, Services, DaemonSets, etc.) that it will natively maintain. Each of these object types has a predetermined behavior and way of reconciling against their spec should they break, without much deviation in how they are handled.
Now, what if your application has a bit more complexity and you need to perform a custom operation to bring it to a desired running state?
Think of a stateful application. You have a database application running on several nodes. If a majority of nodes go down, you’ll need to reload the database from a specific snapshot following specific steps. Using existing object types and controllers in Kubernetes, this would be impossible to achieve. Or think of scaling nodes up, or upgrading to a new version, or disaster recovery for our stateful application. These kinds of operations often need very specific steps, and typically require manual intervention.
Enter operators.
Operators extend Kubernetes by allowing you to define a Custom Controller to watch your application and perform custom tasks based on its state (a perfect fit to automate maintenance of the stateful application we described above). The application you want to watch is defined in Kubernetes as a new object: a Custom Resource (CR) that has its own yaml spec and object type (in K8s, a kind) that is understood by the API server. That way, you can define any specific criteria in the custom spec to watch out for, and reconcile the instance when it doesn’t match the spec. The way an operator’s controller reconciles against a spec is very similar to native Kubernetes’ controllers, though it is using mostly custom components.
Note the primary difference in our diagram from the previous one is that the Operator is now running the custom controller to reconcile the spec. While the API Server is aware of the custom controller, the Operator runs independently, and can run either inside or outside the cluster.
Because Operators are a powerful tool for stateful applications, we are seeing a number of pre-built operators from CoreOS and other contributors for things like ectd, Vault, and Prometheus. And while these are a great starting point, the value of your operator really depends on what you do with it: what your best practice is for failed states, and how the operator functionality may have to work alongside manual intervention.
Dial it in: Yes, I’d like to try Building an Operator
Based on the above diagram, in order to create our custom Operator, we’ll need the following:
A Custom Resource (CR) spec that defines the application we want to watch, as well as an API for the CR
A Custom Controller to watch our application
Custom code within the new controller that dictates how to reconcile our CR against the spec
An Operator to manage the Custom Controller
A deployment for the Operator and Custom Resource
All of the above could be created by writing Go code and specs by hand, or using a tool like kubebuilder to generate Kubernetes APIs. But the easiest route (and the method we’ll use here) is generating the boilerplate for these components using the CoreOS operator-sdk. It allows you to generate the skeleton for the spec, the controller, and the operator, all via a convenient CLI. Once generated, you define the custom fields in the spec and write the custom code to reconcile against the spec. We’ll walk through each of these steps in the next part of the tutorial.
Toye Idowu is a Platform Engineer at Kenzan Media.
Treasure Considering Arcade Shmup Radiant Silvergun For Switch
The iconic Japanese developer Treasure might be bringing another shoot ’em up game to the Nintendo Switch eShop in the near future. Based on a Twitter reply to a fan last month, Radiant Silvergun has been in consideration for the Switch for some time now. Here’s how it all unfolded in tweet form:
Radiant Silvergun was released in the arcade in 1998 and was ported across to the Sega Saturn not long after. It’s considered to be one of the greatest shmup and Sega Saturn releases of all-time. Like all good games from this genre, you must protect the earth by unleashing bullet hell on the enemy. One other interesting fact is the 2001 title Ikaruga is its spiritual successor.
Is this a game you would like to see released on the Switch eShop eventually? Do you have any other Treasure games you would like to see ported across to Nintendo’s hybrid device? Tell us below.
Why Xbox Is Sticking With E3 After Sony Dropped Out
For the first time in E3's history, Sony is skipping the annual big-time gaming show next year. Microsoft, meanwhile, will attend the event. Now, Xbox boss Phil Spencer has shared some insight into why Microsoft remains committed to E3 after its biggest competitor dropped out.
According to Twinfinite, during Microsoft's Extra Life livestream event, Spencer acknowledged how E3 has changed over the years. E3 began as a very business-focused event that retailers would attend to determine how many games to order for the holidays. That still happens, and E3 remains important for business reasons, but show is now open to the public and overall it's taken more of a consumer and press focus in recent years. Spencer said Microsoft continues to enjoy and support E3 is because it's a "celebration" of gaming that helps bring people today.
He admitted that Microsoft could host its own gaming event outside of E3 or a "direct" in the fashion of Nintendo. But Microsoft won't do that because "it's an awesome and frankly convenient way for the fans to experience video games. I think we do it because it's a U.S. celebration in L.A. It's easy for people in the U.S. to come to one place and just share their love of video games."
Spencer went on to say that he hopes E3 grows bigger still in the future, while at the same time acknowledging that he also expects the show to change "in some ways" in the future.
In addition to E3, Microsoft recently resurrected its X018 event, holding the show in Mexico City last month where it announced the acquisitions of Obsidian and inXile, among other things. Spencer said in the new livestream that Microsoft is "really happy" with how X018 went, and while he stopped short of confirming a 2019 show, he said, "We want to do it again."
Explaining its decision to not attend E3 next year, a Sony representative said, "We are exploring new and familiar ways to engage our community in 2019 and can't wait to share our plans with you."
The company added: "As the industry evolves, Sony Interactive Entertainment continues to look for inventive opportunities to engage the community. PlayStation fans mean the world to us and we always want to innovate, think differently and experiment with new ways to delight gamers. As a result, we have decided not to participate in E3 in 2019."
The major gaming companies--Sony, Microsoft, and Nintendo--have all adjusted their E3 plans in recent years. In 2018, Microsoft notably moved nearly its entire presence offsite to the Microsoft Theater, with only Mixer present on the showfloor, while Nintendo has forgone live press conferences in favor of pre-recorded video presentations for the past several years. Sony, too, tried something different with its E3 2018 showing by focusing primarily on four of its upcoming games and presenting them through a "guided experience," which garnered a mixed reaction from viewers.
While Sony is skipping E3 2019, Microsoft and Nintendo, as well as Ubisoft, Activision, Take-Two, and other notable gaming companies are confirmed to attend the event.
E3 2019 takes place June 11-13. It is notably the final show confirmed for the Los Angeles Convention Center--the venue it has traditionally been held in for much of its history. Former ESA CEO Michael Gallagher had previously said the organization may pursue other options if the LACC does not modernize and upgrade the facility.