British Atmospheric Data Centre Python Eggs. British Atmospheric Data Centre Overview Part I: Installers  What are Eggs?  What Eggs can do for me? 

Slides:



Advertisements
Similar presentations
©2011 Quest Software, Inc. All rights reserved.. Andrei Polevoi, Tatiana Golubovich Program Management Group ActiveRoles Add-on Manager Overview.
Advertisements

By: Lloyd Albin 9/28/2012. We are not talking about a Raspberry Pie.
Module 4: Deploying and Managing BizTalk Applications
11.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft Windows Server 2003 Active Directory Infrastructure.
Eclipse Introduction Dwight Deugo Nesa Matic
Platforms, installation, configuration; accessing example collections Course material prepared by Greenstone Digital Library Project University of Waikato,
Dynamic Web site With PHP and MySQL. MySQL The combination of MySQL database and PHP scripting language is optimum for building dynamic websites. MySQL.
VMware vCenter Server Module 4.
Reproducible Environment for Scientific Applications (Lab session) Tak-Lon (Stephen) Wu.
WebServer & Tomcat By B. Venkateswarlu M.Tech Assoc Prof IT(Dept) Newton’s Institute of Engineering.
Overview of Framework by Ahamed Rifaudeen A. page - i Steps before entering into the Framework?  Basic knowledge of object-oriented programming (OOP)
Linux Operations and Administration
OM. Brad Gall Senior Consultant
VueCentric Architecture
OCLC Online Computer Library Center CONTENTdm Migration Training Craig Yamashita Vice President, Technology and Product Development DiMeMa, Inc. July 2005.

Crystal Hoyer Program Manager IIS Team Preview of features that will be announced at MIX09 Please do not blog, take pictures or video of session.
XA R7.8 Upgrade Process and Technical Overview Ruth Anne Pharr Sr. IT Consultant, CISTECH Inc.
Deploying Experiments with Raven Scott Baker SB-Software John H. Hartman University of Arizona.
MAVEN-BLUEMARTINI Yannick Robin. What is maven-bluemartini?  maven-bluemartini is Maven archetypes for Blue Martini projects  Open source project on.
Stuff about DX/GS. Overview Installation of client/server packages 1 Complex installation: pydxs (pydxc) package into …/lib/python2.4/site- packages/
SKA/KAT SPIN Presentation Software Engineering (!?) Robert Crida.
Project confidential Page 1 20-Jan-09 Integrated Project – EC FP AspireRFID Developers First CodeCamp Athens Information Technology Nikos Kefalakis.
Wikis are websites where pages can be edited using an online document editor. Users can easily edit and share content. Enterprise wikis are platforms.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
Tomcat Spencer Uresk. Notes This is a training NOT a presentation Please ask questions This is being recorded
SchwartzGBIF Nodes III29 April 2003 DiGIR Portal Installation And Configuration.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
The Pipeline Processing Framework LSST Applications Meeting IPAC Feb. 19, 2008 Raymond Plante National Center for Supercomputing Applications.
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
Apache Web Server v. 2.2 Reference Manual Chapter 1 Compiling and Installing.
.NET Framework Danish Sami UG Lead.NetFoundry
1 Installation When this module is complete, you will be able to:  Set a static IP address for your laptop  Install the snom ONE software  Navigate.
Overview of LHCb applications and software environment LHCb software tutorial - March
Vagrant workflow Jul. 15, 2014.
ILDG Middleware Status Chip Watson ILDG-6 Workshop May 12, 2005.
Plug-In Architecture Pattern. Problem The functionality of a system needs to be extended after the software is shipped The set of possible post-shipment.
Building Extensible Desktop Applications with Zope 3 Nathan R. Yergler Software Engineer Creative Commons Licensed under Creative Commons Attribution 2.5.
Ant & Jar Ant – Java-based build tool Jar – pkzip archive, that contains metadata (a manifest file) that the JRE understands.
RPMS - EHR v1.1 Techie Class Really Powerful at Measuring Stuff.
National Center for Supercomputing ApplicationsNational Computational Science Grid Packaging Technology Technical Talk University of Wisconsin Condor/GPT.
Running Kuali: A Technical Perspective Ailish Byrne (Indiana University) Jonathan Keller (University of California, Davis)
Intro to Datazen.
J.P. Wellisch, CERN/EP/SFT SCRAM Information on SCRAM J.P. Wellisch, C. Williams, S. Ashby.
PAYware Transact Terminal Interface Manager
Linux Operations and Administration
Applications Kay Kasemir ORNL/SNS Using Information and pictures from Matthias Clausen, Jan Hatje, and Helge Rickens (DESY) October 2007.
 Packages:  Scrapy, Beautiful Soup  Scrapy  Website  
® IBM Software Group © 2006 IBM Corporation Rational Asset Manager v7.2 Using Scripting Tutorial for using command line and scripting using Ant Tasks Carlos.
Maven. Introduction Using Maven (I) – Installing the Maven plugin for Eclipse – Creating a Maven Project – Building the Project Understanding the POM.
Mantis Bug Tracker. MantisBT features Open source web-based bug tracking system. Track software defects. Mantis is often configured by users to serve.
Custom Authentication Providers For DotNetNuke v5.0 Stan Schultes – Sarasota, FL Florida Community Leader
Basic Setup of OpenMeetings Version Three Styles for Setup Style1 : Starting from Scratch – Starting from svn check out and compiling with ant.
Python Eggs For NOObs and Others Chris Calloway. What Are Python Eggs? Managed distributions of python packages: a)Discovery within repositories, b)Dependency.
Installation and environment variables. Simple Installation 1 The latest sources can always be obtained from the CDAT website:
XNAT 1.7: Getting Started 6 June, Introduction In this presentation we’ll discuss:  Features and functions in XNAT 1.7  Requirements  Installing.
ONAP on Vagrant for ONAPers
Python’s Modules Noah Black.
Getting Started with Alfresco Development
Installation Guide of DMPSW
State of Testing Jason Kenny – ATS committer.
Play Framework: Introduction
17. Packaging a Game.
June 2011 David Front Weizmann Institute
Karabo installation and software organization
Enhancing Cloud Foundry with CLI Plugins
Service Fabric Patterns & Best Practices
Compile, Build, and Debug
Extending Languages.
PyWBEM Python WBEM Client: Overview #2
Presentation transcript:

British Atmospheric Data Centre Python Eggs

British Atmospheric Data Centre Overview Part I: Installers  What are Eggs?  What Eggs can do for me?  Package installation with Eggs Part II: Developers  Component overview  Package compatibility  Developing with Eggs Part III: Demo

British Atmospheric Data Centre What are Python Eggs? Eggs = + JARs CPAN + Backwards Compatibility

British Atmospheric Data Centre Eggs ≈ JARs.egg zip archive Drop into sys.path pkg_resources API What about  Dependencies?  Scripts?  C Extensions? EGG-INFO package_1 package_2 code data _____________.egg

British Atmospheric Data Centre Eggs ≈ CPAN $ easy_install MyPackage>= find MyPackage v download MyPackage v download MyPackage dependencies build all install all... $ python >>> import MyPackage >>>

British Atmospheric Data Centre Python Cheeseshop British Atmospheric Data Centre

easy_install examples $ easy_install MyPackage $ easy_install MyPackage==3.2 $ easy_install -f MyPackage $ easy_install --upgrade MyPackage $ easy_install –d temp_eggs MyPackage-prealpha $ easy_install $SROOT/MyPackage/trunk#egg=MyPackage-dev $ easy_install -m MyPackage==3.2a1

British Atmospheric Data Centre Installing setuptools recipe 1: globally Ensure distutils is available Ensure you can write python installation $ wget $ python ez_setup.py

British Atmospheric Data Centre Installing setuptools recipe 2: using PYTHONPATH Ensure distutils is available In ~/.profile export PYTHONPATH=$HOME/lib/python export PATH=$HOME/bin:$PATH In ~/.pydistutilsrc [install] install_lib = ~/lib/python install_scripts = ~/bin $ wget $ python ez_setup.py

British Atmospheric Data Centre Key Advantages Self contained Try new software easily  install / test / throw away Track development  select version  download from SVN Supports plug-in architectures

British Atmospheric Data Centre Part II Developers

British Atmospheric Data Centre Egg components > pkg_resources dependencies resources metadata namespaces > setuptools build eggs > distutils > easy_install find download install upgrade > setuptools > ez_setup.py

British Atmospheric Data Centre Distutils $ python setup.py install $ python setup.py install –prefix=$HOME $ python setup.py build $ sudo python setup.py install $ python setup.py build –build-opt install

British Atmospheric Data Centre Distutils Problems  Insufficient documentation  Easier to shortcut than use properly Consequences  Inconsistent setup.py interface  Monolithic frameworks

British Atmospheric Data Centre CDAT

British Atmospheric Data Centre cdat-lite / vcs-lite $ URL= $ easy_install –f $URL vcs-lite

British Atmospheric Data Centre Matplotlib

British Atmospheric Data Centre Matplotlib easy_install numpy easy_install matplotlib easy_install basemap easy_install –f $SVN basemap 

British Atmospheric Data Centre M2Crypto $ easy_install M2Crypto No way to use the –openssl option! setup.py's key mistakes  Parses the –openssl argument outside distutils.  Sets include_dirs even if using default location.

British Atmospheric Data Centre It will probably work if you Stick to the distutils framework!  including argument parsing install locations use __file__ or __name__ to find resources

British Atmospheric Data Centre Setuptools: preliminaries import ez_setup ez_setup.use_setuptools() from setuptools import setup, find_packages setup( name = 'MyPackage', version = '1.0',... packages = find_packages('lib', exclude=["test_*"]), package_dir = {'' : 'lib'},... )

British Atmospheric Data Centre Setuptools: dependencies setup(... install_requires = [ 'MyDep1>=0.3', 'MyDep2==1.2rc2', 'MyDep3==dev' ], dependency_links = [ ' ' ],... )

British Atmospheric Data Centre Setuptools: resources setup(... zip_safe = False, include_package_data = True, exclude_package_data = {'': ['README.txt']},... )

British Atmospheric Data Centre Setuptools: scripts setup(... entry_points = { 'console_scripts': [ 'foo = my_package.some_module:main_func', 'bar = other_module:some_func', ], 'gui_scripts': [ 'baz = my_package_gui.start_func', ]},... )

British Atmospheric Data Centre Setuptools: and more namespace packages entry points extras SVN hooks unit tests

British Atmospheric Data Centre pkg_resources API #udunits_name=sys.prefix+'/lib/python'+version+'/site- packages/unidata/udunits.dat' import pkg_resources udunits_name = pkg_resources.resource_filename('unidata', 'udunits.dat') import pkg_resources pkg_resources.require('ZSI==2.0rc1')

British Atmospheric Data Centre Using Eggs in NDG Stripping out CDAT components  cdat-lite, vcs-lite Splitting the ndg package into multiple eggs  namespace packages Managing multiple versions  ZSI Shared code in ndg_util.egg Component bundles

British Atmospheric Data Centre Part III: Demo A WSGI compliant OpeNDAP / WMS server in exactly 0 lines of python

British Atmospheric Data Centre #!/bin/sh # Log commands to stdout set -x # Setup staging area rm -fr eggs myserver demo.log mkdir eggs export PYTHONPATH=$PWD/eggs export PATH=$PYTHONPATH:$PATH DAPSVN= # Bootstrap setuptools python ez_setup.py -d eggs >>demo.log 2>&1 # Install pydap prerequisites easy_install -d eggs -f \ numpy Imaging >>demo.log 2>&1 # Install pydap and plugins easy_install -d eggs \ dap[server] dap.plugins.netcdf dap.responses.wms \ $DAPSVN/responses/html >>demo.log 2>&1 # Create the server project paster create -t dap_server myserver project=My-Server >>demo.log 2>&1 # Move data to server directory cp *.nc myserver/data >>demo.log 2>&1 # Start the server paster serve myserver/server.ini Demo script British Atmospheric Data Centre

[server:main] use = egg:Paste#http # Change to to make public host = port = 8080 [filter-app:main] use = egg:Paste#httpexceptions next = cascade [composit:cascade] use = egg:Paste#cascade app1 = static app2 = pydap catch = 404 [app:static] use = egg:Paste#static document_root = %(here)s/data [app:pydap] use = egg:dap name = My-Server root = %(here)s/data verbose = 0 template = %(here)s/template Demo paste.deploy configuration British Atmospheric Data Centre

The End

British Atmospheric Data Centre References   