diff --git a/.travis.yml b/.travis.yml index 6cc2460..6a12454 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,17 +4,10 @@ services: - docker env: - - DOCKERFILE_DIR=ciao-common - - DOCKERFILE_DIR=ciao-controller - - DOCKERFILE_DIR=ciao-launcher - - DOCKERFILE_DIR=ciao-scheduler - - DOCKERFILE_DIR=ciao-deploy - - DOCKERFILE_DIR=ciao-webui - DOCKERFILE_DIR=clr-sdk - DOCKERFILE_DIR=machine-learning - DOCKERFILE_DIR=machine-learning-ui - DOCKERFILE_DIR=mixer-ci - - DOCKERFILE_DIR=keystone - DOCKERFILE_DIR=mariadb script: diff --git a/README.md b/README.md index 2397f59..0e0aed0 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,6 @@ https://hub.docker.com/u/clearlinux/ Containers ---------- -- ciao-common -- ciao-controller -- ciao-launcher -- ciao-scheduler -- ciao-deploy -- ciao-webui - clr-sdk - machine-learning - mixer-ci diff --git a/ciao-common/Dockerfile b/ciao-common/Dockerfile deleted file mode 100644 index d009bd7..0000000 --- a/ciao-common/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM clearlinux -MAINTAINER obed.n.munoz@intel.com - -ARG swupd_args - -# Setting Environment -RUN mkdir -p /root/share -RUN mkdir -p /root/go/src -RUN mkdir -p /etc/pki/ciao -COPY bashrc /root/bashrc -RUN ln -s /root/bashrc /.bashrc -COPY environment /etc/ - -# update and utilities -RUN swupd update $swupd_args -RUN swupd bundle-add os-core-dev storage-cluster $swupd_args - -# CIAO Dependencies -RUN swupd bundle-add go-basic $swupd_args -RUN swupd bundle-add cloud-control $swupd_args -ENV GOPATH /root/go -ENV GOBIN /root/go/bin -ENV GOPATH $GOPATH:$GOPATH/vendor -RUN go get --insecure -v -u github.com/01org/ciao/... ; exit 0 - -RUN rm -rf /var/lib/swupd/* - -WORKDIR /root - -VOLUME '/root/share' - -CMD '/usr/sbin/bash' diff --git a/ciao-common/README.md b/ciao-common/README.md deleted file mode 100644 index b6ff196..0000000 --- a/ciao-common/README.md +++ /dev/null @@ -1,24 +0,0 @@ -CIAO Common -============== -[![](https://images.microbadger.com/badges/image/clearlinux/ciao-common.svg)](http://microbadger.com/images/clearlinux/ciao-common "Get your own image badge on microbadger.com") -[![](https://images.microbadger.com/badges/version/clearlinux/ciao-common.svg)](http://microbadger.com/images/clearlinux/common "Get your own version badge on microbadger.com") - -This provides a CIAO Common base image that contains all initial requirements for working with CIAO project - -Build ------ -``` -docker build -t clearlinux/ciao-common . -``` - -Or just pull it from Dockerhub ------------------------------- -``` -docker pull clearlinux/ciao-common -``` - -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 diff --git a/ciao-common/bashrc b/ciao-common/bashrc deleted file mode 100644 index a901fbd..0000000 --- a/ciao-common/bashrc +++ /dev/null @@ -1,15 +0,0 @@ -export no_proxy=10.0.0.0/8,192.168.0.0/16,localhost,127.0.0.0/8,134.134.0.0/16,ciao-dev.example.com -export PATH=$GOBIN:$PATH -export TERM=xterm - -# OpenStack rc file -if [ -f /root/openrc ]; -then - . /root/openrc -fi - -# CIAO rc file -if [ -f /root/ciaorc ]; -then - . /root/ciaorc -fi \ No newline at end of file diff --git a/ciao-common/environment b/ciao-common/environment deleted file mode 100644 index 3432913..0000000 --- a/ciao-common/environment +++ /dev/null @@ -1,5 +0,0 @@ -#Proxy Settings - -# GO dependencies -GOPATH="/root/go" -GOBIN="$GOPATH/bin" \ No newline at end of file diff --git a/ciao-common/openssl.cnf b/ciao-common/openssl.cnf deleted file mode 100644 index a1af719..0000000 --- a/ciao-common/openssl.cnf +++ /dev/null @@ -1,350 +0,0 @@ -# -# OpenSSL example configuration file. -# This is mostly being used for generation of certificate requests. -# - -# This definition stops the following lines choking if HOME isn't -# defined. -HOME = . -RANDFILE = $ENV::HOME/.rnd - -# Extra OBJECT IDENTIFIER info: -#oid_file = $ENV::HOME/.oid -oid_section = new_oids - -# To use this configuration file with the "-extfile" option of the -# "openssl x509" utility, name here the section containing the -# X.509v3 extensions to use: -# extensions = -# (Alternatively, use a configuration file that has only -# X.509v3 extensions in its main [= default] section.) - -[ new_oids ] - -# We can add new OIDs in here for use by 'ca', 'req' and 'ts'. -# Add a simple OID like this: -# testoid1=1.2.3.4 -# Or use config file substitution like this: -# testoid2=${testoid1}.5.6 - -# Policies used by the TSA examples. -tsa_policy1 = 1.2.3.4.1 -tsa_policy2 = 1.2.3.4.5.6 -tsa_policy3 = 1.2.3.4.5.7 - -#################################################################### -[ ca ] -default_ca = CA_default # The default ca section - -#################################################################### -[ CA_default ] - -dir = /etc/ssl # Where everything is kept -certs = $dir/certs # Where the issued certs are kept -crl_dir = $dir/crl # Where the issued crl are kept -database = $dir/index.txt # database index file. -#unique_subject = no # Set to 'no' to allow creation of - # several ctificates with same subject. -new_certs_dir = $dir/newcerts # default place for new certs. - -certificate = $dir/cacert.pem # The CA certificate -serial = $dir/serial # The current serial number -crlnumber = $dir/crlnumber # the current crl number - # must be commented out to leave a V1 CRL -crl = $dir/crl.pem # The current CRL -private_key = $dir/private/cakey.pem# The private key -RANDFILE = $dir/private/.rand # private random number file - -x509_extensions = usr_cert # The extentions to add to the cert - -# Comment out the following two lines for the "traditional" -# (and highly broken) format. -name_opt = ca_default # Subject Name options -cert_opt = ca_default # Certificate field options - -# Extension copying option: use with caution. -# copy_extensions = copy - -# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs -# so this is commented out by default to leave a V1 CRL. -# crlnumber must also be commented out to leave a V1 CRL. -# crl_extensions = crl_ext - -default_days = 365 # how long to certify for -default_crl_days= 30 # how long before next CRL -default_md = default # use public key default MD -preserve = no # keep passed DN ordering - -# A few difference way of specifying how similar the request should look -# For type CA, the listed attributes must be the same, and the optional -# and supplied fields are just that :-) -policy = policy_match - -# For the CA policy -[ policy_match ] -countryName = match -stateOrProvinceName = match -organizationName = match -organizationalUnitName = optional -commonName = supplied -emailAddress = optional - -# For the 'anything' policy -# At this point in time, you must list all acceptable 'object' -# types. -[ policy_anything ] -countryName = optional -stateOrProvinceName = optional -localityName = optional -organizationName = optional -organizationalUnitName = optional -commonName = supplied -emailAddress = optional - -#################################################################### -[ req ] -default_bits = 2048 -default_keyfile = privkey.pem -distinguished_name = req_distinguished_name -attributes = req_attributes -x509_extensions = v3_ca # The extentions to add to the self signed cert - -# Passwords for private keys if not present they will be prompted for -# input_password = secret -# output_password = secret - -# This sets a mask for permitted string types. There are several options. -# default: PrintableString, T61String, BMPString. -# pkix : PrintableString, BMPString (PKIX recommendation before 2004) -# utf8only: only UTF8Strings (PKIX recommendation after 2004). -# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). -# MASK:XXXX a literal mask value. -# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings. -string_mask = utf8only - -# req_extensions = v3_req # The extensions to add to a certificate request - -[ req_distinguished_name ] -countryName = Country Name (2 letter code) -countryName_default = AU -countryName_min = 2 -countryName_max = 2 - -stateOrProvinceName = State or Province Name (full name) -stateOrProvinceName_default = Some-State - -localityName = Locality Name (eg, city) - -0.organizationName = Organization Name (eg, company) -0.organizationName_default = Internet Widgits Pty Ltd - -# we can do this but it is not needed normally :-) -#1.organizationName = Second Organization Name (eg, company) -#1.organizationName_default = World Wide Web Pty Ltd - -organizationalUnitName = Organizational Unit Name (eg, section) -#organizationalUnitName_default = - -commonName = Common Name (e.g. server FQDN or YOUR name) -commonName_max = 64 - -emailAddress = Email Address -emailAddress_max = 64 - -# SET-ex3 = SET extension number 3 - -[ req_attributes ] -challengePassword = A challenge password -challengePassword_min = 4 -challengePassword_max = 20 - -unstructuredName = An optional company name - -[ usr_cert ] - -# These extensions are added when 'ca' signs a request. - -# This goes against PKIX guidelines but some CAs do it and some software -# requires this to avoid interpreting an end user certificate as a CA. - -basicConstraints=CA:FALSE - -# Here are some examples of the usage of nsCertType. If it is omitted -# the certificate can be used for anything *except* object signing. - -# This is OK for an SSL server. -# nsCertType = server - -# For an object signing certificate this would be used. -# nsCertType = objsign - -# For normal client use this is typical -# nsCertType = client, email - -# and for everything including object signing: -# nsCertType = client, email, objsign - -# This is typical in keyUsage for a client certificate. -# keyUsage = nonRepudiation, digitalSignature, keyEncipherment - -# This will be displayed in Netscape's comment listbox. -nsComment = "OpenSSL Generated Certificate" - -# PKIX recommendations harmless if included in all certificates. -subjectKeyIdentifier=hash -authorityKeyIdentifier=keyid,issuer - -# This stuff is for subjectAltName and issuerAltname. -# Import the email address. -# subjectAltName=email:copy -# An alternative to produce certificates that aren't -# deprecated according to PKIX. -# subjectAltName=email:move - -# Copy subject details -# issuerAltName=issuer:copy - -#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem -#nsBaseUrl -#nsRevocationUrl -#nsRenewalUrl -#nsCaPolicyUrl -#nsSslServerName - -# This is required for TSA certificates. -# extendedKeyUsage = critical,timeStamping - -[ v3_req ] - -# Extensions to add to a certificate request - -basicConstraints = CA:FALSE -keyUsage = nonRepudiation, digitalSignature, keyEncipherment - -[ v3_ca ] - - -# Extensions for a typical CA - - -# PKIX recommendation. - -subjectKeyIdentifier=hash - -authorityKeyIdentifier=keyid:always,issuer - -# This is what PKIX recommends but some broken software chokes on critical -# extensions. -#basicConstraints = critical,CA:true -# So we do this instead. -basicConstraints = CA:true - -# Key usage: this is typical for a CA certificate. However since it will -# prevent it being used as an test self-signed certificate it is best -# left out by default. -# keyUsage = cRLSign, keyCertSign - -# Some might want this also -# nsCertType = sslCA, emailCA - -# Include email address in subject alt name: another PKIX recommendation -# subjectAltName=email:copy -# Copy issuer details -# issuerAltName=issuer:copy - -# DER hex encoding of an extension: beware experts only! -# obj=DER:02:03 -# Where 'obj' is a standard or added object -# You can even override a supported extension: -# basicConstraints= critical, DER:30:03:01:01:FF - -[ crl_ext ] - -# CRL extensions. -# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. - -# issuerAltName=issuer:copy -authorityKeyIdentifier=keyid:always - -[ proxy_cert_ext ] -# These extensions should be added when creating a proxy certificate - -# This goes against PKIX guidelines but some CAs do it and some software -# requires this to avoid interpreting an end user certificate as a CA. - -basicConstraints=CA:FALSE - -# Here are some examples of the usage of nsCertType. If it is omitted -# the certificate can be used for anything *except* object signing. - -# This is OK for an SSL server. -# nsCertType = server - -# For an object signing certificate this would be used. -# nsCertType = objsign - -# For normal client use this is typical -# nsCertType = client, email - -# and for everything including object signing: -# nsCertType = client, email, objsign - -# This is typical in keyUsage for a client certificate. -# keyUsage = nonRepudiation, digitalSignature, keyEncipherment - -# This will be displayed in Netscape's comment listbox. -nsComment = "OpenSSL Generated Certificate" - -# PKIX recommendations harmless if included in all certificates. -subjectKeyIdentifier=hash -authorityKeyIdentifier=keyid,issuer - -# This stuff is for subjectAltName and issuerAltname. -# Import the email address. -# subjectAltName=email:copy -# An alternative to produce certificates that aren't -# deprecated according to PKIX. -# subjectAltName=email:move - -# Copy subject details -# issuerAltName=issuer:copy - -#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem -#nsBaseUrl -#nsRevocationUrl -#nsRenewalUrl -#nsCaPolicyUrl -#nsSslServerName - -# This really needs to be in place for it to be a proxy certificate. -proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo - -#################################################################### -[ tsa ] - -default_tsa = tsa_config1 # the default TSA section - -[ tsa_config1 ] - -# These are used by the TSA reply generation only. -dir = ./demoCA # TSA root directory -serial = $dir/tsaserial # The current serial number (mandatory) -crypto_device = builtin # OpenSSL engine to use for signing -signer_cert = $dir/tsacert.pem # The TSA signing certificate - # (optional) -certs = $dir/cacert.pem # Certificate chain to include in reply - # (optional) -signer_key = $dir/private/tsakey.pem # The TSA private key (optional) - -default_policy = tsa_policy1 # Policy if request did not specify it - # (optional) -other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional) -digests = md5, sha1 # Acceptable message digests (mandatory) -accuracy = secs:1, millisecs:500, microsecs:100 # (optional) -clock_precision_digits = 0 # number of digits after dot. (optional) -ordering = yes # Is ordering defined for timestamps? - # (optional, default: no) -tsa_name = yes # Must the TSA name be included in the reply? - # (optional, default: no) -ess_cert_id_chain = no # Must the ESS cert id chain be included? - # (optional, default: no) diff --git a/ciao-controller/Dockerfile b/ciao-controller/Dockerfile deleted file mode 100644 index 44feb8c..0000000 --- a/ciao-controller/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM clearlinux/ciao-common -MAINTAINER obed.n.munoz@intel.com - -ARG swupd_args - -COPY *.sh /root/ -COPY ciaorc /root/ - -CMD '/root/controller.sh' diff --git a/ciao-controller/README.md b/ciao-controller/README.md deleted file mode 100644 index bf089d1..0000000 --- a/ciao-controller/README.md +++ /dev/null @@ -1,86 +0,0 @@ -CIAO Controller -============== -[![](https://images.microbadger.com/badges/image/clearlinux/ciao-controller.svg)](http://microbadger.com/images/clearlinux/ciao-controller "Get your own image badge on microbadger.com") -[![](https://images.microbadger.com/badges/version/clearlinux/ciao-controller.svg)](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-controller``, 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`/certs/ciao-image_cert.pem:/etc/pki/ciao/ciao-image_cert.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`/certs/ciao-image_cert.pem:/etc/pki/ciao/ciao-image_cert.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 Controller -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 -- (Optional) ``CIAO_TENANT_NAME`` Specifies Tenant (Project) name (default=admin) -- (Optional) ``CIAO_USERNAME`` Specifies default user name (default=admin) -- (Optional) ``CIAO_PASSWORD`` Specifies default password (default=secret) -- ``CEPH_ID`` Specifies the CEPH storage ID (default=admin) - -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 diff --git a/ciao-controller/ciaorc b/ciao-controller/ciaorc deleted file mode 100644 index 31d75f3..0000000 --- a/ciao-controller/ciaorc +++ /dev/null @@ -1,5 +0,0 @@ -export CIAO_CONTROLLER=CONTROLLER_HOST -export CIAO_IDENTITY=https://IDENTITY_HOST:35357 -export CIAO_USERNAME= -export CIAO_PASSWORD= -export CIAO_TENANT_NAME= diff --git a/ciao-controller/controller.sh b/ciao-controller/controller.sh deleted file mode 100755 index f8dbca9..0000000 --- a/ciao-controller/controller.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -IDENTITY_HOST="${IDENTITY_HOST:-localhost}" -CONTROLLER_HOST="${CONTROLLER_HOST:-localhost}" -CIAO_TENANT_NAME="${CIAO_TENANT_NAME:-admin}" -CIAO_USERNAME="${CIAO_USERNAME:-admin}" -CIAO_PASSWORD="${CIAO_PASSWORD:-secret}" -CEPH_ID="${CEPH_ID:-admin}" - -sed -i.bak s/CONTROLLER_HOST/$CONTROLLER_HOST/g /root/ciaorc -sed -i.bak s/IDENTITY_HOST/$IDENTITY_HOST/g /root/ciaorc -sed -i.bak s/\/$CIAO_TENANT_NAME/g /root/ciaorc -sed -i.bak s/\/$CIAO_USERNAME/g /root/ciaorc -sed -i.bak s/\/$CIAO_PASSWORD/g /root/ciaorc - -# compile the code before running it -go install github.com/01org/ciao/... -cp -f $GOBIN/* /usr/bin - -mkdir -p /var/lib/ciao/data/controller/ -cp -r /root/go/src/github.com/01org/ciao/ciao-controller/tables /var/lib/ciao/data/controller/ -cp -r /root/go/src/github.com/01org/ciao/ciao-controller/workloads /var/lib/ciao/data/controller/ - -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/api/controller_cert.pem >> /etc/ca-certs/cacert.pem -fi - -# Wait until keystone is ready -source /root/ciaorc -echo "Waiting keystone to start " -until ciao-cli tenant list | grep service > /dev/null 2>&1 ; do - echo -n . - sleep 1 -done -# Starging ciao-controller -$GOBIN/ciao-controller -logtostderr -ceph_id=$CEPH_ID -v=3 - diff --git a/ciao-deploy/Dockerfile b/ciao-deploy/Dockerfile deleted file mode 100644 index a97d3ce..0000000 --- a/ciao-deploy/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM clearlinux -MAINTAINER marcos.simental.magana@intel.com - -ARG swupd_args -ENV HOME=/root/ - -RUN swupd update $swupd_args -RUN swupd bundle-add cryptography sysadmin-hostmgmt go-basic c-basic openstack-python-clients $swupd_args - -RUN rm -rf /var/lib/swupd - -CMD 'bash' diff --git a/ciao-deploy/README.md b/ciao-deploy/README.md deleted file mode 100644 index 9cd058f..0000000 --- a/ciao-deploy/README.md +++ /dev/null @@ -1,61 +0,0 @@ -Ciao Deploy -========== -[![](https://images.microbadger.com/badges/image/clearlinux/ciao-deploy.svg)](http://microbadger.com/images/clearlinux/ciao-deploy "Get your own image badge on microbadger.com") -[![](https://images.microbadger.com/badges/version/clearlinux/ciao-deploy.svg)](http://microbadger.com/images/clearlinux/ciao-deploy "Get your own version badge on microbadger.com") - -This provides a ciao deployment container. - -Build ------ -``` -docker build -t clearlinux/ciao-deploy . -``` - -Or just pull it from Dockerhub ------------------------------- -``` -docker pull clearlinux/ciao-deploy -``` - -Clone the ciao example deployment ---------------------------------- -``` -git clone https://github.com/01org/ciao.git -``` - -Setup your cluster configuration --------------------------------- -You may need to edit `ciao/_DeploymentAndDistroPackaging/ansible/group_vars/all` -and `ciao/_DeploymentAndDistroPackaging/ansible/hosts` to suit your cluster -setup needs. - -For more detailed instructions you may want to check -[Deploying ciao via automation](https://clearlinux.org/documentation/ciao-deploy.html) -documentation. - -Run the Ciao-deploy Container ----------------------------- -You will need to use an ssh key to manage the remote nodes. Replace -`/path/to/your/.ssh/key` with your private ssh key filename (notice it -must be an absolute path). - -``` -docker run --privileged -v /dev/:/dev/ \ - -v $(pwd)/ciao:/root/ciao \ - -v /path/to/your/.ssh/key:/root/.ssh/key \ - -it clearlinux/ciao-deploy -``` - -**Note**: - -The cotainer needs `–privileged -v /dev/:/dev/` in order to install -your certificates in the -[CNCI image](https://github.com/01org/ciao/tree/master/networking/ciao-cnci-agent#cnci-agent). -To learn more about the Docker options used, please refer to the -[Docker* documentation](https://docs.docker.com/engine/reference/commandline/run/). - -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 diff --git a/ciao-launcher/Dockerfile b/ciao-launcher/Dockerfile deleted file mode 100644 index f8357b1..0000000 --- a/ciao-launcher/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM clearlinux/ciao-common -MAINTAINER obed.n.munoz@intel.com - -ARG swupd_args - -COPY *.sh /root/ -COPY dnsmasq.conf.macvlan0 /etc/dnsmasq.conf - -CMD '/root/launcher.sh' diff --git a/ciao-launcher/README.md b/ciao-launcher/README.md deleted file mode 100644 index 9bd7e13..0000000 --- a/ciao-launcher/README.md +++ /dev/null @@ -1,75 +0,0 @@ -CIAO Launcher -============= -[![](https://images.microbadger.com/badges/image/clearlinux/ciao-launcher.svg)](http://microbadger.com/images/clearlinux/ciao-launcher "Get your own image badge on microbadger.com") -[![](https://images.microbadger.com/badges/version/clearlinux/ciao-launcher.svg)](http://microbadger.com/images/clearlinux/launcher "Get your own version badge on microbadger.com") - -This provides a CIAO Launcher 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-launcher . -``` - -Or just pull it from Dockerhub ------------------------------- -``` -docker pull clearlinux/ciao-launcher -``` - -Pre-requirements ----------------- -Before starting ``ciao-launcher``, take a look on [CIAO on top of Docker containers for development]() - -Start CIAO Launcher container ------------------------------ -### Run in daemon mode -``` -docker run -it -d --name launcher --net=host --privileged -v /dev/kvm:/dev/kvm \ - -v /dev:/dev -v /var/run/docker.sock:/var/run/docker.sock \ - --cap-add=NET_ADMIN --device /dev/net/tun:/dev/net/tun \ - -v `pwd`/certs/CAcert-localhost.pem:/etc/pki/ciao/CAcert-ciao-dev.pem \ - -v `pwd`/certs/cert-CNAgent-NetworkingAgent-localhost.pem:/etc/pki/ciao/cert-CNAgent-NetworkingAgent-ciao-dev.pem \ - -v $GOPATH/src/github.com/01org/ciao:/root/go/src/github.com/01org/ciao \ - ciao/launcher -``` - -### Run on manual mode -``` -docker run -it --name launcher --net=host --privileged -v /dev/kvm:/dev/kvm \ - -v /dev:/dev -v /var/run/docker.sock:/var/run/docker.sock \ - --cap-add=NET_ADMIN --device /dev/net/tun:/dev/net/tun \ - -v `pwd`/certs/CAcert-localhost.pem:/etc/pki/ciao/CAcert-ciao-dev.pem \ - -v `pwd`/certs/cert-CNAgent-NetworkingAgent-localhost.pem:/etc/pki/ciao/cert-CNAgent-NetworkingAgent-ciao-dev.pem \ - -v $GOPATH/src/github.com/01org/ciao:/root/go/src/github.com/01org/ciao \ - ciao/launcher bash - -# Inside container -root@example.com # ls -ciaorc go launcher.sh share - -# Manual Start of Ciao Launcher -root@example.com # ./launcher.sh -``` - -### Getting CIAO Scheduler logs from docker -``` -docker logs -f ciao-scheduler -``` - -Environment Variables ---------------------- -- ``CEPH_ID`` Specifies the CEPH storage ID (default=admin) - -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 diff --git a/ciao-launcher/dnsmasq.conf.macvlan0 b/ciao-launcher/dnsmasq.conf.macvlan0 deleted file mode 100644 index 4b75e67..0000000 --- a/ciao-launcher/dnsmasq.conf.macvlan0 +++ /dev/null @@ -1,25 +0,0 @@ -# Only listen to routers' LAN NIC. Doing so opens up tcp/udp port 53 to -# localhost and udp port 67 to world: -interface=macvlan0 - -listen-address=192.168.0.1 - -# dnsmasq will open tcp/udp port 53 and udp port 67 to world to help with -# dynamic interfaces (assigning dynamic ips). Dnsmasq will discard world -# requests to them, but the paranoid might like to close them and let the -# kernel handle them: -bind-interfaces - -# Dynamic range of IPs to make available to LAN pc -dhcp-range=192.168.0.50,192.168.0.100,12h - -# If you’d like to have dnsmasq assign static IPs, bind the LAN computer's -# NIC MAC address: - -except-interface=lo - -log-queries - -log-dhcp - -#dhcp-host=aa:bb:cc:dd:ee:ff,192.168.111.50 diff --git a/ciao-launcher/generate_cnci_cloud_image.sh b/ciao-launcher/generate_cnci_cloud_image.sh deleted file mode 100755 index faf3d71..0000000 --- a/ciao-launcher/generate_cnci_cloud_image.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash -#Defaults - -set -x -image="clear-8260-ciao-networking.img" -certs_dir=$GOPATH/src/github.com/01org/ciao/networking/ciao-cnci-agent/scripts/certs -cnci_agent=$GOPATH/bin/ciao-cnci-agent -cnci_sysd=$GOPATH/src/github.com/01org/ciao/networking/ciao-cnci-agent/scripts/ciao-cnci-agent.service -partition="2" -download=0 - -usage="$(basename "$0") [--image clear_cnci_image_name] [-certs certificate_directory] [-agent cnci_agent_binary] [-script cnci_systemd_script] \n\n A simple script to create a CNCI Image from a clear cloud image. \n Defaults for any unspecified option are as follows \n\n --agent $cnci_agent \n --certs $certs_dir \n --image $image \n --script $cnci_sysd\n\n" - - -while : -do - case "$1" in - -a | --agent) - cnci_agent="$2" - shift 2 - ;; - -c | --certs) - certs_dir="$2" - shift 2 - ;; - -d | --download) - download=1 - shift 1 - ;; - -h | --help) - echo -e "$usage" >&2 - exit 0 - ;; - -i | --image) - image="$2" - shift 2 - ;; - -s | --script) - cnci_sysd="$2" - shift 2 - ;; - *) - break - ;; - esac -done - -set -o nounset - -if [ $download -eq 1 ] -then - rm -f "$image" - curl -O https://download.clearlinux.org/demos/ciao/"$image".xz - unxz "$image".xz -fi - -echo -e "\nMounting image: $image" -tmpdir=$(mktemp -d) -#sudo modprobe nbd max_part=63 -#sudo qemu-nbd --format=raw -c /dev/nbd0 "$image" - -#it can take some time for the device to get created -retry=0 -loop='' -until [ $retry -ge 3 ] -do - if [ "$loop" == "" ]; then - loop=`sudo losetup -f --show -P $image` - fi - sudo mount ${loop}p$partition "$tmpdir" && break - let retry=retry+1 - echo "Mount failed, retrying $retry" - sleep 10 -done - -if [ $retry -ge 3 ] -then - echo "Unable to mount CNCI Image" - return 1 -fi - -echo -e "Cleaning up any artifacts" -sudo rm -rf "$tmpdir"/var/lib/ciao - -echo -e "Copying agent image" -sudo cp "$cnci_agent" "$tmpdir"/usr/sbin/ - -echo -e "Copying agent systemd service script" -sudo cp "$cnci_sysd" "$tmpdir"/usr/lib/systemd/system/ - -echo -e "Installing the service" -sudo mkdir -p "$tmpdir"/etc/systemd/system/default.target.wants -sudo rm -f "$tmpdir"/etc/systemd/system/default.target.wants/ciao-cnci-agent.service -sudo chroot "$tmpdir" /bin/bash -c "sudo ln -s /usr/lib/systemd/system/ciao-cnci-agent.service /etc/systemd/system/default.target.wants/" - -echo -e "Copying CA certificates" -sudo mkdir -p "$tmpdir"/var/lib/ciao/ -sudo cp "$certs_dir"/CAcert-* "$tmpdir"/var/lib/ciao/CAcert-server-localhost.pem - -echo -e "Copying CNCI Agent certificate" -sudo cp "$certs_dir"/cert-CNCIAgent-* "$tmpdir"/var/lib/ciao/cert-client-localhost.pem - -echo -e "Removing cloud-init traces" -sudo rm -rf "$tmpdir"/var/lib/cloud - -#Umount -echo -e "Done! unmounting\n" -sudo umount "$tmpdir" -sudo losetup -d $loop -sudo rm -rf "$tmpdir" -exit 0 diff --git a/ciao-launcher/launcher.sh b/ciao-launcher/launcher.sh deleted file mode 100755 index 3b0c265..0000000 --- a/ciao-launcher/launcher.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -set -x - -CEPH_ID="${CEPH_ID:-admin}" - -# Copy images -mkdir -p /var/lib/ciao/images -if [ ! "$(ls -A /var/lib/ciao/images)" ]; then - cp -r /share/images/* /var/lib/ciao/images/ -fi - -# compile the code before running it -go install github.com/01org/ciao/... -cp -f $GOBIN/* /usr/bin - -# Starting Compute Service -mkdir -p /var/lib/misc -mkdir -p /var/run - -killall -9 dnsmasq -dnsmasq -C /etc/dnsmasq.conf - -$GOBIN/ciao-launcher -logtostderr -ceph_id=$CEPH_ID -v=3 diff --git a/ciao-scheduler/Dockerfile b/ciao-scheduler/Dockerfile deleted file mode 100644 index 9e62ab4..0000000 --- a/ciao-scheduler/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM clearlinux/ciao-common -MAINTAINER obed.n.munoz@intel.com - -ARG swupd_args - -COPY *.sh /root/ -RUN mkdir /etc/ciao - -COPY configuration.yaml /etc/ciao/ -COPY ciaorc /root/ - -CMD '/root/scheduler.sh' diff --git a/ciao-scheduler/README.md b/ciao-scheduler/README.md deleted file mode 100644 index 4f3b72c..0000000 --- a/ciao-scheduler/README.md +++ /dev/null @@ -1,74 +0,0 @@ -CIAO Scheduler -============== -[![](https://images.microbadger.com/badges/image/clearlinux/ciao-scheduler.svg)](http://microbadger.com/images/clearlinux/ciao-scheduler "Get your own image badge on microbadger.com") -[![](https://images.microbadger.com/badges/version/clearlinux/ciao-scheduler.svg)](http://microbadger.com/images/clearlinux/scheduler "Get your own version badge on microbadger.com") - -This provides a CIAO Scheduler 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 containers. -- No data/binary copies, everything can be accesible from container - -Build ------ -``` -docker build -t clearlinux/ciao-scheduler . -``` - -Or just pull it from Dockerhub ------------------------------- -``` -docker pull clearlinux/ciao-scheduler -``` - -Pre-requirements ----------------- -Before launching scheduler, take a look on [CIAO on top of Docker containers for development]() - -Start CIAO Scheduler container ------------------------------ -### Run in daemon mode -``` -export YOUR_HOST=localhost -docker run -d -it -v --name ciao-scheduler --net=host -v `pwd`/certs/CAcert-$YOUR_HOST.pem:/etc/pki/ciao/CAcert-ciao-dev.pem \ - -v `pwd`/certs/cert-Scheduler-$YOU_HOST.pem:/etc/pki/ciao/cert-Scheduler-ciao-dev.pem \ - -e IDENTITY_HOST=$YOUR_HOST \ - -v $GOPATH/src/github.com/01org/ciao:/root/go/src/github.com/01org/ciao \ - ciao/scheduler -``` - -### Run on manual mode -``` -export YOUR_HOST=localhost -docker run -d -it -v --name ciao-scheduler --net=host -v `pwd`/certs/CAcert-$YOUR_HOST.pem:/etc/pki/ciao/CAcert-ciao-dev.pem \ - -v `pwd`/certs/cert-Scheduler-$YOU_HOST.pem:/etc/pki/ciao/cert-Scheduler-ciao-dev.pem \ - -e IDENTITY_HOST=$YOUR_HOST \ - -v $GOPATH/src/github.com/01org/ciao:/root/go/src/github.com/01org/ciao \ - ciao/scheduler bash - -# Inside container -root@example.com # ls -ciaorc go scheduler.sh share - -# Manual Start of Ciao Scheduler -root@example.com # ./scheduler.sh -``` - -### Getting CIAO Scheduler logs from docker -``` -docker logs -f ciao-scheduler -``` - -Environment Variables ---------------------- -- ``IDENTITY_HOST`` Specifies the Keystone 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 diff --git a/ciao-scheduler/ciaorc b/ciao-scheduler/ciaorc deleted file mode 100644 index f3178fd..0000000 --- a/ciao-scheduler/ciaorc +++ /dev/null @@ -1,4 +0,0 @@ -export CIAO_CONTROLLER=192.168.0.1 -export CIAO_IDENTITY=https://192.168.0.1:35357 -export CIAO_USERNAME=admin -export CIAO_PASSWORD=secret \ No newline at end of file diff --git a/ciao-scheduler/configuration.yaml b/ciao-scheduler/configuration.yaml deleted file mode 100644 index 56d7daf..0000000 --- a/ciao-scheduler/configuration.yaml +++ /dev/null @@ -1,20 +0,0 @@ -configure: - scheduler: - storage_uri: file:///etc/ciao/configuration.yaml - controller: - compute_port: 8774 - compute_ca: /etc/pki/ciao/api/controller_cert.pem - compute_cert: /etc/pki/ciao/api/controller_key.pem - identity_user: admin - identity_password: secret - launcher: - compute_net: [192.168.0.1/24] - mgmt_net: [192.168.0.1/24] - disk_limit: false - mem_limit: false - image_service: - type: glance - url: http://HOST - identity_service: - type: keystone - url: https://IDENTITY_HOST:35357 diff --git a/ciao-scheduler/scheduler.sh b/ciao-scheduler/scheduler.sh deleted file mode 100755 index 0d2e104..0000000 --- a/ciao-scheduler/scheduler.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -set -x - -IDENTITY_HOST="${IDENTITY_HOST:-localhost}" - -sed -i.bak s/IDENTITY_HOST/$IDENTITY_HOST/g /etc/ciao/configuration.yaml - -# compile the code before running it -go install github.com/01org/ciao/... -cp -f $GOBIN/* /usr/bin - -# Starting Scheduler -$GOBIN/ciao-scheduler --cacert=/etc/pki/ciao/CAcert-ciao-dev.pem --cert=/etc/pki/ciao/cert-Scheduler-ciao-dev.pem --heartbeat diff --git a/ciao-webui/Dockerfile b/ciao-webui/Dockerfile deleted file mode 100644 index 2e98a4d..0000000 --- a/ciao-webui/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM clearlinux -MAINTAINER marcos.simental.magana@intel.com - -ARG WEBUI_VERSION=1.4.14.15 - -ARG swupd_args - -RUN swupd update $swupd_args -RUN swupd bundle-add network-basic nodejs-basic $swupd_args - -RUN mkdir -p /etc/ciao-webui -COPY ciao_config.json /etc/ciao-webui -COPY bootstrap.sh /usr/bin/bootstrap.sh - -RUN curl -LOk https://github.com/01org/ciao-webui/archive/v${WEBUI_VERSION}.tar.gz -RUN tar xf v${WEBUI_VERSION}.tar.gz -RUN mv ciao-webui-${WEBUI_VERSION} ciao-webui - -CMD '/usr/bin/bootstrap.sh' diff --git a/ciao-webui/README.md b/ciao-webui/README.md deleted file mode 100644 index b39a808..0000000 --- a/ciao-webui/README.md +++ /dev/null @@ -1,56 +0,0 @@ -Ciao webui -========== -[![](https://images.microbadger.com/badges/image/clearlinux/ciao-webui.svg)](http://microbadger.com/images/clearlinux/ciao-webui "Get your own image badge on microbadger.com") -[![](https://images.microbadger.com/badges/version/clearlinux/ciao-webui.svg)](http://microbadger.com/images/clearlinux/ciao-webui "Get your own version badge on microbadger.com") - -This provides a ciao web dashboard container - -Build ------ -``` -docker build -t clearlinux/ciao-webui . -``` - -Or just pull it from Dockerhub ------------------------------- -``` -docker pull clearlinux/ciao-webui -``` -Create Ciao-webui SSL certificates ----------------------------------- -``` -YOUR_HOST=`hostname -f` - -openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout webui_key.pem \ - -out webui_cert.pem -subj "/CN=$YOUR_HOST" -``` - -Run the Ciao-webui Container ----------------------------- -``` -docker run -v `pwd`/webui_key.pem:/etc/pki/ciao-webui-key.pem \ - -v `pwd`/webui_cert.pem:/etc/pki/ciao-webui-cert.pem \ - -e CONTROLLER_HOST=controller.example.com \ - -e IDENTITY_HOST=keystone.example.com \ - -p 443:443 -d clearlinux/ciao-webui -``` - -Environment Variables ---------------------- -- ``IDENTITY_HOST`` - Identity (Keystone) host -- ``CONTROLLER_HOST`` - Controller (ciao-controller) host -- ``STORAGE_HOST`` - Storage (ciao-controller) host -- ``CERT_PASS`` - Passprhase for the ciao-webui certificate -- ``MODE`` - Ciao-webui deployment mode (production|development) - default is `production` - -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 diff --git a/ciao-webui/bootstrap.sh b/ciao-webui/bootstrap.sh deleted file mode 100755 index de7310e..0000000 --- a/ciao-webui/bootstrap.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -NODE_ENV=$MODE -CONTROLLER_HOST=$CONTROLLER_HOST -IDENTITY_HOST=$IDENTITY_HOST -CERT_PASS=$CERT_PASS -STORAGE_HOST=$STORAGE_HOST - -_usage(){ - >&2 echo "usage:" - >&2 echo " $ docker run -v /path/to/ciao-webui-key.pem:/etc/pki/ciao-webui-key.pem \\" - >&2 echo " -v /path/to/ciao-webui-cert.pem:/etc/pki/ciao-webui-cert.pem \\" - >&2 echo " -e CONTROLLER_HOST=controller.example.com \\" - >&2 echo " -e IDENTITY_HOST=keystone.example.com \\" - >&2 echo "(optional: -e STORAGE_HOST=storage.example.com )\\" - >&2 echo "(optional: -e CERT_PASS=certificate_passphrase )" -} - -if [[ -z $MODE ]] ; then - NODE_ENV="production" -fi - -if [[ -z $CONTROLLER_HOST || -z $IDENTITY_HOST ]] ; then - >&2 echo -e "missing CONTROLLER_HOST or IDENTITY_HOST arguments\n" - _usage - exit -fi - -if [[ ! -r /etc/pki/ciao-webui-key.pem ]] ; then - >&2 echo -e "missing /etc/pki/ciao-webui-key.pem\n" - _usage - exit -fi - -if [[ ! -r /etc/pki/ciao-webui-cert.pem ]] ; then - >&2 echo -e "missing /etc/pki/ciao-webui-cert.pem\n" - _usage - exit -fi - -sed -i.bak s/##MODE##/$NODE_ENV/g /etc/ciao-webui/ciao_config.json -sed -i.bak s/##CONTROLLER_HOST##/$CONTROLLER_HOST/g /etc/ciao-webui/ciao_config.json -sed -i.bak s/##STORAGE_HOST##/$STORAGE_HOST/g /etc/ciao-webui/ciao_config.json -sed -i.bak s/##KEYSTONE_HOST##/$IDENTITY_HOST/g /etc/ciao-webui/ciao_config.json -sed -i.bak s/##CERT_PASS##/$CERT_PASS/g /etc/ciao-webui/ciao_config.json - -ln -sf /etc/ciao-webui/ciao_config.json /ciao-webui/config/ciao_config.json - -cd /ciao-webui -export PORT=443 -./deploy.sh $NODE_ENV diff --git a/ciao-webui/ciao_config.json b/ciao-webui/ciao_config.json deleted file mode 100644 index 01793d0..0000000 --- a/ciao-webui/ciao_config.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "##MODE##": { - "controller": { - "host": "##CONTROLLER_HOST##", - "port": "8774", - "protocol": "https" - }, - "storage":{ - "host": "##STORAGE_HOST##", - "port": "8776", - "protocol": "https" - }, - "keystone": { - "host": "##KEYSTONE_HOST##", - "port": "35357", - "protocol": "https", - "uri": "/v3/auth/tokens" - }, - "ui": { - "protocol": "https", - "certificates": { - "key": "/etc/pki/ciao-webui-key.pem", - "cert": "/etc/pki/ciao-webui-cert.pem", - "passphrase": "##CERT_PASS##", - "trusted": [] - } - } - } -} diff --git a/keystone/Dockerfile b/keystone/Dockerfile deleted file mode 100644 index 4f3d809..0000000 --- a/keystone/Dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -FROM clearlinux/mariadb -MAINTAINER obed.n.munoz@intel.com - -ARG swupd_args="" - -RUN swupd update $swupd_args -RUN swupd update $swupd_args -RUN swupd bundle-add openstack-identity openstack-python-clients $swupd_args -RUN rm -rf /var/lib/swupd/* - -# Keystone -RUN mkdir -p /etc/keystone -RUN mkdir -p /var/tmp -COPY keystone.conf /etc/keystone - -RUN mkdir -p /etc/nginx/ssl -COPY keystone.wsgi.conf /etc/nginx/ - -COPY bootstrap.sh /usr/bin -COPY pre-setup.sh /usr/bin -COPY verify-keystone.sh /usr/bin -COPY openrc /root/ -RUN /usr/bin/pre-setup.sh - -VOLUME /var/lib/mysql -WORKDIR /root -CMD '/usr/bin/bootstrap.sh' - -EXPOSE 5000 -EXPOSE 35357 diff --git a/keystone/README.md b/keystone/README.md deleted file mode 100644 index 08388ab..0000000 --- a/keystone/README.md +++ /dev/null @@ -1,67 +0,0 @@ -Keystone with SSL -================= -[![](https://images.microbadger.com/badges/image/clearlinux/keystone.svg)](http://microbadger.com/images/clearlinux/keystone "Get your own image badge on microbadger.com") -[![](https://images.microbadger.com/badges/version/clearlinux/keystone.svg)](http://microbadger.com/images/clearlinux/keystone "Get your own version badge on microbadger.com") - -This provides a SSL-enabled Keystone docker container - -Build ------ -``` -docker build -t clearlinux/keystone . -``` - -Or just pull it from Dockerhub ---------------------------- -``` -docker pull clearlinux/keystone:stable -``` - -Create Keystone SSL certificates --------------------------------- -``` -YOUR_HOST=`hostname -f` -openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout keystone_key.pem \ - -out keystone_cert.pem -subj "/CN=$YOUR_HOST" -``` - -Start Keystone container ------------------------- -``` -YOUR_HOST=`hostname -f` -MYSQL_DATA_DIR=/var/lib/mysql/ -docker run -d -it --name keystone -p 5000:5000 -p 35357:35357 \ - -e IDENTITY_HOST="$YOUR_HOST" \ - -e KEYSTONE_ADMIN_PASSWORD="secret" \ - -v $MYSQL_DATA_DIR:/var/lib/mysql \ - -v `pwd`/keystone_cert.pem:/etc/nginx/ssl/keystone_cert.pem \ - -v `pwd`/keystone_key.pem:/etc/nginx/ssl/keystone_key.pem \ - clearlinux/keystone:stable -``` - -Login into Keystone container ------------------------------- -``` -docker exec -it keystone bash -# Inside the container -root@26bd2b8a8a60 /root # source openrc -openstack user list -+----------------------------------+-------+ -| ID | Name | -+----------------------------------+-------+ -| 24620586335a473fb56fc2be2f6bfb53 | admin | -+----------------------------------+-------+ -``` - -Environment Variables ---------------------- -- ``IDENTITY_HOST`` - Identity (Keystone) host -- (Optional) ``KEYSTONE_ADMIN_PASSWORD`` - Keystone Admin user password. Default: ``bb915e9ce0ae4b46e82a069b2ef0f8d7`` - -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 diff --git a/keystone/bootstrap.sh b/keystone/bootstrap.sh deleted file mode 100755 index e6e1707..0000000 --- a/keystone/bootstrap.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -IDENTITY_HOST="${IDENTITY_HOST:-localhost}" -KEYSTONE_ADMIN_PASSWORD="${KEYSTONE_ADMIN_PASSWORD:-bb915e9ce0ae4b46e82a069b2ef0f8d7}" - -sed -i.bak s/IDENTITY_HOST/$IDENTITY_HOST/g /root/openrc -sed -i.bak s/KEYSTONE_ADMIN_PASSWORD/$KEYSTONE_ADMIN_PASSWORD/g /root/openrc - -if [[ ! -d /var/lib/mysql/mysql ]]; then - cp -r /data/* /var/lib/mysql/ -fi - -# MariaDB -mysqld_safe & -mysqladmin --silent --wait=30 ping || exit 1 - -# Populate keystone database -keystone-manage db_sync - -# Start keystone service -/usr/bin/uwsgi --ini /usr/share/uwsgi/keystone/admin.ini -s /run/uwsgi/keystone/admin.sock & -/usr/bin/uwsgi --ini /usr/share/uwsgi/keystone/public.ini -s /run/uwsgi/keystone/public.sock & -/usr/bin/nginx -/usr/bin/memcached -u root & - -# Bootstrap keystone -keystone-manage bootstrap --bootstrap-username admin \ - --bootstrap-password $KEYSTONE_ADMIN_PASSWORD \ - --bootstrap-project-name admin \ - --bootstrap-role-name admin \ - --bootstrap-service-name keystone \ - --bootstrap-admin-url "https://$IDENTITY_HOST:35357/v3" \ - --bootstrap-public-url "https://$IDENTITY_HOST:5000/v3" \ - --bootstrap-internal-url "https://$IDENTITY_HOST:5000/v3" - -source /root/openrc -# Create 'service' project if it does not exists -openstack project show service -if [[ $? == 1 ]]; then - openstack project create --domain default --description "Service Project" service - openstack role add --project service --user admin admin -fi - -# Create 'user' role -openstack role show user -if [[ $? == 1 ]]; then - openstack role create user -fi - -# Run post-keystone.sh script, if it exists -if [ -f "/usr/bin/post-keystone.sh" ]; then - /usr/bin/post-keystone.sh -fi - -tail -f /var/log/* diff --git a/keystone/keystone.conf b/keystone/keystone.conf deleted file mode 100644 index 8cb4ef8..0000000 --- a/keystone/keystone.conf +++ /dev/null @@ -1,14 +0,0 @@ -[DEFAULT] - -[database] -connection = mysql+pymysql://KEYSTONE_DB_USER:KEYSTONE_DB_PASSWORD@localhost/KEYSTONE_DB_NAME - -[cache] -enabled = True -backend = oslo_cache.memcache_pool - -[catalog] -caching = False - -[assignment] -driver = sql diff --git a/keystone/keystone.wsgi.conf b/keystone/keystone.wsgi.conf deleted file mode 100644 index 4a2cefe..0000000 --- a/keystone/keystone.wsgi.conf +++ /dev/null @@ -1,77 +0,0 @@ -server { - listen 35357 ssl http2; - server_name IDENTITY_HOST; - ssl_certificate /etc/nginx/ssl/keystone_cert.pem; - ssl_certificate_key /etc/nginx/ssl/keystone_key.pem; - error_log /var/log/nginx-error.log warn; - access_log /var/log/nginx-access.log; - location / { - include uwsgi_params; - uwsgi_pass unix:/run/uwsgi/keystone/admin.sock; - uwsgi_param SCRIPT_NAME ''; - if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Subject-Token,X-Auth-Token'; - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain charset=UTF-8'; - add_header 'Content-Length' 0; - add_header 'Access-Control-Expose-Headers' 'X-Subject-Token,X-Auth-Token,Content-Type'; - return 204; - } - if ($request_method = 'POST') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Subject-Token,X-Auth-Token'; - add_header 'Access-Control-Expose-Headers' 'X-Subject-Token,X-Auth-Token,Content-Type'; - } - if ($request_method = 'GET') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Conntent-Type,X-Subject-Token,X-Auth-Token'; - add_header 'Access-Control-Expose-Headers' 'X-Subject-Token,X-Auth-Token,Content-Type'; - } - } -} - -server { - listen 5000 ssl http2; - server_name IDENTITY_HOST; - ssl_certificate /etc/nginx/ssl/keystone_cert.pem; - ssl_certificate_key /etc/nginx/ssl/keystone_key.pem; - location / { - include uwsgi_params; - uwsgi_pass unix:/run/uwsgi/keystone/public.sock; - uwsgi_param SCRIPT_NAME ''; - error_log /var/log/nginx-error.log warn; - access_log /var/log/nginx-access.log; - if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Subject-Token,X-Auth-Token'; - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain charset=UTF-8'; - add_header 'Content-Length' 0; - add_header 'Access-Control-Expose-Headers' 'X-Subject-Token,X-Auth-Token,Content-Type'; - return 204; - } - if ($request_method = 'POST') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Subject-Token,X-Auth-Token'; - add_header 'Access-Control-Expose-Headers' 'X-Subject-Token,X-Auth-Token,Content-Type'; - } - if ($request_method = 'GET') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Conntent-Type,X-Subject-Token,X-Auth-Token'; - add_header 'Access-Control-Expose-Headers' 'X-Subject-Token,X-Auth-Token,Content-Type'; - } - } -} diff --git a/keystone/openrc b/keystone/openrc deleted file mode 100644 index ca4f1c3..0000000 --- a/keystone/openrc +++ /dev/null @@ -1,9 +0,0 @@ -export OS_PROJECT_DOMAIN_NAME=default -export OS_USER_DOMAIN_NAME=default -export OS_PROJECT_NAME=admin -export OS_USERNAME=admin -export OS_PASSWORD=KEYSTONE_ADMIN_PASSWORD -export OS_AUTH_URL=https://IDENTITY_HOST:35357/v3 -export OS_IDENTITY_API_VERSION=3 -export OS_IMAGE_API_VERSION=2 -export OS_CACERT=/etc/nginx/ssl/keystone_cert.pem diff --git a/keystone/pre-setup.sh b/keystone/pre-setup.sh deleted file mode 100755 index 02d1921..0000000 --- a/keystone/pre-setup.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -IDENTITY_HOST="${IDENTITY_HOST:-localhost}" -KEYSTONE_DB_USER=keystone -KEYSTONE_DB_PASSWORD=914de29bc82616d7c159eaf9b1f39402 -KEYSTONE_DB_NAME=keystone - -sed -i.bak s/KEYSTONE_DB_USER/$KEYSTONE_DB_USER/g /etc/keystone/keystone.conf -sed -i.bak s/KEYSTONE_DB_PASSWORD/$KEYSTONE_DB_PASSWORD/g /etc/keystone/keystone.conf -sed -i.bak s/KEYSTONE_DB_NAME/$KEYSTONE_DB_NAME/g /etc/keystone/keystone.conf -sed -i.bak s/IDENTITY_HOST/$IDENTITY_HOST/g /etc/nginx/keystone.wsgi.conf - -# MariaDB -mkdir /data -echo "datadir = /data" >> /etc/mariadb/my.cnf - -# Initialize MariaDB data -/usr/bin/mysql-systemd-start pre -mysqld_safe & -mysqladmin --silent --wait=30 ping || exit 1 - -# Remove anonymous user access -mysql -e "DELETE FROM mysql.user WHERE User=\"\";" - -# Remove test database -mysql -e "DROP DATABASE test;" - -# Keystone Database and user -mysql -e "create database $KEYSTONE_DB_NAME;" -mysql -e "grant all on $KEYSTONE_DB_NAME.* to '$KEYSTONE_DB_USER'@'%' IDENTIFIED by '$KEYSTONE_DB_PASSWORD';" -mysql -e "grant all on $KEYSTONE_DB_NAME.* to '$KEYSTONE_DB_USER'@'localhost' IDENTIFIED BY '$KEYSTONE_DB_PASSWORD';" -mysql -e "FLUSH PRIVILEGES;" - -# Populate keystone database -keystone-manage db_sync - -# Nginx & UWSGI -mkdir -p /run/uwsgi/keystone -sed -i 's/uid.*/ /' /usr/share/uwsgi/keystone/{public,admin}.ini -sed -i 's/gid.*/ /' /usr/share/uwsgi/keystone/{public,admin}.ini -echo "logto=/var/log/uwsgi-keystone-admin.log" >> /usr/share/uwsgi/keystone/admin.ini -echo "logto=/var/log/uwsgi-keystone-public.log" >> /usr/share/uwsgi/keystone/public.ini -/usr/bin/uwsgi --ini /usr/share/uwsgi/keystone/admin.ini -s /run/uwsgi/keystone/admin.sock & -/usr/bin/uwsgi --ini /usr/share/uwsgi/keystone/public.ini -s /run/uwsgi/keystone/public.sock & - -mkdir /var/lib/nginx -echo "user root;" >> /usr/share/nginx/conf/nginx.conf - -# Reset MariaDB datadir -sed -i.bak "s/datadir =.*//g" /etc/mariadb/my.cnf diff --git a/keystone/verify-keystone.sh b/keystone/verify-keystone.sh deleted file mode 100755 index cf81223..0000000 --- a/keystone/verify-keystone.sh +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/bash -# This scripts informs CI about a working Keystone Service - -source /root/openrc - -for i in {1..5}; do echo "Test #$i"; openstack user list && break || sleep 5; done - -openstack token issue - - -#ec2 section - -function createEC2 () { - openstack ec2 credentials create --user admin -} - -function showNewEC2() { - ID=$(openstack ec2 credentials list | awk '!/Access/ && !/+/ {print $2}') - Exist=$(openstack ec2 credentials show $ID | awk ' /access/ {print $2}') - [[ "$Exist" ]] -} - -function deleteEC2() { - ID=$(openstack ec2 credentials list | awk '!/Access/ && !/+/ {print $2}') - openstack ec2 credentials delete $ID - Exist=$(openstack ec2 credentials list | grep $ID) - [[ ! "$Exist" ]] -} - -#endpoint section - -function createEndPoint () { - openstack endpoint create identity public http://fakehost:5500/v3 --region RegionOne - } - -function showEndPoint () { - ID=$(openstack endpoint list | awk '/fakehost/ {print $2}') - [[ "$ID" ]] -} - -function deleteEndPoint () { - ID=$(openstack endpoint list | awk '/fakehost/ {print $2}') - openstack endpoint delete $ID - ID=$(openstack endpoint list | awk '/fakehost/ {print $2}') - [[ ! "$ID" ]] -} - -#Roles section - -function createProjectAndUser () { - openstack project create --domain default --description "Test Project" TestProject - openstack user create TestUser --domain default --password secure --email demo@example.com --project TestProject - } - - -function createRole () { - openstack role create TestRole - } - -function addUserToRole () { - openstack role add --user TestUser --project TestProject TestRole - } - -function listRole() { - openstack role list | grep TestRole - } - -function showRole() { - openstack role show TestRole - } - -function deleteRole() { - openstack role delete TestRole - openstack project delete TestProject - openstack user delete TestUser - } - -#Services - -function createService () { - openstack service create --name TestService --description TestDescription image2 - } - -function showService () { - ID=$(openstack service list | awk '/image2/ {print $2}') - openstack service show $ID - } - -function deleteService() { - openstack service delete TestService - ID=$(openstack service list | awk '/image2/ {print $2}') - [[ ! "$ID" ]] - } - -#Projects - -function createProject () { - openstack project create --description TestProjectDescr TestProject - } - -function showProject() { - ID=$(openstack project list | awk '/TestProject/ {print $2}') - openstack project show $ID - } - -function deleteProject() { - openstack project delete TestProject - } - -#Users - -function createUser () { - openstack user create --password testUserpassword --email client@example.com TestUser - } - -function showUser (){ - ID=$(openstack user list | awk '/TestUser/ {print $2}') - openstack user show $ID - } - -function deleteUser () { - openstack user delete TestUser - } - -#Lets call the functions start the show -echo "#################### EC2 TESTS #########################" -createEC2 -showNewEC2 -deleteEC2 -echo "#################### ENDPOINTS TESTS #########################" -createEndPoint -showEndPoint -deleteEndPoint -echo "#################### ROLES TESTS #########################" -createProjectAndUser -createRole -addUserToRole -listRole -showRole -deleteRole -echo "#################### SERVICES TESTS #########################" -createService -showService -deleteService -echo "#################### PROJECTS TESTS #########################" -createProject -showProject -deleteProject -echo "#################### USERS TESTS #########################" -createUser -showUser -deleteUser