SlideShare una empresa de Scribd logo
1 de 43
Descargar para leer sin conexión
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Abstract
●
“How we build a W.I.F.E.* system using Python”
– *Wireless In-Flight Entertainment
●
Main topics:
– 1) Product requirements
– 2) Architecture decisions
– 3) Atypical challenges
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Hi!
●
I'm David Arcos
●
Python/Django developer since 2008
●
Co-organizer of Python Barcelona
●
Lead engineer at Immfly
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Immfly
Private & Confidential
Immfly is a new Entertainment, Retail and
Communication platform for the in-flight
experience.
Focused on the European domestic flights
market, Immfly offers wireless content to
passengers via their Personal Electronic
Devices.
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
1) The product requirements
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
How does it work?
The passenger's device
(smartphone/tablet/laptop)
connects to the wif
(no internet!)
and opens the app
(web/android/ios)
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
What kind of services?
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
What kind of services?
●
Flight information
●
View TV Shows, videos
●
Read newspapers, magazines
●
Get guides, offers, deals
●
Etc...
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
But it's off-line
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
We need eventual connectivity
●
Update the contents
“I don't want yesterday's newspaper!”
●
Send “booking” actions to external APIs
●
Do payments
●
Send emails
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Ground mode
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Ground mode
●
Keep the experience after landing
●
Bring your contents with you
●
Get email confrmations
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
2) The Architecture
●
In the airplane:
– Frontend & Backend
– System services
– Hardware
●
In the datacenter:
– The "Hangar"
– Ingests
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Frontend apps
●
Web app:
●
Mobile apps:
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Backend API
●
“A powerful and
flexible toolkit
that makes it easy
to build Web APIs”
●
“The web
framework for
perfectionists
with deadlines”
●
“A widely used
general-purpose,
high-level
programming
language”
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
HTTP server
●
Monitor and
control:
– API
– daemons
– celery
●
WSGI Server●
Web Server
●
Static contents
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Databases
●
NoSQL data
– Cache, sessions
– Metrics, expirations
●
SQL data
– Django ORM
– Critical transactions
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Network
Fabric
– Initializing
– Other tasks
Ansible
– Deployment
– Confg
Management
– Pull mode
SSH
– Through VPN
– Hidden port
– PK Auth
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Hardware
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Wireless Access Points
●
3 WAPs per plane
●
Provide the WiFi
●
Isolated users
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Aircraft Server
●
Embedded computer
– Hardened, certifed
●
Xen with Ubuntu VMs
●
Internal 3G data card
●
Avionics bus
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Avionics data bus
● altitude
● flight_id
● ground_speed
● heading
● latitude
● longitude
● mach_speed
● outside_temperature
● pitch
● roll
● wind_speed
● yaw
We have access to this data, in real-time:
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Discrete-time signals
● DCFAILSIG
● ACFAILSIG
● OVERTEMPSIG
● GSM_POWER_STATUS
● ENB2SIG
● ENB1SIG
● ENB0SIG
● GSMSIG_STATUS
● CPLD_REV0
● CPLD_REV1
● SYSENSIG
● ENB3SIG
● ENB4SIG
● ENB5SIG
● ALERT
● CONFIGSIG0
● CONFIGSIG1
● CONFIGSIG2
● INTTEST_OUT
● INTTEST_IN
● ISO_OUT0
● ISO_OUT1
● ISO_OUT2
● ISO_OUT3
● GPIO_DCFAILSIG
● GPIO_ACFAILSIG
● GPIO_OVERTEMPSIG
● GPIO_SYSENSIG
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
The Hangar
●
Hosted in the Internet
●
Central point
●
Orchestrates the
operations
●
Update contents,
databases, code...
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Hangar Operations
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Resource ingest
●
Thousands of resources, from ~20 providers
– Per language
– Per country
– Per category: Videos, Readings, Deals...
●
Some external APIs are questionable:
– Missing SSL, Documentation...
– Manually updates to an ftp...
– Data in excel fles...
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Ingesting videos
●
Ingest from SFTP / AWS S3
●
Send to AWS ElasticTranscoder
– Convert to HLS
●
Sync chunk by chunk
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Ingesting reading
●
Ingest from SFTP / AWS S3
●
Celery task:
– Reduce size (image resolution)
– Generate thumbnails
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Ground mode
●
Similar to the “Aircraft” mode
●
Minor differences:
– No Videos (we don't have the permissions)
– More focus on destination offers
– Online functionality (like “forgot my password”)
●
Made to scale
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
3) Atypical challenges
●
Specifc perks of working with aircrafts
●
Dealing with airplanes has extra challenges
●
Problems we weren't expecting beforehand
●
Also, “mistakes where made”
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Regulations & Certifications
End of 2013, EASA allowed use of PEDs
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Certificate everything!
●
Had to certifcate every step
– The hardware was already certifed
– The WAPs were already certifed
– Lots of wireless tests
●
Even the smallest screw has to be certifed!
●
Took us 6-9 months!
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Certificate everything!
●
Had to certifcate every step
– The hardware was already certifed
– The WAPs were already certifed
– Lots of wireless tests
●
Even the smallest screw has to be certifed!
●
Took us 6-9 months!
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Intermittent connectivity
●
We get 30~90m of connectivity per day
– 10-15 minutes after each flight
●
Sometimes, roaming applies
– Limited synchro
●
Improve the deployment tools
●
Optimize the performance
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Hard shutdown
●
Electrical power is suddenly removed, and our
airplane server is turned off
●
Happens often:
– When changing power from engine to external,
after landing
– If there is a storm, or just if the pilot wishes
●
We could only mitigate...
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Mistake: trusted the hardware
●
File system corruption
– The HDD write buffer is sometimes lost
– Corrupted fles
– fsck at start
– sync after each deploy
– Added several consistency checks (for contents)
●
Internal clock corruption
– Logs showed wrong times
– Added NTP checks (requires connectivity)
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
The CAP Theorem
“It's impossible for a distributed system to
simultaneously provide all three:”
- Consistency
All nodes see the same data at the same time
- Availability
Guarantee that every request receives a response
- Partition tolerance
Continue to operate despite network partitioning
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Big mistake: try to beat the CAP
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Settled for “Eventual Consistency”
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Recap
●
Complex project with lots of features
– Kept a modular design
●
Could implement everything
– helped by existing Python libraries
●
Learned a lot from unexpected challenges
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Conclusions
●
Python made it possible!
●
Very versatile, covers all our use cases
●
“We stand on the shoulders of giants”
●
Developed in a short time
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Thanks for attending!
- Get the slides at http://slideshare.net/DZPM
- We're hiring! http://immfly.com/jobs
Python in the Sky – EuroPython 2015 David Arcos - @DZPM
Questions?

Más contenido relacionado

Último

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Último (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Destacado

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Destacado (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Python in the Sky

  • 1. Python in the Sky – EuroPython 2015 David Arcos - @DZPM
  • 2. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Abstract ● “How we build a W.I.F.E.* system using Python” – *Wireless In-Flight Entertainment ● Main topics: – 1) Product requirements – 2) Architecture decisions – 3) Atypical challenges
  • 3. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Hi! ● I'm David Arcos ● Python/Django developer since 2008 ● Co-organizer of Python Barcelona ● Lead engineer at Immfly
  • 4. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Immfly Private & Confidential Immfly is a new Entertainment, Retail and Communication platform for the in-flight experience. Focused on the European domestic flights market, Immfly offers wireless content to passengers via their Personal Electronic Devices.
  • 5. Python in the Sky – EuroPython 2015 David Arcos - @DZPM 1) The product requirements
  • 6. Python in the Sky – EuroPython 2015 David Arcos - @DZPM How does it work? The passenger's device (smartphone/tablet/laptop) connects to the wif (no internet!) and opens the app (web/android/ios)
  • 7. Python in the Sky – EuroPython 2015 David Arcos - @DZPM What kind of services?
  • 8. Python in the Sky – EuroPython 2015 David Arcos - @DZPM What kind of services? ● Flight information ● View TV Shows, videos ● Read newspapers, magazines ● Get guides, offers, deals ● Etc...
  • 9. Python in the Sky – EuroPython 2015 David Arcos - @DZPM But it's off-line
  • 10. Python in the Sky – EuroPython 2015 David Arcos - @DZPM We need eventual connectivity ● Update the contents “I don't want yesterday's newspaper!” ● Send “booking” actions to external APIs ● Do payments ● Send emails
  • 11. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Ground mode
  • 12. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Ground mode ● Keep the experience after landing ● Bring your contents with you ● Get email confrmations
  • 13. Python in the Sky – EuroPython 2015 David Arcos - @DZPM 2) The Architecture ● In the airplane: – Frontend & Backend – System services – Hardware ● In the datacenter: – The "Hangar" – Ingests
  • 14. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Frontend apps ● Web app: ● Mobile apps:
  • 15. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Backend API ● “A powerful and flexible toolkit that makes it easy to build Web APIs” ● “The web framework for perfectionists with deadlines” ● “A widely used general-purpose, high-level programming language”
  • 16. Python in the Sky – EuroPython 2015 David Arcos - @DZPM HTTP server ● Monitor and control: – API – daemons – celery ● WSGI Server● Web Server ● Static contents
  • 17. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Databases ● NoSQL data – Cache, sessions – Metrics, expirations ● SQL data – Django ORM – Critical transactions
  • 18. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Network Fabric – Initializing – Other tasks Ansible – Deployment – Confg Management – Pull mode SSH – Through VPN – Hidden port – PK Auth
  • 19. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Hardware
  • 20. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Wireless Access Points ● 3 WAPs per plane ● Provide the WiFi ● Isolated users
  • 21. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Aircraft Server ● Embedded computer – Hardened, certifed ● Xen with Ubuntu VMs ● Internal 3G data card ● Avionics bus
  • 22. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Avionics data bus ● altitude ● flight_id ● ground_speed ● heading ● latitude ● longitude ● mach_speed ● outside_temperature ● pitch ● roll ● wind_speed ● yaw We have access to this data, in real-time:
  • 23. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Discrete-time signals ● DCFAILSIG ● ACFAILSIG ● OVERTEMPSIG ● GSM_POWER_STATUS ● ENB2SIG ● ENB1SIG ● ENB0SIG ● GSMSIG_STATUS ● CPLD_REV0 ● CPLD_REV1 ● SYSENSIG ● ENB3SIG ● ENB4SIG ● ENB5SIG ● ALERT ● CONFIGSIG0 ● CONFIGSIG1 ● CONFIGSIG2 ● INTTEST_OUT ● INTTEST_IN ● ISO_OUT0 ● ISO_OUT1 ● ISO_OUT2 ● ISO_OUT3 ● GPIO_DCFAILSIG ● GPIO_ACFAILSIG ● GPIO_OVERTEMPSIG ● GPIO_SYSENSIG
  • 24. Python in the Sky – EuroPython 2015 David Arcos - @DZPM The Hangar ● Hosted in the Internet ● Central point ● Orchestrates the operations ● Update contents, databases, code...
  • 25. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Hangar Operations
  • 26. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Resource ingest ● Thousands of resources, from ~20 providers – Per language – Per country – Per category: Videos, Readings, Deals... ● Some external APIs are questionable: – Missing SSL, Documentation... – Manually updates to an ftp... – Data in excel fles...
  • 27. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Ingesting videos ● Ingest from SFTP / AWS S3 ● Send to AWS ElasticTranscoder – Convert to HLS ● Sync chunk by chunk
  • 28. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Ingesting reading ● Ingest from SFTP / AWS S3 ● Celery task: – Reduce size (image resolution) – Generate thumbnails
  • 29. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Ground mode ● Similar to the “Aircraft” mode ● Minor differences: – No Videos (we don't have the permissions) – More focus on destination offers – Online functionality (like “forgot my password”) ● Made to scale
  • 30. Python in the Sky – EuroPython 2015 David Arcos - @DZPM 3) Atypical challenges ● Specifc perks of working with aircrafts ● Dealing with airplanes has extra challenges ● Problems we weren't expecting beforehand ● Also, “mistakes where made”
  • 31. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Regulations & Certifications End of 2013, EASA allowed use of PEDs
  • 32. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Certificate everything! ● Had to certifcate every step – The hardware was already certifed – The WAPs were already certifed – Lots of wireless tests ● Even the smallest screw has to be certifed! ● Took us 6-9 months!
  • 33. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Certificate everything! ● Had to certifcate every step – The hardware was already certifed – The WAPs were already certifed – Lots of wireless tests ● Even the smallest screw has to be certifed! ● Took us 6-9 months!
  • 34. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Intermittent connectivity ● We get 30~90m of connectivity per day – 10-15 minutes after each flight ● Sometimes, roaming applies – Limited synchro ● Improve the deployment tools ● Optimize the performance
  • 35. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Hard shutdown ● Electrical power is suddenly removed, and our airplane server is turned off ● Happens often: – When changing power from engine to external, after landing – If there is a storm, or just if the pilot wishes ● We could only mitigate...
  • 36. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Mistake: trusted the hardware ● File system corruption – The HDD write buffer is sometimes lost – Corrupted fles – fsck at start – sync after each deploy – Added several consistency checks (for contents) ● Internal clock corruption – Logs showed wrong times – Added NTP checks (requires connectivity)
  • 37. Python in the Sky – EuroPython 2015 David Arcos - @DZPM The CAP Theorem “It's impossible for a distributed system to simultaneously provide all three:” - Consistency All nodes see the same data at the same time - Availability Guarantee that every request receives a response - Partition tolerance Continue to operate despite network partitioning
  • 38. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Big mistake: try to beat the CAP
  • 39. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Settled for “Eventual Consistency”
  • 40. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Recap ● Complex project with lots of features – Kept a modular design ● Could implement everything – helped by existing Python libraries ● Learned a lot from unexpected challenges
  • 41. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Conclusions ● Python made it possible! ● Very versatile, covers all our use cases ● “We stand on the shoulders of giants” ● Developed in a short time
  • 42. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Thanks for attending! - Get the slides at http://slideshare.net/DZPM - We're hiring! http://immfly.com/jobs
  • 43. Python in the Sky – EuroPython 2015 David Arcos - @DZPM Questions?