Build, test and release your python packages

Similar documents
Creating pipelines that build, test and deploy containerized artifacts Slides: Tom Adams

Harbor Registry. VMware VMware Inc. All rights reserved.

I hate money. Release 1.0

There Should be One Obvious Way to Bring Python into Production. Sebastian Neubauer

DevOps Workflow. From 0 to kube in 60 min. Christian Kniep, v Technical Account Manager, Docker Inc.

Deployability. of Python. web applications

Accelerate at DevOps Speed With Openshift v3. Alessandro Vozza & Samuel Terburg Red Hat

SCALING DRUPAL TO THE CLOUD WITH DOCKER AND AWS

Deploying Rails with Kubernetes

Continuous Integration (CI) with Jenkins

DEPLOYMENT MADE EASY!

WorldSpace Attest Quick Start Guide

Setting up a Chaincoin Masternode

CONTINUOUS INTEGRATION; TIPS & TRICKS

Gunnery Documentation

Patch Server for Jamf Pro Documentation

" Qué me estás container?" Docker for dummies

USER MANUAL. Star Track Shipping TABLE OF CONTENTS. Version: 2.0.0

The Long Road from Capistrano to Kubernetes

Php4u Payment Restrictions Module for Magento 2

CloudCenter for Developers

Django MFA Documentation

TangeloHub Documentation

Pulp Python Support Documentation

turbo-hipster Documentation

By: Jeeva S. Chelladhurai

Docker on VDS. Aurelijus Banelis

Administration Guide. 05 Apr TM and copyright Imagicle spa

NetApp Jenkins Plugin Documentation

Developing and Testing Java Microservices on Docker. Todd Fasullo Dir. Engineering

Container-based virtualization: Docker

How Docker Compose Changed My Life

Table of Contents. Configure and Manage Logging in to the Management Portal Verify and Trust Certificates

Composer and Drupal. CIDUG Meeting December 13, 2018 John Rearick

VNS3:turret WAF Guide Sept 2015

Autopology Installation & Quick Start Guide

datapusher Documentation

Containers. Pablo F. Ordóñez. October 18, 2018

Dockerfile Best Practices

tailon Documentation Release Georgi Valkov

Configuration Management

pydrill Documentation

Handel-CodePipeline Documentation

Centrify Identity Services for AWS

SPC Documentation. Release Wesley Brewer

Index. Bessel function, 51 Big data, 1. Cloud-based version-control system, 226 Containerization, 30 application, 32 virtualize processes, 30 31

Harnessing the Power of Python in ArcGIS Using the Conda Distribution. Shaun Walbridge Mark Janikas Ting Lee

Pulp OSTree Documentation

Aruba Certified Clearpass Professional 6.5

pistahx type safe, design first, haxe web api by Emmanuel BOTROS YOUSSEF / mebyz

Your Engineering Excellency

RED HAT QUAY. As part of OCP Architecture Workshop. Technical Deck

OSM Hackfest - Session 5 Adding day-1/day-2 configuration to your VNF Creating your first proxy charm

Application Guide. Connection Broker. Advanced Connection and Capacity Management For Hybrid Clouds

Verteego VDS Documentation

VNS3 Plugins. VSN3:turret WAF Container Guide

Who is Docker and how he can help us? Heino Talvik

WORKSHOP: from Zero to a Network Application with #golang

Infoblox Kubernetes1.0.0 IPAM Plugin

Red Hat Containers Cheat Sheet

Best Practices for a Mission- Critical Jenkins

Docker Cheat Sheet. Introduction

HOW TO SECURELY CONFIGURE A LINUX HOST TO RUN CONTAINERS

DCLI User's Guide. Data Center Command-Line Interface 2.9.1

IBM Cloud Developer Tools (IDT) and App Service Console Overview

Portainer Documentation

FROM VSTS TO AZURE DEVOPS

Android meets Docker. Jing Li

WORKSHOP SHINKEN REFERENCE: Ref[1] tutorial for Centos7 Ref[2] offical documentation

CIS : Computational Reproducibility

Eucalyptus User Console Guide

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Gerrit

Intro Technical details Using vcsh Outlook Outro. vcsh. manage config files in $HOME via fake bare git repositories

Chris Calloway for Triangle Python Users Group at Caktus Group December 14, 2017

Trunk Player Documentation

Using vrealize Operations Tenant App as a Service Provider

Deploying Code42 CrashPlan with Jamf Pro. Technical Paper Jamf Pro 9.0 or Later 21 January 2019

Simplified CICD with Jenkins and Git on the ZeroStack Platform

Bitdock. Release 0.1.0

Getting Started with Cisco UCS Director Open Automation

Get Started with SQL Server containers with cloned databases

DEVOPS COURSE CONTENT

Magento Survey Extension User Guide

Deploying Cisco Nexus Data Broker Embedded for OpenFlow

School of Computing Science Gitlab Platform - User Notes

Drupal Command Line Instructions Windows 7 List Files >>>CLICK HERE<<<

Red Hat Quay 2.9 Deploy Red Hat Quay - Basic

Adding an Additional Node to an existing Oracle Applications Instance Using Rapidclone

Containers OpenStack. Murano brings Docker & Kubernetes to OpenStack. Serg Melikyan. software.mirantis.com. January 27, 2015

python-docker-machine Documentation

Continuous Delivery for Python Developers PyCon 8, 2017

Qualys Cloud Platform (VM, PC) v8.x Release Notes

withenv Documentation

DCLI User's Guide. Modified on 20 SEP 2018 Data Center Command-Line Interface

LET S ENCRYPT WITH PYTHON WEB APPS. Joe Jasinski Imaginary Landscape

Libra Client Documentation

EasyLogin. Intro to the Alpha version

DCLI User's Guide. Data Center Command-Line Interface

Cloud Computing II. Exercises

Managing a WordPress 2.6 installation with Subversion. Sam Bauers - Automattic

Transcription:

Build, test and release your python packages Using DevPI, Docker and Jenkins David Melamed PyWeb #55-1st August 2016

A word about me Moved to Israel 8 years ago PhD in BioInformatics Senior Research Engineer

A word about CloudLock Leader in the Cloud Access Security Broker (CASB) market Founded: 2011 Corporate Headquarters: Waltham, Mass. (U.S.A.) R&D Headquarters: Tel Aviv Employees: 140 (30 in TLV) Trusted by major brands: Acquired by Cisco today! 180K APPS 10 M USERS 1 B / month ACTIVITIES

CloudLock initial dev & release workflow hook DEV git clone git@github.com:cloudlock/myrepo.git Jenkins PROD test - name: Clone repository git: repo=git@github.com :Cloudlock/myrepo.git git commit git tag 0.1 RELEASE - name: Install requirements Pip: requirements=/path/requirements

The problems PyPI may be not available No offline work Dependencies may change between dev & release Packages may be removed from repository Compiles source in production

What we would like Build immutable package Package code as wheels Being able to work offline Host private packages

DevPI main advantages Local fast PyPI mirror Multiple indexes Web interface 100% compatible with pip Private indexes (dev, stage, prod) UI for index navigation Replication for offline use Index inheritance Search for packages Package documentation

The dev & release flow using DevPI and Jenkins Commit Test Build Tag Upload Install

DevPI client main commands (1) Define the server devpi use http://user:password@localhost/myindex/ Create user devpi user -c john email=john@abc.com password=12345 Login as user devpi login john --password=12345 Upload package devpi upload --formats=sdist,bdist_egg,bdist_wheel

DevPI indices Multiple private indices Index volatile / non-volatile Index inheritance Source: devpi website

DevPI client main commands (2) List indices devpi index -l Create an index devpi index -c mycompany/prod volatile=false devpi index -c john/dev bases=mycompany/prod Use an index devpi use mycompany/prod Modify index properties devpi index mycompany/prod acl_upload=jenkins \ uploadtrigger_jenkins=http://jenkins-url \ slack_hook=https://hooks.slack.com/services...

How to use devpi with pip pip install requests -i http://user:password@devpi/myindex/+simple --trusted-host devpi pip install requests -i https://user:password@devpi/myindex/+simple

PIP configuration ~/.pip/pip.conf [global] timeout = 60 index-url = http://localhost/root/pypi/+simple download-cache = ~/.pip/cache log-file = ~/.pip/pip.log build = ~/.pip/build use-wheel = true find-links = ~/.pip-wheelhouse [wheel] wheel-dir = ~/.pip-wheelhouse Environment variable PIP_CONFIG_FILE=/etc/pip.conf PIP_INDEX_URL=http://localhost/myuser/myidx/+simple/ PIP_TRUSTED_HOST=localhost PIP_DISABLE_PIP_VERSION_CHECK=true

DevPI hooks & plugins UI Theme Authentication Upload hooks devpi-semantic-ui devpi-ldap devpi-jenkins devpi-slack

Install devpi with Docker data devpi nginx Container for the packages The DevPI server itself Basic auth for server access - download packages - UI Exposes port 4040 Exposes port 80

Install devpi with Docker - data container data FROM alpine:3.2 # Env vars ENV PYTHONUNBUFFERED=1 # Server directory RUN adduser -D devpi && mkdir -p /devpi/server && chown -R devpi:devpi /devpi # Entry point, simply exit with status code 0 CMD ["/bin/true"]

Install devpi with Docker - devpi container devpi FROM alpine:3.2 # Env vars ENV PYTHONUNBUFFERED=1 # Dependencies RUN apk add --update python3 py-pip RUN pip3 install devpi-server devpi-web devpi-semantic-ui # Server directory RUN adduser -D devpi && mkdir /devpi && chown -R devpi:devpi /devpi # Copy static files RUN cp -R /usr/lib/python3.4/site-packages/devpi_web/static /devpi/+static # Expose volume VOLUME ["/devpi/server"] # Change to unprivileged user USER devpi # Entry point EXPOSE 4040 CMD ["devpi-server", "--host", "0.0.0.0", "--port", "4040", "--serverdir", "/devpi/server", "--theme", \ "/usr/lib/python3.4/site-packages/devpi_semantic_ui", "--restrict-modify", "root"]

Install devpi with Docker (3) nginx FROM alpine:3.2 RUN apk add --update nginx # Copy config file COPY ["nginx.conf", "auth.conf", "htpasswd", "/etc/nginx/"] RUN chown root:nginx /etc/nginx/htpasswd && chmod 660 /etc/nginx/htpasswd # Change to unprivileged user USER nginx # Entry point EXPOSE 80 CMD ["nginx"]

Run devpi with docker-compose docker-compose.yml version: 2 services: data: build:./data volumes: - /devpi/server devpi: restart: always build:./devpi ports: - 4040:4040 volumes_from: - data nginx: restart: always build:./nginx ports: - 80:8080 links: - devpi volumes_from: - data

Interested? Send an email to sapir@cloudlock.com