"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "devstack/lib/zun" between
zun-3.0.0.tar.gz and zun-4.0.0.tar.gz

About: OpenStack Zun is a Container Management service for OpenStack.
The "Train" series (latest release).

zun  (zun-3.0.0):zun  (zun-4.0.0)
skipping to change at line 81 skipping to change at line 81
ZUN_UWSGI=$ZUN_BIN_DIR/zun-api-wsgi ZUN_UWSGI=$ZUN_BIN_DIR/zun-api-wsgi
ZUN_UWSGI_CONF=$ZUN_CONF_DIR/zun-api-uwsgi.ini ZUN_UWSGI_CONF=$ZUN_CONF_DIR/zun-api-uwsgi.ini
DOCKER_REMOTE_API_PORT=2375 DOCKER_REMOTE_API_PORT=2375
ZUN_DRIVER=${ZUN_DRIVER:-docker} ZUN_DRIVER=${ZUN_DRIVER:-docker}
ZUN_DB_TYPE=${ZUN_DB_TYPE:-sql} ZUN_DB_TYPE=${ZUN_DB_TYPE:-sql}
ZUN_ETCD_VERSION=${ZUN_ETCD_VERSION:-v3.0.13} ZUN_ETCD_VERSION=${ZUN_ETCD_VERSION:-v3.0.13}
ZUN_ETCD_PORT=${ZUN_ETCD_PORT:-2379} ZUN_ETCD_PORT=${ZUN_ETCD_PORT:-2379}
ZUN_WEBSOCKET_PROXY_PORT=${ZUN_WEBSOCKET_PROXY_PORT:-6784} ZUN_WEBSOCKET_PROXY_PORT=${ZUN_WEBSOCKET_PROXY_PORT:-6784}
ZUN_WEBSOCKET_PROXY_IP=${ZUN_WEBSOCKET_PROXY_IP:-0.0.0.0} ZUN_WEBSOCKET_PROXY_IP=${ZUN_WEBSOCKET_PROXY_IP:-$(ipv6_unquote $SERVICE_LISTEN_ ADDRESS)}
if is_ubuntu; then if is_ubuntu; then
UBUNTU_RELEASE_BASE_NUM=`lsb_release -r | awk '{print $2}' | cut -d '.' -f 1 ` UBUNTU_RELEASE_BASE_NUM=`lsb_release -r | awk '{print $2}' | cut -d '.' -f 1 `
fi fi
ZUN_DOCKER_IMAGES=${ZUN_DOCKER_IMAGES:-kubernetes/pause} ZUN_DOCKER_IMAGES=${ZUN_DOCKER_IMAGES:-kubernetes/pause}
# Functions # Functions
# --------- # ---------
# cleanup_zun() - Remove residual data files, anything left over from previous # cleanup_zun() - Remove residual data files, anything left over from previous
skipping to change at line 125 skipping to change at line 125
configure_rootwrap zun configure_rootwrap zun
# Rebuild the config file from scratch # Rebuild the config file from scratch
create_zun_conf create_zun_conf
if is_service_enabled zun-api; then if is_service_enabled zun-api; then
create_api_paste_conf create_api_paste_conf
write_uwsgi_config "$ZUN_UWSGI_CONF" "$ZUN_UWSGI" "/container" write_uwsgi_config "$ZUN_UWSGI_CONF" "$ZUN_UWSGI" "/container"
if [[ "$USE_PYTHON3" = "True" ]]; then
# Switch off glance->swift communication as swift fails under py3.x
iniset /etc/glance/glance-api.conf glance_store default_store file
fi
fi fi
} }
# upload_images() - Upload docker images to glance # upload_images() - Upload docker images to glance
function upload_images { function upload_images {
echo_summary "Uploading images" echo_summary "Uploading images"
if "${ZUN_DRIVER}" == "docker" && is_service_enabled g-api; then if "${ZUN_DRIVER}" == "docker" && is_service_enabled g-api; then
for image in ${ZUN_DOCKER_IMAGES//,/ }; do for image in ${ZUN_DOCKER_IMAGES//,/ }; do
sudo docker pull $image sudo docker pull $image
skipping to change at line 182 skipping to change at line 177
} }
# create_zun_conf() - Create a new zun.conf file # create_zun_conf() - Create a new zun.conf file
function create_zun_conf { function create_zun_conf {
# (Re)create ``zun.conf`` # (Re)create ``zun.conf``
rm -f $ZUN_CONF rm -f $ZUN_CONF
if [[ ${ZUN_DRIVER} == "docker" ]]; then if [[ ${ZUN_DRIVER} == "docker" ]]; then
iniset $ZUN_CONF DEFAULT container_driver docker.driver.DockerDriver iniset $ZUN_CONF DEFAULT container_driver docker.driver.DockerDriver
fi fi
if [[ ${ZUN_DB_TYPE} == "etcd" ]]; then
iniset $ZUN_CONF DEFAULT db_type etcd
elif [[ ${ZUN_DB_TYPE} == "sql" ]]; then
iniset $ZUN_CONF DEFAULT db_type sql
fi
iniset $ZUN_CONF DEFAULT debug "$ENABLE_DEBUG_LOG_LEVEL" iniset $ZUN_CONF DEFAULT debug "$ENABLE_DEBUG_LOG_LEVEL"
iniset $ZUN_CONF DEFAULT my_ip "$HOST_IP" if [[ $SERVICE_IP_VERSION == 6 ]]; then
iniset $ZUN_CONF DEFAULT my_ip "$HOST_IPV6"
iniset $ZUN_CONF docker docker_remote_api_host "$HOST_IPV6"
else
iniset $ZUN_CONF DEFAULT my_ip "$HOST_IP"
iniset $ZUN_CONF docker docker_remote_api_host "$HOST_IP"
fi
iniset $ZUN_CONF DEFAULT default_cpu 0 iniset $ZUN_CONF DEFAULT default_cpu 0
iniset $ZUN_CONF DEFAULT default_memory 0 iniset $ZUN_CONF DEFAULT default_memory 0
iniset $ZUN_CONF DEFAULT default_disk 0 iniset $ZUN_CONF DEFAULT default_disk 0
iniset_rpc_backend zun $ZUN_CONF iniset_rpc_backend zun $ZUN_CONF
iniset $ZUN_CONF database connection `database_connection_url zun` iniset $ZUN_CONF database connection `database_connection_url zun`
iniset $ZUN_CONF etcd etcd_host "$SERVICE_HOST"
iniset $ZUN_CONF etcd etcd_port "$ZUN_ETCD_PORT"
iniset $ZUN_CONF websocket_proxy wsproxy_port "$ZUN_WEBSOCKET_PROXY_PORT" iniset $ZUN_CONF websocket_proxy wsproxy_port "$ZUN_WEBSOCKET_PROXY_PORT"
iniset $ZUN_CONF websocket_proxy wsproxy_host "$ZUN_WEBSOCKET_PROXY_IP" iniset $ZUN_CONF websocket_proxy wsproxy_host "$ZUN_WEBSOCKET_PROXY_IP"
iniset $ZUN_CONF websocket_proxy base_url "ws://${SERVICE_HOST}:${ZUN_WEBSOC KET_PROXY_PORT}/" iniset $ZUN_CONF websocket_proxy base_url "ws://${SERVICE_HOST}:${ZUN_WEBSOC KET_PROXY_PORT}/"
iniset $ZUN_CONF api host_ip "$ZUN_SERVICE_HOST" iniset $ZUN_CONF api host_ip "$(ipv6_unquote $ZUN_SERVICE_HOST)"
iniset $ZUN_CONF api port "$ZUN_SERVICE_PORT" iniset $ZUN_CONF api port "$ZUN_SERVICE_PORT"
iniset $ZUN_CONF docker docker_remote_api_host "$HOST_IP"
iniset $ZUN_CONF keystone_auth auth_type password iniset $ZUN_CONF keystone_auth auth_type password
iniset $ZUN_CONF keystone_auth username zun iniset $ZUN_CONF keystone_auth username zun
iniset $ZUN_CONF keystone_auth password $SERVICE_PASSWORD iniset $ZUN_CONF keystone_auth password $SERVICE_PASSWORD
iniset $ZUN_CONF keystone_auth project_name $SERVICE_PROJECT_NAME iniset $ZUN_CONF keystone_auth project_name $SERVICE_PROJECT_NAME
iniset $ZUN_CONF keystone_auth project_domain_id default iniset $ZUN_CONF keystone_auth project_domain_id default
iniset $ZUN_CONF keystone_auth user_domain_id default iniset $ZUN_CONF keystone_auth user_domain_id default
configure_auth_token_middleware $ZUN_CONF zun $ZUN_AUTH_CACHE_DIR configure_auth_token_middleware $ZUN_CONF zun $ZUN_AUTH_CACHE_DIR
skipping to change at line 248 skipping to change at line 241
# Register SSL certificates if provided # Register SSL certificates if provided
if is_ssl_enabled_service zun; then if is_ssl_enabled_service zun; then
ensure_certificates zun ensure_certificates zun
iniset $ZUN_CONF DEFAULT ssl_cert_file "$ZUN_SSL_CERT" iniset $ZUN_CONF DEFAULT ssl_cert_file "$ZUN_SSL_CERT"
iniset $ZUN_CONF DEFAULT ssl_key_file "$ZUN_SSL_KEY" iniset $ZUN_CONF DEFAULT ssl_key_file "$ZUN_SSL_KEY"
iniset $ZUN_CONF DEFAULT enabled_ssl_apis "$ZUN_ENABLED_APIS" iniset $ZUN_CONF DEFAULT enabled_ssl_apis "$ZUN_ENABLED_APIS"
fi fi
if is_service_enabled n-cpu; then
iniset $ZUN_CONF compute host_shared_with_nova "True"
fi
} }
function create_api_paste_conf { function create_api_paste_conf {
# copy api_paste.ini # copy api_paste.ini
cp $ZUN_DIR/etc/zun/api-paste.ini $ZUN_API_PASTE cp $ZUN_DIR/etc/zun/api-paste.ini $ZUN_API_PASTE
} }
# create_zun_cache_dir() - Part of the init_ZUN() process # create_zun_cache_dir() - Part of the init_ZUN() process
function create_zun_cache_dir { function create_zun_cache_dir {
# Create cache dir # Create cache dir
skipping to change at line 275 skipping to change at line 272
# Only do this step once on the API node for an entire cluster. # Only do this step once on the API node for an entire cluster.
if is_service_enabled zun-api; then if is_service_enabled zun-api; then
if is_service_enabled $DATABASE_BACKENDS; then if is_service_enabled $DATABASE_BACKENDS; then
# (Re)create zun database # (Re)create zun database
recreate_database zun recreate_database zun
# Migrate zun database # Migrate zun database
$ZUN_BIN_DIR/zun-db-manage upgrade $ZUN_BIN_DIR/zun-db-manage upgrade
fi fi
if is_service_enabled zun-etcd; then
install_etcd_server
fi
create_zun_cache_dir create_zun_cache_dir
fi fi
} }
# install_zunclient() - Collect source and prepare # install_zunclient() - Collect source and prepare
function install_zunclient { function install_zunclient {
if use_library_from_git "python-zunclient"; then if use_library_from_git "python-zunclient"; then
git_clone_by_name "python-zunclient" git_clone_by_name "python-zunclient"
setup_dev_lib "python-zunclient" setup_dev_lib "python-zunclient"
sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-zunclient"]}/to ols/,/etc/bash_completion.d/}zun.bash_completion sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-zunclient"]}/to ols/,/etc/bash_completion.d/}zun.bash_completion
skipping to change at line 300 skipping to change at line 294
# install_zun() - Collect source and prepare # install_zun() - Collect source and prepare
function install_zun { function install_zun {
git_clone $ZUN_REPO $ZUN_DIR $ZUN_BRANCH git_clone $ZUN_REPO $ZUN_DIR $ZUN_BRANCH
setup_develop $ZUN_DIR setup_develop $ZUN_DIR
git_clone $ZUN_TEMPEST_PLUGIN_REPO $ZUN_TEMPEST_PLUGIN_DIR $ZUN_TEMPEST_PLUG IN_BRANCH git_clone $ZUN_TEMPEST_PLUGIN_REPO $ZUN_TEMPEST_PLUGIN_DIR $ZUN_TEMPEST_PLUG IN_BRANCH
setup_develop $ZUN_TEMPEST_PLUGIN_DIR setup_develop $ZUN_TEMPEST_PLUGIN_DIR
} }
function install_etcd_server {
echo "Installing etcd"
# If there's a container named 'etcd' already exists, remove it.
if [ $(sudo docker ps -a | awk '{print $NF}' | grep -w etcd) ]; then
sudo docker rm -f etcd || true
fi
[[ $(pgrep -x "etcd") ]] || sudo docker run -d --net=host --name etcd quay.i
o/coreos/etcd:${ZUN_ETCD_VERSION} \
/usr/local/bin/etcd \
--data-dir=data.etcd \
--name node0 \
--initial-advertise-peer-urls http://${HOST_IP}:2380 \
--listen-peer-urls http://${HOST_IP}:2380 \
--advertise-client-urls http://${HOST_IP}:${ZUN_ETCD_PORT} \
--listen-client-urls http://${HOST_IP}:${ZUN_ETCD_PORT} \
--initial-cluster node0=http://${HOST_IP}:2380 \
--initial-cluster-state new \
--initial-cluster-token etcd-token
}
# start_zun_api() - Start the API process ahead of other things # start_zun_api() - Start the API process ahead of other things
function start_zun_api { function start_zun_api {
# Get right service port for testing # Get right service port for testing
local service_port=$ZUN_SERVICE_PORT local service_port=$ZUN_SERVICE_PORT
local service_protocol=$ZUN_SERVICE_PROTOCOL local service_protocol=$ZUN_SERVICE_PROTOCOL
if is_service_enabled tls-proxy; then if is_service_enabled tls-proxy; then
service_port=$ZUN_SERVICE_PORT_INT service_port=$ZUN_SERVICE_PORT_INT
service_protocol="http" service_protocol="http"
fi fi
skipping to change at line 360 skipping to change at line 335
run_process zun-wsproxy "$ZUN_BIN_DIR/zun-wsproxy" run_process zun-wsproxy "$ZUN_BIN_DIR/zun-wsproxy"
fi fi
} }
# start_zun_compute() - Start Zun compute agent # start_zun_compute() - Start Zun compute agent
function start_zun_compute { function start_zun_compute {
echo "Start zun compute..." echo "Start zun compute..."
run_process zun-compute "$ZUN_BIN_DIR/zun-compute" run_process zun-compute "$ZUN_BIN_DIR/zun-compute"
} }
function start_zun_etcd {
echo "Start zun etcd..."
sudo docker start etcd || true
}
function stop_zun_etcd {
echo "Stop zun etcd..."
sudo docker stop etcd
sudo docker rm -f etcd || true
}
# start_zun() - Start running processes, including screen # start_zun() - Start running processes, including screen
function start_zun { function start_zun {
# ``run_process`` checks ``is_service_enabled``, it is not needed here # ``run_process`` checks ``is_service_enabled``, it is not needed here
start_zun_api start_zun_api
start_zun_compute start_zun_compute
if is_service_enabled zun-etcd; then
start_zun_etcd
fi
} }
# stop_zun() - Stop running processes (non-screen) # stop_zun() - Stop running processes (non-screen)
function stop_zun { function stop_zun {
if is_service_enabled zun-etcd; then
stop_zun_etcd
fi
if [ "$ZUN_USE_UWSGI" == "True" ]; then if [ "$ZUN_USE_UWSGI" == "True" ]; then
disable_apache_site zun disable_apache_site zun
restart_apache_server restart_apache_server
else else
stop_process zun-api stop_process zun-api
fi fi
stop_process zun-compute stop_process zun-compute
if is_service_enabled zun-wsproxy; then if is_service_enabled zun-wsproxy; then
stop_process zun-wsproxy stop_process zun-wsproxy
fi fi
 End of changes. 13 change blocks. 
57 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)