...

Cm container что это за программа

Saved searches

Use saved searches to filter your results more quickly

Cancel Create saved search

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Docker containers main control process for Caché, Ensemble and HealthShare

License

zrml/ccontainermain

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Switch branches/tags
Branches Tags
Could not load branches
Nothing to show
Could not load tags
Nothing to show

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Cancel Create

  • Local
  • Codespaces

HTTPS GitHub CLI
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

Latest commit message
Commit time
ccontainermain

README.md

ccontainermain

The program ccontainermain allows a Caché, Ensemble or HealthShare product to run in a Docker container. Docker containers need a PID 1 or main process to hold up the container. This is what ccontainermain provides. It is developed so that one can quickly work with Caché in a Docker container vs

  • having to understand why the container dies straight away and
  • having to develop a comprehensive script.

The name convention used is that of InterSystems commands found in the /bin directory like: ccontrol, cstart, cforce etc.

ccontainermain is called to run as the main process of a Docker container. One would copy it in the container and specify it as program to run when issuing a ‘docker run’ command. Alternatively, when using a dockerfile manifesto you would specify ccontainermain as the ENTRYPOINT command argument. See Docker documentation on Dockerfile declarative manifesto. The typical string found at the end of a Dockerfile would look like:

Please see the dockerfile examples in the [dockerfile] folder above.

ccontainermain start Caché|Ensemble|HealthShare and logs any message and issues to the standard Docker logs output. It also tries to tune shared memory so that Caché may start. You can pass higher value than the default 512MB that is usually enough to work.

ccontainermain also allows a software developer to start her or his Caché program and also other services. Here is an example of the syntax on how to fire up a container created via a Dockerfile -with the ENTRYPOINT specified as above, which wraps the call to a java service needed for the app:

$ docker run -p 57772:57772 centos7:C153 -xstart=/myExtraService.sh

However, the most important thing that ccontainermain does is probably the trapping of signals to the container. Consider the Docker command:

$ docker stop

Docker gives a 10 seconds default and then bring the container down. Not ideal for a database using shared memory. ccontainermain traps the signal and runs the Caché silent shutdown. Please remember to specify the -t (timeout) flag to the Docker stop command with a value >10 seconds as at times -depending on how busy the system is, it takes longer than that. Of course it all depends if one uses volumes or if one just uses a DB inside the container as an immutable artifact.

options

ccontainermain offers several flags:

  • -i for instance; it allows to specify the DB instance to start & stop; -i=CACHESYS2
  • -n for namespace; it allows to specify the namespace where to run a program; -n=USER
  • -r for routine; it allows to specify the routine name to start; -r=myApp or -r=»##class(package.class).method()»
  • -shmem for tuning SHMMAX; default val 512MB; -shmem=1024
  • -xprestart for eXecuting anything before Caché is started; -xprestart=/myapp/runMyExtraServive.sh
  • -xstart for eXecuting anything after Caché is started; -xstart=/myapp/runMyExtraServive.sh
  • -xstop for eXecuting anything after the Caché shutdown; -xstop=/bringAllMyProcsDown.sh
  • -cstart it’s a boolean defaulted to true; It gives us the option to start a container without starting Caché; -cstart=true
  • -cstop it’s a boolean defaulted to true; it gives the option to skip the Caché shutdown; -cstop=false
  • -nostu it’s a boolean defaulted to false; it allows DB single user startup for maintenance mode
  • -cconsole it’s a boolean defaulted to false; it shows Caché cconsole.log output in the container logs output
  • -version shows ccontainer version

The above flags can also be retrieved via

$ ./ccontainermain -help 

For more information on the Caché ccontrol related options please see: [InteSystems documentation] (http://docs.intersystems.com/cache201511/csp/docbook/DocBook.UI.Page.cls?KEY=GSA_using_instance#GSA_using_instance_control) and for the rest see [the Docker documentation] (https://docs.docker.com/)

Please note that I’ve left in a debug (dbg) constant that you can use to get extra debugging information throughout the program. For your convenience a linux executable has been provided so that you don’t have to install GO and compile the code. If you have GO installed simply

$ go build ccontainermain.go 

Please also note the dockerfile/ directory under which I’ll try to upload few useful Dockerfile examples. Dockerfiles are Docker engine manifests that allows one to automate Docker images creation.

TODO

  • investigate SIGCHLD for dying processes and clean up PID table
  • Windows/Azure support and testing

About

Docker containers main control process for Caché, Ensemble and HealthShare

Saved searches

Use saved searches to filter your results more quickly

Cancel Create saved search

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

License

codemonarch/CM-WebContainer

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Switch branches/tags
Branches Tags
Could not load branches
Nothing to show
Could not load tags
Nothing to show

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Cancel Create

  • Local
  • Codespaces

HTTPS GitHub CLI
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

Latest commit message
Commit time

README.md

CM-WebContainer

CMW 提供两种接入方式,分别是直接接入 WebContainer 和接入相应的 Activity/UIViewController。

接入 WebContainer 方式如下:

val webContainer = WebContainer(context) webContainer.delegate = this
let webContainer = WebContainer(frame: CGRect(. )) webContainer.delegate = self

接入 Activity 的方式如下:

正在准备中 ...

接入 UIViewController 的方式如下:

正在准备中 . 

API

Property acceptCookies 是否接受 Cookie
Property delegate 代理类,其中包含 onStartLoad , onEndLoad , onMeta 三个方法,分别对应页面开始载加,页面完成加载,获得 Meta 三个时机的回调
Method loadLocalResource 加载本地的资源,这个加载将允许 CMW 优先使用本地资源,开发者可以将全部或部分资源放在本地
Method getCookie 获取当前的 Cookie
Method setCookie 设置 Cookie,必须在请求前进行设置
Method load 加载一个 url 对应的页面
Method loadLocal 加载一个本地文件
Method callJs 调用页面内的 js 路由
Method runJs 直接执行一段 js 代码
JsRouting registerRouting 注册一个 js 路由
JsRouting removeRouting 移除一个 js 路由

При подготовке материала использовались источники:
https://github.com/zrml/ccontainermain
https://github.com/codemonarch/CM-WebContainer

Оцените статью