Upload
wu-fan-cheng
View
1.667
Download
2
Embed Size (px)
Citation preview
輕鬆打造持續整合開發環境
台灣攻城獅 Doro Wu | QNAP
使用 QNAP Docker
Doro Wu’s profile, https://github.com/fcwu
NAS
正常使用
• 備份資料• 下載影片• 看影片
自從知道 QNAP, A牌有支援 HDMI輸出後我就再才不買 S 牌
攻城獅使用
• Busybox!!• apt/yum !!• HDD layout!!
攻城獅觀點
這什麼怪系統
(迷之音)你可以抓他們的 toolchain自己 build 你要的東西
(心理是這麼想)不如我買台機器自己灌個Ubuntu 好了AWS, linode, Azure…
Virtualization
• 虛擬化讓我可以跑各種作業
系統
• 基於 KVM
• 網頁可直接操作 VM
• 網頁可直接瀏覽桌面 (noVNC)2014
2015
Container Station
• Light-weight, fast and small
• Same kernel
• Namespace, cgroup, capability
2015
One-Click App
一鍵架設 Docker Private Registry,GitLab,Joomla
Auto Configuration
$ docker run -p 6379 -v /data redis
ARM
LXC & Docker
輕鬆跑 Linux App真 OS
Containerized App
當一個 App 有多個 Containers時,像 GitLab
Docker compose
搭建自己的 Docker App,照官方標準作法
Custom Repo
Container API
Docker Cert
持續整合發佈
QCS我們用到了…
• Infrastructure
• Gitlab
• Jenkins
• Docker Private Registry
• Virtualization
• VirtualBox
• Vagrant
• Docker
• LXC
• Packer
• Configuration Management
• Docker Compose
• Ansible
• Fabric
• Document and Test
• Sphinx
持續整合環境
JenkinsCI Server
GitlabVCS
Testbed
Docker
Private
Registry
Archive
polling
KVM
使用 QCS 輕鬆建立 CI 基礎設施
QNAP Container Station - Create CI Environment https://youtu.be/434dTxMRyDs
Build
JenkinsCI Server
GitlabVCS
Testbed
Archive
1. polling
KVM
2. Trigger
3. Pull
5. Build
6. Artifact
Docker
Private
Registry
4. Clone
• Docker image for building image
• Docker image for uploading artifact
Deploy
JenkinsCI Server
GitlabVCS
Testbed
Archive
KVM
1. Trigger
2. Pull
3. Fetch
4. Deploy
Docker
Private
Registry
• Docker image for downloading artifact
• Docker image for deploying to target
Test
JenkinsCI Server
GitlabVCS
Testbed
Archive
KVM
1. Trigger
2. Pull
4. Test
5. Report
Docker
Private
Registry
3. Clone
• Docker image for running test suits
• Docker image for uploading image
以Container Station 為例
• 所有行為皆在 Docker container 裡完成
• 需用到的 Docker images
• Build source code and Test
• Operate archive and Deploy
• Jenkins Job 自動更新 Docker images
Automate
Automate
Build
Automate
Deploy
Automate
Test
Automate
Rebuild Docker images
開發環境
VirtualBox + Vagrant
Building on NAS
Packer template in
JSON
Run Packer on LXC Ubuntu
Provisioning with Ansible
Vagrant box Upload
KVM in Docker
Running KVM in docker container with QNAP Container Stationhttps://youtu.be/gxhBcuIFAfU
Wrap Up
• Virtualization Station
• Container Station
• ARM
• One-click App
• Auto container configuration
• Continuous Integration
• Gitlab, Jenkins, Docker Private Registry
• Everything is running on container