SlideShare a Scribd company logo
Elixir Deployment Tools
A A R O N R E N N E R
@ b a y f i e l d c o d e r
Use heroku?
HOW DO I RUN IN PRODUCTION?
Just run: MIX_ENV=prod mix phx.server
https://oscar.ofm.co.za/img/fr_201691716455.jpg
What’s in the Elixir ecosystem? OTP Releases?
DISTILLERY
• Compiles and packages your
application with the erlang vm so it
can be deployed to clean machine
https://openclipart.org/detail/26101/cardboard-box-package
SETTING UP
• Install in mix.exs
• mix deps.get
• mix release.init
• Follow Use Distillery with Phoenix Guide
MIX_ENV=prod mix release
• Creates a folder in _build/prod/rel/my_app
my_app master % ls
bin erts-9.0 lib releases var
./bin/<app_name>
Usage: my_app <task>
Service Control
=======================
start # start my_app as a daemon
start_boot <file> # start my_app as a daemon, but supply a
custom .boot file
foreground # start my_app in the foreground
console # start my_app with a console attached
console_clean # start a console with code paths set but
no apps loaded/started
...
./bin/<app_name>
Usage: my_app <task>
start # start my_app as a daemon
stop # stop the my_app daemon
remote_console # remote shell to my_app's console
ping # checks if my_app is running
upgrade <version> # upgrade my_app to <version>
HOW DO WE SHIP IT?
my_app master % ls
bin erts-9.0 lib releases var
EDELIVER
• Builds your application on a remote
build server and then deploys it to
staging/production servers
http://clipartix.com/wp-content/uploads/2016/04/Airplane-clipart-no-background-free-clipart-images.jpg
.deliver/config
#!/usr/bin/env bash
APP=”my_app”
BUILD_HOST="build-system.acme.org”
BUILD_USER="build
BUILD_AT="/tmp/my_app/builds
DELIVER_TO="/srv/my_app"
STAGING_HOSTS=”staging1.acme.org staging2.acme.org”
STAGING_USER=”staging”
PRODUCTION_HOSTS=”app1.acme.org app2.acme.org"
PRODUCTION_USER="production"
BUILD AND DEPLOY
• mix edeliver build release
• mix edeliver deploy release to [staging | production]
• mix edeliver start [staging | production]
• mix edeliver ping [staging | production]
ONE BUILD TO MULTIPLE ENVIRONMENTS
v0.0.1
http://i.istockimg.com/file_thumbview_approve/17278421/3/stock-illustration-17278421-glowing-green-box.jpg
staging1 prod3prod2prod1
WHERE CONFIG IS COMPILED
config/config.exs releases/<vsn>/sys.config
MANAGING CONFIG
releases/<version>/sys.config
[{sasl,[{errlog_type,error}]},
{logger,
[{console,
[{format,<<"$time $metadata[$level] $messagen">>},
{metadata,[request_id]}]},
{level,info}]},
{distillery_example,
[{'Elixir.DistilleryExampleWeb.Endpoint',
[{render_errors,
[{view,'Elixir.DistilleryExampleWeb.ErrorView'},
{accepts,[<<"html">>,<<"json">>]}]},
{pubsub,
[{name,'Elixir.DistilleryExample.PubSub'},
{adapter,'Elixir.Phoenix.PubSub.PG2'}]},
{load_from_system_env,true},
{url,[{host,<<"example.com">>},{port,{system,<<"PORT">>}}]},
{cache_static_manifest,<<"priv/static/cache_manifest.json">>},
{server,true},
{root,<<".">>},
{version,"0.0.1"},
{secret_key_base,
<<"qhKyagfd2eswVGdgQMIZzfbO4Hi6Vr8J0Y3GR67SHvG7EPNODK6z+d0haLkx7HYy">>}]}]}].
MANAGING CONFIG
releases/<version>/sys.config
[{sasl,[{errlog_type,error}]},
{logger,
[{console,
[{format,<<"$time $metadata[$level] $messagen">>},
{metadata,[request_id]}]},
{level,info}]},
{distillery_example,
[{'Elixir.DistilleryExampleWeb.Endpoint',
[{render_errors,
[{view,'Elixir.DistilleryExampleWeb.ErrorView'},
{accepts,[<<"html">>,<<"json">>]}]},
{pubsub,
[{name,'Elixir.DistilleryExample.PubSub'},
{adapter,'Elixir.Phoenix.PubSub.PG2'}]},
{load_from_system_env,true},
{url,[{host, <<"example.com">> },{port,{system,<<"PORT">>}}]},
{cache_static_manifest,<<"priv/static/cache_manifest.json">>},
{server,true},
{root,<<".">>},
{version,"0.0.1"},
{secret_key_base,
<<"qhKyagfd2eswVGdgQMIZzfbO4Hi6Vr8J0Y3GR67SHvG7EPNODK6z+d0haLkx7HYy">> }]}]}].
CONFORM
• Injects settings into the sys.config
when your application is starting up
http://www.clker.com/cliparts/W/F/s/r/d/6/gear-md.png
<deploy_dir>/<app_name>.conf
# Secret key base for sessions. Needs to be the same across app servers
my_app.secret_key_base = “super secret”
# Hostname to use when generating urls
my_app.url.host = “acme.com”
# More custom settings
# …
CONFORM
releases/<version>/sys.config
<app_name>.conf
var/sys.config
+
=
CONFORM INJECTS SETTINGS
var/sys.config
[{sasl,[{errlog_type,error}]},
{logger,
[{console,
[{format,<<"$time $metadata[$level] $messagen">>},
{metadata,[request_id]}]},
{level,info}]},
{distillery_example,
[{'Elixir.DistilleryExampleWeb.Endpoint',
[{render_errors,
[{view,'Elixir.DistilleryExampleWeb.ErrorView'},
• {accepts,[<<"html">>,<<"json">>]}]},
{pubsub,
[{name,'Elixir.DistilleryExample.PubSub'},
{adapter,'Elixir.Phoenix.PubSub.PG2'}]},
{load_from_system_env,true},
{url,[{host, <<”acme.com">> },{port,{system,<<"PORT">>}}]},
{cache_static_manifest,<<"priv/static/cache_manifest.json">>},
{server,true},
{root,<<".">>},
{version,"0.0.1"},
{secret_key_base,
<<”super secret">> }]}]}].
THINGS TO KEEP IN MIND
@api_key Application.get_env(:my_app, :api_key)
DON’T: compile settings into module attributes
DO: Create functions for easier access
def api_key do
Application.get_env(:my_app, :api_key)
end
TOOL CHAIN
BITWALKER/CONFORM
http://www.clker.com/cliparts/W/F/s/r/d/6/gear-md.png
Inject settings into
sys.config
EDELIVER/EDELIVER
Remote Builds and
Deployment
BITWALKER/DISTILLERY
Package
Application
THANK YOU!
WE’RE HIRING
A A R O N R E N N E R
@ b a y f i e l d c o d e r

More Related Content

What's hot

Automating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumAutomating Hybrid Applications with Appium
Automating Hybrid Applications with Appium
Sauce Labs
 
Appium mobile web+dev conference
Appium   mobile web+dev conferenceAppium   mobile web+dev conference
Appium mobile web+dev conference
Isaac Murchie
 
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
D
 
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
D
 

What's hot (20)

iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...
 
Automating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumAutomating Hybrid Applications with Appium
Automating Hybrid Applications with Appium
 
Automated-Testing-inside-containers
Automated-Testing-inside-containersAutomated-Testing-inside-containers
Automated-Testing-inside-containers
 
Appium mobile web+dev conference
Appium   mobile web+dev conferenceAppium   mobile web+dev conference
Appium mobile web+dev conference
 
React native development with expo
React native development with expoReact native development with expo
React native development with expo
 
Improving Android app testing with Appium and Sauce Labs
Improving Android app testing with Appium and Sauce LabsImproving Android app testing with Appium and Sauce Labs
Improving Android app testing with Appium and Sauce Labs
 
Cordova Tutorial
Cordova TutorialCordova Tutorial
Cordova Tutorial
 
Testing on Mobile Devices with Location Services
Testing on Mobile Devices with Location ServicesTesting on Mobile Devices with Location Services
Testing on Mobile Devices with Location Services
 
React Native Expo
React Native ExpoReact Native Expo
React Native Expo
 
Selenium, Appium, and Robots!
Selenium, Appium, and Robots!Selenium, Appium, and Robots!
Selenium, Appium, and Robots!
 
Ionic2
Ionic2Ionic2
Ionic2
 
Xcode Server & Xcode 7 Bots
Xcode Server & Xcode 7 Bots Xcode Server & Xcode 7 Bots
Xcode Server & Xcode 7 Bots
 
ADF 2.4.0 And Beyond
ADF 2.4.0 And BeyondADF 2.4.0 And Beyond
ADF 2.4.0 And Beyond
 
PhoneGap Day 2016 EU: Creating the Ideal Cordova Dev Environment
PhoneGap Day 2016 EU: Creating the Ideal Cordova Dev EnvironmentPhoneGap Day 2016 EU: Creating the Ideal Cordova Dev Environment
PhoneGap Day 2016 EU: Creating the Ideal Cordova Dev Environment
 
Play with Alfresco ADF 2.0.0 Angular
Play with Alfresco ADF 2.0.0 AngularPlay with Alfresco ADF 2.0.0 Angular
Play with Alfresco ADF 2.0.0 Angular
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
Device software image verification
Device software image verificationDevice software image verification
Device software image verification
 
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
 
Installing iOS and Android Simulators on MacOSX
Installing iOS and Android Simulators on MacOSXInstalling iOS and Android Simulators on MacOSX
Installing iOS and Android Simulators on MacOSX
 
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
 

Similar to Elixir Deployment Tools

Baruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion WorkshopBaruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion Workshop
Brian Sam-Bodden
 
Virtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitVirtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profit
Andreas Heim
 
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみたネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
furusin
 
How to automate elixir phoenix deployment with distillery and edeliver on ubu...
How to automate elixir phoenix deployment with distillery and edeliver on ubu...How to automate elixir phoenix deployment with distillery and edeliver on ubu...
How to automate elixir phoenix deployment with distillery and edeliver on ubu...
VasiliyPodnebesniy
 
BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docx
moirarandell
 

Similar to Elixir Deployment Tools (20)

Node Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.jsNode Summit 2018: Cloud Native Node.js
Node Summit 2018: Cloud Native Node.js
 
Baruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion WorkshopBaruco 2014 - Rubymotion Workshop
Baruco 2014 - Rubymotion Workshop
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 servers
 
Scale your PHP application with Elastic Beanstalk - CloudParty Genova
Scale your PHP application with Elastic Beanstalk - CloudParty GenovaScale your PHP application with Elastic Beanstalk - CloudParty Genova
Scale your PHP application with Elastic Beanstalk - CloudParty Genova
 
Virtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitVirtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profit
 
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみたネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
 
FullStack London - Cloud Native Node.js
FullStack London - Cloud Native Node.jsFullStack London - Cloud Native Node.js
FullStack London - Cloud Native Node.js
 
London Node.js User Group - Cloud-native Node.js
London Node.js User Group - Cloud-native Node.jsLondon Node.js User Group - Cloud-native Node.js
London Node.js User Group - Cloud-native Node.js
 
Best practices for implementing CI/CD on Salesforce
Best practices for implementing CI/CD on SalesforceBest practices for implementing CI/CD on Salesforce
Best practices for implementing CI/CD on Salesforce
 
Minimum Viable Docker: our journey towards orchestration
Minimum Viable Docker: our journey towards orchestrationMinimum Viable Docker: our journey towards orchestration
Minimum Viable Docker: our journey towards orchestration
 
React Native
React NativeReact Native
React Native
 
Google Cloud Endpointsによる API構築
Google Cloud Endpointsによる API構築Google Cloud Endpointsによる API構築
Google Cloud Endpointsによる API構築
 
Better Operations into the Cloud
Better Operations  into the CloudBetter Operations  into the Cloud
Better Operations into the Cloud
 
Getting started with open mobile development on the Openmoko platform
Getting started with open mobile development on the Openmoko platformGetting started with open mobile development on the Openmoko platform
Getting started with open mobile development on the Openmoko platform
 
How to automate elixir phoenix deployment with distillery and edeliver on ubu...
How to automate elixir phoenix deployment with distillery and edeliver on ubu...How to automate elixir phoenix deployment with distillery and edeliver on ubu...
How to automate elixir phoenix deployment with distillery and edeliver on ubu...
 
Silicon Valley Code Camp 2019 - Reaching the Cloud Native World
Silicon Valley Code Camp 2019 - Reaching the Cloud Native WorldSilicon Valley Code Camp 2019 - Reaching the Cloud Native World
Silicon Valley Code Camp 2019 - Reaching the Cloud Native World
 
BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docx
 
Pyramid deployment
Pyramid deploymentPyramid deployment
Pyramid deployment
 
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic BeanstalkDeploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
 
Deliver Python Apps with Docker
Deliver Python Apps with DockerDeliver Python Apps with Docker
Deliver Python Apps with Docker
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 

Elixir Deployment Tools