Archive

Archive for October, 2018

Hynek Schlawack – How to Write Deployment-friendly Applications – PyCon 2018

October 26, 2018 Leave a comment

Speaker: Hynek Schlawack

The DevOps movement gave us many ways to put Python applications into production. But should your *application* care? Should it need to know whether it’s running on your notebook, on a server, in a Docker container, or in some cloud platform as a service?

It should not, because environment-agnostic applications are easier to **test**, easier to **deploy**, easier to **handle**, and easier to **scale**.

But how can you *practically* structure and configure your applications to make them indifferent to the environment they run in? How do secrets fit into the picture? And where do you put that log file?

By the end of this talk you’ll know the tools and techniques that enable you to write such Python applications and you’ll be ready for the next big change.

Categories: Interesting

An Introduction to Helm, the Package Manager for Kubernetes

October 24, 2018 Leave a comment

Introduction

Deploying applications to Kubernetes – the powerful and popular container-orchestration system – can be complex. Setting up a single application can involve creating multiple interdependent Kubernetes resources – such as pods, services, deployments, and replicasets – each requiring you to write a detailed YAML manifest file.

Helm is a package manager for Kubernetes that allows developers and operators to more easily package, configure, and deploy applications and services onto Kubernetes clusters.

Helm is now an official Kubernetes project and is part of the Cloud Native Computing Foundation, a non-profit that supports open source projects in and around the Kubernetes ecosystem.

In this article we will give an overview of Helm and the various abstractions it uses to simplify deploying applications to Kubernetes. If you are new to Kubernetes, it may be helpful to read An Introduction to Kubernetes first to familiarize yourself with the basics concepts.

https://www.digitalocean.com/community/tutorials/an-introduction-to-helm-the-package-manager-for-kubernetes

Categories: Interesting Tags: ,

How To Back Up and Restore a Kubernetes Cluster on DigitalOcean Using Heptio Ark

October 23, 2018 Leave a comment

Introduction

Heptio Ark is a convenient backup tool for Kubernetes clusters that compresses and backs up Kubernetes objects to object storage. It also takes snapshots of your cluster’s Persistent Volumes using your cloud provider’s block storage snapshot features, and can then restore your cluster’s objects and Persistent Volumes to a previous state.

StackPointCloud’s DigitalOcean Ark Plugin allows you to use DigitalOcean block storage to snapshot your Persistent Volumes, and Spaces to back up your Kubernetes objects. When running a Kubernetes cluster on DigitalOcean, this allows you to quickly back up your cluster’s state and restore it should disaster strike.

In this tutorial we’ll set up and configure the Ark client on a local machine, and deploy the Ark server into our Kubernetes cluster. We’ll then deploy a sample Nginx app that uses a Persistent Volume for logging, and simulate a disaster recovery scenario.

https://www.digitalocean.com/community/tutorials/how-to-back-up-and-restore-a-kubernetes-cluster-on-digitalocean-using-heptio-ark

Categories: Interesting Tags: ,

Kenneth Reitz – Pipenv: The Future of Python Dependency Management – PyCon 2018

October 22, 2018 Leave a comment

Speaker: Kenneth Reitz

This talk is about the history of Python packaging, the tools that have been historically available for application deployment, the problems/constraints presented by them, and presents a holistic solution to many of these problems: Pipenv.

A live demo of the tool will be presented, as well as a Q&A session.

Slides can be found at: https://speakerdeck.com/pycon2018 and https://github.com/PyCon/2018-slides

Categories: Interesting, python Tags:

How to Add User Authentication to Flask Apps with Okta

October 18, 2018 Leave a comment

User authentication is a basic feature in web applications so people can create and access their own accounts. Unfortunately, authentication is not always easy to set up and there are many ways to incorrectly implement login and logout features.

This tutorial walks through how to use the secure identity authentication service called Okta, which is free for up to 1,000 active user accounts, to easily handle user data in Flask applications.

https://www.fullstackpython.com/blog/add-user-authentication-flask-apps-okta.html

Categories: Interesting, python

pre-commit: A framework for managing and maintaining multi-language pre-commit hooks.

October 16, 2018 Leave a comment

Introduction

Git hook scripts are useful for identifying simple issues before submission to code review. We run our hooks on every commit to automatically point out issues in code such as missing semicolons, trailing whitespace, and debug statements. By pointing these issues out before code review, this allows a code reviewer to focus on the architecture of a change while not wasting time with trivial style nitpicks.

As we created more libraries and projects we recognized that sharing our pre-commit hooks across projects is painful. We copied and pasted unwieldy bash scripts from project to project and had to manually change the hooks to work for different project structures.

We believe that you should always use the best industry standard linters. Some of the best linters are written in languages that you do not use in your project or have installed on your machine. For example scss-lint is a linter for SCSS written in Ruby. If you’re writing a project in node you should be able to use scss-lint as a pre-commit hook without adding a Gemfile to your project or understanding how to get scss-lint installed.

We built pre-commit to solve our hook issues. It is a multi-language package manager for pre-commit hooks. You specify a list of hooks you want and pre-commit manages the installation and execution of any hook written in any language before every commit. pre-commit is specifically designed to not require root access. If one of your developers doesn’t have node installed but modifies a JavaScript file, pre-commit automatically handles downloading and building node to run eslint without root.


https://pre-commit.com/

Categories: git, Interesting

Ned Batchelder – Big-O: How Code Slows as Data Grows – PyCon 2018

October 4, 2018 Leave a comment

Speaker: Ned Batchelder

Big-O is a computer science technique for analyzing how code performs as data gets larger. It’s a very handy tool for the working programmer, but it’s often shrouded in off-putting mathematics.

In this talk, I’ll teach you what you need to know about Big-O, and how to use it to keep your programs running well. Big-O helps you choose the data structures and algorithms that will let your code work efficiently even on large data sets.

You can understand Big-O even if you aren’t a theoretical computer science math nerd. Big-O isn’t as mystical as it appears. It’s wrapped in mathematical trappings, but doesn’t have to be more than a common-sense assessment of how your code will behave.

Slides can be found at: https://speakerdeck.com/pycon2018 and https://github.com/PyCon/2018-slides

Source:
https://realpython.com/must-watch-pycon-talks/#10-refactoring-python-why-and-how-to-restructure-your-code

Categories: python Tags: