SlideShare a Scribd company logo
1 of 11
Download to read offline
Releasing Elixir/Phoenix
get_user(“Yaroslav Martsynyuk”)
|> elixir_club(12)
|> kyiv()
applications
WISE ENGINEERING
Distillery Is Your Friend
- Inits release config
- Builds release binary
- Builds upgrade/downgrade tarball
- Doesn’t deploy app
- Doesn’t upgrade/downgrade app
defp deps do
[
{:phoenix, "~> 1.3.0"},
{:phoenix_pubsub, "~> 1.0"},
{:phoenix_ecto, "~> 3.2"},
{:phoenix_html, "~> 2.10"},
{:phoenix_live_reload, "~> 1.0", only: :dev},
{:gettext, "~> 0.11"},
{:cowboy, "~> 1.0"},
{:distillery, "~> 1.5.2"}
]
end
Installation
$> MIX_ENV=prod mix release.init
use Mix.Releases.Config,
default_release: :web,
default_environment: Mix.env()
environment :prod do
set include_erts: true
set cookie: “ M*~{1amT9B(cG9qoi3I*a>BUS{AkC;Lb<hh~BG[g ”
end
release :web_app do
set version: current_version(:web)
end
Init Release
- Increase app version in mix.exs
- Hot upgrades are possible with included ERTS only
- Don’t mess up with cookie
$> MIX_ENV=prod mix deps.get --only prod
$> MIX_ENV=prod mix release [--upgrade] --env=prod
Create Release/Upgrade
#! /usr/bin/env
V=$(grep 'version' mix.exs | cut -d'"' -f2)
if["$(ssh user@host /tmp/bin/demo_app ping)" = "pong" ]; then
bash ./upgrade.sh
else
cd ~/demo_app
MIX_ENV=prod mix deps.get --only prod
MIX_ENV=prod mix release --env=prod
scp .../releases/${V}/demo_app.tar.gz user@host:/home/user/demo_app
ssh user@host tar -xf demo_app.tar.gz -C /home/user/demo_app
ssh user@host /home/user/demo_app/bin/demo_app start
fi
Install Script
#! /usr/bin/env
V=$(grep 'version' mix.exs | cut -d'"' -f2)
cd ~/demo_app
MIX_ENV=prod mix deps.get --only prod
MIX_ENV=prod mix release --env=prod --upgrade
scp .../releases/${V}/demo_app.tar.gz
user@host:/home/user/demo_app/releases/${V}
ssh user@host /home/user/bin/demo_app upgrade
Upgrade Script
OTP
FROM elixir:1.5.2
ENV APP_NAME demo_app
EXPOSE 4000
...
RUN mix deps.get
RUN MIX_ENV=prod mix release.init
RUN MIX_ENV=prod mix release
CMD MIX_ENV=prod _build/prod/rel/demo_app/bin/web foreground
Docker/Kubernetes
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: demo_app
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0%
maxSurge: 35%
replicas: 30
...
Docker/Kubernetes
...
|> have_questions?()
|> thx!()

More Related Content

What's hot

Nikita Tuk: Handling background processes in iOS: problems & solutions
Nikita Tuk: Handling background processes in iOS: problems & solutionsNikita Tuk: Handling background processes in iOS: problems & solutions
Nikita Tuk: Handling background processes in iOS: problems & solutionsmdevtalk
 
Alfresco sdk 2.0
Alfresco sdk 2.0Alfresco sdk 2.0
Alfresco sdk 2.0Yoshi Aochi
 
Project 2 - how to compile os161?
Project 2 - how to compile os161?Project 2 - how to compile os161?
Project 2 - how to compile os161?Xiao Qin
 
Przemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy Terraform
Przemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy TerraformPrzemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy Terraform
Przemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy Terraformjzielinski_pl
 
彭盛韶/公私協力的公共服務 - 以資料面詮釋
彭盛韶/公私協力的公共服務 - 以資料面詮釋彭盛韶/公私協力的公共服務 - 以資料面詮釋
彭盛韶/公私協力的公共服務 - 以資料面詮釋台灣資料科學年會
 
2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会
2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会
2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会Miki Takata
 
Running node.js as a service behind nginx/varnish
Running node.js as a service behind nginx/varnishRunning node.js as a service behind nginx/varnish
Running node.js as a service behind nginx/varnishthiagoalessio
 
Ansible windows cheat sheet by anil.k
Ansible windows cheat sheet by anil.kAnsible windows cheat sheet by anil.k
Ansible windows cheat sheet by anil.kanilvm09
 
Databases and MySQL
Databases and MySQLDatabases and MySQL
Databases and MySQLThings Lab
 
Using Ansible as Makefiles to unite your developers
Using Ansible as Makefiles to unite your developersUsing Ansible as Makefiles to unite your developers
Using Ansible as Makefiles to unite your developersthiagoalessio
 
Managing windows Nodes like Linux Nodes by Ansible
Managing windows Nodes like Linux Nodes by AnsibleManaging windows Nodes like Linux Nodes by Ansible
Managing windows Nodes like Linux Nodes by Ansibleanilvm09
 
Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Yuriy Senko
 
Jenkins@EC2 による 継続的インテグレーション
Jenkins@EC2 による 継続的インテグレーションJenkins@EC2 による 継続的インテグレーション
Jenkins@EC2 による 継続的インテグレーションbluepapa32
 
Delivering SaaS to the Enterprise with illumos
Delivering SaaS to the Enterprise with illumosDelivering SaaS to the Enterprise with illumos
Delivering SaaS to the Enterprise with illumosEric Sproul
 
Apache FTP Server Integration
Apache FTP Server IntegrationApache FTP Server Integration
Apache FTP Server IntegrationWO Community
 
WebSocketサーバを使ってみよう! Jul 2011
WebSocketサーバを使ってみよう! Jul 2011WebSocketサーバを使ってみよう! Jul 2011
WebSocketサーバを使ってみよう! Jul 2011takanao ENODH
 

What's hot (19)

Nikita Tuk: Handling background processes in iOS: problems & solutions
Nikita Tuk: Handling background processes in iOS: problems & solutionsNikita Tuk: Handling background processes in iOS: problems & solutions
Nikita Tuk: Handling background processes in iOS: problems & solutions
 
Alfresco sdk 2.0
Alfresco sdk 2.0Alfresco sdk 2.0
Alfresco sdk 2.0
 
Project 2 - how to compile os161?
Project 2 - how to compile os161?Project 2 - how to compile os161?
Project 2 - how to compile os161?
 
Przemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy Terraform
Przemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy TerraformPrzemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy Terraform
Przemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy Terraform
 
彭盛韶/公私協力的公共服務 - 以資料面詮釋
彭盛韶/公私協力的公共服務 - 以資料面詮釋彭盛韶/公私協力的公共服務 - 以資料面詮釋
彭盛韶/公私協力的公共服務 - 以資料面詮釋
 
2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会
2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会
2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会
 
Running node.js as a service behind nginx/varnish
Running node.js as a service behind nginx/varnishRunning node.js as a service behind nginx/varnish
Running node.js as a service behind nginx/varnish
 
Ansible windows cheat sheet by anil.k
Ansible windows cheat sheet by anil.kAnsible windows cheat sheet by anil.k
Ansible windows cheat sheet by anil.k
 
Databases and MySQL
Databases and MySQLDatabases and MySQL
Databases and MySQL
 
Using Ansible as Makefiles to unite your developers
Using Ansible as Makefiles to unite your developersUsing Ansible as Makefiles to unite your developers
Using Ansible as Makefiles to unite your developers
 
Managing windows Nodes like Linux Nodes by Ansible
Managing windows Nodes like Linux Nodes by AnsibleManaging windows Nodes like Linux Nodes by Ansible
Managing windows Nodes like Linux Nodes by Ansible
 
Easy mock
Easy mockEasy mock
Easy mock
 
Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)
 
Jenkins@EC2 による 継続的インテグレーション
Jenkins@EC2 による 継続的インテグレーションJenkins@EC2 による 継続的インテグレーション
Jenkins@EC2 による 継続的インテグレーション
 
Delivering SaaS to the Enterprise with illumos
Delivering SaaS to the Enterprise with illumosDelivering SaaS to the Enterprise with illumos
Delivering SaaS to the Enterprise with illumos
 
My First MOJO Plugin
My First MOJO PluginMy First MOJO Plugin
My First MOJO Plugin
 
Apache FTP Server Integration
Apache FTP Server IntegrationApache FTP Server Integration
Apache FTP Server Integration
 
Phinx talk
Phinx talkPhinx talk
Phinx talk
 
WebSocketサーバを使ってみよう! Jul 2011
WebSocketサーバを使ってみよう! Jul 2011WebSocketサーバを使ってみよう! Jul 2011
WebSocketサーバを使ってみよう! Jul 2011
 

Similar to Deploying and Releasing Elixir/Phoenix Apps

Yaroslav Martsynyuk - Deploying Elixir/Phoenix with Distillery
Yaroslav Martsynyuk - Deploying Elixir/Phoenix with DistilleryYaroslav Martsynyuk - Deploying Elixir/Phoenix with Distillery
Yaroslav Martsynyuk - Deploying Elixir/Phoenix with DistilleryElixir Club
 
DCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDocker, Inc.
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment TacticsIan Barber
 
DockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best PracticesDockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best PracticesTibor Vass
 
DCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDocker, Inc.
 
Elixir Deployment Tools
Elixir Deployment ToolsElixir Deployment Tools
Elixir Deployment ToolsAaron Renner
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linuxtutorialsruby
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linuxtutorialsruby
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linuxtutorialsruby
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linuxtutorialsruby
 
[Cook book] ansible 4_dell emc networking
[Cook book] ansible 4_dell emc networking[Cook book] ansible 4_dell emc networking
[Cook book] ansible 4_dell emc networkingJo Hoon
 
Composer for busy developers - DPC13
Composer for busy developers - DPC13Composer for busy developers - DPC13
Composer for busy developers - DPC13Rafael Dohms
 
Oracle11g On Fedora14
Oracle11g On Fedora14Oracle11g On Fedora14
Oracle11g On Fedora14kmsa
 
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf Conference
 
Lab Zero Lunchdown: Deploying Elixir and Phoenix Applications
Lab Zero Lunchdown: Deploying Elixir and Phoenix ApplicationsLab Zero Lunchdown: Deploying Elixir and Phoenix Applications
Lab Zero Lunchdown: Deploying Elixir and Phoenix Applicationsbrien_wankel
 
Hide your development environment and application in a container
Hide your development environment and application in a containerHide your development environment and application in a container
Hide your development environment and application in a containerJohan Janssen
 

Similar to Deploying and Releasing Elixir/Phoenix Apps (20)

Yaroslav Martsynyuk - Deploying Elixir/Phoenix with Distillery
Yaroslav Martsynyuk - Deploying Elixir/Phoenix with DistilleryYaroslav Martsynyuk - Deploying Elixir/Phoenix with Distillery
Yaroslav Martsynyuk - Deploying Elixir/Phoenix with Distillery
 
DCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best Practices
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
 
DockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best PracticesDockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best Practices
 
DCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best Practices
 
Bosh 2.0
Bosh 2.0Bosh 2.0
Bosh 2.0
 
Elixir Deployment Tools
Elixir Deployment ToolsElixir Deployment Tools
Elixir Deployment Tools
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
 
[Cook book] ansible 4_dell emc networking
[Cook book] ansible 4_dell emc networking[Cook book] ansible 4_dell emc networking
[Cook book] ansible 4_dell emc networking
 
Composer for busy developers - DPC13
Composer for busy developers - DPC13Composer for busy developers - DPC13
Composer for busy developers - DPC13
 
Oracle11g On Fedora14
Oracle11g On Fedora14Oracle11g On Fedora14
Oracle11g On Fedora14
 
Oracle11g on fedora14
Oracle11g on fedora14Oracle11g on fedora14
Oracle11g on fedora14
 
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
 
Lab Zero Lunchdown: Deploying Elixir and Phoenix Applications
Lab Zero Lunchdown: Deploying Elixir and Phoenix ApplicationsLab Zero Lunchdown: Deploying Elixir and Phoenix Applications
Lab Zero Lunchdown: Deploying Elixir and Phoenix Applications
 
Hide your development environment and application in a container
Hide your development environment and application in a containerHide your development environment and application in a container
Hide your development environment and application in a container
 
IIS Web Ecosystem
IIS Web EcosystemIIS Web Ecosystem
IIS Web Ecosystem
 
RunX ELCE 2020
RunX ELCE 2020RunX ELCE 2020
RunX ELCE 2020
 

More from Wise Engineering

Transition to Infrastructure as Code
Transition to Infrastructure as CodeTransition to Infrastructure as Code
Transition to Infrastructure as CodeWise Engineering
 
Local development environment evolution
Local development environment evolutionLocal development environment evolution
Local development environment evolutionWise Engineering
 
Scheduled delivery of a large amount of emails
Scheduled delivery of a large amount of emailsScheduled delivery of a large amount of emails
Scheduled delivery of a large amount of emailsWise Engineering
 
Launch safely with Feature Flags
Launch safely with Feature FlagsLaunch safely with Feature Flags
Launch safely with Feature FlagsWise Engineering
 
Search query assistance. Autosuggestion
Search query assistance. AutosuggestionSearch query assistance. Autosuggestion
Search query assistance. AutosuggestionWise Engineering
 
Build and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane toolsBuild and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane toolsWise Engineering
 

More from Wise Engineering (6)

Transition to Infrastructure as Code
Transition to Infrastructure as CodeTransition to Infrastructure as Code
Transition to Infrastructure as Code
 
Local development environment evolution
Local development environment evolutionLocal development environment evolution
Local development environment evolution
 
Scheduled delivery of a large amount of emails
Scheduled delivery of a large amount of emailsScheduled delivery of a large amount of emails
Scheduled delivery of a large amount of emails
 
Launch safely with Feature Flags
Launch safely with Feature FlagsLaunch safely with Feature Flags
Launch safely with Feature Flags
 
Search query assistance. Autosuggestion
Search query assistance. AutosuggestionSearch query assistance. Autosuggestion
Search query assistance. Autosuggestion
 
Build and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane toolsBuild and release iOS apps using Fastlane tools
Build and release iOS apps using Fastlane tools
 

Recently uploaded

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
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 productivityPrincipled Technologies
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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...Miguel Araújo
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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 slidevu2urc
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 

Recently uploaded (20)

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 

Deploying and Releasing Elixir/Phoenix Apps

  • 1. Releasing Elixir/Phoenix get_user(“Yaroslav Martsynyuk”) |> elixir_club(12) |> kyiv() applications WISE ENGINEERING
  • 2. Distillery Is Your Friend - Inits release config - Builds release binary - Builds upgrade/downgrade tarball - Doesn’t deploy app - Doesn’t upgrade/downgrade app
  • 3. defp deps do [ {:phoenix, "~> 1.3.0"}, {:phoenix_pubsub, "~> 1.0"}, {:phoenix_ecto, "~> 3.2"}, {:phoenix_html, "~> 2.10"}, {:phoenix_live_reload, "~> 1.0", only: :dev}, {:gettext, "~> 0.11"}, {:cowboy, "~> 1.0"}, {:distillery, "~> 1.5.2"} ] end Installation
  • 4. $> MIX_ENV=prod mix release.init use Mix.Releases.Config, default_release: :web, default_environment: Mix.env() environment :prod do set include_erts: true set cookie: “ M*~{1amT9B(cG9qoi3I*a>BUS{AkC;Lb<hh~BG[g ” end release :web_app do set version: current_version(:web) end Init Release
  • 5. - Increase app version in mix.exs - Hot upgrades are possible with included ERTS only - Don’t mess up with cookie $> MIX_ENV=prod mix deps.get --only prod $> MIX_ENV=prod mix release [--upgrade] --env=prod Create Release/Upgrade
  • 6. #! /usr/bin/env V=$(grep 'version' mix.exs | cut -d'"' -f2) if["$(ssh user@host /tmp/bin/demo_app ping)" = "pong" ]; then bash ./upgrade.sh else cd ~/demo_app MIX_ENV=prod mix deps.get --only prod MIX_ENV=prod mix release --env=prod scp .../releases/${V}/demo_app.tar.gz user@host:/home/user/demo_app ssh user@host tar -xf demo_app.tar.gz -C /home/user/demo_app ssh user@host /home/user/demo_app/bin/demo_app start fi Install Script
  • 7. #! /usr/bin/env V=$(grep 'version' mix.exs | cut -d'"' -f2) cd ~/demo_app MIX_ENV=prod mix deps.get --only prod MIX_ENV=prod mix release --env=prod --upgrade scp .../releases/${V}/demo_app.tar.gz user@host:/home/user/demo_app/releases/${V} ssh user@host /home/user/bin/demo_app upgrade Upgrade Script
  • 8. OTP
  • 9. FROM elixir:1.5.2 ENV APP_NAME demo_app EXPOSE 4000 ... RUN mix deps.get RUN MIX_ENV=prod mix release.init RUN MIX_ENV=prod mix release CMD MIX_ENV=prod _build/prod/rel/demo_app/bin/web foreground Docker/Kubernetes
  • 10. apiVersion: extensions/v1beta1 kind: Deployment metadata: name: demo_app spec: strategy: type: RollingUpdate rollingUpdate: maxUnavailable: 0% maxSurge: 35% replicas: 30 ... Docker/Kubernetes