Skip to content

Heersin/openwhisk

 
 

Fork改动

  1. 修改一部分dockerfile,解决在国内构建openwhisk中的奇怪问题
  1. 预下载一部分文件,方便没有网络条件的情况下手动添加
  2. 加入搭建时用的两个脚本。

背景

主要是搭建过程中时常遇到一些网络问题(issue#4888),比如alpine/ubuntu的源问题

$ apk add --no-cache bash
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
(1/6) Installing pkgconf (1.3.10-r0)
(2/6) Installing ncurses-terminfo-base (6.0_p20171125-r0)
(3/6) Installing ncurses-terminfo (6.0_p20171125-r0)
ERROR: ncurses-terminfo-6.0_p20171125-r0: Protocol error
(4/6) Installing ncurses-libs (6.0_p20171125-r0)
(5/6) Installing readline (7.0.003-r0)
(6/6) Installing bash (4.4.19-r1)
ERROR: bash-4.4.19-r1: Protocol error
Executing busybox-1.27.2-r7.trigger
2 errors; 5 MiB in 15 packages

以及构建ow-utils时需要从google上下载一个东西,对于构建大型项目来说耗时太长了。所以对原始构建过程中的一些配置进行改动,以及构建了2个docker image解决网络问题。

项目文件

  • Docker File改动

    • common/scala/Dockerfile, 原始dockerfile备份为.bak
    • tools/ow-utils/Dockerfile, 原始dockerfile备份为.bak
  • pre_download_and_script

    • APKINDEX.tar.gz -- alpine 所需
    • OpenWhisk_CLI-latest-linux-amd64.tgz -- owutils 所需
    • kubectl -- owutils 所需
    • start_wsk.sh -- 启动ansible的命令
    • wsk_env.sh -- wsk_env 相关环境变量(手动在shell中输入而非执行脚本)

Quick Start

构建过程参考原始项目即可(Deploy to Docker for Ubuntu),这里仅仅是个人搭建时的一些经验

  1. ubuntu需要安装npm,在构建一个组件的时候需要,然而openwhisk的readme上似乎并没有提醒。
  2. 构建过程中最好开启debug模式即"./gradlew distDocker --debug",方便出问题时排查
  3. 需要更换如pip源、apt源等可以阅读对应Dockerfile,找到启动的镜像,若镜像内有sed,则可以用sed在dockerfile内写命令对docker的源配置进行修改。没有的话可能需要启动镜像,修改后commit,然后在dockerfile里引用自己修改后的镜像。
  4. 可能用到的命令
docker run -it [IMAGE] "/bin/bash" 启动docker内的shell(也可能没有bash,换成sh)
docker cp [file_path] [docker_name]:/path/to/ 从外部拷贝文件到docker内
docker ps -a 列出运行中的docker

==========原始项目简介==========

OpenWhisk

Build Status License Join Slack codecov Twitter

OpenWhisk is a serverless functions platform for building cloud applications. OpenWhisk offers a rich programming model for creating serverless APIs from functions, composing functions into serverless workflows, and connecting events to functions using rules and triggers. Learn more at http://openwhisk.apache.org.

Quick Start

The easiest way to start using OpenWhisk is to install the "Standalone" OpenWhisk stack. This is a full-featured OpenWhisk stack running as a Java process for convenience. Serverless functions run within Docker containers. You will need Docker, Java and Node.js available on your machine.

To get started:

git clone https://github.com/apache/openwhisk.git
cd openwhisk
./gradlew core:standalone:bootRun
  • When the OpenWhisk stack is up, it will open your browser to a functions Playground, typically served from http://localhost:3232. The Playground allows you create and run functions directly from your browser.

  • To make use of all OpenWhisk features, you will need the OpenWhisk command line tool called wsk which you can download from https://s.apache.org/openwhisk-cli-download. Please refer to the CLI configuration for additional details. Typically you configure the CLI for Standalone OpenWhisk as follows:

wsk property set \
  --apihost 'http://localhost:3233' \
  --auth '23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP'
  • Standalone OpenWhisk can be configured to deploy additional capabilities when that is desirable. Additional resources are available here.

Deploy to Kubernetes

OpenWhisk can also be installed on a Kubernetes cluster. You can use a managed Kubernetes cluster provisioned from a public cloud provider (e.g., AKS, EKS, IKS, GKE), or a cluster you manage yourself. Additionally for local development, OpenWhisk is compatible with Minikube, and Kubernetes for Mac using the support built into Docker 18.06 (or higher).

To get started:

git clone https://github.com/apache/openwhisk-deploy-kube.git

Then follow the instructions in the OpenWhisk on Kubernetes README.md.

Learn Concepts and Commands

Browse the documentation to learn more. Here are some topics you may be interested in:

OpenWhisk Community and Support

Report bugs, ask questions and request features here on GitHub.

You can also join the OpenWhisk Team on Slack https://openwhisk-team.slack.com and chat with developers. To get access to our public Slack team, request an invite https://openwhisk.apache.org/slack.html.

Project Repository Structure

The OpenWhisk system is built from a number of components. The picture below groups the components by their GitHub repos. Please open issues for a component against the appropriate repo (if in doubt just open against the main openwhisk repo).

component/repo mapping

About

Apache OpenWhisk 改动部分docker

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 87.4%
  • JavaScript 5.7%
  • Python 2.6%
  • Shell 2.1%
  • Java 0.9%
  • Groovy 0.5%
  • Other 0.8%