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)
2. Python dans le cloud avec
Windows Azure
Yann Schwartz
criteo
@abolibibelot
Ronan Amicel Benjamin Guinebertière
Technical Evangelist
Pocket Sensei
Microsoft France
@amicel
@benjguin
Architecture/Azure/Cloud
3. Donnez votre avis !
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 !
#mstechdays
Architecture/Azure/Cloud
7. Python
• 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
#mstechdays
Architecture/Azure/Cloud
13. PYTHON ET WINDOWS AZURE WEB
SITES
#mstechdays
Architecture/Azure/Cloud
14. Frameworks web Python
• Django : le plus connu
• Flask et Pyramid : légers, modulaires,
extensibles
• Bottle : le plus minimaliste
#mstechdays
Architecture/Azure/Cloud
16. Déployer du Python dans Azure Web Sites
•
•
•
•
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
#mstechdays
Architecture/Azure/Cloud
19. CRÉER UN CLUSTER IPYTHON
EN PYTHON
#mstechdays
Architecture/Azure/Cloud
20. PYTHON + HIVE DANS HDINSIGHT
#mstechdays
Architecture/Azure/Cloud
21. et dans Hadoop ?
• HDInsight: en complément de HIVE par
exemple
– HIVE : langage à la SQL
– Python : langage procédural
#mstechdays
Architecture/Azure/Cloud
22. Appel de Python depuis Hive (Hadoop)
insert overwrite table myDestTable
select
transform(s.param1, s.param2)
USING 'D:Python27python.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)])
#mstechdays
Architecture/Azure/Cloud
23. HIVE + PYTHON DANS
HDINSIGHT
#mstechdays
Architecture/Azure/Cloud
24. Appel de Python depuis Hive
#mstechdays
Architecture/Azure/Cloud
28. Testez dès maintenant Windows Azure !
MSDN:
Partenaires:
http://aka.ms/MSDN/Avantages/Abo
150€ de
ressources
http://aka.ms/Azure/Partner
Poursuivez la
discussion
sur le stand “au
coeur du SI”
http://aka.ms/free/trial