Alien4Cloud for DEEP Hybrid-DataCloud
1.9K
Documentation version 3.0.1
Intro
Administration Guide
Getting Started
Prerequisites
Docker Container
Parameters
Variables
Settings Manager
SSL
Deployment
Upgrade
REST API
Usage
Plugin Activation
Instance Creation
Users
Plugin Parameters
Obtain Certificate
Testing
Coverage
Style
User Guide
Registration
Login
Topology
Creation
Editor
UI Editor
Text Editor
Inputs
Deployment
Undeployment
Authors
License
Acknowledgments
Resources
This repository contains the necessary parts needed to create a Docker image holding the Alien4cloud application, along with the DEEP - Indigo Data Cloud TOSCA types, and the plugin which connects Alien4Cloud (A4C) to the orchestrator used in DEEP. Each time the Docker image is created, the latest version of the normative TOSCA used by IndigoDataCloud and the latest version of the plugin are integrated in this image.
Right now, we use a customized version of A4C 2.0. The code for our version is in the a4c directory in the root of this repository. The plugin code is in the indigodc-orchestrator-plugin directory.
The default port for A4C is 8088.
The default username / password are admin/admin. Please change them!
Aside of the official requirements found at [Res2], Alien4Cloud needs at least 3GB of RAM to run and a dual core CPU.
You also need Docker, we tested with the CE version 17.03 and above. We strongly advise you to install the latest version from the official Docker site.
This repository contains a Dockerfile that allows the creation of a container with A4C ready to be used by the final user. Due to various requirements determined during development, we expose a number of container runtime parameters and environment variables that allow the customization of the container.
We defined a number of constants to allow easy parametrisation of the container.
The docker file contains environment variables. Some of them can be modified by the user when running a container. These are denoted by RW (read-write). The other group exists just to indicate features that were builtin in the container. This group is marked with RO (read-only). The RO group can be modified by modifying the args detailed in the previous paragraph. If the name of a variable is the same as the name of an argument, but with capital letters, then the variable is initialized with the valued of the argument.
A4C_SH_NAME (RO) - the name of the script that executes A4C; Script generated by the Settings Manager in the a4c_install_dir folder (it has to be in the same folder with the war)
A4C_CERTS_ROOT_PATH (RW) - the full path to the directory containing the files refered by A4C_PEM_CERT_FILE, A4C_PEM_KEY_FILE
A4C_INSTALL_PATH (RO) - the path to the installation root directory of A4C
A4C_SRC_DIR (RO) - the relative path used to store the source of A4C
A4C_INSTALL_DIR (RO) - the relative path denoting the root where the A4C war is stored
A4C_USER (RO) - the user name of the non-privileged user that executes the A4C server
A4C_SETTINGS_MANAGER_VER (RO) - The version of the settings manager that is used in the Dockerfile
A4C_PORT_HTTP (RO) - the port on which A4C is exposed
A4C_PORT_HTTPS (RO) - the port on which A4C is exposed
A4C_SPRING_OIDC_ISSUER (RW) - the URL of the IAM that performs the authentication of the user; For more details, please check the Spring OIDC A4C plugin at [Res8]
A4C_SPRING_OIDC_CLIENT_ID (RW) - the ID of the client registered on the IAM; The client normally represents an A4C instance; For more details, please check the Spring OIDC A4C plugin at [Res8]
A4C_SPRING_OIDC_CLIENT_SECRET (RW) - the secret of the client registered on the IAM; The client normally represents an A4C instance; For more details, please check the Spring OIDC A4C plugin at [Res8]
A4C_SPRING_OIDC_ROLES (RW) - the roles given to the users created on the fly on A4C; Use CSV style approach, that is list of elements with single quote, separated by one and only one comma eg 'ADMIN','APPLICATION MANGER','DEV, OPS' at least one element is necessary; For more details, please check the Spring OIDC A4C plugin at [Res8]
A4C_ORCHESTRATOR_URL (RW) - the URL of the orchestrator that allows the deployment of the topologies created in A4C
A4C_ORCHESTRATOR_ENABLE_KEYSTORE (RW) - enable the keystore creation and loading for those cases when the orchestrator certificate is not signed by a recognized authority
A4C_ORCHESTRATOR_KEYSTORE_PASSWORD (RW) - the default password for the Java keystore containing the orchestrator certificate
A4C_ORCHESTRATOR_KEY_PASSWORD (RW) - the password to be used to protected the certificate inside the Java keystore
A4C_ORCHESTRATOR_PEM_CERT_FILE (RW) - the file name of the orchestrator certificate file that is available on A4C_CERTS_ROOT_PATH
A4C_ORCHESTRATOR_PEM_KEY_FILE (RW) - the file name of the orchestrator certificate key file that is available on A4C_CERTS_ROOT_PATH
A4C_RUNTIME_DIR (RW) - the container directory that holds the runtime data generated by A4C during runtime like logs, uploads, and the Elastic Search cluster data
A4C_RESET_CONFIG (RW) - Caution! Enable the A4C settings manager execution with old data present; This will delete everything from the directory set in the A4C_RUNTIME_DIR and will let the settings manager re-create the A4C config files; Either "true" or "false"; Disabled for the time being
A4C_ADMIN_USERNAME (RW) - the username of the default admin user of A4C
A4C_ADMIN_PASSWORD (RW) - the password of the default admin user of A4C
A4C_ENABLE_SSL (RW) - enable SSL mode for A4C; HTTP will be disabled; Either "true" or "false"
A4C_KEY_STORE_PASSWORD (RW) - the password of the keystore used by A4C
A4C_KEY_PASSWORD (RW) - the password of the key that is added using the PEM file refered by the ENV A4C_PEM_KEY_FILE
A4C_PEM_CERT_FILE (RW) - the name of the PEM file with the certificate used to secure the A4C instance (just the name, without path)
A4C_PEM_KEY_FILE (RW) - the name of the PEM file with the key used to secure the A4C instance (just the name, without path)
We included a small Java utility program that runs each time the container is started. It takes some of the values defined by the Docker ENV variables listed earlier, and modifies the config files of the a4c instance. The A4C_ADMIN_USERNAME defines a custom name for the admin user. This utility writes it in the a4c_install_path/a4c_install_dir/config/alien4cloud-config.yml. The code is in the alien4cloud-settings-manager folder.
We also use this application to convert the certificates provided as detailed in the next sections to a Java storing format. You can protect this way the a4c communication with SSL.
Skip this section if you don't want to deploy a secured A4C instance.
If you want to activate the HTTPS protocol for the A4C instance, you must set the A4C_ENABLE_SSL ENV to "true", without double quotes. Furthermore, you must mount an external volume containing a ca pem certificate (with the file name controlled by the A4C_PEM_CERT_FILE ENV) and a ca pem key (with the file name controlled by the A4C_PEM_KEY_FILE ENV). Finally, since the previous two files must be just file names, you can control the path inside the container for the mount using the A4C_CERTS_ROOT_PATH ENV. You can control the Java keystore password by the means of the A4C_KEY_STORE_PASSWORD ENV, and set the password for your key using the A4C_KEY_PASSWORD ENV. Take a look at the examples in the Deployment section.
You can get the docker image from DockerHub IndigoDC repo [Res5].
docker pull indigodatacloud/alien4cloud-deep
docker run -d --name alien4cloud-deep -p ${A4C_PORT_HTTP}:${A4C_PORT_HTTP} -e ${A4C_SPRING_OIDC_CLIENT_ID}=<IAM client ID> -e ${A4C_SPRING_OIDC_CLIENT_SECRET}=<IAM client secret> -e ${A4C_SPRING_OIDC_ROLES}=<list of roles> indigodatacloud/alien4cloud-deep
where the A4C_PORT, A4C_SPRING_OIDC_CLIENT_ID, A4C_SPRING_OIDC_CLIENT_SECRET, A4C_SPRING_OIDC_ROLES run parameter values are explained in the Docker Variables section of this README.
docker logs -f alien4cloud-deep
docker run -d --name alien4cloud-deep -p ${A4C_PORT_HTTP}:${A4C_PORT_HTTP} -e ${A4C_SPRING_OIDC_CLIENT_ID}=<IAM client ID> -e ${A4C_SPRING_OIDC_CLIENT_SECRET}=<IAM client secret> -e ${A4C_SPRING_OIDC_ROLES}=<list of roles> -e A4C_RUNTIME_DIR=${A4C_RUNTIME_DIR_MINE} -v /mnt/a4c_runtime:${A4C_RUNTIME_DIR_MINE} indigodatacloud/alien4cloud-deep
where the A4C_VOLUME_DIR, A4C_PORT, A4C_SPRING_OIDC_CLIENT_ID, A4C_SPRING_OIDC_CLIENT_SECRET, A4C_SPRING_OIDC_ROLES run parameter values are explained in the Docker Variables section of this README.
docker run -d --name alien4cloud-deep -p ${A4C_PORT_HTTPS}:${A4C_PORT_HTTPS} -e ${A4C_SPRING_OIDC_CLIENT_ID}=<IAM client ID> -e ${A4C_SPRING_OIDC_CLIENT_SECRET}=<IAM client secret> -e ${A4C_SPRING_OIDC_ROLES}=<list of roles> -e A4C_RUNTIME_DIR=${A4C_RUNTIME_DIR_MINE} -v <path to directory that will hold A4C's runtime data>:${A4C_RUNTIME_DIR_MINE} -e A4C_CERTS_ROOT_PATH=${A4C_CERTS_ROOT_PATH_MINE} -v <path to certificates root>:${A4C_CERTS_ROOT_PATH_MINE} -e A4C_PEM_CERT_FILE=<ca cert file name> -e A4C_PEM_KEY_FILE=<ca private key file name> -e A4C_KEY_PASSWORD=<password used to sign the certificate> -e A4C_ENABLE_SSL=true indigodatacloud/alien4cloud-deep
where you have to specify the secure port, the root path where the certificates are on the host and its mapping inside the container, the names of the key and certificates pems and to enable SSL
The upgrade process involves pulling the desired version of the container alien4cloud-deep_ from the DockerHub repository [Res5]. The new version can be executed along with the old one, provided that there are no conflicts. We do not support sharing of any kind of the data related to a container between two running at the same time. This is especially true for the runtime data generated by Alien4Cloud.
A4C stores the runtime generated data in the path set in the variable A4C_RUNTIME_DIR. You should be able to mount the runtime path of the newer version of the alien4cloud-deep Docker distribution in the same location as the old one. Alien4Cloud should be able to load the existing data, however a straightforward upgrade process is not always guaranteed due to the multiple versions released. All in all, be sure to backup your data before any upgrade.
A4C supports a REST API [Res4] that can be used for many operations. We list some examples in the following paragraphs.
# Set the A4C server
export ALIEN_URL='http://example.com:8088'
# Set the cookie file path
export ALIEN_COOKIE='/tmp/a4c cookie.txt'
# Authenticate, check if the file
# This call protects the username and password by using the read call
# When you execute the following line, the shell will wait for two values separated by the ENTER key, before executing the curl call
# The first value is the username, the second is the password
curl -k -c "${ALIEN_COOKIE}" "$ALIEN_URL/login" --data-urlencode "username=$( read -s U; echo $U )" --data-urlencode "password=$( read -s P; echo $P )" --data-urlencode "submit=Login" -XPOST -H 'Content-Type: application/x-www-form-urlencoded'
# Create new user; the cookie must be from an ADMIN type user
curl -k -b "${ALIEN_COOKIE}" -XPOST -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/plain, */*' --data '{"email": "a@a", "firstName": "fn", "lastName": "ln", "password": "pass new", "roles": ["ADMIN", "APPLICATIONS_MANAGER", "ARCHITECT", "COMPONENTS_BROWSER", "COMPONENTS_MANAGER"], "username": "tst2"}' "$ALIEN_URL/rest/v1/users"
# Set the username you want to change; you can use the read call as when you authenticated yourself
export ALIEN_USERNAME='tst2'
# Update user; the cookie must be from an ADMIN type user
curl -k -b "${ALIEN_COOKIE}" -XPUT -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/plain, */*' --data '{"email": "a@a", "firstName": "fn", "lastName": "ln", "password": "pass new", "roles": ["ADMIN", "APPLICATIONS_MANAGER", "ARCHITECT", "COMPONENTS_BROWSER", "COMPONENTS_MANAGER"], "username": "${ALIEN_USERNAME}"}' "$ALIEN_URL/rest/v1/users/${ALIEN_USERNAME}"
Once Alien4Cloud started, you can connect to it using a supported browser [Res3]. Before anything else, one should take a look at the [Res2].
The IndigoDataCloud Orchestrator plugin comes preinstalled in the Docker container. It should also be activated by default. Please check the list from Administration -> Plugins. The switch on the right should be green.
First and foremost, one should create and instance of the DEEP - IndigoDataCloud Orchestrator plugin. Next, the values for the parameters should be set (explanation for each in the Plugin Parameters subsection. Finally, on the same page, one has to create a location. We support only one location, that is Deep Orchestrator Location.
The DEEP orchestrator plugin uses the token obtained when the user logs in with the IAM instance. Due to the token based authorization of the orchestrator used in DEEP, the local users cannot connect to the orchestrator.
A local user can be added using the Administration -> Users -> New User functionality. The same location allows the modification of various user specific settings. The web application stores the information locally. If you change it in the IAM, you have to manually update it for each A4C instance.
The A4C user roles are not taken in consideration by the plugin. The admin should consider the proper role(s) for a user only in the context of the A4C running instance. In order to allow a user that is not an admin to modify his/her own settings, the role USER_SPECIFIC_SETTINGS_EDITOR must be enabled.
A non-admin user cannot use a location, unless an admin adds the username to the list of authorized users for each location. This is done by going to a Administration -> Orchestrators -> instance of the orchestrator -> Location(s) -> Security -> Authorize users. The user(s) selected from the list appear on the Security page. They can now access the instance & location offered by the orchestrator plugin. If the access must be revoked for whatever reason, the red delete button de-authorizes a user for the selected combination of orchestrator instance and location.
In order to obtain the certificates used by the plugin and stored in the tokenEndpointCert, orchestratorEndpointCert, and iamHostCert respectively, you should follow the steps described in this subsection for each different server. We refer to servers as in the following unit: *.domain.extension. Two variables may point towards the same server, but with different paths. deep-paas.cloud.ba.infn.it/rest/v1 and deep-paas.cloud.ba.infn.it/token point towards the same domain/subdomains with different paths, therefore you only have to execute the following procedure once, for deep-paas.cloud.ba.infn.it. You also need the port (normally 443 for HTTPS), as you'll see next.
apt-get install openssl
echo "Q" | openssl s_client -showcerts -servername deep-paas.cloud.ba.infn.it -connect deep-paas.cloud.ba.infn.it:443 > crt.tmp
grep -m 1 -ozP '(?<=-----BEGIN\ CERTIFICATE-----)(\n|.)+?(?=-----END\ CERTIFICATE-----)' crt.tmp > crt_solos.tmp
cat crt_solos.tmp | tr -d '\n'
Content type
Image
Digest
Size
161.6 MB
Last updated
over 6 years ago
docker pull indigodatacloud/alien4cloud-deep