aptly - система управления Debian-репозиториями пакетов

581 views

Published on

aptly is a swiss army knife for Debian repository management: it allows to mirror remote repositories, take snapshots, pull new versions of packages along with dependencies, publish snapshots.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
581
On SlideShare
0
From Embeds
0
Number of Embeds
83
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

aptly - система управления Debian-репозиториями пакетов

  1. 1. aptly - система управления Debianрепозиториями пакетов Андрей Смирнов,
 DevOps Meetup Moscow Jan’14
  2. 2. Повторяемость!
  3. 3. Изменения
  4. 4. Окружение
  5. 5. Повторяемость окружения
  6. 6. Изменение окружения
  7. 7. Повторяемость изменений окружения
  8. 8. Окружение - 
 набор пакетов
  9. 9. Версии окружения development staging testing production
  10. 10. Управление окружением Debian
 repo apt-sources apt-get backports aptpreferences 3rd-party
 repo
  11. 11. Не та версия…
  12. 12. apt pinning поможет!
  13. 13. No…
  14. 14. Цель • Зафиксированный репозиторий пакетов (повторяемость) • Контролируемые изменения версий (изменений)
  15. 15. aptly * не является заменой apt, dpkg!
  16. 16. Сущности mirror – зеркало удаленного репозитория snapshot – неизменяемый срез набора пакетов published
 repo – опубликованный репозиторий пакетов
  17. 17. mirror take snapshot pull snapshot snapshot update diff take snapshot local
 repo verify published
 repo snapshot publish merge snapshot
  18. 18. aptly mirror $ aptly mirror create wheezy-main http://mirror.yandex.ru/ debian/ wheezy main Downloading http://mirror.yandex.ru/debian/dists/wheezy/ Release... ! Mirror [mirror1]: http://mirror.yandex.ru/debian/ wheezy successfully added. You can run 'aptly mirror update mirror1' to download repository contents.
  19. 19. aptly mirror $ aptly mirror update wheezy-main Downloading http://mirror.yandex.ru/debian/dists/wheezy/ Release... Downloading & parsing package files... Downloading http://mirror.yandex.ru/debian/dists/wheezy/ main/binary-i386/Packages.bz2... Downloading http://mirror.yandex.ru/debian/dists/wheezy/ main/binary-amd64/Packages.bz2... Saving packages to database... Building download queue... Download queue: 0 items, 0.00 GiB size ! Mirror `wheezy-main` has been successfully updated.
  20. 20. mirror update
  21. 21. aptly snapshot $ aptly snapshot create deb-main-250114 from mirror wheezymain ! Snapshot deb-main-250114 successfully created. You can run 'aptly publish snapshot deb-main-250114' to publish snapshot as Debian repository.
  22. 22. mirror update take snapshot snapshot
  23. 23. aptly snapshot pull $ aptly snapshot pull deb-main-250114 percona-250114 deb-wpercona 'percona-server-server (>=5.5)’ … [+] [+] [+] [+] [-] [+] [+] [+] [+] [+] [-] [+] percona-server-server-5.5.35-rel33.0-611.wheezy_amd64 added percona-server-server-5.5-5.5.35-rel33.0-611.wheezy_amd64 added percona-server-client-5.5-5.5.35-rel33.0-611.wheezy_amd64 added percona-server-common-5.5-5.5.35-rel33.0-611.wheezy_amd64 added libmysqlclient18-5.5.31+dfsg-0+wheezy1_amd64 removed libmysqlclient18-5.5.35-rel33.0-611.wheezy_amd64 added percona-server-server-5.5.35-rel33.0-611.wheezy_i386 added percona-server-server-5.5-5.5.35-rel33.0-611.wheezy_i386 added percona-server-client-5.5-5.5.35-rel33.0-611.wheezy_i386 added percona-server-common-5.5-5.5.35-rel33.0-611.wheezy_i386 added libmysqlclient18-5.5.31+dfsg-0+wheezy1_i386 removed libmysqlclient18-5.5.35-rel33.0-611.wheezy_i386 added
  24. 24. aptly snapshot pull $ aptly snapshot pull aptly snapshot pull deb-main-250114 back-250114 deb-w-xorg rsyslog … [-] [+] [-] [+] [+] [-] [+] [-] [+] rsyslog-5.8.11-3_amd64 removed rsyslog-7.4.4-1~bpo70+1_amd64 added libestr0-0.1.1-2_amd64 removed libestr0-0.1.9-1~bpo70+1_amd64 added init-system-helpers-1.11~bpo70.1_all added rsyslog-5.8.11-3_i386 removed rsyslog-7.4.4-1~bpo70+1_i386 added libestr0-0.1.1-2_i386 removed libestr0-0.1.9-1~bpo70+1_i386 added
  25. 25. mirror take snapshot pull update snapshot snapshot snapshot
  26. 26. aptly snapshot diff $ aptly snapshot diff deb-main-250114 deb-w-percona ! + + + + ! + + + + Arch amd64 amd64 amd64 amd64 amd64 i386 i386 i386 i386 i386 | | | | | | | | | | | Package libmysqlclient18 percona-server-client-5.5 percona-server-common-5.5 percona-server-server percona-server-server-5.5 libmysqlclient18 percona-server-client-5.5 percona-server-common-5.5 percona-server-server percona-server-server-5.5 | | | | | | | | | | | Version in A 5.5.31+dfsg-0+wheezy1 5.5.31+dfsg-0+wheezy1 - | | | | | | | | | | | Version in B 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy 5.5.35-rel33.0-611.wheezy
  27. 27. mirror take snapshot pull snapshot update diff snapshot snapshot
  28. 28. aptly snapshot verify $ aptly snapshot verify deb-w-percona Missing dependencies (13): fenix [amd64] fenix-plugins-system [amd64] ia32-libs-i386 [amd64] ia32-libs-gtk-i386 [amd64] vidcontrol [amd64] kbdcontrol [amd64] libmysqlclient18 (= 5.5.31+dfsg-0+wheezy1) [amd64] scsh-0.6 (>= 0.6.6) [amd64] scsh-0.6 [amd64] mozart (>= 1.4.0) [amd64] libmysqlclient18 (= 5.5.31+dfsg-0+wheezy1) [i386] vidcontrol [i386] kbdcontrol [i386]
  29. 29. mirror take snapshot pull snapshot update diff snapshot snapshot verify
  30. 30. aptly snapshot merge $ aptly snapshot merge deb-w-percona-250114 deb-main-250114 percona-250114 ! Snapshot deb-w-percona-250114 successfully created. You can run 'aptly publish snapshot deb-w-percona-250114' to publish snapshot as Debian repository.
  31. 31. mirror take snapshot pull snapshot snapshot update diff snapshot merge snapshot verify
  32. 32. aptly publish snapshot $ aptly publish snapshot -distribution=wheezy percona-250114 Signing file '/Users/smira/.aptly/public/dists/wheezy/ Release' with gpg, please enter your passphrase when prompted: ! … ! Snapshot percona-250114 has been successfully published. Please setup your webserver to serve directory '/Users/ smira/.aptly/public' with autoindexing. Now you can add following line to apt sources: deb http://your-server/ wheezy main Don't forget to add your GPG key to apt with apt-key.
  33. 33. mirror take snapshot pull snapshot verify snapshot update diff published
 repo snapshot publish merge snapshot
  34. 34. Что планируется • Поиск • Фильтры при выполнении операций • Управление локальными репозиториями (добавление “своих” пакетов) • Поддержка source-пакетов и translations • Верифицирование удаленных репозиторев
  35. 35. Что не работает пока • удаление • bash-completion • flat-репозитории • прогресс скачивания
  36. 36. Конкуренты • mirror: ftpsync, reprepro, debmirror, apt-mirror, aptcache… • archive generation: dak, mini-dak, reprepro, …
  37. 37. Внутренности • Написано на Go • База данных - LevelDB • Файлы пакетов хранятся один раз
  38. 38. Внутренности • ~/.aptly.conf - конфигурация • ~/.aptly/ - рабочий каталог по умолчанию • db/ - база данных (мета-информация) • pool/ - хранилище файлов • public/ - опубликованные репозитории
  39. 39. Ссылки • http://www.aptly.info/ • https://github.com/smira/aptly/ • @smira • me@smira.ru • Skype: smirnov.andrey

×