SlideShare uma empresa Scribd logo
1 de 22
Baixar para ler offline
Implementing
a build manager in Ada
Stéphane Carrez FOSDEM 2022
Ada DevRoom
https://gitlab.com/stcarrez/porion 2
Introducing Porion
●
Why a new build manager ?
– Jenkins is slow and uses 1.3Gb memory RSS
– Requires Java on build nodes
– Regular security vulnerabilities
●
Some requirements :
– Security & perf : safe design in Ada
– CLI and web interface
– Flexible build nodes (ssh, docker, virsh,...)
https://gitlab.com/stcarrez/porion 3
What a build manager must know
●
Define projects with source control method
●
Define recipes to build the project
●
Define project dependencies
●
Define build nodes (different systems, CPUs,...)
●
Define build information to track build results
●
Define build and project metrics
●
Store credentials to connect to build nodes
●
Store API secret keys to publish
●
More secret keys to sign builds…
https://gitlab.com/stcarrez/porion 4
What a build manager must do
●
Probe source changes in projects
●
Schedule builds according to changes
(management of a build queue)
●
Launch builds (locally or remotely)
●
Control and track build execution
●
Collect build results (coverage, tests, logs)
●
Publish build results
●
Send build notifications
●
Keep managers happy by providing reports
https://gitlab.com/stcarrez/porion 5
What a build manager must protect
●
A build manager has access to sensitive data
●
It must protect sources files (proprietary projects)
●
It must protect API secret keys
●
It must protect credentials (checkout sources,
connect to build nodes)
●
It must protect the secret keys to sign or to
publish
●
It must protect build results and build logs
●
It must not leak API secret keys through logs
●
...
https://gitlab.com/stcarrez/porion 6
Porion numbers
●
Cost : 1.5 engineer month so far
(260 hours on my free time)
●
95 % Ada, 2 % HTML, 0.4 % Typescript
●
32K CLOC Ada (16K generated)
●
43 Ada packages, 30 private Ada packages
●
19 database tables
https://gitlab.com/stcarrez/porion 7
Architecture
porion
Build
Nodes
SQLite Database
Command Line
Filesystem
Web Server
porion-server
config logs projects
tmp
Ada
Keystore
AWS
Ada Database
Objects
AWA
https://gitlab.com/stcarrez/porion 8
Porion Agent Architecture
SQLite
GNU/Linux
FreeBSD
NetBSD
Dynamo
Ada Database
Objects
Ada Keystore
Ada EL Ada Util
XML/Ada
Porion Lib
Printer Toolkit
Advanced
Resource
Embedder
Porion Agent
(commands)
https://gitlab.com/stcarrez/porion 9
Porion Server Architecture
Ada Web Application
Ada Database
Objects
OpenAPI Ada
Ada
Server Faces
Ada Servlet
Ada Keystore
Ada EL
Ada Security
Ada Util
Ada Web Server XML/Ada
SQLite
GNU/Linux
FreeBSD
NetBSD
Dynamo
Advanced
Resource
Embedder
Porion Lib
Porion Web Server
https://gitlab.com/stcarrez/porion 10
UML to Ada generation
●
Described the database model in UML :
– 19 tables organized in 5 packages
●
Used ArgoUML (Java tool) :
– Tool migrated from tigris.org to GitHub
– Works very well to define the UML class model
●
Used Dynamo for the code generation :
– It reads ArgoUML file
– It generates Ada model for the UML classes
– It generates SQL table creation schema
https://gitlab.com/stcarrez/dynamo 11
Database Modeling
XML Model
Dynamo
Generator
Model
Doc
(HTML)
SQL
Tables
Ada
Model
Packages
UML Model
Ada Database
Objects Library
Generated Application Model Packages
Your Application Code
Ada Utility Library
Postgresql, MySQL or SQLite
Generate Develop
YAML Model
Design
https://gitlab.com/stcarrez/dynamo 12
UML generated Ada code
●
14K CLOC generated in 6 Ada packages
●
Handles SQL insert, update, delete, queries
●
Uses Ada.Containers.Vectors for lists
●
Reference counting for objects
https://gitlab.com/stcarrez/dynamo 13
A tour to Porion UML model
https://gitlab.com/stcarrez/porion 14
Benefit of UML and Ada
●
UML database model is not right at the first time
●
Several iterations to add new tables, new
relations or new attributes in UML model
●
Easy and fast generation of Ada from UML
●
Changes in UML model breaks the compilation
and can be identified and fixed
●
Consistency between Ada and SQL
●
Refactoring is safe due to Ada strong typing !
https://gitlab.com/stcarrez/porion 15
Focus : build queue scheduler 1/3
●
Role of the build queue and its scheduler :
– Keep an ordered list of recipes that must be built
– Minimize the number of builds
– Take into account project dependencies
A
B
C
D
C
A D C
B
D
A
Add B in queue
Dependencies
https://gitlab.com/stcarrez/porion 16
Focus : build queue scheduler 2/3
●
Load the build queue in an Ada vector
function "<" (Left, Right : in Build_Queue_Ref) return Boolean;
with Porion.Builds.Models;
Queues : Porion.Builds.Models.Build_Queue_Vector;
Query : ADO.Queries.Context;
DB : ADO.Sessions.Session;
Query.Set_Filter ("o.node_id = :node_id");
Query.Bind_Param ("node_id", Node_Id) ;
Porion.Builds.Models.List (Queues, DB, Query);
●
Compare two build queue entries
https://gitlab.com/stcarrez/porion 17
Focus : build queue scheduler 3/3
●
Sort the build queue vector
declare
Order : Natural := 0;
begin
for Queue of Queues loop
Queue.Set_Order (Order);
Queue.Save (Service.DB);
Order := Order + 1;
end loop;
end;
Queues.Append (New_Item);
Sort_Queue.Sort (Queues);
●
Update the queue order and save in the database
package Sort_Queue is
new Build_Queue_Vectors.Generic_Sorting ("<" => "<");
●
Instantiate the sort package
https://gitlab.com/stcarrez/resource-embedder 18
Embedding resource
●
Problem :
– How to configure the database ?
●
Solution :
– Embed the SQL schema definition in the binary
– Have an array of String with each String being an
SQL create table statement
– Use ARE to embed the SQL schema
– Generates 2K CLOC in 3 Ada packages
https://gitlab.com/stcarrez/resource-embedder 19
Advanced Resource Embedder
esource 
Configuration
Files
Binary
Executable
Generate Build
Resources
Compiler 
(C, Ada, Go)
Help Files
Web Files
(HTML, CSS, JS...)
Run
Rules
Copy
Minify
Compress
Config
Help
Web
C
Ada
Go
A
R
E
dvanced
mbedder
https://gitlab.com/stcarrez/porion 20
ARE generated code
●
ARE generates a child package with function
declaration and static constant array of strings
package Porion.Resources.Schema is
function Get_Content (Name : String) return Content_Access;
end Porion.Resources.Schema;
package Porion.Resources is
type Content_Array is array (Natural range <>)
of access constant String;
type Content_Access is access constant Content_Array;
end Porion.Resources;
●
Types are declared in a parent package
https://gitlab.com/stcarrez/porion 21
Conclusion
●
Lessons learned :
– Writing a build manager is hard (secure is harder!)
– Ada helps by forcing to think more about your design
●
Code generation can speed up development :
– Dynamo : UML => Ada mapping & SQL schema
– ARE : SQL files => Ada package with static content
●
High level database representation is key :
– Load, insert, update database objects easily
– Implement complex algorithm easily
https://gitlab.com/stcarrez/porion 22
Questions
?

Mais conteúdo relacionado

Mais procurados

Automating & Integrating Pantheon with JIRA, Slack, Jenkins and More
Automating & Integrating Pantheon with JIRA, Slack, Jenkins and MoreAutomating & Integrating Pantheon with JIRA, Slack, Jenkins and More
Automating & Integrating Pantheon with JIRA, Slack, Jenkins and MorePantheon
 
Configuration Management Tools on NX-OS
Configuration Management Tools on NX-OSConfiguration Management Tools on NX-OS
Configuration Management Tools on NX-OSCisco DevNet
 
how to use openstack api
how to use openstack apihow to use openstack api
how to use openstack apiLiang Bo
 
Apache development with GitHub and Travis CI
Apache development with GitHub and Travis CIApache development with GitHub and Travis CI
Apache development with GitHub and Travis CIJukka Zitting
 
ContainerCon sysdig Slides
ContainerCon sysdig Slides ContainerCon sysdig Slides
ContainerCon sysdig Slides Loris Degioanni
 
Terraform 101: What's infrastructure as code?
Terraform 101: What's infrastructure as code?Terraform 101: What's infrastructure as code?
Terraform 101: What's infrastructure as code?GDX Wu
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with DockerDocker, Inc.
 
Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016Chris Tankersley
 
Live deployment, ci, drupal
Live deployment, ci, drupalLive deployment, ci, drupal
Live deployment, ci, drupalAndrii Podanenko
 
CIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops betterCIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops betterAndrii Podanenko
 
GIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APPGIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APPPavel Tyk
 
OpenStack API's and WSGI
OpenStack API's and WSGIOpenStack API's and WSGI
OpenStack API's and WSGIMike Pittaro
 
jbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingjbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingRed Hat Developers
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with PuppetKris Buytaert
 
Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.Andrii Podanenko
 
Docker SQL Continuous Integration Flow
Docker SQL Continuous Integration FlowDocker SQL Continuous Integration Flow
Docker SQL Continuous Integration FlowAndrii Podanenko
 

Mais procurados (20)

Automating & Integrating Pantheon with JIRA, Slack, Jenkins and More
Automating & Integrating Pantheon with JIRA, Slack, Jenkins and MoreAutomating & Integrating Pantheon with JIRA, Slack, Jenkins and More
Automating & Integrating Pantheon with JIRA, Slack, Jenkins and More
 
Configuration Management Tools on NX-OS
Configuration Management Tools on NX-OSConfiguration Management Tools on NX-OS
Configuration Management Tools on NX-OS
 
how to use openstack api
how to use openstack apihow to use openstack api
how to use openstack api
 
Apache development with GitHub and Travis CI
Apache development with GitHub and Travis CIApache development with GitHub and Travis CI
Apache development with GitHub and Travis CI
 
ContainerCon sysdig Slides
ContainerCon sysdig Slides ContainerCon sysdig Slides
ContainerCon sysdig Slides
 
Terraform 101: What's infrastructure as code?
Terraform 101: What's infrastructure as code?Terraform 101: What's infrastructure as code?
Terraform 101: What's infrastructure as code?
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
 
CoreOS Overview
CoreOS OverviewCoreOS Overview
CoreOS Overview
 
Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016
 
Live deployment, ci, drupal
Live deployment, ci, drupalLive deployment, ci, drupal
Live deployment, ci, drupal
 
BitTorrent on iOS
BitTorrent on iOSBitTorrent on iOS
BitTorrent on iOS
 
CIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops betterCIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops better
 
GIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APPGIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APP
 
Puppeteerのお話
Puppeteerのお話Puppeteerのお話
Puppeteerのお話
 
OpenStack API's and WSGI
OpenStack API's and WSGIOpenStack API's and WSGI
OpenStack API's and WSGI
 
jbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scriptingjbang: Unleash the power of Java for shell scripting
jbang: Unleash the power of Java for shell scripting
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.
 
Docker SQL Continuous Integration Flow
Docker SQL Continuous Integration FlowDocker SQL Continuous Integration Flow
Docker SQL Continuous Integration Flow
 
Intro to CloudStack API
Intro to CloudStack APIIntro to CloudStack API
Intro to CloudStack API
 

Semelhante a Implementing a build manager in Ada

Icinga 2009 at OSMC
Icinga 2009 at OSMCIcinga 2009 at OSMC
Icinga 2009 at OSMCIcinga
 
Ansiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at robloxAnsiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at robloxDamien Garros
 
Bye bye $GLOBALS['TYPO3_DB']
Bye bye $GLOBALS['TYPO3_DB']Bye bye $GLOBALS['TYPO3_DB']
Bye bye $GLOBALS['TYPO3_DB']Jan Helke
 
Yaetos_Meetup_SparkBCN_v1.pdf
Yaetos_Meetup_SparkBCN_v1.pdfYaetos_Meetup_SparkBCN_v1.pdf
Yaetos_Meetup_SparkBCN_v1.pdfprevota
 
Apache Calcite (a tutorial given at BOSS '21)
Apache Calcite (a tutorial given at BOSS '21)Apache Calcite (a tutorial given at BOSS '21)
Apache Calcite (a tutorial given at BOSS '21)Julian Hyde
 
OSMC 2009 | Icinga by Icinga Team
OSMC 2009 | Icinga by Icinga TeamOSMC 2009 | Icinga by Icinga Team
OSMC 2009 | Icinga by Icinga TeamNETWAYS
 
PGConf.ASIA 2019 Bali - PostgreSQL on K8S at Zalando - Alexander Kukushkin
PGConf.ASIA 2019 Bali - PostgreSQL on K8S at Zalando - Alexander KukushkinPGConf.ASIA 2019 Bali - PostgreSQL on K8S at Zalando - Alexander Kukushkin
PGConf.ASIA 2019 Bali - PostgreSQL on K8S at Zalando - Alexander KukushkinEqunix Business Solutions
 
Applying software engineering to configuration management
Applying software engineering to configuration managementApplying software engineering to configuration management
Applying software engineering to configuration managementBart Vanbrabant
 
Big Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-FormatsBig Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-FormatsGuido Schmutz
 
Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...
Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...
Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...Databricks
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Cosimo Streppone
 
Yaetos Tech Overview
Yaetos Tech OverviewYaetos Tech Overview
Yaetos Tech Overviewprevota
 
Generating Code with Oracle SQL Developer Data Modeler
Generating Code with Oracle SQL Developer Data ModelerGenerating Code with Oracle SQL Developer Data Modeler
Generating Code with Oracle SQL Developer Data ModelerRob van den Berg
 
High-speed Database Throughput Using Apache Arrow Flight SQL
High-speed Database Throughput Using Apache Arrow Flight SQLHigh-speed Database Throughput Using Apache Arrow Flight SQL
High-speed Database Throughput Using Apache Arrow Flight SQLScyllaDB
 
Productionizing Machine Learning - Bigdata meetup 5-06-2019
Productionizing Machine Learning - Bigdata meetup 5-06-2019Productionizing Machine Learning - Bigdata meetup 5-06-2019
Productionizing Machine Learning - Bigdata meetup 5-06-2019Iulian Pintoiu
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and LingvokotLingvokot
 
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)lennartkats
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBMongoDB
 

Semelhante a Implementing a build manager in Ada (20)

Icinga 2009 at OSMC
Icinga 2009 at OSMCIcinga 2009 at OSMC
Icinga 2009 at OSMC
 
Ansiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at robloxAnsiblefest 2018 Network automation journey at roblox
Ansiblefest 2018 Network automation journey at roblox
 
Bye bye $GLOBALS['TYPO3_DB']
Bye bye $GLOBALS['TYPO3_DB']Bye bye $GLOBALS['TYPO3_DB']
Bye bye $GLOBALS['TYPO3_DB']
 
Grails 101
Grails 101Grails 101
Grails 101
 
Genode Programming
Genode ProgrammingGenode Programming
Genode Programming
 
Yaetos_Meetup_SparkBCN_v1.pdf
Yaetos_Meetup_SparkBCN_v1.pdfYaetos_Meetup_SparkBCN_v1.pdf
Yaetos_Meetup_SparkBCN_v1.pdf
 
Apache Calcite (a tutorial given at BOSS '21)
Apache Calcite (a tutorial given at BOSS '21)Apache Calcite (a tutorial given at BOSS '21)
Apache Calcite (a tutorial given at BOSS '21)
 
OSMC 2009 | Icinga by Icinga Team
OSMC 2009 | Icinga by Icinga TeamOSMC 2009 | Icinga by Icinga Team
OSMC 2009 | Icinga by Icinga Team
 
PGConf.ASIA 2019 Bali - PostgreSQL on K8S at Zalando - Alexander Kukushkin
PGConf.ASIA 2019 Bali - PostgreSQL on K8S at Zalando - Alexander KukushkinPGConf.ASIA 2019 Bali - PostgreSQL on K8S at Zalando - Alexander Kukushkin
PGConf.ASIA 2019 Bali - PostgreSQL on K8S at Zalando - Alexander Kukushkin
 
Applying software engineering to configuration management
Applying software engineering to configuration managementApplying software engineering to configuration management
Applying software engineering to configuration management
 
Big Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-FormatsBig Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-Formats
 
Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...
Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...
Spark SQL Catalyst Code Optimization using Function Outlining with Kavana Bha...
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 
Yaetos Tech Overview
Yaetos Tech OverviewYaetos Tech Overview
Yaetos Tech Overview
 
Generating Code with Oracle SQL Developer Data Modeler
Generating Code with Oracle SQL Developer Data ModelerGenerating Code with Oracle SQL Developer Data Modeler
Generating Code with Oracle SQL Developer Data Modeler
 
High-speed Database Throughput Using Apache Arrow Flight SQL
High-speed Database Throughput Using Apache Arrow Flight SQLHigh-speed Database Throughput Using Apache Arrow Flight SQL
High-speed Database Throughput Using Apache Arrow Flight SQL
 
Productionizing Machine Learning - Bigdata meetup 5-06-2019
Productionizing Machine Learning - Bigdata meetup 5-06-2019Productionizing Machine Learning - Bigdata meetup 5-06-2019
Productionizing Machine Learning - Bigdata meetup 5-06-2019
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and Lingvokot
 
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 

Mais de Stephane Carrez

Protect Sensitive Data with Ada Keystore
Protect Sensitive Data with Ada KeystoreProtect Sensitive Data with Ada Keystore
Protect Sensitive Data with Ada KeystoreStephane Carrez
 
AKT un outil pour sécuriser vos données et documents sensibles
AKT un outil pour sécuriser vos données et documents sensiblesAKT un outil pour sécuriser vos données et documents sensibles
AKT un outil pour sécuriser vos données et documents sensiblesStephane Carrez
 
Persistence with Ada Database Objects (ADO)
Persistence with Ada Database Objects (ADO)Persistence with Ada Database Objects (ADO)
Persistence with Ada Database Objects (ADO)Stephane Carrez
 
Writing REST APIs with OpenAPI and Swagger Ada
Writing REST APIs with OpenAPI and Swagger AdaWriting REST APIs with OpenAPI and Swagger Ada
Writing REST APIs with OpenAPI and Swagger AdaStephane Carrez
 
IP Network Stack in Ada 2012 and the Ravenscar Profile
IP Network Stack in Ada 2012 and the Ravenscar ProfileIP Network Stack in Ada 2012 and the Ravenscar Profile
IP Network Stack in Ada 2012 and the Ravenscar ProfileStephane Carrez
 

Mais de Stephane Carrez (6)

Protect Sensitive Data with Ada Keystore
Protect Sensitive Data with Ada KeystoreProtect Sensitive Data with Ada Keystore
Protect Sensitive Data with Ada Keystore
 
AKT un outil pour sécuriser vos données et documents sensibles
AKT un outil pour sécuriser vos données et documents sensiblesAKT un outil pour sécuriser vos données et documents sensibles
AKT un outil pour sécuriser vos données et documents sensibles
 
Ada for Web Development
Ada for Web DevelopmentAda for Web Development
Ada for Web Development
 
Persistence with Ada Database Objects (ADO)
Persistence with Ada Database Objects (ADO)Persistence with Ada Database Objects (ADO)
Persistence with Ada Database Objects (ADO)
 
Writing REST APIs with OpenAPI and Swagger Ada
Writing REST APIs with OpenAPI and Swagger AdaWriting REST APIs with OpenAPI and Swagger Ada
Writing REST APIs with OpenAPI and Swagger Ada
 
IP Network Stack in Ada 2012 and the Ravenscar Profile
IP Network Stack in Ada 2012 and the Ravenscar ProfileIP Network Stack in Ada 2012 and the Ravenscar Profile
IP Network Stack in Ada 2012 and the Ravenscar Profile
 

Último

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 

Último (20)

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 

Implementing a build manager in Ada

  • 1. Implementing a build manager in Ada Stéphane Carrez FOSDEM 2022 Ada DevRoom
  • 2. https://gitlab.com/stcarrez/porion 2 Introducing Porion ● Why a new build manager ? – Jenkins is slow and uses 1.3Gb memory RSS – Requires Java on build nodes – Regular security vulnerabilities ● Some requirements : – Security & perf : safe design in Ada – CLI and web interface – Flexible build nodes (ssh, docker, virsh,...)
  • 3. https://gitlab.com/stcarrez/porion 3 What a build manager must know ● Define projects with source control method ● Define recipes to build the project ● Define project dependencies ● Define build nodes (different systems, CPUs,...) ● Define build information to track build results ● Define build and project metrics ● Store credentials to connect to build nodes ● Store API secret keys to publish ● More secret keys to sign builds…
  • 4. https://gitlab.com/stcarrez/porion 4 What a build manager must do ● Probe source changes in projects ● Schedule builds according to changes (management of a build queue) ● Launch builds (locally or remotely) ● Control and track build execution ● Collect build results (coverage, tests, logs) ● Publish build results ● Send build notifications ● Keep managers happy by providing reports
  • 5. https://gitlab.com/stcarrez/porion 5 What a build manager must protect ● A build manager has access to sensitive data ● It must protect sources files (proprietary projects) ● It must protect API secret keys ● It must protect credentials (checkout sources, connect to build nodes) ● It must protect the secret keys to sign or to publish ● It must protect build results and build logs ● It must not leak API secret keys through logs ● ...
  • 6. https://gitlab.com/stcarrez/porion 6 Porion numbers ● Cost : 1.5 engineer month so far (260 hours on my free time) ● 95 % Ada, 2 % HTML, 0.4 % Typescript ● 32K CLOC Ada (16K generated) ● 43 Ada packages, 30 private Ada packages ● 19 database tables
  • 7. https://gitlab.com/stcarrez/porion 7 Architecture porion Build Nodes SQLite Database Command Line Filesystem Web Server porion-server config logs projects tmp Ada Keystore AWS Ada Database Objects AWA
  • 8. https://gitlab.com/stcarrez/porion 8 Porion Agent Architecture SQLite GNU/Linux FreeBSD NetBSD Dynamo Ada Database Objects Ada Keystore Ada EL Ada Util XML/Ada Porion Lib Printer Toolkit Advanced Resource Embedder Porion Agent (commands)
  • 9. https://gitlab.com/stcarrez/porion 9 Porion Server Architecture Ada Web Application Ada Database Objects OpenAPI Ada Ada Server Faces Ada Servlet Ada Keystore Ada EL Ada Security Ada Util Ada Web Server XML/Ada SQLite GNU/Linux FreeBSD NetBSD Dynamo Advanced Resource Embedder Porion Lib Porion Web Server
  • 10. https://gitlab.com/stcarrez/porion 10 UML to Ada generation ● Described the database model in UML : – 19 tables organized in 5 packages ● Used ArgoUML (Java tool) : – Tool migrated from tigris.org to GitHub – Works very well to define the UML class model ● Used Dynamo for the code generation : – It reads ArgoUML file – It generates Ada model for the UML classes – It generates SQL table creation schema
  • 11. https://gitlab.com/stcarrez/dynamo 11 Database Modeling XML Model Dynamo Generator Model Doc (HTML) SQL Tables Ada Model Packages UML Model Ada Database Objects Library Generated Application Model Packages Your Application Code Ada Utility Library Postgresql, MySQL or SQLite Generate Develop YAML Model Design
  • 12. https://gitlab.com/stcarrez/dynamo 12 UML generated Ada code ● 14K CLOC generated in 6 Ada packages ● Handles SQL insert, update, delete, queries ● Uses Ada.Containers.Vectors for lists ● Reference counting for objects
  • 14. https://gitlab.com/stcarrez/porion 14 Benefit of UML and Ada ● UML database model is not right at the first time ● Several iterations to add new tables, new relations or new attributes in UML model ● Easy and fast generation of Ada from UML ● Changes in UML model breaks the compilation and can be identified and fixed ● Consistency between Ada and SQL ● Refactoring is safe due to Ada strong typing !
  • 15. https://gitlab.com/stcarrez/porion 15 Focus : build queue scheduler 1/3 ● Role of the build queue and its scheduler : – Keep an ordered list of recipes that must be built – Minimize the number of builds – Take into account project dependencies A B C D C A D C B D A Add B in queue Dependencies
  • 16. https://gitlab.com/stcarrez/porion 16 Focus : build queue scheduler 2/3 ● Load the build queue in an Ada vector function "<" (Left, Right : in Build_Queue_Ref) return Boolean; with Porion.Builds.Models; Queues : Porion.Builds.Models.Build_Queue_Vector; Query : ADO.Queries.Context; DB : ADO.Sessions.Session; Query.Set_Filter ("o.node_id = :node_id"); Query.Bind_Param ("node_id", Node_Id) ; Porion.Builds.Models.List (Queues, DB, Query); ● Compare two build queue entries
  • 17. https://gitlab.com/stcarrez/porion 17 Focus : build queue scheduler 3/3 ● Sort the build queue vector declare Order : Natural := 0; begin for Queue of Queues loop Queue.Set_Order (Order); Queue.Save (Service.DB); Order := Order + 1; end loop; end; Queues.Append (New_Item); Sort_Queue.Sort (Queues); ● Update the queue order and save in the database package Sort_Queue is new Build_Queue_Vectors.Generic_Sorting ("<" => "<"); ● Instantiate the sort package
  • 18. https://gitlab.com/stcarrez/resource-embedder 18 Embedding resource ● Problem : – How to configure the database ? ● Solution : – Embed the SQL schema definition in the binary – Have an array of String with each String being an SQL create table statement – Use ARE to embed the SQL schema – Generates 2K CLOC in 3 Ada packages
  • 19. https://gitlab.com/stcarrez/resource-embedder 19 Advanced Resource Embedder esource  Configuration Files Binary Executable Generate Build Resources Compiler  (C, Ada, Go) Help Files Web Files (HTML, CSS, JS...) Run Rules Copy Minify Compress Config Help Web C Ada Go A R E dvanced mbedder
  • 20. https://gitlab.com/stcarrez/porion 20 ARE generated code ● ARE generates a child package with function declaration and static constant array of strings package Porion.Resources.Schema is function Get_Content (Name : String) return Content_Access; end Porion.Resources.Schema; package Porion.Resources is type Content_Array is array (Natural range <>) of access constant String; type Content_Access is access constant Content_Array; end Porion.Resources; ● Types are declared in a parent package
  • 21. https://gitlab.com/stcarrez/porion 21 Conclusion ● Lessons learned : – Writing a build manager is hard (secure is harder!) – Ada helps by forcing to think more about your design ● Code generation can speed up development : – Dynamo : UML => Ada mapping & SQL schema – ARE : SQL files => Ada package with static content ● High level database representation is key : – Load, insert, update database objects easily – Implement complex algorithm easily