How to deploy Docker containers with Fabricio.
Fabricio supports image building, container creation and update, applying migrations, rollback, backup and restore.
Link to the project: https://github.com/renskiy/fabricio
Streamline your development environment with dockerGiacomo Bagnoli
These days applications are getting more and more complex. It's becoming quite
difficult to keep track of all the different components an application needs in order to
function (a database, a message queueing system, a web server, a document
store, a search engine, you name it.). How many times we heard 'it worked on my
machine'?. In this talk we are going to explore Docker, what it is, how it works
and how much it can benefit in keeping the development environment consistent.
We are going to talk about Dockerfiles, best practices, tools like fig and vagrant,
and finally show an example of how it applies to a ruby on rails
application.
Big query - Command line tools and Tips - (MOSG)Soshi Nemoto
BigQuery =Command line tools and Tips for business use=
Mulodo Open Study Group (MOSG) @Ho chi minh, Vietnam
http://www.meetup.com/Open-Study-Group-Saigon/events/231504491/
The perl on most linux distros is a mess. Docker makes it easier to build and packge a local perl and applications. Problem is that Docker's manuals produce a mess of their own.
Distributing perl on top of Gentoo's stage3 distro, busybox, or nothing at all made good alternatives. This talk includes basics of setting up docker, building a local perl for it, and packaging perl or applications into images for use in containers.
PuppetCamp SEA 1 - Version Control with PuppetWalter Heck
Choon Ming Goh, System Administrator at OnApp Malaysia, gave a presentation on how OnApp implements version control. Since they have quite a few repositories, this is all puppetised and that is quite a nice way of doing version control.
Walter Heck, founder of OlinData, presented a step-by-step guide on how to set up a proper puppet repository, complete with the brand new PuppetDB, exported resources and usage of open source modules.
PuppetCamp SEA 1 - Puppet Deployment at OnAppWalter Heck
Wai Keen Woon, CTO CDN Division OnApp Malaysia, gave an interesting overview of what the Puppet architecture at OnApp looks like. The CDN division at OnApp is a large provider of CDN services, and as such makes a very interesting candidate for a case study.
Streamline your development environment with dockerGiacomo Bagnoli
These days applications are getting more and more complex. It's becoming quite
difficult to keep track of all the different components an application needs in order to
function (a database, a message queueing system, a web server, a document
store, a search engine, you name it.). How many times we heard 'it worked on my
machine'?. In this talk we are going to explore Docker, what it is, how it works
and how much it can benefit in keeping the development environment consistent.
We are going to talk about Dockerfiles, best practices, tools like fig and vagrant,
and finally show an example of how it applies to a ruby on rails
application.
Big query - Command line tools and Tips - (MOSG)Soshi Nemoto
BigQuery =Command line tools and Tips for business use=
Mulodo Open Study Group (MOSG) @Ho chi minh, Vietnam
http://www.meetup.com/Open-Study-Group-Saigon/events/231504491/
The perl on most linux distros is a mess. Docker makes it easier to build and packge a local perl and applications. Problem is that Docker's manuals produce a mess of their own.
Distributing perl on top of Gentoo's stage3 distro, busybox, or nothing at all made good alternatives. This talk includes basics of setting up docker, building a local perl for it, and packaging perl or applications into images for use in containers.
PuppetCamp SEA 1 - Version Control with PuppetWalter Heck
Choon Ming Goh, System Administrator at OnApp Malaysia, gave a presentation on how OnApp implements version control. Since they have quite a few repositories, this is all puppetised and that is quite a nice way of doing version control.
Walter Heck, founder of OlinData, presented a step-by-step guide on how to set up a proper puppet repository, complete with the brand new PuppetDB, exported resources and usage of open source modules.
PuppetCamp SEA 1 - Puppet Deployment at OnAppWalter Heck
Wai Keen Woon, CTO CDN Division OnApp Malaysia, gave an interesting overview of what the Puppet architecture at OnApp looks like. The CDN division at OnApp is a large provider of CDN services, and as such makes a very interesting candidate for a case study.
Ironically, our life is an open book!
Whether, you are looking for 2016 Corporate or Customized Diaries, Calendars, Notebooks, Agendas, Organizers, Gift Boxes, Gift Sets, Gift Boxes, Corporate Gifts, Promotional Gift Items.... You name it, we got it!
You definitely came to the right place!
Customized extensively; from your Company Name and Logo Embossed or Foiled on the Cover, to advertising inserts featuring your products and services, Tellurian Diaries are the perfect promotional business gift that will complement your branding by leaving a long lasting impression on your clients and partners. Along with the diaries, we create Desk Planners, Desk Calendars and Sloppy Pads that can be assembled to create the ideal Gift Set for all Occasions and Events, add to that our High End Customized NoteBooks and Organizers, our Certificate Holders, our Luxurious Ramadan Gift Sets, Executive Sets and VIP sets.
This year we bring to you Tellurian Hospitality, providing the most comprehensive products that best represents your hospitality business or your hotel. All Restaurant and Hotel accessories are manufactured in Dubai with the finest PU material to the highest standards.
Our satisfied customers range from banks and financial institutions, government offices and ministries, NGOs, real estate companies, pharmaceutical corporations to advertising agencies, restaurants, hotels, schools, etc…
Just imagine what you would want your product to look like, and our team will create custom designs and find innovative solutions for you.
With Tellurian Diaries and One-Off Gifts, your company is certain to be remembered every day of the year.
Voluntrme.com is a platform that connects people with volunteering projects. Voluntrme is crowd service similar like Kickstarter and Indiegogo. However, Voluntrme do crowdsourcing people. Project will be executed only when it has enough people.
Docker Essentials Workshop— Innovation Labs July 2020CloudHero
This presentation was the foundation of our Docker Essentials workshop hosted by CloudHero CEO & founder Andrei Manea for the Innovation Labs team on the 23rd of July 2020.
This presentation covers the following topics:
-Getting started with containers
-A bit of history about orchestration
-Introduction to services (what they are, how to create and scale them).
To find out more about this topic, check https://cloudhero.io/
Bartosz Tkaczewski - Przygód z Dockerem ciąg dalszy
http://www.tsh.io
Docker jest zauważalny już niemal wszędzie. Na prezentacji zobaczysz działające środowisko developerskie, poznasz kilka sztuczek, jak sobie z nim dobrze radzić i efektywnie pracować, zobaczysz też, jak szybko można prosty projekt wzbogacić o zaawansowane stacki aplikacji (na przykładzie ELK). Postaram się również opowiedzieć, jak można sobie z tym potworkiem poradzić na produkcji.
Prezentacja z Uszanowanka Programowanka #16 - http://www.meetup.com/Uszanowanko-Programowanko/events/234826115/
In this deck from the Stanford HPC Conference, Christian Kniep from Docker, Inc. gives a tutorial on linux containers.
"This tutorial provides a detailed overview of the components needed to run containerized applications and explores how distributed HPC applications can be tackled. We’ll explain the concept of Linux Containers and describe the bits and pieces participants will explore following step-by-step examples.
The workshop will introduce the predominant forms of orchestration in the industry; what problems they solve and how to approach the problem.
Attendees will explore the benefits and drawbacks of orchestrators first hand with their own small exemplary stack deployments.
Finally the workshop will introduce how HPC and Big Data workloads can be tackled on-top of these service-oriented clusters."
Watch the video: https://youtu.be/LJinZpCTyk0
Learn more: http://www.docker.com/
and
http://hpcadvisorycouncil.com
Sign up for our insideHPC Newsletter: http://insidehpc.com/newsletter
Dockerizing Symfony2 application. Why Docker is so cool And what is Docker? And what are Containers? How they works? What are the ecosystem of Docker? And how to dockerize your web application (can be based on Symfony2 framework)?
About 94% of AI Adopters are planning to use containers in the next 1 year. What’s driving this exponential growth? Faster time to deployment and Faster AI workload processing are the two major reasons. You can use GPUs in big data applications such as machine learning, data analytics, and genome sequencing. Docker containerization makes it easier for you to package and distribute applications. You can enable GPU support when using YARN on Docker containers. In this talk, I will demonstrate how Docker accelerates the AI workload development and deployment over the IoT Edge devices in efficient manner
This presentation session will go through the basics of Docker and illustrate its importance in modern DevOps. It will also go through a step-by-step demo of setting up a Docker image for the LAMP stack (Linux, Apache, MySQL, PHP) together with a working sample application.
Slides & codes: http://bit.ly/thomasdocker
Pluralsight Webinar: Simplify Your Project Builds with DockerElton Stoneman
Docker containers give you a consistent way to package and run your applications, but they can also power up your software builds. Join Pluralsight author and Docker Captain Elton Stoneman to learn how to compile apps inside containers—making Docker your build server and ditching the need to install any SDKs or runtimes to build and run your app from source.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
6th International Conference on Machine Learning & Applications (CMLA 2024)ClaraZara1
6th International Conference on Machine Learning & Applications (CMLA 2024) will provide an excellent international forum for sharing knowledge and results in theory, methodology and applications of on Machine Learning & Applications.
We have compiled the most important slides from each speaker's presentation. This year’s compilation, available for free, captures the key insights and contributions shared during the DfMAy 2024 conference.
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
Water billing management system project report.pdfKamal Acharya
Our project entitled “Water Billing Management System” aims is to generate Water bill with all the charges and penalty. Manual system that is employed is extremely laborious and quite inadequate. It only makes the process more difficult and hard.
The aim of our project is to develop a system that is meant to partially computerize the work performed in the Water Board like generating monthly Water bill, record of consuming unit of water, store record of the customer and previous unpaid record.
We used HTML/PHP as front end and MYSQL as back end for developing our project. HTML is primarily a visual design environment. We can create a android application by designing the form and that make up the user interface. Adding android application code to the form and the objects such as buttons and text boxes on them and adding any required support code in additional modular.
MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software. It is a stable ,reliable and the powerful solution with the advanced features and advantages which are as follows: Data Security.MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software.
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
HEAP SORT ILLUSTRATED WITH HEAPIFY, BUILD HEAP FOR DYNAMIC ARRAYS.
Heap sort is a comparison-based sorting technique based on Binary Heap data structure. It is similar to the selection sort where we first find the minimum element and place the minimum element at the beginning. Repeat the same process for the remaining elements.
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
9. 10
DEPLOY TOOL REQUIREMENTS
Arbitrary environment support
Easy adaptation (copy/paste)
Easy customization
No special education or experience requirements
Docker support
DB migrations apply and rollback
Support of private registry and complex networks
11. 12
FABRICIO DEPLOY CONFIG EXAMPLE
# fabfile.py
from fabricio import docker, tasks
class NginxContainer(docker.Container):
image = docker.Image('nginx:1.9')
ports = '80:80'
nginx = tasks.DockerTasks(
container=NginxContainer(name='web'),
hosts=['user@example.com'],
)
12. 13
FABRICIO DEPLOY PROCESS
$ fab --list
Available commands:
nginx backup -> pull -> migrate -> update
nginx.deploy backup -> pull -> migrate -> update
nginx.pull pull Docker image from registry
nginx.rollback rollback Docker container to previous version
nginx.update start new Docker container if necessary
$ fab nginx
[user@example.com] Executing task ‘pull’
[user@example.com] run: docker pull nginx:stable
[user@example.com] out: 1.9: Pulling from library/nginx
...
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ec44b023adf0 nginx:1.9 "nginx -g" 2 minutes ago Up 2 minutes 0.0.0.0:80->80/tcp web
13. 14
FABRICIO FEATURES
Build Docker images
Create containers from images with provided tags
Unlimited infrastructures
Parallel execution (Fabric feature)
Rollback containers to previous version
Work with public and private Docker registries
DB migrations and rollback, backup and restore
14. 15
FABRICIO COMMAND PARAMS
# show detailed information about command
$ fab --display nginx
Displaying detailed information for task 'nginx':
backup -> pull -> migrate -> update
Arguments: self, tag=None, force=False, migrate=True, backup=False
# deploy container using image with provided tag
$ fab nginx:1.10
# force new container
$ fab nginx:force=yes
# combo!
$ fab nginx:1.10,force=yes
# rollback container to previous version
$ fab nginx.rollback
16. 18
FABRICIO AND PRIVATE DOCKER REGISTRY
# start local Docker registry
$ docker run -d -p 5000:5000 --name registry -v /data/registry:/var/lib/registry registry:2
nginx = tasks.PullDockerTasks(
container=NginxContainer('web'),
hosts=['user@example.com'],
)
$ fab --list
Available commands:
nginx prepare -> push -> backup -> pull -> migrate -> update
nginx.deploy prepare -> push -> backup -> pull -> migrate -> update
nginx.prepare prepare Docker image
nginx.pull pull Docker image from registry
nginx.push push Docker image to registry
nginx.rollback rollback Docker container to previous version
nginx.update start new Docker container if necessary
17. 19
BUILD DOCKER IMAGES WITH FABRICIO
class MyContainer(docker.Container):
image = docker.Image('my_image')
app = tasks.BuildDockerTasks(
container=MyContainer('my_service'),
hosts=['user@example.com'],
build_path='.',
)
$ fab --list
Available commands:
app prepare -> push -> backup -> pull -> migrate -> update
app.deploy prepare -> push -> backup -> pull -> migrate -> update
app.prepare prepare Docker image
app.pull pull Docker image from registry
app.push push Docker image to registry
app.rollback rollback Docker container to previous version
app.update start new Docker container if necessary
18. 20
FABRICIO ROLES AND INFRASTRUCTURES
from fabric import api as fab
@tasks.infrastructure
def production():
fab.env.update(roledefs={'front': ['user@example.com']})
nginx = tasks.DockerTasks(
container=NginxContainer(name='web'),
roles=['front'],
)
$ fab --list
Available commands:
production select production infrastructure to run task(s) on
production.confirm automatically confirm production infrastructure selection
...
$ fab production nginx
Are you sure you want to select production infrastructure to run task(s) on? [y/N]
19. 21
FABRICIO: DEPLOYING DJANGO PROJECTS
from fabric import api as fab
from fabricio import docker, tasks
from fabricio.apps.python.django import DjangoContainer
class BaseDjangoContainer(DjangoContainer):
image = docker.Image('my_django')
@property
def env(self):
return 'DJANGO_SETTINGS_MODULE=settings.{}'.format(
fab.env.infrastructure,
)
django = tasks.BuildDockerTasks(
container=BaseDjangoContainer('api'),
hosts=['user@example.com'],
migrate_commands=True,
)
20. 22
FABRICIO: DEPLOYING DJANGO PROJECTS
$ fab --list
Available commands:
django prepare -> push -> backup -> pull -> migrate -> update
django.deploy prepare -> push -> backup -> pull -> migrate -> update
django.migrate apply migrations
django.migrate_back remove previously applied migrations if any
django.prepare prepare Docker image
django.pull pull Docker image from registry
django.push push Docker image to registry
django.rollback rollback Docker container to previous version
django.update start new Docker container if necessary
21. 23
FABRICIO: DATA BACKUP AND RESTORE
from fabricio.apps.db.postgres import PostgresqlBackupMixin
class BackupDjangoContainer(BaseDjangoContainer,
PostgresqlBackupMixin):
volumes = '/data/backup/postgres:/backup'
db_backup_dir = '/backup'
django = tasks.BuildDockerTasks(
container=BackupDjangoContainer('api'),
hosts=['user@example.com'],
backup_commands=True,
)
$ fab --list
Available commands:
django.backup backup data
django.restore restore data
...
25. 27
USEFUL LINKS & QUESTIONS
Fabricio: https://github.com/renskiy/fabricio
Author of Fabricio: https://www.facebook.com/rinat.khabibiev
Хабра-блог Redmadrobot: https://habrahabr.ru/company/redmadrobot
Redmadrobot on Facebook: https://www.facebook.com/redmadrobot
The 12-factor App (SaaS dev patterns): https://12factor.net
Docker image with cron: https://hub.docker.com/r/renskiy/cron
Questions
Editor's Notes
Всем привет, спасибо что пришли на мой доклад. Сегодня мы погорим об автоматическом деплое Docker контейнеров.
Итак, меня зовут Ринат Хабибиев. Я являюсь руководителем отдела веб-разработки в компании Remadrobot.
Мы разрабатываем комплексные решения для российских и зарубежных заказчиков. Такие решения состоят из мобильного и веб приложений, а также бэкенда.
Начнем с небольшой статистики.
Обратим внимание на количество звед github, и этого всего за 3 года - по моему впечатляющее достижение!
Немного о грустном.
Многие наши заказчики недоверчиво относятся к Docker, не только потому что это технология молодая, но также Open Source.
Еще одна досада - это слегка увеличенные сетевые задержки.
И все же преимуществ больше. Среди них:
Упрощенные требования к инфраструктуре (нужен только Docker).
Более логичная система интеграции с CI/CD (образ работает одинаково на всех хостах, где установлен Docker).
Не нужен доступ в интернет, чтобы обновить зависимости.
Еще 12 факторов, перечисленных на 12factor.net.
1.5 года назад мы решили полностью перейти на Docker.
Но такой переход был сопряжен с рядом трудностей. Например, не все образы сразу можно найти на Docker Hub.
А если бы переход был неполный, то это не только не упростило бы нам работу, но добавило бы дополнительную по поддержке зоопарка технологий.
Однако, мы удачно справились со всеми трудностями, и на текущий момент три проекта нашей разработки работают в Docker контейнерах.
До перехода на Docker использовали Vagrant для запуска сервисов и разворачивания тестового сервера.
Потом приспособили Fabric. Fabric занимает один модуль.
После того, как появилась время заняться оптимизацией:
Ansible - YAML, требует специально обучения.
Capistrano - нет преимуществ над Fabric.
Docker Compose и Kubernetes - также YAML, плюс делают упор на оркестрации.
Остальное (Chef, Puppet, Salt и пр.) не стали рассматривать из-за чрезмерной сложности.
Мы так и не смогли подобрать удобного для себя инструмента.
Зато поиск решения привел к созданию списка требований и пожеланий к такой системе.
поддержка любых типов инфраструктуры: от dev и test до production
адаптация конфигов под новый проект (копи-паст рулит)
кастомизация под нужды проекта должна быть фичей, а не костылем
отсутствие необходимости переучиваться
поддержка Docker
миграция и их откат
работа с Docker Hub и приватными Registry для защищенных сетей
Правильно сформулированные требования - это половина успешного продукта.
А потому я принял решение о разработке совершенного нового инструмента для деплоя, непохожего на все то, что мы рассматривали.
Знакомтесь, Fabricio - средство для автоматизации деплоя на базе Fabric.
Большое внимание при его разработке уделяется стабильности и отсутствию ошибок, что достигается за счет высокого покрытия автоматическими тестами.
Как это принято при знакомстве с новым инструментом, сразу простой пример - разворачивание контейнера с Nginx на 80-м порту.
Свойства контейнера задаются при помощи специального класса, который описывает контейнер.
Внизу на уровне модуля создается сущность с описанием доступных команд Fabric.
Интеграция с Fabric означает работу всех его возможностей.
Например, для вывода списка доступных задач набираем fab -l.
Выполнить команду просто - достаточно указать ее название.
Внизу результат выполнения команды «fab nginx».
Кратко перечислю основные возможности Fabricio
сборка образов Docker из исходников
поддержка тегов
поддержка произвольного количества и типа инфраструктур
параллельная выкладка контейнера на несколько хостов
откат контейнера к предыдущей версии
работа с публичными и приватными репозиториями образов Docker
применение и откат миграций, а также бэкап и восстановление
Актуальный список всегда можно найти на странице проекта в Github
Почти все команды Fabricio содержат опциональные параметры.
Список параметров и значений по-умолчанию смотрим при помощи опции --display.
Можно использовать позиционный способ указания параметра и через keyword - все как в Python.
Перечисление параметров через запятую.
Обращение к нижестоящей по иерархии команде через точку.
Стандартный набор свойств контейнера можно увидеть в описании базового класса.
Большинство свойств можно передать в конструктор при создании экземпляра контейнера, либо переопределить их в потомках.
Когда я говорил о поддержке сложных сетевых конфигураций, я имел в виду тот факт, что целевая инфраструктура может быть настолько сильно защищена от внешнего воздействия, что порой на ней нет даже доступа в Интернет, либо он ограничен буквально несколькими доверенными сайтами, на которых хранятся критически важные обновления системы. А потому закачать, скажем, свежий образ приложения на боевой сервер становится довольно проблематично, не говоря уже о том, что сборка образа на самом сервере в таких условиях вообще невозможна.
В таких случаях нас выручает возможность установить SSH туннель между боевым сервером и компьютером администратора, у которого как правило нет ограничений на выход в Интернет. Нам повезло, что Fabric из коробки умеет устанавливать такой туннель, обеспечивая необходимый доступ к ресурсам с боевой инфраструктуры. Но есть одна проблема: даже при установке SSH туннеля демон Докера не может скачать образ из основного репозитория (hub.docker.com). Это связано с особенностью работы сетевых балансировщиков и маршрутизаторов, которые ожидают, что в заголовке Host клиент укажет доменное имя того хоста, к которому он хочет обратиться. Через туннель этот заголовок выставляется неверно, соответственно, запрос на скачивание образа Docker не доходит до нужного сервера.
Проблему в принципе можно решить переопределяя доменные имена в /etc/hosts, заворачивая их в localhost. Есть даже специальные расширения для Linux, которые позволяют установить, доменные алиасы для отдельного пользователя системы. Но я думаю многие со мной согласятся, что это не очень удобный способ.
Одной из самых интересных возможностей Fabricio является поддержка защищенных сетей (у которых нет прямого доступа к Docker Hub). Она реализована при помощи промежуточного Registry.
По-умолчанию, используется Registry запущенный локально, как в этом примере.
Применяется другой класс задач, который расширяет список двумя дополнительными командами: prepare и push.
prepare готовит образ, то есть скачивать его из основного репозитория, а push скачивает образ в промежуточный, доступ к которому с защищенной инфраструктуры обеспечивается через SSH туннель.
Для сборки образов используется еще один класс задач, в который можно передать путь до папки с Dockerfile.
В остальном отличий от предыдущего кейса нет.
Мощным инструментом Fabricio являются роли и поддержка различных инфраструктур.
И если роли наследуются от Fabric, то поддержка инфраструктур реализуются при помощи декоратора, которым можно обернуть специальную функцию, подготавливающую текущее окружение для работы с соответствующей инфраструктурой.
Применение этого декоратора создает дополнительные команды, предназначенные для выбора инфраструктуры. Для этого, одну из этих команд надо выполнить перед всеми остальными.
Каждый ORM фреймворк имеет свои собственные механизмы применения и отката миграций.
Единственный фреймворк, который пока поддерживается Fabricio - это Django.
Вся логика прозрачно инкапсулирована в специальном типе контейнера и автоматически задействуется при деплое и откате.
Применение и откат миграций осуществляется автоматически, но есть возможность вызвать команды вручную при помощи migrate и migrate_back.
В Fabricio также реализован простейший механизм бэкапа и восстановления для PostgreSQL на основе pg_dump и pg_restore.
Весь функционал реализован в отдельном классе и может быть при необходимости использован как примесь.
Если я смог вас заинтересовать, то вам наверняка будет интересно что требуется для работы Fabricio.
Использование Python 2 здесь обусловлено возможностями самого Fabric, который пока не осуществил переход на 3-ю версию.
Также для работы требуется установленный консольный клиент для Docker.
На хосте должна быть установлена соответствующая версия Docker, от версии зависит работоспособность некоторых опций.
Поддержка деплоя Master-Slave конфигураций PostgreSQL
Поддержка Docker Swarm
Интеграция с docker-py
Возможно MySQL
И другие отличные от Django фреймворки
О стоимости и ограничениях.
Спешу обрадовать, что Fabricio абсолютно бесплатен и не обладает какими-либо ограничениями на использование.
Полезные ссылки
Вопросы?
Одной из самых насущных проблем стала автоматизация деплоя.
Часто этим словом определяют совокупность трех операций: провизионинга, оркестрации и собственно сам деплоя.
Провизионинг - это подготовка сервера к работе (например, установка на нем Docker).
Оркестрация - описание конфигов взаимодействия контейнеров между собой и окружающей инфраструктурой.
А деплой - это процесс запуска нового контейнера из свежего образа.