SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Downloaden Sie, um offline zu lesen
RELX
A Dead Simple Way to Build Releases
Tuesday, June 18, 13
Topics
The basics of OTP Applications and Releases
Why Releases are important
How Relx builds Releases
How different Relx options affect the built Release
How to extend Relx
Tuesday, June 18, 13
Goal
Walk out of this talk with the ability
to create and use releases.
Tuesday, June 18, 13
What is Relx
Tool designed to build releases
Designed to integrate into a unix like suite of build tools
Tuesday, June 18, 13
OTP Application Refresher
Well defined structure
Well defined lifecycle (start, stop, semantics)
Useful metadata (including an explicit dependency graph)
Basic Building Blocks of Erlang Systems
Tuesday, June 18, 13
Well Defined Structure
!"" <name>-<version>
!"" ebin
# $"" <name>.app
!"" doc
!"" priv
!"" include
$"" src
Tuesday, June 18, 13
Well Defined Lifecycle
-module(echo_get_app).
-behaviour(application).
%% API.
-export([start/2,
stop/1]).
-include("echo_get.hrl").
%%%===================================================================
%%% API
%%%===================================================================
start(_Type, _Args) ->
Dispatch = cowboy_router:compile(?DISPATCH),
{ok, _} = cowboy:start_http(http, 100,
[{port, 8080}],
[{env,
[{dispatch, Dispatch}]}]),
echo_get_sup:start_link().
stop(_State) ->
ok.
Tuesday, June 18, 13
Useful Metadata
{application,echo_get,
[{description,"Cowboy GET echo example."},
{vsn,"0.0.0+build.1.ref5b05dba"},
{modules,[echo_get,
echo_get_app,
echo_get_handler,
echo_get_sup]},
{registered,[]},
{applications,[kernel,
stdlib,
ranch,
cowboy]},
{mod,{echo_get_app,[]}},
{env,[]}]}.
Tuesday, June 18, 13
How We Start Applications
-module(echo_get).
%% API.
-export([manual_start/0]).
%%%===================================================================
%%% API
%%%===================================================================
manual_start() ->
ok = application:start(crypto),
ok = application:start(ranch),
ok = application:start(cowboy),
ok = application:start(echo_get).
Tuesday, June 18, 13
How We Start Applications
#!/bin/sh
erl -noshell -pa ebin deps/*/ebin -s echo_get manual_start 
-eval "io:format("Point your browser at http://localhost:8080/?echo=test~n")."
Tuesday, June 18, 13
What Do We Have?
An Erlang System where dependency information is hap hazard
(in at least two places, one of which is ignored)
A system that trusts the programmer to manually startup things
in the right order (without leaving anything out)
A system where its component parts are spread around the OS
filesystem (if we are lucky and they are even there)
Tuesday, June 18, 13
Current State of the World
Lots of systems are assembled poorly (ie, poorly organized, not using the
right abstractions, prone to failure)
Commonly deploy by simply manually copying the Apps and then running a
script that starts it (which also starts its dependencies manually)
Dependencies described and handled outside of the OTP Apps themselves
itself
Tuesday, June 18, 13
What is Needed
Something that manages and provides clear semantics around system
startup and shutdown
Something that uses the dependencies described and manages where they
occur and when they are started
Something that does the creation and packaging and of Erlang Systems
leveraging all that metadata
Something to startup and manage systems
Tuesday, June 18, 13
We Have It!
Something that manages and provides clear semantics around system
startup and shutdown - Erlang/OTP Releases
Something that uses the dependencies described and manages where they
occur and when they are started - Erlang/OTP Release
Something that does the creation and packaging and of Erlang Systems
leveraging all that metadata - Erlware’s Relx
Something to startup and manage systems - Erlang/OTP Release
or How to Build Systems the Right way
Tuesday, June 18, 13
What Exactly is a Release
A Set of built, versioned OTP Applications
Metadata that describes applications required
An explicit configuration mechanism
Optionally tarballs that can be managed and deployed
Tuesday, June 18, 13
Release Overview
Tuesday, June 18, 13
Release Metadata
{release,{"echo_get","0.0.1"},
{erts,"5.10.1"},
[{kernel,"2.16.1"},
{stdlib,"1.19.1"},
{ranch,"0.8.3"},
{crypto,"2.3"},
{cowboy,"0.8.5"},
{echo_get,"0.0.1"}]}.
Tuesday, June 18, 13
Release Structure
!"" bin
!"" echo_get
$"" echo_get-0.0.1
!"" erts-5.10.1
!"" lib
#   !"" cowboy-0.8.5
#   !"" crypto-2.3
#   !"" echo_get-0.0.0+build.1.ref5b05dba
#   !"" kernel-2.16.1
#   !"" ranch-0.8.3
#   $"" stdlib-1.19.1
$"" releases
$"" echo_get-0.0.1
!"" echo_get.boot
!"" echo_get.rel
!"" echo_get.script
!"" sys.config
$"" vm.args
Tuesday, June 18, 13
Creating A Release
>relx
Starting relx build process ...
Resolving OTP Applications from directories:
/Users/emerrit/workspace/EUC2013/echo_get/ebin
/Users/emerrit/workspace/EUC2013/echo_get/deps
/usr/local/Cellar/erlang/R16B/lib/erlang/lib
Resolving available releases from directories:
/Users/emerrit/workspace/EUC2013/echo_get/ebin
/Users/emerrit/workspace/EUC2013/echo_get/deps
/usr/local/Cellar/erlang/R16B/lib/erlang/lib
Resolved echo_get-0.0.1
release successfully created!
Tuesday, June 18, 13
What Relx Does
Reads the configuration
Discovers the environment (Apps and Releases available)
Starting at the apps and constraints specified - does a constraint
solve to resolve the full dependency tree
Uses that information to assemble the release
Creates the release, including all metadata and support functions
Tuesday, June 18, 13
Configuration
%% -*- mode: Erlang; fill-column: 80 -*-
{release, {echo_get, "0.0.1"},
[echo_get]}.
Tuesday, June 18, 13
An Example (echo_get)
{application,echo_get,
[{description,"Cowboy GET echo example."},
{vsn,"0.0.0+build.1.ref5b05dba"},
{modules,[echo_get,
echo_get_app,
echo_get_handler,
echo_get_sup]},
{registered,[]},
{applications,[kernel,
stdlib,
ranch,
cowboy]},
{mod,{echo_get_app,[]}},
{env,[]}]}.
Tuesday, June 18, 13
echo_get Release Structure
!"" bin
!"" echo_get
$"" echo_get-0.0.1
!"" erts-5.10.1
!"" lib
#   !"" cowboy-0.8.5
#   !"" crypto-2.3
#   !"" echo_get-0.0.0+build.1.ref5b05dba
#   !"" kernel-2.16.1
#   !"" ranch-0.8.3
#   $"" stdlib-1.19.1
$"" releases
$"" echo_get-0.0.1
!"" echo_get.boot
!"" echo_get.rel
!"" echo_get.script
!"" sys.config
$"" vm.args
Tuesday, June 18, 13
Constraining
%% -*- mode: Erlang; fill-column: 80 -*-
{release, {echo_get, "0.0.1"},
[echo_get,
sasl]}.
Tuesday, June 18, 13
Constraining
%% -*- mode: Erlang; fill-column: 80 -*-
{release, {echo_get, "0.0.1"},
[echo_get,
{sasl, “2.3”, gte}]}.
Tuesday, June 18, 13
App Overrides
{overrides,	
  [{sexpr,	
  "../sexpr"}]}.
Tuesday, June 18, 13
Overlays
{overlay_vars,	
  "vars.config"}.
{overlay,	
  [{mkdir,	
  "log/sasl"},
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {copy,	
  "files/erl",	
  "{{erts_vsn}}/bin/erl"},
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {copy,	
  "files/nodetool",	
  "{{erts_vsn}}/bin/nodetool"},
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {template,	
  "files/app.config",	
  "etc/app.config"},
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {template,	
  "files/vm.args",	
  "etc/vm.args"}]}.
Tuesday, June 18, 13
Multiple Releases
%% -*- mode: Erlang; fill-column: 80 -*-
{release, {echo_get, "0.0.1"},
[{echo_get, “0.0.1”}]}.
{release, {echo_get, "0.0.2"},
[{echo_get, “0.0.2”]}.
Tuesday, June 18, 13
Easily Extendable
Simply implement the rlx_provider behaviour
Api for accessing and manipulating releases via rlx_state, rlx_release and
rlx_app_info
Tuesday, June 18, 13
Implementing a Provider
-­‐callback	
  init(rlx_state:t())	
  -­‐>	
  
	
  	
  	
  	
  	
  	
  	
  	
  {ok,	
  rlx_state:t()}	
  |	
  relx:error().
-­‐callback	
  do(rlx_state:t())	
  -­‐>	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  {ok,	
  rlx_state:t()}	
  |	
  relx:error().
-­‐callback	
  format_error(Reason::term())	
  -­‐>	
  
	
  	
  	
  	
  	
  	
  	
  	
  iolist().
Tuesday, June 18, 13
Adding Providers
{add_providers,	
  [my_custom_functionality]}.
Tuesday, June 18, 13
Erlware’s Relx
http://relx.org
http://erlware.org
Tuesday, June 18, 13
August 30th - 31st
http://erlangcamp.com
Tuesday, June 18, 13
October 11th - 12th
http://erlangcamp.com
Tuesday, June 18, 13
Questions??
Tuesday, June 18, 13

Weitere ähnliche Inhalte

Ähnlich wie EUC 2013 - Relx

Open social 2.0 sandbox ee and breaking out of the gadget box
Open social 2.0 sandbox  ee and breaking out of the gadget boxOpen social 2.0 sandbox  ee and breaking out of the gadget box
Open social 2.0 sandbox ee and breaking out of the gadget box
Ryan Baxter
 
Legacy Lowdown - Options When Migrating Solaris Applications
Legacy Lowdown - Options When Migrating Solaris ApplicationsLegacy Lowdown - Options When Migrating Solaris Applications
Legacy Lowdown - Options When Migrating Solaris Applications
AppZero
 
NEOOUG 2010 Oracle Data Integrator Presentation
NEOOUG 2010 Oracle Data Integrator PresentationNEOOUG 2010 Oracle Data Integrator Presentation
NEOOUG 2010 Oracle Data Integrator Presentation
askankit
 

Ähnlich wie EUC 2013 - Relx (20)

Open social 2.0 sandbox ee and breaking out of the gadget box
Open social 2.0 sandbox  ee and breaking out of the gadget boxOpen social 2.0 sandbox  ee and breaking out of the gadget box
Open social 2.0 sandbox ee and breaking out of the gadget box
 
Apache Eagle: Architecture Evolvement and New Features
Apache Eagle: Architecture Evolvement and New FeaturesApache Eagle: Architecture Evolvement and New Features
Apache Eagle: Architecture Evolvement and New Features
 
Legacy Lowdown - Options When Migrating Solaris Applications
Legacy Lowdown - Options When Migrating Solaris ApplicationsLegacy Lowdown - Options When Migrating Solaris Applications
Legacy Lowdown - Options When Migrating Solaris Applications
 
OGCE Project Overview
OGCE Project OverviewOGCE Project Overview
OGCE Project Overview
 
jQuery Mobile & PhoneGap
jQuery Mobile & PhoneGapjQuery Mobile & PhoneGap
jQuery Mobile & PhoneGap
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
Hotcode 2013: Javascript in a database (Part 2)
Hotcode 2013: Javascript in a database (Part 2)Hotcode 2013: Javascript in a database (Part 2)
Hotcode 2013: Javascript in a database (Part 2)
 
Apache Aries Blog Sample
Apache Aries Blog SampleApache Aries Blog Sample
Apache Aries Blog Sample
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - Switzerl...
 
The InstallShield of the 21st Century – Theo Schlossnagle
The InstallShield of the 21st Century – Theo SchlossnagleThe InstallShield of the 21st Century – Theo Schlossnagle
The InstallShield of the 21st Century – Theo Schlossnagle
 
Selenium web driver | java
Selenium web driver | javaSelenium web driver | java
Selenium web driver | java
 
Lone StarPHP 2013 - Building Web Apps from a New Angle
Lone StarPHP 2013 - Building Web Apps from a New AngleLone StarPHP 2013 - Building Web Apps from a New Angle
Lone StarPHP 2013 - Building Web Apps from a New Angle
 
Automated bug localization
Automated bug localizationAutomated bug localization
Automated bug localization
 
JavaScript Dependencies, Modules & Browserify
JavaScript Dependencies, Modules & BrowserifyJavaScript Dependencies, Modules & Browserify
JavaScript Dependencies, Modules & Browserify
 
dJango
dJangodJango
dJango
 
UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)UberFire Quick Intro and Overview (early beta Aug 2013)
UberFire Quick Intro and Overview (early beta Aug 2013)
 
SEA Open Hack - YAP
SEA Open Hack - YAPSEA Open Hack - YAP
SEA Open Hack - YAP
 
NEOOUG 2010 Oracle Data Integrator Presentation
NEOOUG 2010 Oracle Data Integrator PresentationNEOOUG 2010 Oracle Data Integrator Presentation
NEOOUG 2010 Oracle Data Integrator Presentation
 
Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...
Microservices for the Masses with Spring Boot, JHipster, and OAuth - South We...
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile Widgets
 

Kürzlich hochgeladen

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
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
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

EUC 2013 - Relx

  • 1. RELX A Dead Simple Way to Build Releases Tuesday, June 18, 13
  • 2. Topics The basics of OTP Applications and Releases Why Releases are important How Relx builds Releases How different Relx options affect the built Release How to extend Relx Tuesday, June 18, 13
  • 3. Goal Walk out of this talk with the ability to create and use releases. Tuesday, June 18, 13
  • 4. What is Relx Tool designed to build releases Designed to integrate into a unix like suite of build tools Tuesday, June 18, 13
  • 5. OTP Application Refresher Well defined structure Well defined lifecycle (start, stop, semantics) Useful metadata (including an explicit dependency graph) Basic Building Blocks of Erlang Systems Tuesday, June 18, 13
  • 6. Well Defined Structure !"" <name>-<version> !"" ebin # $"" <name>.app !"" doc !"" priv !"" include $"" src Tuesday, June 18, 13
  • 7. Well Defined Lifecycle -module(echo_get_app). -behaviour(application). %% API. -export([start/2, stop/1]). -include("echo_get.hrl"). %%%=================================================================== %%% API %%%=================================================================== start(_Type, _Args) -> Dispatch = cowboy_router:compile(?DISPATCH), {ok, _} = cowboy:start_http(http, 100, [{port, 8080}], [{env, [{dispatch, Dispatch}]}]), echo_get_sup:start_link(). stop(_State) -> ok. Tuesday, June 18, 13
  • 8. Useful Metadata {application,echo_get, [{description,"Cowboy GET echo example."}, {vsn,"0.0.0+build.1.ref5b05dba"}, {modules,[echo_get, echo_get_app, echo_get_handler, echo_get_sup]}, {registered,[]}, {applications,[kernel, stdlib, ranch, cowboy]}, {mod,{echo_get_app,[]}}, {env,[]}]}. Tuesday, June 18, 13
  • 9. How We Start Applications -module(echo_get). %% API. -export([manual_start/0]). %%%=================================================================== %%% API %%%=================================================================== manual_start() -> ok = application:start(crypto), ok = application:start(ranch), ok = application:start(cowboy), ok = application:start(echo_get). Tuesday, June 18, 13
  • 10. How We Start Applications #!/bin/sh erl -noshell -pa ebin deps/*/ebin -s echo_get manual_start -eval "io:format("Point your browser at http://localhost:8080/?echo=test~n")." Tuesday, June 18, 13
  • 11. What Do We Have? An Erlang System where dependency information is hap hazard (in at least two places, one of which is ignored) A system that trusts the programmer to manually startup things in the right order (without leaving anything out) A system where its component parts are spread around the OS filesystem (if we are lucky and they are even there) Tuesday, June 18, 13
  • 12. Current State of the World Lots of systems are assembled poorly (ie, poorly organized, not using the right abstractions, prone to failure) Commonly deploy by simply manually copying the Apps and then running a script that starts it (which also starts its dependencies manually) Dependencies described and handled outside of the OTP Apps themselves itself Tuesday, June 18, 13
  • 13. What is Needed Something that manages and provides clear semantics around system startup and shutdown Something that uses the dependencies described and manages where they occur and when they are started Something that does the creation and packaging and of Erlang Systems leveraging all that metadata Something to startup and manage systems Tuesday, June 18, 13
  • 14. We Have It! Something that manages and provides clear semantics around system startup and shutdown - Erlang/OTP Releases Something that uses the dependencies described and manages where they occur and when they are started - Erlang/OTP Release Something that does the creation and packaging and of Erlang Systems leveraging all that metadata - Erlware’s Relx Something to startup and manage systems - Erlang/OTP Release or How to Build Systems the Right way Tuesday, June 18, 13
  • 15. What Exactly is a Release A Set of built, versioned OTP Applications Metadata that describes applications required An explicit configuration mechanism Optionally tarballs that can be managed and deployed Tuesday, June 18, 13
  • 18. Release Structure !"" bin !"" echo_get $"" echo_get-0.0.1 !"" erts-5.10.1 !"" lib #   !"" cowboy-0.8.5 #   !"" crypto-2.3 #   !"" echo_get-0.0.0+build.1.ref5b05dba #   !"" kernel-2.16.1 #   !"" ranch-0.8.3 #   $"" stdlib-1.19.1 $"" releases $"" echo_get-0.0.1 !"" echo_get.boot !"" echo_get.rel !"" echo_get.script !"" sys.config $"" vm.args Tuesday, June 18, 13
  • 19. Creating A Release >relx Starting relx build process ... Resolving OTP Applications from directories: /Users/emerrit/workspace/EUC2013/echo_get/ebin /Users/emerrit/workspace/EUC2013/echo_get/deps /usr/local/Cellar/erlang/R16B/lib/erlang/lib Resolving available releases from directories: /Users/emerrit/workspace/EUC2013/echo_get/ebin /Users/emerrit/workspace/EUC2013/echo_get/deps /usr/local/Cellar/erlang/R16B/lib/erlang/lib Resolved echo_get-0.0.1 release successfully created! Tuesday, June 18, 13
  • 20. What Relx Does Reads the configuration Discovers the environment (Apps and Releases available) Starting at the apps and constraints specified - does a constraint solve to resolve the full dependency tree Uses that information to assemble the release Creates the release, including all metadata and support functions Tuesday, June 18, 13
  • 21. Configuration %% -*- mode: Erlang; fill-column: 80 -*- {release, {echo_get, "0.0.1"}, [echo_get]}. Tuesday, June 18, 13
  • 22. An Example (echo_get) {application,echo_get, [{description,"Cowboy GET echo example."}, {vsn,"0.0.0+build.1.ref5b05dba"}, {modules,[echo_get, echo_get_app, echo_get_handler, echo_get_sup]}, {registered,[]}, {applications,[kernel, stdlib, ranch, cowboy]}, {mod,{echo_get_app,[]}}, {env,[]}]}. Tuesday, June 18, 13
  • 23. echo_get Release Structure !"" bin !"" echo_get $"" echo_get-0.0.1 !"" erts-5.10.1 !"" lib #   !"" cowboy-0.8.5 #   !"" crypto-2.3 #   !"" echo_get-0.0.0+build.1.ref5b05dba #   !"" kernel-2.16.1 #   !"" ranch-0.8.3 #   $"" stdlib-1.19.1 $"" releases $"" echo_get-0.0.1 !"" echo_get.boot !"" echo_get.rel !"" echo_get.script !"" sys.config $"" vm.args Tuesday, June 18, 13
  • 24. Constraining %% -*- mode: Erlang; fill-column: 80 -*- {release, {echo_get, "0.0.1"}, [echo_get, sasl]}. Tuesday, June 18, 13
  • 25. Constraining %% -*- mode: Erlang; fill-column: 80 -*- {release, {echo_get, "0.0.1"}, [echo_get, {sasl, “2.3”, gte}]}. Tuesday, June 18, 13
  • 26. App Overrides {overrides,  [{sexpr,  "../sexpr"}]}. Tuesday, June 18, 13
  • 27. Overlays {overlay_vars,  "vars.config"}. {overlay,  [{mkdir,  "log/sasl"},                        {copy,  "files/erl",  "{{erts_vsn}}/bin/erl"},                        {copy,  "files/nodetool",  "{{erts_vsn}}/bin/nodetool"},                        {template,  "files/app.config",  "etc/app.config"},                        {template,  "files/vm.args",  "etc/vm.args"}]}. Tuesday, June 18, 13
  • 28. Multiple Releases %% -*- mode: Erlang; fill-column: 80 -*- {release, {echo_get, "0.0.1"}, [{echo_get, “0.0.1”}]}. {release, {echo_get, "0.0.2"}, [{echo_get, “0.0.2”]}. Tuesday, June 18, 13
  • 29. Easily Extendable Simply implement the rlx_provider behaviour Api for accessing and manipulating releases via rlx_state, rlx_release and rlx_app_info Tuesday, June 18, 13
  • 30. Implementing a Provider -­‐callback  init(rlx_state:t())  -­‐>                  {ok,  rlx_state:t()}  |  relx:error(). -­‐callback  do(rlx_state:t())  -­‐>                    {ok,  rlx_state:t()}  |  relx:error(). -­‐callback  format_error(Reason::term())  -­‐>                  iolist(). Tuesday, June 18, 13
  • 33. August 30th - 31st http://erlangcamp.com Tuesday, June 18, 13
  • 34. October 11th - 12th http://erlangcamp.com Tuesday, June 18, 13