SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
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)

Weitere ähnliche Inhalte

Was ist angesagt?

當專案漸趕,當遷移也不再那麼難 (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.0Michael Vorburger
 
Container sig#1 ansible-container
Container sig#1 ansible-containerContainer sig#1 ansible-container
Container sig#1 ansible-containerNaoya Hashimoto
 
Managing dependencies with gradle
Managing dependencies with gradleManaging dependencies with gradle
Managing dependencies with gradleLiviu 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
 
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
Супер быстрая автоматизация тестирования на iOSSQALab
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017Paul 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 caserjsmelo
 
時代在變 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 cloudMassimiliano Dessì
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90minsLarry Cai
 
Start tracking your ruby infrastructure
Start tracking your ruby infrastructureStart tracking your ruby infrastructure
Start tracking your ruby infrastructureSergiy Kukunin
 

Was ist angesagt? (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
 

Andere mochten auch

안드로이드 개발자를 위한 스위프트
안드로이드 개발자를 위한 스위프트안드로이드 개발자를 위한 스위프트
안드로이드 개발자를 위한 스위프트병한 유
 
Swift and Xcode8
Swift and Xcode8Swift and Xcode8
Swift and Xcode8Hyuk Hur
 
Letswift Swift 3.0
Letswift Swift 3.0Letswift Swift 3.0
Letswift Swift 3.0Sehyun 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 SwiftSeongGyu Jo
 
Swift internals
Swift internalsSwift internals
Swift internalsJung Kim
 
LetSwift RxSwift 시작하기
LetSwift RxSwift 시작하기LetSwift RxSwift 시작하기
LetSwift RxSwift 시작하기Wanbok Choi
 

Andere mochten auch (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 시작하기
 

Ähnlich wie 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 AWSLadislav Prskavec
 
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 - IndroducAl 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 CloudSalesforce 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 1Liang 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 TeamRachid Zarouali
 
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 TeamDocker, Inc.
 
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 GuideRapidValue
 
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 routerNikolaos Monios
 
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 dockerQt
 
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 DockerBurkhard Stubert
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Henry Schreiner
 
Chicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyChicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyMediafly
 
BBL Premiers pas avec Docker
BBL Premiers pas avec DockerBBL Premiers pas avec Docker
BBL Premiers pas avec Dockerkanedafromparis
 

Ähnlich wie 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
 
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
 
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
 
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
 
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
 
Docker con osdk_ver1.0
Docker con osdk_ver1.0Docker con osdk_ver1.0
Docker con osdk_ver1.0
 

Mehr von 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 2017Eric Ahn
 
Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-apiEric Ahn
 
Docker deploy
Docker deployDocker deploy
Docker deployEric Ahn
 
Tensorflow in Docker
Tensorflow in DockerTensorflow in Docker
Tensorflow in DockerEric Ahn
 
Docker command
Docker commandDocker command
Docker commandEric Ahn
 
High perforance-browse-networking-2015-bwahn
High perforance-browse-networking-2015-bwahnHigh perforance-browse-networking-2015-bwahn
High perforance-browse-networking-2015-bwahnEric Ahn
 
Cdn gslb-20151209
Cdn gslb-20151209Cdn gslb-20151209
Cdn gslb-20151209Eric Ahn
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stackEric Ahn
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-pythonEric Ahn
 
Http capturing
Http capturingHttp capturing
Http capturingEric Ahn
 
Apache module-201511
Apache module-201511Apache module-201511
Apache module-201511Eric Ahn
 
Spring rest-doc-2015-11
Spring rest-doc-2015-11Spring rest-doc-2015-11
Spring rest-doc-2015-11Eric Ahn
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-pythonEric Ahn
 
CORS review
CORS reviewCORS review
CORS reviewEric Ahn
 
Docker build #1
Docker build #1Docker build #1
Docker build #1Eric Ahn
 

Mehr von 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
 

Kürzlich hochgeladen

Presentation2.pptx - JoyPress Wordpress
Presentation2.pptx -  JoyPress WordpressPresentation2.pptx -  JoyPress Wordpress
Presentation2.pptx - JoyPress Wordpressssuser166378
 
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced HorizonsVision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced HorizonsRoxana Stingu
 
Check out the Free Landing Page Hosting in 2024
Check out the Free Landing Page Hosting in 2024Check out the Free Landing Page Hosting in 2024
Check out the Free Landing Page Hosting in 2024Shubham Pant
 
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdfLESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdfmchristianalwyn
 
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASSLESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASSlesteraporado16
 
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...APNIC
 
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024Jan Löffler
 
Zero-day Vulnerabilities
Zero-day VulnerabilitiesZero-day Vulnerabilities
Zero-day Vulnerabilitiesalihassaah1994
 
Bio Medical Waste Management Guideliness 2023 ppt.pptx
Bio Medical Waste Management Guideliness 2023 ppt.pptxBio Medical Waste Management Guideliness 2023 ppt.pptx
Bio Medical Waste Management Guideliness 2023 ppt.pptxnaveenithkrishnan
 
Computer 10 Lesson 8: Building a Website
Computer 10 Lesson 8: Building a WebsiteComputer 10 Lesson 8: Building a Website
Computer 10 Lesson 8: Building a WebsiteMavein
 
Introduction to ICANN and Fellowship program by Shreedeep Rayamajhi.pdf
Introduction to ICANN and Fellowship program  by Shreedeep Rayamajhi.pdfIntroduction to ICANN and Fellowship program  by Shreedeep Rayamajhi.pdf
Introduction to ICANN and Fellowship program by Shreedeep Rayamajhi.pdfShreedeep Rayamajhi
 
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDSTYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDSedrianrheine
 

Kürzlich hochgeladen (12)

Presentation2.pptx - JoyPress Wordpress
Presentation2.pptx -  JoyPress WordpressPresentation2.pptx -  JoyPress Wordpress
Presentation2.pptx - JoyPress Wordpress
 
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced HorizonsVision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
 
Check out the Free Landing Page Hosting in 2024
Check out the Free Landing Page Hosting in 2024Check out the Free Landing Page Hosting in 2024
Check out the Free Landing Page Hosting in 2024
 
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdfLESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
 
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASSLESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
 
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
 
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
 
Zero-day Vulnerabilities
Zero-day VulnerabilitiesZero-day Vulnerabilities
Zero-day Vulnerabilities
 
Bio Medical Waste Management Guideliness 2023 ppt.pptx
Bio Medical Waste Management Guideliness 2023 ppt.pptxBio Medical Waste Management Guideliness 2023 ppt.pptx
Bio Medical Waste Management Guideliness 2023 ppt.pptx
 
Computer 10 Lesson 8: Building a Website
Computer 10 Lesson 8: Building a WebsiteComputer 10 Lesson 8: Building a Website
Computer 10 Lesson 8: Building a Website
 
Introduction to ICANN and Fellowship program by Shreedeep Rayamajhi.pdf
Introduction to ICANN and Fellowship program  by Shreedeep Rayamajhi.pdfIntroduction to ICANN and Fellowship program  by Shreedeep Rayamajhi.pdf
Introduction to ICANN and Fellowship program by Shreedeep Rayamajhi.pdf
 
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDSTYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
 

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