OpenWhisk λŠ” Apache μž¬λ‹¨μ˜ μΈνλ² μ΄νŒ… ν”„λ‘œμ νŠΈλ‘œ 곡개된 μ˜€ν”ˆμ†ŒμŠ€ μ„œλ²„λ¦¬μŠ€ ν”Œλž«νΌμž…λ‹ˆλ‹€. 이 κΈ€μ—μ„œλŠ” OpenWhisk λ₯Ό λΉ λ₯΄κ³  μ•ˆμ „ν•˜κ²Œ κ°œλ°œν•˜κΈ° μœ„ν•˜μ—¬ Docker container 둜 개발 ν™˜κ²½μ„ λ§Œλ“€κ³ , λ°°ν¬ν•˜λŠ” ν™˜κ²½μ„ λ§Œλ“€μ–΄ λ΄…λ‹ˆλ‹€.

μ„œλ²„λ¦¬μŠ€μ™€ Apache OpenWhisk λž€?

ν΄λΌμš°λ“œ ν™˜κ²½μ—μ„œ IaaS (Infrastructure as a Service) 가상머신 및 λ² μ–΄λ©”νƒˆμ€ λͺ‡ λΆ„ λ§Œμ— μ„œλ²„λ₯Ό λ§Œλ“€ 수 있게 ν•΄ μ£Όμ—ˆκ³ , PaaS (Platform as a service) 와 Docker container κΈ°μˆ μ€ 개발과 배치λ₯Ό 보닀 νŽΈν•˜κ²Œ ν•˜κ³  μžμ›μ„ 보닀 효율적으둜 μ‚¬μš©ν•  수 있게 λ„μ™€μ£Όμ—ˆμŠ΅λ‹ˆλ‹€. μ„œλ²„λ¦¬μŠ€ (Serverless) ν”Œλž«νΌ, ν˜Ήμ€ FaaS (Function as a Service) λŠ” μ—¬κΈ°μ„œ 더 λ‚˜μ•„κ°€ ν•„μš”ν•  λ•Œλ§Œ μ‹€ν–‰λ˜κ³  μ‰½κ²Œ ν™•μž₯될 수 μžˆμŠ΅λ‹ˆλ‹€.

ν”„λ‘œμ νŠΈ ν™ˆνŽ˜μ΄μ§€: http://openwhisk.incubator.apache.org/

Apache OpenWhisk λŠ” IBM Bluemix ν΄λΌμš°λ“œμ—μ„œ FaaS ν˜•νƒœλ‘œ μ‚¬μš©ν•  μˆ˜λ„ 있고, OpenStack κ³Ό 같은 on-premis IaaS λ‚˜ ν˜Ήμ€ ν΄λΌμš°λ“œμ— μ„€μΉ˜ν•˜μ—¬ μ„œλ²„λ¦¬μŠ€ ν™˜κ²½μ„ ꡬ좕할 수 μžˆμŠ΅λ‹ˆλ‹€.

개발 ν™˜κ²½μ„ μœ„ν•œ Docker inception in Docker

Apache OpenWhisk λŠ” μ£Ό 개발 μ–Έμ–΄λ‘œ Scala λ₯Ό μ‚¬μš©ν•˜κ³  λ°°μΉ˜μ— Python Ansible νˆ΄μ„ μ‚¬μš©ν•˜μ—¬ ν•„μš”ν•œ μ»΄νΌλ„ŒνŠΈλ₯Ό Docker container 둜 λ°°μΉ˜ν•©λ‹ˆλ‹€.

곡식 λ¬Έμ„œμ—μ„œλŠ” Vagrant λ‚˜ Docker for Mac 을 μ‚¬μš©ν•˜μ—¬ λ§₯μ—μ„œ κ°œλ°œν•˜λŠ” 방법과 Ubuntu 14.04 ν™˜κ²½μ—μ„œ κ°œλ°œν•˜λŠ” 방법이 μ•ˆλ‚΄λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. 이 ν™˜κ²½μ—μ„œλŠ” 호슀트 머신에 ν•„μš”ν•œ 개발 μ˜μ‘΄μ„±μ„ μ„€μΉ˜ν•œ ν›„, Docker 둜 ν•„μš”ν•œ μ»΄ν¬λ„ŒνŠΈλ₯Ό λ°°μΉ˜ν•©λ‹ˆλ‹€.

ν•˜μ§€λ§Œ 개발 머신이 Ubuntu 16.04 λ“± λ‹€λ₯Έ Ubuntu 버젼을 μ‚¬μš©ν•˜κ±°λ‚˜ CentOS, Fedora λ“±μ˜ λ‹€λ₯Έ λ°°ν¬νŒμ„ μ‚¬μš©ν•œλ‹€λ©΄ μ–΄λ–»κ²Œ ν•΄μ•Ό ν• κΉŒμš”? λ§₯μ—μ„œλ„ Java VM 이 μ„žμ΄μ§€ μ•Šκ²Œ ν•˜κ±°λ‚˜ κ°œλ°œν™˜κ²½μ΄ 꼬이지 μ•Šκ²Œ ꡬ성할 ν•„μš”κ°€ μžˆμŠ΅λ‹ˆλ‹€.

이런 μƒν™©μ—μ„œ Docker 자체λ₯Ό 개발 ν™˜κ²½μœΌλ‘œ μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 이 κΈ€μ—μ„œλŠ” Docker inception μ΄λΌλŠ” κ°œλ…μ„ μ‚¬μš©ν•΄μ„œ Docker 개발 ν™˜κ²½μœΌλ‘œλΆ€ν„° λ‹€λ₯Έ 개발 Docker image λ₯Ό λ§Œλ“€κ³  Docker instance λ₯Ό λ°°μΉ˜ν•˜λŠ” 방법을 μ†Œκ°œν•©λ‹ˆλ‹€.

Docker ν™˜κ²½ μ€€λΉ„ν•˜κΈ°

호슀트 머신에 Docker κ°€ μ„€μΉ˜λ˜μ–΄ μžˆμ§€ μ•Šλ‹€λ©΄ Docker μ„€μΉ˜ λ¬Έμ„œλ₯Ό μ°Έκ³ ν•˜μ—¬ μ„€μΉ˜ν•΄μ•Ό ν•©λ‹ˆλ‹€. 그리고 OpenWhisk 배치λ₯Ό μœ„ν•΄ Docker tcp API κ°€ ν•„μš”ν•˜κΈ° λ•Œλ¬Έμ— 일반적으둜 μ‚¬μš©ν•˜λŠ” Docker interface 인 172.17.0.1 에 λŒ€ν•΄ 4243 포트λ₯Ό μ—΄μ–΄μ€˜μ•Ό ν•©λ‹ˆλ‹€. λ‹€μŒκ³Ό 같이 netstat λͺ…λ Ήμ–΄λ₯Ό 내렸을 λ•Œ ν¬νŠΈκ°€ LISTEN μƒνƒœμ΄λ©΄ μ€€λΉ„λœ κ²ƒμž…λ‹ˆλ‹€.

$ netstat -nl |grep 4243
tcp        0      0 172.17.0.1:4243         0.0.0.0:*               LISTEN

Ubuntu 14.04

/etc/default/docker νŒŒμΌμ— λ‹€μŒ 쀄을 μΆ”κ°€ν•œ ν›„ docker λ₯Ό μž¬μ‹œμž‘ν•˜λ©΄ λ©λ‹ˆλ‹€.

DOCKER_OPTS="-H tcp://172.17.0.1:4243 -H unix:///var/run/docker.sock"

Ubuntu 16.04

systemd λ₯Ό μ‚¬μš©ν•˜λŠ” Linux λ°°ν¬νŒμ—μ„œλŠ” μ‹€ν–‰ μ˜΅μ…˜μ„ λ³€κ²½ν•΄μ€˜μ•Ό ν•©λ‹ˆλ‹€. /etc/systemd/system/docker.service.d/tcp.conf νŒŒμΌμ„ λ‹€μŒκ³Ό 같이 μž‘μ„±ν•©λ‹ˆλ‹€.

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -H 172.17.0.1:4243

그리고 λ‹€μŒ λͺ…λ Ήμ–΄λ‘œ λ³€κ²½ λ‚΄μš©μ„ μ μš©ν•˜κ³  Docker 데λͺ¬μ„ μž¬μ‹œμž‘ν•©λ‹ˆλ‹€.

sudo systemctl daemon-reload
sudo systemctl restart docker

Inception μ»¨ν…Œμ΄λ„ˆ μΈμŠ€ν„΄μŠ€ μ‹€ν–‰

  • λ‹€μŒ λͺ…λ ΉμœΌλ‘œ OpenWhisk 개발용 inception μ»¨ν…Œμ΄λ„ˆλ₯Ό μ‹€ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€. μΈμŠ€ν„΄μŠ€ 이름은 openwhisk_inception_1 둜 μ„€μ •ν•˜κ³ , 호슀트 λ¨Έμ‹ κ³Ό Docker μ†ŒμΌ“ 및 /tmp 디렉터리λ₯Ό κ³΅μœ ν•˜λŠ” μ„€μ •μž…λ‹ˆλ‹€.
docker run -it --name openwhisk_inception_1 -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp jgkong/openwhisk-inception bash
  • μ‰˜μ΄ μ‹€ν–‰λ˜λ©΄ inception μΈμŠ€ν„΄μŠ€μ—μ„œ docker ps λͺ…λ Ήμ–΄λ‘œ ν˜„μž¬ inception μΈμŠ€ν„΄μŠ€κ°€ 잘 λ³΄μ΄λŠ”μ§€ ν™•μΈν•œ ν›„ exit λͺ…λ Ήμ–΄λ‘œ λΉ μ Έλ‚˜μ˜΅λ‹ˆλ‹€.
root@85b3e0d2754d:/# docker ps
CONTAINER ID        IMAGE                        COMMAND             CREATED             STATUS              PORTS               NAMES
85b3e0d2754d        jgkong/openwhisk-inception   "bash"              3 seconds ago       Up 2 seconds                            openwhisk_inception_1
  • ν˜ΈμŠ€νŠΈμ—μ„œ λ‹€μŒ λͺ…λ Ήμ–΄λ‘œ inception μΈμŠ€ν„΄μŠ€μ˜ docker κ·Έλ£Ή GID λ₯Ό λ§žμΆ°μ€€ ν›„ λ‹€μ‹œ μΈμŠ€ν„΄μŠ€λ‘œ λ“€μ–΄κ°‘λ‹ˆλ‹€.
docker start openwhisk_inception_1
docker exec openwhisk_inception_1 groupmod -g $(grep ^docker /etc/group |cut -d : -f 3) docker
docker exec -it openwhisk_inception_1 bash
  • (선택사항) root μ‚¬μš©μžλ‘œ μž‘μ—…ν•˜λŠ” 것은 λ³΄μ•ˆμƒ μœ„ν—˜ν•˜λ‹ˆ, dev μ‚¬μš©μžλ₯Ό μΆ”κ°€ν•΄μ£Όκ³ , su λͺ…λ Ήμ–΄λ₯Ό 톡해 dev μ‚¬μš©μžλ‘œ μž‘μ—…μ„ μ‹œμž‘ν•©λ‹ˆλ‹€. root 둜 μž‘μ—…ν•˜λŠ” 것도 κ°€λŠ₯ν•˜λ©°, dev λŒ€μ‹  λ‹€λ₯Έ μ‚¬μš©μžμ΄λ¦„μ„ μ‚¬μš©ν•΄λ„ λ¬΄λ°©ν•©λ‹ˆλ‹€.
root@85b3e0d2754d:/# useradd -m dev
root@85b3e0d2754d:/# echo "dev ALL=(ALL) NOPASSWD:ALL" |sudo tee /etc/sudoers.d/dev
dev ALL=(ALL) NOPASSWD:ALL
root@85b3e0d2754d:/# adduser dev docker
Adding user `dev' to group `docker' ...
Adding user dev to group docker
Done.
root@85b3e0d2754d:/# su - dev
dev@85b3e0d2754d:~$
  • (선택사항) dev μ‚¬μš©μžλ„ docker 그룹에 ν¬ν•¨ν–ˆκΈ° λ•Œλ¬Έμ— docker λͺ…λ Ήμ–΄λ₯Ό μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€. docker ps λͺ…λ Ήμ–΄λ‘œ root 와 λ§ˆμ°¬κ°€μ§€ κ²°κ³Όκ°€ λ‚˜μ˜€λŠ”μ§€ ν™•μΈν•©λ‹ˆλ‹€.
dev@85b3e0d2754d:~$ docker ps
CONTAINER ID        IMAGE                        COMMAND             CREATED              STATUS              PORTS               NAMES
85b3e0d2754d        jgkong/openwhisk-inception   "bash"              About a minute ago   Up About a minute                       openwhisk_inception_1

OpenWhisk λΉŒλ“œ

  • Git 으둜 OpenWhisk λ¦¬νŒŒμ§€ν† λ¦¬λ₯Ό λ‹€μš΄λ°›κ³  ν•„μš”ν•œ Docker 이미지λ₯Ό λΉŒλ“œν•©λ‹ˆλ‹€.
dev@85b3e0d2754d:~$ git clone --depth=1 https://github.com/apache/incubator-openwhisk.git openwhisk
Cloning into 'openwhisk'...
remote: Counting objects: 880, done.
remote: Compressing objects: 100% (743/743), done.
remote: Total 880 (delta 137), reused 417 (delta 51), pack-reused 0
Receiving objects: 100% (880/880), 9.32 MiB | 683.00 KiB/s, done.
Resolving deltas: 100% (137/137), done.
Checking connectivity... done.
dev@85b3e0d2754d:~$ cd openwhisk/
dev@85b3e0d2754d:~/openwhisk$ ./gradlew distDocker
  • μ„œλ²„μ˜ μ„±λŠ₯κ³Ό λ„€νŠΈμ›Œν¬ 상황에 따라 λ‹€λ₯΄μ§€λ§Œ, OpenWhisk 에 ν•„μš”ν•œ 20μ—¬κ°œμ˜ Docker 이미지λ₯Ό λΉŒλ“œν•˜λŠ”λ°λŠ” λͺ‡μ‹­λΆ„μ˜ μ‹œκ°„μ΄ 걸릴 수 μžˆμŠ΅λ‹ˆλ‹€. λΉŒλ“œκ°€ μ™„λ£Œλœ ν›„ docker images λͺ…λ Ήμ–΄λ‘œ λΉŒλ“œλœ 이미지λ₯Ό 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.
dev@85b3e0d2754d:~/openwhisk$ docker images
REPOSITORY                     TAG                 IMAGE ID            CREATED              SIZE
badproxy                       latest              f94950ce7b2c        15 seconds ago       107MB
whisk/badproxy                 latest              f94950ce7b2c        15 seconds ago       107MB
badaction                      latest              41fa4e2a2eda        15 seconds ago       107MB
whisk/badaction                latest              41fa4e2a2eda        15 seconds ago       107MB
cli                            latest              d86c401c4a0c        17 seconds ago       753MB
whisk/cli                      latest              d86c401c4a0c        17 seconds ago       753MB
whisk/example                  latest              0b4beaff35fc        About a minute ago   108MB
example                        latest              0b4beaff35fc        About a minute ago   108MB
swift3action                   latest              bd050270b93b        2 minutes ago        1.47GB
whisk/swift3action             latest              bd050270b93b        2 minutes ago        1.47GB
action-swift-v3.1.1            latest              1f160857de71        9 minutes ago        1.37GB
whisk/action-swift-v3.1.1      latest              1f160857de71        9 minutes ago        1.37GB
python3action                  latest              2eba74b62cdd        13 minutes ago       287MB
whisk/python3action            latest              2eba74b62cdd        13 minutes ago       287MB
whisk/python2action            latest              3d7b5244f4a3        16 minutes ago       293MB
python2action                  latest              3d7b5244f4a3        16 minutes ago       293MB
nodejs6action                  latest              b09a36ad839b        20 minutes ago       487MB
whisk/nodejs6action            latest              b09a36ad839b        20 minutes ago       487MB
nodejsactionbase               latest              ec6b47795cc5        22 minutes ago       303MB
whisk/nodejsactionbase         latest              ec6b47795cc5        22 minutes ago       303MB
java8action                    latest              ba5346794d77        25 minutes ago       453MB
whisk/java8action              latest              ba5346794d77        25 minutes ago       453MB
invoker                        latest              18806c0492b4        25 minutes ago       457MB
whisk/invoker                  latest              18806c0492b4        25 minutes ago       457MB
controller                     latest              71935c333d30        25 minutes ago       437MB
whisk/controller               latest              71935c333d30        25 minutes ago       437MB
dockerskeleton                 latest              5ee27f40dbe1        28 minutes ago       107MB
whisk/dockerskeleton           latest              5ee27f40dbe1        28 minutes ago       107MB
scala                          latest              20a2e316c237        30 minutes ago       353MB
whisk/scala                    latest              20a2e316c237        30 minutes ago       353MB
jgkong/openwhisk-inception     latest              8ac988dca566        2 hours ago          1.67GB
buildpack-deps                 trusty              a7bcc05e2568        2 days ago           551MB
buildpack-deps                 trusty-curl         bdba6257828d        2 days ago           200MB
python                         3.6.1-alpine        ddd6300d05a3        10 days ago          88.7MB
golang                         1.8                 d2f558dda133        2 weeks ago          699MB
ibmcom/swift-ubuntu            3.1.1               39995571098d        2 weeks ago          1.19GB
python                         2.7.12-alpine       9c8c07c0f9b7        7 months ago         72.2MB
clarity                        latest              263920854b31        8 months ago         974MB
consul                         0.7.0               2ba9010ee3cc        8 months ago         33.7MB
ches/kafka                     0.10.0.1            6330d31d4be4        10 months ago        698MB
gliderlabs/registrator         latest              3b59190c6c80        14 months ago        23.8MB
docker/docker-bench-security   latest              c27d95c6a9d0        21 months ago        46.5MB

OpenWhisk 배치

https://github.com/apache/incubator-openwhisk/blob/master/ansible/README.md 에 μ„€λͺ…λœκ²ƒμ²˜λŸΌ ansible 둜 ν•„μš”ν•œ ν™˜κ²½μ„ λ°°μΉ˜ν•©λ‹ˆλ‹€.

  1. CouchDB ν™˜κ²½ μ„€μ •
    ansible λ””λ ‰ν„°λ¦¬μ—μ„œ ansible-playbook setup.yml μ»€λ§¨λ“œλ‘œ CouchDB ν™˜κ²½μ„ μ„€μ •ν•©λ‹ˆλ‹€. λ‹€νλ¨ΌνŠΈ μ„€λͺ…λŒ€λ‘œ Cloudant λ₯Ό μ‚¬μš©ν•΄λ„
    되며, λͺ¨λ“  ansible μ‹€ν–‰λ•ŒλŠ” 빨간색 μ—λŸ¬κ°€ λ‚˜μ˜€μ§€ μ•Šμ•„μ•Ό ν•©λ‹ˆλ‹€.

    dev@85b3e0d2754d:~/openwhisk$ cd ansible/
    dev@85b3e0d2754d:~/openwhisk/ansible$ ansible-playbook setup.yml
  2. λ‹€μŒ λͺ…λ Ήμ–΄λ‘œ λ°μ΄ν„°λ² μ΄μŠ€λ₯Ό μ΄ˆκΈ°ν™”ν•©λ‹ˆλ‹€.

    ansible-playbook prereq.yml
    ansible-playbook couchdb.yml
    ansible-playbook initdb.yml
    ansible-playbook wipe.yml

    docker ps λͺ…λ Ήμ–΄λ‘œ couchdb μΈμŠ€ν„΄μŠ€κ°€ 보이면 λ©λ‹ˆλ‹€.

    dev@85b3e0d2754d:~/openwhisk/ansible$ docker ps
    CONTAINER ID        IMAGE                        COMMAND                  CREATED              STATUS              PORTS                    
    NAMES
    c870ab6f7c83        couchdb:1.6                  "tini -- /docker-e..."   About a minute ago   Up About a minute   0.0.0.0:5984->5984/tcp   couchdb
    85b3e0d2754d        jgkong/openwhisk-inception   "bash"                   45 minutes ago       Up 44 minutes                                openwhisk_inception_1
  3. λ‹€μŒ λͺ…λ Ήμ–΄λ‘œ api-gateway 와 OpenWhisk μ»΄ν¬λ„ŒνŠΈλ₯Ό λ„μ›λ‹ˆλ‹€.

    ansible-playbook apigateway.yml
    ansible-playbook openwhisk.yml
    ansible-playbook postdeploy.yml
  4. docker ps λͺ…λ Ήμ–΄λ‘œ ν•„μš”ν•œ μ»΄ν¬λ„ŒνŠΈλ“€μ΄ μ‹€ν–‰λ˜μ—ˆλŠ”μ§€ ν™•μΈν•©λ‹ˆλ‹€.

    dev@85b3e0d2754d:~/openwhisk/ansible$ docker ps
    CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS                  PORTS                                                                                                                                                  NAMES
    b422cabba350        nginx:1.11                   "nginx -g 'daemon ..."   3 minutes ago       Up 3 minutes            0.0.0.0:8443->8443/tcp, 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp                                                                                     nginx
    418536116a02        whisk/nodejs6action:latest   "/bin/sh -c 'node ..."   3 minutes ago       Up 3 minutes                                                                                                                                                                   wsk0_3_warmJsContainer_20170709T115814324Z
    02311a6dafd3        whisk/nodejs6action:latest   "/bin/sh -c 'node ..."   3 minutes ago       Up 3 minutes (Paused)                                                                                                                                                          wsk0_2_whisksysteminvokerHealthTestAction001_20170709T115814097Z
    1d82c1388bec        whisk/nodejs6action:latest   "/bin/sh -c 'node ..."   3 minutes ago       Up 3 minutes                                                                                                                                                                   wsk0_1_warmJsContainer_20170709T115813790Z
    cdcf77a6b179        whisk/invoker:latest         "/bin/sh -c 'exec ..."   3 minutes ago       Up 3 minutes            0.0.0.0:12001->8080/tcp                                                                                                                                invoker0
    c91be5666f3b        whisk/controller:latest      "/bin/sh -c 'contr..."   3 minutes ago       Up 3 minutes            0.0.0.0:10001->8080/tcp                                                                                                                                controller0
    80d16698c63e        ches/kafka:0.10.2.1          "/start.sh"              3 minutes ago       Up 3 minutes            7203/tcp, 0.0.0.0:9092->9092/tcp                                                                                                                       kafka
    65f6d97218af        zookeeper:3.4                "/docker-entrypoin..."   4 minutes ago       Up 4 minutes            2888/tcp, 0.0.0.0:2181->2181/tcp, 3888/tcp                                                                                                             zookeeper
    988f09942f93        gliderlabs/registrator       "/bin/registrator ..."   4 minutes ago       Up 4 minutes                                                                                                                                                                   registrator
    e2b974f00474        consul:0.7.0                 "docker-entrypoint..."   4 minutes ago       Up 4 minutes            0.0.0.0:8300-8302->8300-8302/tcp, 0.0.0.0:8400->8400/tcp, 0.0.0.0:8301-8302->8301-8302/udp, 0.0.0.0:8500->8500/tcp, 0.0.0.0:8600->8600/udp, 8600/tcp   consul
    23711d5fdfc6        openwhisk/apigateway:0.8.2   "/usr/local/bin/du..."   About an hour ago   Up About an hour        80/tcp, 8423/tcp, 0.0.0.0:9000->9000/tcp, 0.0.0.0:9001->8080/tcp                                                                                       apigateway
    4a1328c21664        redis:3.2                    "docker-entrypoint..."   About an hour ago   Up About an hour        0.0.0.0:6379->6379/tcp                                                                                                                                 redis
    c870ab6f7c83        couchdb:1.6                  "tini -- /docker-e..."   About an hour ago   Up About an hour        0.0.0.0:5984->5984/tcp                                                                                                                                 couchdb
    85b3e0d2754d        jgkong/openwhisk-inception   "bash"                   2 hours ago         Up 2 hours                                                                                                                                                                     openwhisk_inception_1

OpenWhisk μ„€μΉ˜ 확인

  1. wskadmin λͺ…λ Ήμ–΄λ‘œ μ‚¬μš©μžλ₯Ό μΆ”κ°€ν•©λ‹ˆλ‹€.

    dev@85b3e0d2754d:~/openwhisk/ansible$ ../bin/wskadmin user create user1
    7fecc680-c267-4f06-90cc-84a691780683:wFR6Wa5pLVUu7rjOrlPEOFsnGN7lLBtXuiRIMCneHGDeoqkgVS81NJFRcVYqmoDU
  2. μœ„μ˜ μ‹€ν–‰κ²°κ³Όλ‘œ λ‚˜μ˜€λŠ” API KEY 둜 인증정보와 API HOST λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€.

    dev@85b3e0d2754d:~/openwhisk/ansible$ ../bin/wsk property set --auth 7fecc680-c267-4f06-90cc-84a691780683:wFR6Wa5pLVUu7rjOrlPEOFsnGN7lLBtXuiRIMCneHGDeoqkgVS81NJFRcVYqmoDU
    ok: whisk auth set. Run 'wsk property get --auth' to see the new value.
    dev@85b3e0d2754d:~/openwhisk/ansible$ ../bin/wsk property set --apihost 172.17.0.1
    ok: whisk API host set to 172.17.0.1
  3. hello, μž…λ ₯κ°’ 을 ν‘œμ‹œν•˜λŠ” ν…ŒμŠ€νŠΈ μ•‘μ…˜μ„ λ§Œλ“€κ³  μ‹€ν–‰ν•΄ λ΄…λ‹ˆλ‹€. payload κ°€ μ •μƒμ μœΌλ‘œ 좜λ ₯되면 OpenWhisk μ„€μΉ˜ 및 λ°°μΉ˜κ°€ μ™„λ£Œλ©λ‹ˆλ‹€.

    dev@85b3e0d2754d:~/openwhisk/ansible$ ../bin/wsk -i action create hello ../tests/dat/actions/hello.js
    ok: created action hello
    dev@85b3e0d2754d:~/openwhisk/ansible$ ../bin/wsk -i action invoke hello -p payload world --result
    {
    "payload": "hello, world!"
    }

문제 ν•΄κ²°

  • Ansible μ‹€ν–‰ 도쀑 λ¬Έμ œκ°€ 생기면 -e mode=clean 을 λΆ™μ—¬ μ‹€ν–‰ν•˜λ©΄ 싀행이 μ·¨μ†Œλ©λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄, ansible-playbook openwhisk.yml 배치λ₯Ό μ·¨μ†Œν•˜κ³  μ‹Άλ‹€λ©΄ ansible-playbook openwhisk.yml -e mode=clean 둜 μ‹€ν–‰ν•˜λ©΄ λ©λ‹ˆλ‹€.

참고 링크

ν† λ‘  μ°Έκ°€

이메일은 κ³΅κ°œλ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. ν•„μˆ˜ μž…λ ₯창은 * 둜 ν‘œμ‹œλ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€