SlideShare a Scribd company logo
let swift(16)
Docker + Swift Server-Side
OSXDEV.orgByungwook Ahn
OSXDEV.orgWonseok Yang
1
2
Experienced
Device driver(windows, linux)
Media streaming
CDN
Docker
Letswift Conf. 2016 Speaker
Tensorflow-KR 2016 Speaker
PyCon Hongkong 2015 Speaker
PyCon Korea 2015 Speaker
3
Agenda
WWDC 2016 - swift session
Server-Side?
Swift backend framework
VirtualBox, Kitura, Docker
myFirstProject
Demo
Summary
4
WWDC 2016 - swift session
Swift
What’s New in Swift : https://developer.apple.com/videos/play/wwdc2016/402/
Client-Side
What’s New in Foundation for Swift : https://developer.apple.com/videos/play/wwdc2016/207/
Getting Started with Swift : https://developer.apple.com/videos/play/wwdc2016/404/
Introducing Swift Playgrounds : https://developer.apple.com/videos/play/wwdc2016/408/
Swift API Design Guidelines : https://developer.apple.com/videos/play/wwdc2016/403/
Understanding Swift Performance : https://developer.apple.com/videos/play/wwdc2016/416/
Concurrent Programming With GCD in Swift 3 : https://developer.apple.com/videos/play/
wwdc2016/720/
Using Store Kit for In-App Purchase wit Swift 3 : https://developer.apple.com/videos/play/
wwdc2016/702/
Server-Side
Going Server-side with Swift Open Source : https://developer.apple.com/videos/play/
wwdc2016/415/
Software Engineer
@red
5
Server-Side?
Backend Web Framework
Web Framework?
Ajax asynchronous Javascript and XML
MVC framework Model/View/Controller
i18n Internationalization ( ex:date … )
ORM Object Relational Mapping(RDB)
Testing framework Framework JUnit, Cedar…
Security Framework Spring Security(OAuth)
Template Framework Mustache
Caching Framework redis, Ehcache
6
Kitura Perfect
Hosted IBM perfect.org
latest version v0.20.0 v1.0.0
started date Feb 9, 2016 Oct 3, 2015
License Apache 2.0 Apache 2.0
MySQL O O
SQLite O O
Redis O O
HTTP URL routing O O
Parmeter Parsing O O
JSON O O
OAuth Kitura-Credentials -
Package/3rdParty Library Many ?
Swift backend framework
Most popular Swift backend framework : Zewo,Vapor…
let swift(16)
VirtualBox, Kitura, Docker
https://github.com/bwahn/letswift2016-conference
8
VirtualBox(vagrantfile)
# -*- mode: ruby -*-
# vi: set ft=ruby :
BOX_URL = 'https://cloud-images.ubuntu.com/vagrant/wily/current/wily-server-cloudimg-amd64-vagrant-
disk1.box'.freeze
SWIFT_PATH = 'https://swift.org/builds/development/ubuntu1510/swift-DEVELOPMENT-
SNAPSHOT-2016-06-06-a'.freeze
SWIFT_DIRECTORY = 'swift-DEVELOPMENT-SNAPSHOT-2016-06-06-a-ubuntu15.10'.freeze
SWIFT_FILE = "#{SWIFT_DIRECTORY}.tar.gz".freeze
SWIFT_HOME = "/home/vagrant/#{SWIFT_DIRECTORY}".freeze
LIBDISPATCH_URL = '-b experimental/foundation https://github.com/apple/swift-corelibs-libdispatch'.freeze
KITURA_URL = 'https://github.com/IBM-Swift/Kitura.git'.freeze
KITURA_BRANCH = 'master'.freeze
Vagrant.configure(2) do |config|
config.vm.box = BOX_URL
config.vm.network 'forwarded_port', guest: 8090, host: 8090
Swift 3.0
For Restful-APIs
9
KITURA master
###
# 1. Install compiler, autotools
sudo apt-get --assume-yes install clang
sudo apt-get --assume-yes install autoconf libtool pkg-config
# 2. Install dtrace (to generate provider.h)
sudo apt-get --assume-yes install systemtap-sdt-dev
# 3. Install libdispatch pre-reqs
sudo apt-get --assume-yes install libblocksruntime-dev libkqueue-dev libpthread-
workqueue-dev libbsd-dev
# 4. Kitura packages
sudo apt-get --assume-yes install libhttp-parser-dev libcurl4-openssl-dev libhiredis-dev
Install packages
10
11
### Download and install Kitura
git clone #{KITURA_URL} -b #{KITURA_BRANCH}
cd Kitura
swift build -Xcc -fblocks
cd ..
$ vagrant up
let swift(16)
myFirstProject
13
$ vagrant ssh
vagrant@vagrant-ubuntu-wily-64: $ mkdir myFirstProject
vagrant@vagrant-ubuntu-wily-64: $ cd myFirstProject
vagrant@vagrant-ubuntu-wily-64: $ swift package init
14
$ vi package.swift
import PackageDescription
let package = Package(
name: "myFirstProject",
dependencies: [
.Package(url: "https://github.com/IBM-Swift/Kitura.git",
majorVersion: 0, minor: 20)
])
15
$ vi Sources/main.swift
import Kitura
let router = Router()
router.get("/") {
request, response, next in
response.send("Hello, World!")
next()
}
Kitura.addHTTPServer(onPort: 8090, with: router)
Kitura.run()
$ swift build -Xcc -fblocks
$ ./build/debug/myFirstProject
let swift(16)
For Docker
For Docker build
Run a letswift-api server
17
18
Docker build
$ git clone https://github.com/bwahn/
letswift2016-conference.git
$ docker build -t swift-api .
Docker run
$ docker run -d -p 8090:8090 --name api
swift-api:latest
image(swift-api:latest)
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
swift-api latest 829e110bd520 3 hours ago 1.524 GB
ibmcom/kitura-ubuntu latest 20cb1052cd2e 2 weeks ago 1.524 GB
ibmcom/swift-ubuntu latest b4daffd2bbaf 2 weeks ago 1.233 GB
Virtual Box VM - Ubuntu
$ docker run -d -p 8090 --name api1 swift-api:latest
$ docker run -d -p 8090 --name api2 swift-api:latest
$ docker run -d -p 8090 --name api3 swift-api:latest
…
…
..
macOS
port
8090:8090
? => scale up
$ docker-compose
19
let swift(16)
Demo : Introduction
“I Hate Objective-C” Application
Client : Swift 2.2 ( Cocoa-
touch)
Server : Swift 3 ( Kitura)
21
Architecture
MySQL
Cloud End-Point
swift backend
swift backend
swift backend
Google Container cluster
Swift App
22
Dev/Prod Environment
Virtual Box VM - Ubuntu
(Swift - backend)
google container registry
Swift - Client
Google Cloud Platform
swift backend
swift backend
swift backend
MySQL
24
==================================
Description : get a number of vote
Request: Verb: GET URL: http://letswift-api:8090/vote
Response: HTTP code: 200
Body:
{
"objective-c": 100,
"swift": 100
}
==================================
Description : Increase a vote
Request: Verb: PUT URL: http://letswift-api:8090/votes/objectivec_voted
Request: Verb: PUT URL: http://letswift-api:8090/votes/swift_voted
Response: HTTP code: 200
let swift(16)
Let’s vote!
25
26
let swift(16)

More Related Content

What's hot

當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
Ruoshi Ling
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
Michael Vorburger
 
Container sig#1 ansible-container
Container sig#1 ansible-containerContainer sig#1 ansible-container
Container sig#1 ansible-container
Naoya Hashimoto
 
Docker
DockerDocker
Managing dependencies with gradle
Managing dependencies with gradleManaging dependencies with gradle
Managing dependencies with gradle
Liviu Tudor
 
Photon Server Deep Dive - View from Implmentation of PhotonWire, Multiplayer ...
Photon Server Deep Dive - View from Implmentation of PhotonWire, Multiplayer ...Photon Server Deep Dive - View from Implmentation of PhotonWire, Multiplayer ...
Photon Server Deep Dive - View from Implmentation of PhotonWire, Multiplayer ...
Yoshifumi Kawai
 
PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...
PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...
PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...
Puppet
 
Golang workshop
Golang workshopGolang workshop
Golang workshop
Victor S. Recio
 
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
Puppet
 
Супер быстрая автоматизация тестирования на iOS
Супер быстрая автоматизация тестирования на iOSСупер быстрая автоматизация тестирования на iOS
Супер быстрая автоматизация тестирования на iOS
SQALab
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
Paul Chao
 
PuppetConf 2016: Deploying Multi-Tier Windows Applications with Application O...
PuppetConf 2016: Deploying Multi-Tier Windows Applications with Application O...PuppetConf 2016: Deploying Multi-Tier Windows Applications with Application O...
PuppetConf 2016: Deploying Multi-Tier Windows Applications with Application O...
Puppet
 
Docker & PHP - Practical use case
Docker & PHP - Practical use caseDocker & PHP - Practical use case
Docker & PHP - Practical use case
rjsmelo
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
Philip Zheng
 
Going native with less coupling: Dependency Injection in C++
Going native with less coupling: Dependency Injection in C++Going native with less coupling: Dependency Injection in C++
Going native with less coupling: Dependency Injection in C++
Daniele Pallastrelli
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloud
Massimiliano Dessì
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90mins
Larry Cai
 
Start tracking your ruby infrastructure
Start tracking your ruby infrastructureStart tracking your ruby infrastructure
Start tracking your ruby infrastructure
Sergiy Kukunin
 
Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
Schalk Cronjé
 
Vagrant
VagrantVagrant
Vagrant
Denys Kurets
 

What's hot (20)

當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
 
Container sig#1 ansible-container
Container sig#1 ansible-containerContainer sig#1 ansible-container
Container sig#1 ansible-container
 
Docker
DockerDocker
Docker
 
Managing dependencies with gradle
Managing dependencies with gradleManaging dependencies with gradle
Managing dependencies with gradle
 
Photon Server Deep Dive - View from Implmentation of PhotonWire, Multiplayer ...
Photon Server Deep Dive - View from Implmentation of PhotonWire, Multiplayer ...Photon Server Deep Dive - View from Implmentation of PhotonWire, Multiplayer ...
Photon Server Deep Dive - View from Implmentation of PhotonWire, Multiplayer ...
 
PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...
PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...
PuppetConf 2016: Building Nano Server Images with Puppet and DSC – Michael Sm...
 
Golang workshop
Golang workshopGolang workshop
Golang workshop
 
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...PuppetConf 2016:  Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
PuppetConf 2016: Docker, Mesos, Kubernetes and...Puppet? Don't Panic! – Deep...
 
Супер быстрая автоматизация тестирования на iOS
Супер быстрая автоматизация тестирования на iOSСупер быстрая автоматизация тестирования на iOS
Супер быстрая автоматизация тестирования на iOS
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
 
PuppetConf 2016: Deploying Multi-Tier Windows Applications with Application O...
PuppetConf 2016: Deploying Multi-Tier Windows Applications with Application O...PuppetConf 2016: Deploying Multi-Tier Windows Applications with Application O...
PuppetConf 2016: Deploying Multi-Tier Windows Applications with Application O...
 
Docker & PHP - Practical use case
Docker & PHP - Practical use caseDocker & PHP - Practical use case
Docker & PHP - Practical use case
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
 
Going native with less coupling: Dependency Injection in C++
Going native with less coupling: Dependency Injection in C++Going native with less coupling: Dependency Injection in C++
Going native with less coupling: Dependency Injection in C++
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloud
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90mins
 
Start tracking your ruby infrastructure
Start tracking your ruby infrastructureStart tracking your ruby infrastructure
Start tracking your ruby infrastructure
 
Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
 
Vagrant
VagrantVagrant
Vagrant
 

Viewers also liked

안드로이드 개발자를 위한 스위프트
안드로이드 개발자를 위한 스위프트안드로이드 개발자를 위한 스위프트
안드로이드 개발자를 위한 스위프트
병한 유
 
Swift and Xcode8
Swift and Xcode8Swift and Xcode8
Swift and Xcode8
Hyuk Hur
 
Letswift Swift 3.0
Letswift Swift 3.0Letswift Swift 3.0
Letswift Swift 3.0
Sehyun Park
 
Swift package manager
Swift package managerSwift package manager
Swift package manager
성관 윤
 
Do swift: Swift 무작정 해보기
Do swift: Swift 무작정 해보기Do swift: Swift 무작정 해보기
Do swift: Swift 무작정 해보기
YoonBong Steve Kim
 
스위프트 성능 이해하기
스위프트 성능 이해하기스위프트 성능 이해하기
스위프트 성능 이해하기
Yongha Yoo
 
Protocol Oriented Programming in Swift
Protocol Oriented Programming in SwiftProtocol Oriented Programming in Swift
Protocol Oriented Programming in Swift
SeongGyu Jo
 
Swift internals
Swift internalsSwift internals
Swift internals
Jung Kim
 
LetSwift RxSwift 시작하기
LetSwift RxSwift 시작하기LetSwift RxSwift 시작하기
LetSwift RxSwift 시작하기
Wanbok Choi
 

Viewers also liked (9)

안드로이드 개발자를 위한 스위프트
안드로이드 개발자를 위한 스위프트안드로이드 개발자를 위한 스위프트
안드로이드 개발자를 위한 스위프트
 
Swift and Xcode8
Swift and Xcode8Swift and Xcode8
Swift and Xcode8
 
Letswift Swift 3.0
Letswift Swift 3.0Letswift Swift 3.0
Letswift Swift 3.0
 
Swift package manager
Swift package managerSwift package manager
Swift package manager
 
Do swift: Swift 무작정 해보기
Do swift: Swift 무작정 해보기Do swift: Swift 무작정 해보기
Do swift: Swift 무작정 해보기
 
스위프트 성능 이해하기
스위프트 성능 이해하기스위프트 성능 이해하기
스위프트 성능 이해하기
 
Protocol Oriented Programming in Swift
Protocol Oriented Programming in SwiftProtocol Oriented Programming in Swift
Protocol Oriented Programming in Swift
 
Swift internals
Swift internalsSwift internals
Swift internals
 
LetSwift RxSwift 시작하기
LetSwift RxSwift 시작하기LetSwift RxSwift 시작하기
LetSwift RxSwift 시작하기
 

Similar to Swift server-side-let swift2016

GDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWS
Ladislav Prskavec
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
Soshi Nemoto
 
Docker engine - Indroduc
Docker engine - IndroducDocker engine - Indroduc
Docker engine - Indroduc
Al Gifari
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the Cloud
Salesforce Developers
 
Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...
Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...
Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...
Mike Qin
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
Liang Bo
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with DockerPatrick Mizer
 
Docker to the Rescue of an Ops Team
Docker to the Rescue of an Ops TeamDocker to the Rescue of an Ops Team
Docker to the Rescue of an Ops Team
Docker, Inc.
 
Docker to the Rescue of an Ops Team
Docker to the Rescue of an Ops TeamDocker to the Rescue of an Ops Team
Docker to the Rescue of an Ops Team
Rachid Zarouali
 
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment GuideAWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
RapidValue
 
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Jian-Hong Pan
 
Rasperry Pi and TI CC2650 IPv6 border router
Rasperry Pi and TI CC2650 IPv6 border routerRasperry Pi and TI CC2650 IPv6 border router
Rasperry Pi and TI CC2650 IPv6 border router
Nikolaos Monios
 
Webinar: Building Embedded Applications from QtCreator with Docker
Webinar: Building Embedded Applications from QtCreator with DockerWebinar: Building Embedded Applications from QtCreator with Docker
Webinar: Building Embedded Applications from QtCreator with Docker
Burkhard Stubert
 
Build and run embedded apps faster from qt creator with docker
Build and run embedded apps faster from qt creator with dockerBuild and run embedded apps faster from qt creator with docker
Build and run embedded apps faster from qt creator with docker
Qt
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
Henry Schreiner
 
Chicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyChicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - Mediafly
Mediafly
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Nissan Dookeran
 
BBL Premiers pas avec Docker
BBL Premiers pas avec DockerBBL Premiers pas avec Docker
BBL Premiers pas avec Docker
kanedafromparis
 

Similar to Swift server-side-let swift2016 (20)

GDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWS
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 
Docker engine - Indroduc
Docker engine - IndroducDocker engine - Indroduc
Docker engine - Indroduc
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the Cloud
 
Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...
Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...
Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with Docker
 
Docker to the Rescue of an Ops Team
Docker to the Rescue of an Ops TeamDocker to the Rescue of an Ops Team
Docker to the Rescue of an Ops Team
 
Docker to the Rescue of an Ops Team
Docker to the Rescue of an Ops TeamDocker to the Rescue of an Ops Team
Docker to the Rescue of an Ops Team
 
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment GuideAWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
AWS EC2 Ubuntu Instance - Step-by-Step Deployment Guide
 
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
 
Rasperry Pi and TI CC2650 IPv6 border router
Rasperry Pi and TI CC2650 IPv6 border routerRasperry Pi and TI CC2650 IPv6 border router
Rasperry Pi and TI CC2650 IPv6 border router
 
Webinar: Building Embedded Applications from QtCreator with Docker
Webinar: Building Embedded Applications from QtCreator with DockerWebinar: Building Embedded Applications from QtCreator with Docker
Webinar: Building Embedded Applications from QtCreator with Docker
 
Build and run embedded apps faster from qt creator with docker
Build and run embedded apps faster from qt creator with dockerBuild and run embedded apps faster from qt creator with docker
Build and run embedded apps faster from qt creator with docker
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
Chicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyChicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - Mediafly
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
BBL Premiers pas avec Docker
BBL Premiers pas avec DockerBBL Premiers pas avec Docker
BBL Premiers pas avec Docker
 

More from Eric Ahn

Tensorflow and python : fault detection system - PyCon Taiwan 2017
Tensorflow and python : fault detection system - PyCon Taiwan 2017Tensorflow and python : fault detection system - PyCon Taiwan 2017
Tensorflow and python : fault detection system - PyCon Taiwan 2017
Eric Ahn
 
Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-api
Eric Ahn
 
Docker deploy
Docker deployDocker deploy
Docker deploy
Eric Ahn
 
Tensorflow in Docker
Tensorflow in DockerTensorflow in Docker
Tensorflow in Docker
Eric Ahn
 
Docker command
Docker commandDocker command
Docker command
Eric Ahn
 
High perforance-browse-networking-2015-bwahn
High perforance-browse-networking-2015-bwahnHigh perforance-browse-networking-2015-bwahn
High perforance-browse-networking-2015-bwahn
Eric Ahn
 
Cdn gslb-20151209
Cdn gslb-20151209Cdn gslb-20151209
Cdn gslb-20151209
Eric Ahn
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stack
Eric Ahn
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-python
Eric Ahn
 
Http capturing
Http capturingHttp capturing
Http capturing
Eric Ahn
 
Apache module-201511
Apache module-201511Apache module-201511
Apache module-201511
Eric Ahn
 
Spring rest-doc-2015-11
Spring rest-doc-2015-11Spring rest-doc-2015-11
Spring rest-doc-2015-11
Eric Ahn
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-python
Eric Ahn
 
CORS review
CORS reviewCORS review
CORS review
Eric Ahn
 
Docker build #1
Docker build #1Docker build #1
Docker build #1
Eric Ahn
 

More from Eric Ahn (15)

Tensorflow and python : fault detection system - PyCon Taiwan 2017
Tensorflow and python : fault detection system - PyCon Taiwan 2017Tensorflow and python : fault detection system - PyCon Taiwan 2017
Tensorflow and python : fault detection system - PyCon Taiwan 2017
 
Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-api
 
Docker deploy
Docker deployDocker deploy
Docker deploy
 
Tensorflow in Docker
Tensorflow in DockerTensorflow in Docker
Tensorflow in Docker
 
Docker command
Docker commandDocker command
Docker command
 
High perforance-browse-networking-2015-bwahn
High perforance-browse-networking-2015-bwahnHigh perforance-browse-networking-2015-bwahn
High perforance-browse-networking-2015-bwahn
 
Cdn gslb-20151209
Cdn gslb-20151209Cdn gslb-20151209
Cdn gslb-20151209
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stack
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-python
 
Http capturing
Http capturingHttp capturing
Http capturing
 
Apache module-201511
Apache module-201511Apache module-201511
Apache module-201511
 
Spring rest-doc-2015-11
Spring rest-doc-2015-11Spring rest-doc-2015-11
Spring rest-doc-2015-11
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-python
 
CORS review
CORS reviewCORS review
CORS review
 
Docker build #1
Docker build #1Docker build #1
Docker build #1
 

Recently uploaded

Output determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CCOutput determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CC
ShahulHameed54211
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptxLiving-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
TristanJasperRamos
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
Himani415946
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 

Recently uploaded (16)

Output determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CCOutput determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CC
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptxLiving-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 

Swift server-side-let swift2016

  • 1. let swift(16) Docker + Swift Server-Side OSXDEV.orgByungwook Ahn OSXDEV.orgWonseok Yang 1
  • 2. 2 Experienced Device driver(windows, linux) Media streaming CDN Docker Letswift Conf. 2016 Speaker Tensorflow-KR 2016 Speaker PyCon Hongkong 2015 Speaker PyCon Korea 2015 Speaker
  • 3. 3
  • 4. Agenda WWDC 2016 - swift session Server-Side? Swift backend framework VirtualBox, Kitura, Docker myFirstProject Demo Summary 4
  • 5. WWDC 2016 - swift session Swift What’s New in Swift : https://developer.apple.com/videos/play/wwdc2016/402/ Client-Side What’s New in Foundation for Swift : https://developer.apple.com/videos/play/wwdc2016/207/ Getting Started with Swift : https://developer.apple.com/videos/play/wwdc2016/404/ Introducing Swift Playgrounds : https://developer.apple.com/videos/play/wwdc2016/408/ Swift API Design Guidelines : https://developer.apple.com/videos/play/wwdc2016/403/ Understanding Swift Performance : https://developer.apple.com/videos/play/wwdc2016/416/ Concurrent Programming With GCD in Swift 3 : https://developer.apple.com/videos/play/ wwdc2016/720/ Using Store Kit for In-App Purchase wit Swift 3 : https://developer.apple.com/videos/play/ wwdc2016/702/ Server-Side Going Server-side with Swift Open Source : https://developer.apple.com/videos/play/ wwdc2016/415/ Software Engineer @red 5
  • 6. Server-Side? Backend Web Framework Web Framework? Ajax asynchronous Javascript and XML MVC framework Model/View/Controller i18n Internationalization ( ex:date … ) ORM Object Relational Mapping(RDB) Testing framework Framework JUnit, Cedar… Security Framework Spring Security(OAuth) Template Framework Mustache Caching Framework redis, Ehcache 6
  • 7. Kitura Perfect Hosted IBM perfect.org latest version v0.20.0 v1.0.0 started date Feb 9, 2016 Oct 3, 2015 License Apache 2.0 Apache 2.0 MySQL O O SQLite O O Redis O O HTTP URL routing O O Parmeter Parsing O O JSON O O OAuth Kitura-Credentials - Package/3rdParty Library Many ? Swift backend framework Most popular Swift backend framework : Zewo,Vapor…
  • 8. let swift(16) VirtualBox, Kitura, Docker https://github.com/bwahn/letswift2016-conference 8
  • 9. VirtualBox(vagrantfile) # -*- mode: ruby -*- # vi: set ft=ruby : BOX_URL = 'https://cloud-images.ubuntu.com/vagrant/wily/current/wily-server-cloudimg-amd64-vagrant- disk1.box'.freeze SWIFT_PATH = 'https://swift.org/builds/development/ubuntu1510/swift-DEVELOPMENT- SNAPSHOT-2016-06-06-a'.freeze SWIFT_DIRECTORY = 'swift-DEVELOPMENT-SNAPSHOT-2016-06-06-a-ubuntu15.10'.freeze SWIFT_FILE = "#{SWIFT_DIRECTORY}.tar.gz".freeze SWIFT_HOME = "/home/vagrant/#{SWIFT_DIRECTORY}".freeze LIBDISPATCH_URL = '-b experimental/foundation https://github.com/apple/swift-corelibs-libdispatch'.freeze KITURA_URL = 'https://github.com/IBM-Swift/Kitura.git'.freeze KITURA_BRANCH = 'master'.freeze Vagrant.configure(2) do |config| config.vm.box = BOX_URL config.vm.network 'forwarded_port', guest: 8090, host: 8090 Swift 3.0 For Restful-APIs 9 KITURA master
  • 10. ### # 1. Install compiler, autotools sudo apt-get --assume-yes install clang sudo apt-get --assume-yes install autoconf libtool pkg-config # 2. Install dtrace (to generate provider.h) sudo apt-get --assume-yes install systemtap-sdt-dev # 3. Install libdispatch pre-reqs sudo apt-get --assume-yes install libblocksruntime-dev libkqueue-dev libpthread- workqueue-dev libbsd-dev # 4. Kitura packages sudo apt-get --assume-yes install libhttp-parser-dev libcurl4-openssl-dev libhiredis-dev Install packages 10
  • 11. 11 ### Download and install Kitura git clone #{KITURA_URL} -b #{KITURA_BRANCH} cd Kitura swift build -Xcc -fblocks cd .. $ vagrant up
  • 13. 13 $ vagrant ssh vagrant@vagrant-ubuntu-wily-64: $ mkdir myFirstProject vagrant@vagrant-ubuntu-wily-64: $ cd myFirstProject vagrant@vagrant-ubuntu-wily-64: $ swift package init
  • 14. 14 $ vi package.swift import PackageDescription let package = Package( name: "myFirstProject", dependencies: [ .Package(url: "https://github.com/IBM-Swift/Kitura.git", majorVersion: 0, minor: 20) ])
  • 15. 15 $ vi Sources/main.swift import Kitura let router = Router() router.get("/") { request, response, next in response.send("Hello, World!") next() } Kitura.addHTTPServer(onPort: 8090, with: router) Kitura.run() $ swift build -Xcc -fblocks $ ./build/debug/myFirstProject
  • 17. For Docker build Run a letswift-api server 17
  • 18. 18 Docker build $ git clone https://github.com/bwahn/ letswift2016-conference.git $ docker build -t swift-api . Docker run $ docker run -d -p 8090:8090 --name api swift-api:latest image(swift-api:latest) $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE swift-api latest 829e110bd520 3 hours ago 1.524 GB ibmcom/kitura-ubuntu latest 20cb1052cd2e 2 weeks ago 1.524 GB ibmcom/swift-ubuntu latest b4daffd2bbaf 2 weeks ago 1.233 GB
  • 19. Virtual Box VM - Ubuntu $ docker run -d -p 8090 --name api1 swift-api:latest $ docker run -d -p 8090 --name api2 swift-api:latest $ docker run -d -p 8090 --name api3 swift-api:latest … … .. macOS port 8090:8090 ? => scale up $ docker-compose 19
  • 20. let swift(16) Demo : Introduction
  • 21. “I Hate Objective-C” Application Client : Swift 2.2 ( Cocoa- touch) Server : Swift 3 ( Kitura) 21
  • 22. Architecture MySQL Cloud End-Point swift backend swift backend swift backend Google Container cluster Swift App 22
  • 23. Dev/Prod Environment Virtual Box VM - Ubuntu (Swift - backend) google container registry Swift - Client Google Cloud Platform swift backend swift backend swift backend MySQL
  • 24. 24 ================================== Description : get a number of vote Request: Verb: GET URL: http://letswift-api:8090/vote Response: HTTP code: 200 Body: { "objective-c": 100, "swift": 100 } ================================== Description : Increase a vote Request: Verb: PUT URL: http://letswift-api:8090/votes/objectivec_voted Request: Verb: PUT URL: http://letswift-api:8090/votes/swift_voted Response: HTTP code: 200