mirror of
https://github.com/clearlinux/dockerfiles.git
synced 2026-08-25 16:55:59 +00:00
Add ciao-controller
Signed-off-by: Munoz, Obed N <obed.n.munoz@intel.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
FROM clearlinux/ciao-controller
|
||||
MAINTAINER obed.n.munoz@intel.com
|
||||
|
||||
ARG swupd_args
|
||||
|
||||
COPY *.sh /root/
|
||||
COPY ciaorc /root/
|
||||
|
||||
CMD '/root/controller.sh'
|
||||
@@ -0,0 +1,80 @@
|
||||
CIAO Controller
|
||||
==============
|
||||
[](http://microbadger.com/images/clearlinux/ciao-controller "Get your own image badge on microbadger.com")
|
||||
[](http://microbadger.com/images/clearlinux/controller "Get your own version badge on microbadger.com")
|
||||
|
||||
This provides a CIAO Controller container
|
||||
|
||||
Features
|
||||
--------
|
||||
- From source building solution
|
||||
- Daemon and Manual service start mode
|
||||
- You mess it, just destroy it and start it again
|
||||
- Develop on you local development machine and deploy it on container
|
||||
|
||||
Build
|
||||
-----
|
||||
```
|
||||
docker build -t clearlinux/ciao-controller .
|
||||
```
|
||||
|
||||
Or just pull it from Dockerhub
|
||||
------------------------------
|
||||
```
|
||||
docker pull clearlinux/ciao-controller
|
||||
```
|
||||
|
||||
Pre-requirements
|
||||
----------------
|
||||
Before starting ``ciao-launcher``, take a look on [CIAO on top of Docker containers for development]()
|
||||
|
||||
Start CIAO Controller container
|
||||
-----------------------------
|
||||
### Run in daemon mode
|
||||
```
|
||||
export YOUR_HOST=localhost
|
||||
docker run -it -d --name ciao-controller --net=host
|
||||
-v `pwd`/certs/CAcert-$YOUR_HOST.pem:/etc/pki/ciao/CAcert-ciao-dev.pem \
|
||||
-v `pwd`/certs/cert-Controller-$YOUR_HOST.pem:/etc/pki/ciao/cert-Controller-ciao-dev.pem \
|
||||
-v `pwd`/certs/controller_cert.pem:/etc/pki/ciao/controller_cert.pem \
|
||||
-v `pwd`/certs/controller_key.pem:/etc/pki/ciao/controller_key.pem \
|
||||
-v `pwd`/ciao-keystone_cert.pem:/etc/ca-certs/cacert.pem \
|
||||
-e IDENTITY_HOST=$YOUR_HOST -e CONTROLLER_HOST=$YOUR_HOST \
|
||||
-v $GOPATH/src/github.com/01org/ciao:/root/go/src/github.com/01org/ciao \
|
||||
clearlinux/ciao-controller
|
||||
```
|
||||
### Run on manual mode
|
||||
```
|
||||
export YOUR_HOST=localhost
|
||||
docker run -it --name ciao-controller --net=host
|
||||
-v `pwd`/certs/CAcert-$YOUR_HOST.pem:/etc/pki/ciao/CAcert-ciao-dev.pem \
|
||||
-v `pwd`/certs/cert-Controller-$YOUR_HOST.pem:/etc/pki/ciao/cert-Controller-ciao-dev.pem \
|
||||
-v `pwd`/certs/controller_cert.pem:/etc/pki/ciao/controller_cert.pem \
|
||||
-v `pwd`/certs/controller_key.pem:/etc/pki/ciao/controller_key.pem \
|
||||
-v `pwd`/ciao-keystone_cert.pem:/etc/ca-certs/cacert.pem \
|
||||
-e IDENTITY_HOST=$YOUR_HOST -e CONTROLLER_HOST=$YOUR_HOST \
|
||||
-v $GOPATH/src/github.com/01org/ciao:/root/go/src/github.com/01org/ciao \
|
||||
clearlinux/ciao-controller bash
|
||||
|
||||
# Inside container
|
||||
root@example.com # ls
|
||||
ciaorc go controller.sh share
|
||||
|
||||
# Manual Start of Ciao Launcher
|
||||
root@example.com # ./controller.sh
|
||||
```
|
||||
### Getting CIAO Scheduler logs from docker
|
||||
```
|
||||
docker logs -f ciao-scheduler
|
||||
```
|
||||
|
||||
Environment Variables
|
||||
---------------------
|
||||
- ``IDENTITY_HOST`` Specifies the Keystone URL. Example: example.com
|
||||
- ``CONTROLLER_HOST`` Specifies the CIAO Controller URL. Example: example.com
|
||||
|
||||
Extra Build ARGs
|
||||
----------------
|
||||
- ``swupd_args`` Specifies [SWUPD](https://clearlinux.org/documentation/swupdate_how_to_run_the_updater.html) flags
|
||||
|
||||
Default build args in Docker are on: https://docs.docker.com/engine/reference/builder/#/arg
|
||||
@@ -0,0 +1,5 @@
|
||||
export CIAO_CONTROLLER=CONTROLLER_HOST
|
||||
export CIAO_IDENTITY=https://IDENTITY_HOST:35357
|
||||
export CIAO_USERNAME=admin
|
||||
export CIAO_PASSWORD=secret
|
||||
export CIAO_TENANT_NAME=admin
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
IDENTITY_HOST="${IDENTITY_HOST:-localhost}"
|
||||
CONTROLLER_HOST="${CONTROLLER_HOST:-localhost}"
|
||||
|
||||
sed -i.bak s/CONTROLLER_HOST/$CONTROLLER_HOST/g /root/ciaorc
|
||||
sed -i.bak s/IDENTITY_HOST/$IDENTITY_HOST/g /root/ciaorc
|
||||
|
||||
# compile the code before running it
|
||||
go install github.com/01org/ciao/...
|
||||
cp -f $GOBIN/* /usr/bin
|
||||
|
||||
mkdir -p /root/ciao-data
|
||||
cd /root/ciao-data
|
||||
cp -r /root/go/src/github.com/01org/ciao/ciao-controller/tables .
|
||||
cp -r /root/go/src/github.com/01org/ciao/ciao-controller/workloads .
|
||||
|
||||
if [ ! -d "/etc/ssl" ] ; then
|
||||
hash=`c_hash /etc/ca-certs/cacert.pem | cut -d ' ' -f1`
|
||||
ln -s /etc/ca-certs/cacert.pem /etc/ca-certs/$hash
|
||||
mkdir -p /etc/ssl
|
||||
ln -s /etc/ca-certs/ /etc/ssl/certs
|
||||
ln -s /etc/ca-certs/cacert.pem /usr/share/ca-certs/$hash
|
||||
cat /etc/pki/ciao/controller_cert.pem >> /etc/ca-certs/cacert.pem
|
||||
fi
|
||||
|
||||
# Starting the controller
|
||||
$GOBIN/ciao-controller -logtostderr -v=3
|
||||
Reference in New Issue
Block a user