29

Python dans le cloud avec Windows Azure

Embed Size (px)

DESCRIPTION

Python est-il un langage de scripting à la Perl, de développement à la Ruby, ou plutôt un langage utilisé dans le monde de la recherche par des mathématiciens comme Fortran ? Dans cette session, vous verrez que Python joue tous ces rôles, en particulier dans Windows Azure où l’on peut scripter la création de machines virtuelles, développer un site Flask ou Django dans Windows Azure Web Sites, exécuter des notebooks IPython, et même ajouter un peu de logique procédurale à un script HIVE (syntaxe SQL) dans Hadoop. Speakers : Benjamin Guinebertière (Microsoft), Ronan Amicel (Pocket Sensei), Yann Schwartz (Indépendant)

Citation preview

Page 1: Python dans le cloud avec Windows Azure
Page 2: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud

Python dans le cloud avec Windows Azure

Benjamin GuinebertièreTechnical Evangelist

Microsoft France@benjguin

Ronan AmicelPocket Sensei

@amicel

Yann Schwartzcriteo

@abolibibelot

Page 3: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

Depuis votre smartphone sur :http://notes.mstechdays.fr

De nombreux lots à gagner toute les heures !!!Claviers, souris et jeux Microsoft…

Merci de nous aider à améliorer les Techdays !

Donnez votre avis !

Page 4: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

• Helping teams build better software

• Technology + Agile+ Lean Startup

• "Part-time CTO" for startups

@PocketSenseihttp://pocketsensei.net/

Pocket Sensei

Page 5: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

• Python• Python Tools for Visual Studio• SDK• Web• IPython• HDInsight

Plan

Page 6: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

PYTHON

Page 7: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

• Langage de programmation– dynamique– facile à lire, facile et à apprendre– également orienté objet

• Environnement de script• Disponible dans beaucoup d’environnements

– Unix, Windows, JVM, .NET, …

• Beaucoup de modules– index à https://pypi.python.org

Python

Page 8: Python dans le cloud avec Windows Azure

démo

Architecture/Azure/Cloud#mstechdays

HELLO WORLD!

… et un peu plus

Page 9: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

PYTHON TOOLS FOR VISUAL STUDIO

Page 10: Python dans le cloud avec Windows Azure

démo

Architecture/Azure/Cloud#mstechdays

PYTHON DANS VISUAL STUDIO

CPYTHON

Page 11: Python dans le cloud avec Windows Azure

démo

Architecture/Azure/Cloud#mstechdays

PYTHON DANS VISUAL STUDIO

Appel d’une librairie C# en IronPython

Page 12: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

SDK FOR WINDOWS AZURE

Page 13: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

PYTHON ET WINDOWS AZURE WEB SITES

Page 14: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

• Django : le plus connu• Flask et Pyramid : légers, modulaires,

extensibles• Bottle : le plus minimaliste

Frameworks web Python

Page 15: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

Windows Azure Web Sites

Page 16: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

• Application WSGI• FTP(S) ou git (HTTPS)• Inclure toutes les bibliothèques

requises• fichier web.config: PYTHONPATH et WSGI_HANDLER

Référence: Configuring Python with Windows Azure Web Sites

Déployer du Python dans Azure Web Sites

Page 17: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

IPYTHON SUR WINDOWS AZURE

Page 18: Python dans le cloud avec Windows Azure

démo

Architecture/Azure/Cloud#mstechdays

UTILISER IPYTHON HÉBERGÉ SUR WINDOWS AZURE

Page 19: Python dans le cloud avec Windows Azure

démo

Architecture/Azure/Cloud#mstechdays

CRÉER UN CLUSTER IPYTHON EN PYTHON

Page 20: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

PYTHON + HIVE DANS HDINSIGHT

Page 21: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

• HDInsight: en complément de HIVE par exemple– HIVE : langage à la SQL– Python : langage procédural

et dans Hadoop ?

Page 22: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

Appel de Python depuis Hive (Hadoop)insert overwrite table myDestTableselect

transform(s.param1, s.param2)USING 'D:\Python27\python.exe myPythonScript.py' as (col1 string, col2 string, col3 int)

from mySrcTable s;

#(…)

while True: line = sys.stdin.readline() if not line: break

args, tobedropped = string.split(line, "\n", 2) p1,p2 = string.split(args, "\t") col1,col2,col3 = myFunction(p1,p2)

print "\t".join([str(col1), str(col2), str(col3)])

Page 23: Python dans le cloud avec Windows Azure

démo

Architecture/Azure/Cloud#mstechdays

HIVE + PYTHON DANS HDINSIGHT

Page 24: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

Appel de Python depuis Hive

Page 25: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

• http://www.python.org/• http://www.afpy.org/• http://www.windowsazure.com/• http://git.hupstream.com

Ressources

Page 26: Python dans le cloud avec Windows Azure

Architecture/Azure/Cloud#mstechdays

Criteo recrute

Page 27: Python dans le cloud avec Windows Azure

29 Mars 2014

http://bit.ly/GWAB2014Paris

Page 28: Python dans le cloud avec Windows Azure

Testez dès maintenant Windows Azure !

MSDN: jusqu’à 115€ de

ressources mensuelles

150€ de ressources le 1er mois pour toute

ouverture de compte

Poursuivez la discussion

sur le stand “au coeur du SI”

Partenaires: jusqu’à 75€ de

ressources mensuelles

http://aka.ms/Azure/Partner

http://aka.ms/free/trial

http://aka.ms/MSDN/Avantages/Abo

Page 29: Python dans le cloud avec Windows Azure

© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Digital is business