SlideShare une entreprise Scribd logo
1  sur  49
CRATE
Ruby based, standalone executables

       Jeremy Hinegardner

   jeremy@copiousfreetime.org
        @copiousfreetime
COPIOUS FREE TIME
  Fedora           Ruby
 Packaging         Gems

•beanstalkd    •amalgalite
•haproxy       •crate
•libtomcrypt   •keybox
•libtommath    •launchy
•nginx         •heel
•ragel         •hitimes
•tinyproxy     •htauth
               •rabal
               •stickler
Crate
   &
Amalgalite
SURVEY
PRE HISTORY
 RubyConf 2007
PRE HISTORY
                          RubyConf 2007



• Sploitin’ with   Ruby

  • Aaron   Bedra
PRE HISTORY
                          RubyConf 2007



• Sploitin’ with   Ruby

  • Aaron   Bedra

• Deploying   Ruby Runtimes

  • Bruce Williams   & Rich Kilmer
STORYTIME
PERL 4, 1993
NO CONTROL
NO CONTROL


• interpreters?   - perl probably, python maybe, ruby most likely
 not
NO CONTROL


• interpreters?   - perl probably, python maybe, ruby most likely
 not

• what   libraries? - openssl? zlib?
NO CONTROL


• interpreters?   - perl probably, python maybe, ruby most likely
 not

• what   libraries? - openssl? zlib?

• compiler?   - quite possibly not
What do you do, when only thing
  you know about your target
system, is the Operating System?
AND YOU LOVE RUBY.
YOU MAKE CRATE.
SO WHAT IS CRATE?
embedded Ruby
embedded Ruby
+ ruby extensions
embedded Ruby
+ ruby extensions
+ main wrapper
embedded Ruby
+ ruby extensions
+ main wrapper
+ standard library
embedded Ruby
+ ruby extensions
+ main wrapper
+ standard library
+ application code
embedded Ruby
   + ruby extensions
   + main wrapper
   + standard library
   + application code
Crate based application
RUBYSCRIPT2EXE ?
http://www.erikveen.dds.nl/rubyscript2exe
SHOES ?
MY NEEDS
MY NEEDS

• Minimally   Invasive

  • do   not unpack to a temporary location

  • small   as can be
MY NEEDS

• Minimally   Invasive

  • do   not unpack to a temporary location

  • small   as can be

• Wide   deployment capabilities

  • more    than linux, mac, windows, cygwin
embedded Ruby
   + ruby extensions
   + main wrapper
   + standard library
   + application code
Crate based application
embedded Ruby
C      + ruby extensions
       + main wrapper
       + standard library
       + application code
    Crate based application
embedded Ruby
 C    + ruby extensions
      + main wrapper
      + standard library
Ruby + application code
   Crate based application
Statically Compile

       embedded Ruby
 C    + ruby extensions
      + main wrapper
      + standard library
Ruby + application code
   Crate based application
Statically Compile

       embedded Ruby
 C    + ruby extensions
      + main wrapper
      + standard library
Ruby + application code
   Crate based application


                       Amalgalite
Statically Compile

       embedded Ruby
 C    + ruby extensions
      + main wrapper
      + standard library
Ruby + application code
   Crate based application


           Pack into Amalgalite
1   CREATE TABLE rubylibs (
2         id            INTEGER PRIMARY KEY AUTOINCREMENT,
3         filename      TEXT UNIQUE,
4         compressed    BOOLEAN,
5         contents      BLOB
6         );
Inexact Size Measurements

                   Executable + C
                                    Ruby libs
                     extensions


  Ruby 1.8.6           2.4 M         8.4 M



Crate/ruby 1.8.6       2.9 M         1.9 M
 1   module Kernel
 2     # alias the original require away to use later
 3     alias :amalgalite_original_require :require
 4
 5     #
 6     # hook into the system 'require' to allow for required text or blobs from an
 7     # amalgalite database.  
 8     #
 9     def require( filename )
10       loaded = amalgalite_original_require( filename )
11     rescue LoadError => load_error
12       if load_error.message =~ /#{Regexp.escape filename}z/ then
13         loaded = Amalgalite::Requires.require( filename )
14       else
15         raise load_error
16       end
17     end
18
19     private :require
20     private :amalgalite_original_require
21   end
Amalgalite ruby driver is
bootstrapped in its C extension
DEMO
ISSUE #1 - AUTOLOAD
ISSUE #1 - AUTOLOAD

• Problem

 • bypasses   the require chain setup by amalgalite

 • used   by rack, active_support, active_record
ISSUE #1 - AUTOLOAD

• Problem

  • bypasses   the require chain setup by amalgalite

  • used   by rack, active_support, active_record

• Solution

  • Port   tree style patches?

  • custom    gem builds?
ISSUE #2 - VIEWS
ISSUE #2 - VIEWS

• Problem

 • layout   and templates loaded from disk
ISSUE #2 - VIEWS

• Problem

  • layout   and templates loaded from disk

• Solution

  • wait   for Rails 3

  • sinatra, others, make   patches for upstream, if needed.
ISSUE #3 - CLASS RELOADING


• Problem

  • Development     mode reloads classes

• Solution   ( for now )

  • production   mode when running as crate based apps
QUESTIONS?

Contenu connexe

Tendances

Ruby Security the Hard Way
Ruby Security the Hard WayRuby Security the Hard Way
Ruby Security the Hard WayHiroshi SHIBATA
 
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南Shengyou Fan
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the worldHiroshi SHIBATA
 
Test::Kantan - Perl and Testing
Test::Kantan - Perl and TestingTest::Kantan - Perl and Testing
Test::Kantan - Perl and TestingTokuhiro Matsuno
 
The Future of Dependency Management for Ruby
The Future of Dependency Management for RubyThe Future of Dependency Management for Ruby
The Future of Dependency Management for RubyHiroshi SHIBATA
 
Modern Perl for the Unfrozen Paleolithic Perl Programmer
Modern Perl for the Unfrozen Paleolithic Perl ProgrammerModern Perl for the Unfrozen Paleolithic Perl Programmer
Modern Perl for the Unfrozen Paleolithic Perl ProgrammerJohn Anderson
 
Dependency Resolution with Standard Libraries
Dependency Resolution with Standard LibrariesDependency Resolution with Standard Libraries
Dependency Resolution with Standard LibrariesHiroshi SHIBATA
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Hiroshi SHIBATA
 
How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?Hiroshi SHIBATA
 
Modern Perl for the Unfrozen Paleolithic Perl Programmer
Modern Perl for the Unfrozen Paleolithic  Perl ProgrammerModern Perl for the Unfrozen Paleolithic  Perl Programmer
Modern Perl for the Unfrozen Paleolithic Perl ProgrammerJohn Anderson
 
Roadmap for RubyGems 4 and Bundler 3
Roadmap for RubyGems 4 and Bundler 3Roadmap for RubyGems 4 and Bundler 3
Roadmap for RubyGems 4 and Bundler 3Hiroshi SHIBATA
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mrubyHiroshi SHIBATA
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Pierre Joye
 

Tendances (20)

Ruby Security the Hard Way
Ruby Security the Hard WayRuby Security the Hard Way
Ruby Security the Hard Way
 
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the world
 
CPAN Training
CPAN TrainingCPAN Training
CPAN Training
 
The problem with Perl
The problem with PerlThe problem with Perl
The problem with Perl
 
Test::Kantan - Perl and Testing
Test::Kantan - Perl and TestingTest::Kantan - Perl and Testing
Test::Kantan - Perl and Testing
 
The Future of Dependency Management for Ruby
The Future of Dependency Management for RubyThe Future of Dependency Management for Ruby
The Future of Dependency Management for Ruby
 
Modern Perl for the Unfrozen Paleolithic Perl Programmer
Modern Perl for the Unfrozen Paleolithic Perl ProgrammerModern Perl for the Unfrozen Paleolithic Perl Programmer
Modern Perl for the Unfrozen Paleolithic Perl Programmer
 
Dependency Resolution with Standard Libraries
Dependency Resolution with Standard LibrariesDependency Resolution with Standard Libraries
Dependency Resolution with Standard Libraries
 
Gems on Ruby
Gems on RubyGems on Ruby
Gems on Ruby
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0
 
How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?
 
Till Vollmer Presentation
Till Vollmer PresentationTill Vollmer Presentation
Till Vollmer Presentation
 
Workin On The Rails Road
Workin On The Rails RoadWorkin On The Rails Road
Workin On The Rails Road
 
RubyGems 3 & 4
RubyGems 3 & 4RubyGems 3 & 4
RubyGems 3 & 4
 
Modern Perl for the Unfrozen Paleolithic Perl Programmer
Modern Perl for the Unfrozen Paleolithic  Perl ProgrammerModern Perl for the Unfrozen Paleolithic  Perl Programmer
Modern Perl for the Unfrozen Paleolithic Perl Programmer
 
Roadmap for RubyGems 4 and Bundler 3
Roadmap for RubyGems 4 and Bundler 3Roadmap for RubyGems 4 and Bundler 3
Roadmap for RubyGems 4 and Bundler 3
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
 
Perl6 meets JVM
Perl6 meets JVMPerl6 meets JVM
Perl6 meets JVM
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18
 

Similaire à Crate - ruby based standalone executables

Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
The story of language development
The story of language developmentThe story of language development
The story of language developmentHiroshi SHIBATA
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorialknoppix
 
Agile Web Posting With Ruby / Ruby Kaigi2008
Agile Web Posting With Ruby / Ruby Kaigi2008Agile Web Posting With Ruby / Ruby Kaigi2008
Agile Web Posting With Ruby / Ruby Kaigi2008ujihisa
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The JvmQConLondon2008
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvmdeimos
 
Ruby v cpp_preso
Ruby v cpp_presoRuby v cpp_preso
Ruby v cpp_presojessicard
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLBarry Jones
 
Úvod do Ruby on Rails
Úvod do Ruby on RailsÚvod do Ruby on Rails
Úvod do Ruby on RailsKarel Minarik
 
Rake: Not Your Father's Build Tool
Rake: Not Your Father's Build ToolRake: Not Your Father's Build Tool
Rake: Not Your Father's Build Toolfilmprog
 

Similaire à Crate - ruby based standalone executables (20)

Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
Setup ruby
Setup rubySetup ruby
Setup ruby
 
Polyglot Grails
Polyglot GrailsPolyglot Grails
Polyglot Grails
 
Ruby - The Hard Bits
Ruby - The Hard BitsRuby - The Hard Bits
Ruby - The Hard Bits
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorial
 
遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
 
Agile Web Posting With Ruby / Ruby Kaigi2008
Agile Web Posting With Ruby / Ruby Kaigi2008Agile Web Posting With Ruby / Ruby Kaigi2008
Agile Web Posting With Ruby / Ruby Kaigi2008
 
RubyGems 3 & 4
RubyGems 3 & 4RubyGems 3 & 4
RubyGems 3 & 4
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The Jvm
 
Creating Ruby Gems
Creating Ruby Gems Creating Ruby Gems
Creating Ruby Gems
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvm
 
Amoocon May 2009 Germany
Amoocon May 2009   GermanyAmoocon May 2009   Germany
Amoocon May 2009 Germany
 
Ruby v cpp_preso
Ruby v cpp_presoRuby v cpp_preso
Ruby v cpp_preso
 
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
Úvod do Ruby on Rails
Úvod do Ruby on RailsÚvod do Ruby on Rails
Úvod do Ruby on Rails
 
Rake: Not Your Father's Build Tool
Rake: Not Your Father's Build ToolRake: Not Your Father's Build Tool
Rake: Not Your Father's Build Tool
 

Plus de Jeremy Hinegardner

Plus de Jeremy Hinegardner (7)

Data Stories
Data StoriesData Stories
Data Stories
 
Creative Photography for Geeks
Creative Photography for GeeksCreative Photography for Geeks
Creative Photography for Geeks
 
Gemology
GemologyGemology
Gemology
 
Extending JRuby
Extending JRubyExtending JRuby
Extending JRuby
 
FFI -- creating cross engine rubygems
FFI -- creating cross engine rubygemsFFI -- creating cross engine rubygems
FFI -- creating cross engine rubygems
 
Playing Nice with Others
Playing Nice with OthersPlaying Nice with Others
Playing Nice with Others
 
FFI - building cross engine ruby extensions
FFI - building cross engine ruby extensionsFFI - building cross engine ruby extensions
FFI - building cross engine ruby extensions
 

Dernier

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 

Dernier (20)

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 

Crate - ruby based standalone executables

  • 1. CRATE Ruby based, standalone executables Jeremy Hinegardner jeremy@copiousfreetime.org @copiousfreetime
  • 2. COPIOUS FREE TIME Fedora Ruby Packaging Gems •beanstalkd •amalgalite •haproxy •crate •libtomcrypt •keybox •libtommath •launchy •nginx •heel •ragel •hitimes •tinyproxy •htauth •rabal •stickler
  • 3. Crate & Amalgalite
  • 6. PRE HISTORY RubyConf 2007 • Sploitin’ with Ruby • Aaron Bedra
  • 7. PRE HISTORY RubyConf 2007 • Sploitin’ with Ruby • Aaron Bedra • Deploying Ruby Runtimes • Bruce Williams & Rich Kilmer
  • 11. NO CONTROL • interpreters? - perl probably, python maybe, ruby most likely not
  • 12. NO CONTROL • interpreters? - perl probably, python maybe, ruby most likely not • what libraries? - openssl? zlib?
  • 13. NO CONTROL • interpreters? - perl probably, python maybe, ruby most likely not • what libraries? - openssl? zlib? • compiler? - quite possibly not
  • 14. What do you do, when only thing you know about your target system, is the Operating System?
  • 15. AND YOU LOVE RUBY.
  • 17. SO WHAT IS CRATE?
  • 18.
  • 20. embedded Ruby + ruby extensions
  • 21. embedded Ruby + ruby extensions + main wrapper
  • 22. embedded Ruby + ruby extensions + main wrapper + standard library
  • 23. embedded Ruby + ruby extensions + main wrapper + standard library + application code
  • 24. embedded Ruby + ruby extensions + main wrapper + standard library + application code Crate based application
  • 29. MY NEEDS • Minimally Invasive • do not unpack to a temporary location • small as can be
  • 30. MY NEEDS • Minimally Invasive • do not unpack to a temporary location • small as can be • Wide deployment capabilities • more than linux, mac, windows, cygwin
  • 31. embedded Ruby + ruby extensions + main wrapper + standard library + application code Crate based application
  • 32. embedded Ruby C + ruby extensions + main wrapper + standard library + application code Crate based application
  • 33. embedded Ruby C + ruby extensions + main wrapper + standard library Ruby + application code Crate based application
  • 34. Statically Compile embedded Ruby C + ruby extensions + main wrapper + standard library Ruby + application code Crate based application
  • 35. Statically Compile embedded Ruby C + ruby extensions + main wrapper + standard library Ruby + application code Crate based application Amalgalite
  • 36. Statically Compile embedded Ruby C + ruby extensions + main wrapper + standard library Ruby + application code Crate based application Pack into Amalgalite
  • 37. 1 CREATE TABLE rubylibs ( 2       id            INTEGER PRIMARY KEY AUTOINCREMENT, 3       filename      TEXT UNIQUE, 4       compressed    BOOLEAN, 5       contents      BLOB 6       );
  • 38. Inexact Size Measurements Executable + C Ruby libs extensions Ruby 1.8.6 2.4 M 8.4 M Crate/ruby 1.8.6 2.9 M 1.9 M
  • 39.  1 module Kernel  2   # alias the original require away to use later  3   alias :amalgalite_original_require :require  4  5   #  6   # hook into the system 'require' to allow for required text or blobs from an  7   # amalgalite database.    8   #  9   def require( filename ) 10     loaded = amalgalite_original_require( filename ) 11   rescue LoadError => load_error 12     if load_error.message =~ /#{Regexp.escape filename}z/ then 13       loaded = Amalgalite::Requires.require( filename ) 14     else 15       raise load_error 16     end 17   end 18 19   private :require 20   private :amalgalite_original_require 21 end
  • 40. Amalgalite ruby driver is bootstrapped in its C extension
  • 41. DEMO
  • 42. ISSUE #1 - AUTOLOAD
  • 43. ISSUE #1 - AUTOLOAD • Problem • bypasses the require chain setup by amalgalite • used by rack, active_support, active_record
  • 44. ISSUE #1 - AUTOLOAD • Problem • bypasses the require chain setup by amalgalite • used by rack, active_support, active_record • Solution • Port tree style patches? • custom gem builds?
  • 45. ISSUE #2 - VIEWS
  • 46. ISSUE #2 - VIEWS • Problem • layout and templates loaded from disk
  • 47. ISSUE #2 - VIEWS • Problem • layout and templates loaded from disk • Solution • wait for Rails 3 • sinatra, others, make patches for upstream, if needed.
  • 48. ISSUE #3 - CLASS RELOADING • Problem • Development mode reloads classes • Solution ( for now ) • production mode when running as crate based apps

Notes de l'éditeur

  1. How many of you have full control over your application deployment? How many of your know how many instance of your application there will be? Desktop applications? IT Shops? distribute small apps to your company for command / control monitoring ?
  2. Very similar to how rubygems works.
  3. I left out a fair bit of nitty gritty details would you like me to expand on anything, show some more code, yell and scream at me,