11 Commits

Author SHA1 Message Date
OpenDev Sysadmins
541d79af77 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:42:34 +00:00
Ian Wienand
cdb06f60eb Replace openstack.org git:// URLs with https://
This is a mechanically generated change to replace openstack.org
git:// URLs with https:// equivalents.

This is in aid of a planned future move of the git hosting
infrastructure to a self-hosted instance of gitea (https://gitea.io),
which does not support the git wire protocol at this stage.

This update should result in no functional change.

For more information see the thread at

 http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003825.html

Change-Id: I6758879f5f50b2e14aed55c4427f5f42614c7f3f
2019-03-24 20:33:29 +00:00
9690a7709b Update .gitreview for stable/stein
Change-Id: Id63d9b0fdade34cce3edfc8a985443e4f1dbafa5
2019-03-08 01:12:48 +00:00
Michał Dulko
f896c23116 Support cri-o in CentOS and Fedora
This commit adds support for installing cri-o as container engine in
CentOS and Fedora. Tested on CentOS 7.6 and Fedora 28.

Change-Id: I0e10e06156e02397b5cd64efe802869d0e96b231
2019-02-05 19:57:59 +01:00
Feng Shengqin
b8ff250e97 Configure the dokcer daemon for IPv6
Change-Id: If190af800a8c28e2cf4ae320a770c40847cd18e6
2019-01-29 09:44:38 +08:00
Zuul
7e44a59c1e Merge "Skip linux-image-extra-$(uname -r) on 18.04" 2018-11-30 10:14:08 +00:00
Michał Dulko
63c7b8eddc Add support for CRI-O as container engine
This commit adds support for CRI-O. Support for Fedora/CentOS is in
progress.

Change-Id: Ib049d66058429e499f5d0932c4a749820bec73ff
2018-11-29 09:33:32 +01:00
Michał Dulko
17a865e064 Skip linux-image-extra-$(uname -r) on 18.04
Seems like aforementioned package is not available on Ubuntu 18.04
(Bionic). This commit excludes that version from installation of Docker.

Change-Id: Ib1864497dd19caadf9077386ce278712e4f5de8f
2018-11-27 19:47:33 +01:00
Andreas Jaeger
6d65af2900 Import legacy job
Import legacy job from openstack-zuul-jobs.

Change-Id: I5c28ce42606dc96d7df179a46e55abe453f93fe8
2018-09-09 06:47:12 +02:00
Doug Hellmann
34f6e6fd42 import zuul job settings from project-config
This is a mechanically generated patch to complete step 1 of moving
the zuul job settings out of project-config and into each project
repository.

Because there will be a separate patch on each branch, the branch
specifiers for branch-specific jobs have been removed.

Because this patch is generated by a script, there may be some
cosmetic changes to the layout of the YAML file(s) as the contents are
normalized.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Change-Id: I31bc574b8f66f4fc483c3758e787886fd49d4843
Story: #2002586
Task: #24327
2018-09-08 22:51:18 -04:00
Feng Shengqin
54aa82d99f Support live_restore for keeping all running containers
Change-Id: I5ca480bab5cb402dd7bd29f78dd8b6a639060fcf
2018-04-10 16:21:34 +08:00
8 changed files with 320 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
[gerrit]
host=review.openstack.org
host=review.opendev.org
port=29418
project=openstack/devstack-plugin-container.git
defaultbranch=stable/stein

19
.zuul.yaml Normal file
View File

@@ -0,0 +1,19 @@
- job:
name: devstack-plugin-container-dsvm
parent: legacy-dsvm-base
run: playbooks/devstack-plugin-container-dsvm/run.yaml
post-run: playbooks/devstack-plugin-container-dsvm/post.yaml
timeout: 4200
required-projects:
- openstack/devstack
- openstack/devstack-gate
- openstack/devstack-plugin-container
- project:
check:
jobs:
- devstack-plugin-container-dsvm:
voting: false
gate:
jobs:
- noop

118
devstack/lib/crio Normal file
View File

@@ -0,0 +1,118 @@
#!/bin/bash
# Dependencies:
#
# - functions
# stack.sh
# ---------
# - check_crio
# - install_crio
# - configure_crio
# - stop_crio
# Save trace setting
_XTRACE_DOCKER=$(set +o | grep xtrace)
set +o xtrace
# Defaults
# --------
CRIO_ENGINE_SOCKET_FILE=${CRIO_ENGINE_SOCKET_FILE:-/var/run/crio/crio.sock}
# Functions
# ---------
function check_crio {
if is_ubuntu; then
dpkg -l | grep crio-o > /dev/null 2>&1
else
false
# TODO: CentOS/Fedora support.
fi
}
function install_crio {
if [[ -z "$os_PACKAGE" ]]; then
GetOSVersion
fi
local lsb_dist=${os_VENDOR,,}
local dist_version=${os_CODENAME}
local arch=$(dpkg --print-architecture)
if is_ubuntu; then
apt_get install apt-transport-https ca-certificates software-properties-common
sudo add-apt-repository -y ppa:projectatomic/ppa
# Installing podman and containerd will get us compatible versions of
# cri-o and runc. And we need podman to manage container images anyway.
apt_get install podman buildah
elif is_fedora; then
if [[ "$lsb_dist" = "centos" ]]; then
sudo yum-config-manager \
--add-repo \
https://cbs.centos.org/repos/virt7-container-common-candidate/x86_64/os/
sudo yum-config-manager \
--add-repo \
https://cbs.centos.org/repos/paas7-crio-311-candidate/x86_64/os/
fi
yum_install cri-o podman buildah
fi
}
function configure_crio {
# After an ./unstack it will be stopped. So it is ok if it returns exit-code == 1
sudo systemctl stop crio.service || true
local crio_conf
crio_conf=/etc/crio/crio.conf
# We're wrapping values in \"<val>\" because that's the format cri-o wants.
iniset -sudo ${crio_conf} crio.api listen \"${CRIO_ENGINE_SOCKET_FILE}\"
if [[ "$ENABLE_DEBUG_LOG_LEVEL" == "True" ]]; then
# debug is way too verbose, info will be enough
iniset -sudo ${crio_conf} crio.runtime log_level \"info\"
fi
if is_ubuntu; then
# In Ubuntu's a special vendored version of runc is installed with
# cri-o. This means that it'll not work with the system's version of
# runc. Moreover vendored runc is not placed into /usr/bin, where
# crio.conf states that it will be. We fix that by linking the vendored
# binary to /usr/bin.
if [[ ! -e /usr/bin/runc ]]; then
sudo ln -s /usr/lib/cri-o-runc/sbin/runc /usr/bin/runc
sudo chmod +x /usr/bin/runc
fi
# At least for 18.04 we need to set up /etc/containers/registries.conf
# with some initial content. That's another bug with that PPA.
local registries_conf
registries_conf="/etc/containers/registries.conf"
if [[ ! -f ${registries_conf} ]]; then
sudo mkdir -p `dirname ${registries_conf}`
cat << EOF | sudo tee ${registries_conf}
[registries.search]
registries = ['docker.io']
EOF
fi
elif is_fedora; then
local lsb_dist=${os_VENDOR,,}
if [[ "$lsb_dist" = "centos" ]]; then
# CentOS packages are putting runc binary in different place...
iniset -sudo ${crio_conf} crio.runtime runtime \"/usr/sbin/runc\"
# CentOS version seems to only work with cgroupfs...
iniset -sudo ${crio_conf} crio.runtime cgroup_manager \"cgroupfs\"
fi
fi
sudo systemctl --no-block restart crio.service
}
function stop_crio {
sudo systemctl stop crio.service || true
}
# Restore xtrace
$_XTRACE_DOCKER

View File

@@ -27,6 +27,8 @@ DOCKER_CLUSTER_STORE=${DOCKER_CLUSTER_STORE:-}
DOCKER_GROUP=${DOCKER_GROUP:-$STACK_USER}
DOCKER_CGROUP_DRIVER=${DOCKER_CGROUP_DRIVER:-}
ENABLE_CLEAR_CONTAINER=$(trueorfalse False ENABLE_CLEAR_CONTAINER)
ENABLE_LIVE_RESTORE=$(trueorfalse False ENABLE_LIVE_RESTORE)
ENABLE_IPV6=$(trueorfalse False ENABLE_IPV6)
# Functions
# ---------
@@ -48,10 +50,12 @@ function install_docker {
local dist_version=${os_CODENAME}
local arch=$(dpkg --print-architecture)
if is_ubuntu; then
if uname -r | grep -q -- '-generic' && dpkg -l 'linux-image-*-generic' | grep -qE '^ii|^hi' 2>/dev/null; then
apt_get install linux-image-extra-$(uname -r) linux-image-extra-virtual
else
(>&2 echo "WARNING: Current kernel is not supported by the linux-image-extra-virtual package. Docker may not work.")
if [[ ${dist_version} == 'trusty' ]]; then
if uname -r | grep -q -- '-generic' && dpkg -l 'linux-image-*-generic' | grep -qE '^ii|^hi' 2>/dev/null; then
apt_get install linux-image-extra-$(uname -r) linux-image-extra-virtual
else
(>&2 echo "WARNING: Current kernel is not supported by the linux-image-extra-virtual package. Docker may not work.")
fi
fi
apt_get install apt-transport-https ca-certificates software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@@ -108,17 +112,31 @@ function configure_docker {
fi
local docker_config_file=/etc/docker/daemon.json
local debug
local live_restore
local ipv6
if [[ "$ENABLE_DEBUG_LOG_LEVEL" == "True" ]]; then
debug=true
else
debug=false
fi
if [[ "$ENABLE_LIVE_RESTORE" == "True" ]]; then
live_restore=true
else
live_restore=false
fi
if [[ "$ENABLE_IPV6" == "True" ]]; then
ipv6=true
else
ipv6=false
fi
sudo mkdir -p $(dirname ${docker_config_file})
cat <<EOF | sudo tee $docker_config_file >/dev/null
{
$cluster_store_opts
$runtime_opts
"debug": ${debug},
"live-restore": ${live_restore},
"ipv6": ${ipv6},
"group": "$DOCKER_GROUP",
EOF
if [[ -n "$DOCKER_CGROUP_DRIVER" ]]; then

View File

@@ -6,6 +6,7 @@ set -o xtrace
echo_summary "container's plugin.sh was called..."
source $DEST/devstack-plugin-container/devstack/lib/docker
source $DEST/devstack-plugin-container/devstack/lib/crio
(set -o posix; set)
if is_service_enabled container; then
@@ -13,17 +14,23 @@ if is_service_enabled container; then
echo_summary "Installing container engine"
if [[ ${CONTAINER_ENGINE} == "docker" ]]; then
check_docker || install_docker
elif [[ ${CONTAINER_ENGINE} == "crio" ]]; then
check_crio || install_crio
fi
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
echo_summary "Configuring container engine"
if [[ ${CONTAINER_ENGINE} == "docker" ]]; then
configure_docker
elif [[ ${CONTAINER_ENGINE} == "crio" ]]; then
configure_crio
fi
fi
if [[ "$1" == "unstack" ]]; then
if [[ ${CONTAINER_ENGINE} == "docker" ]]; then
stop_docker
elif [[ ${CONTAINER_ENGINE} == "crio" ]]; then
stop_crio
fi
fi

View File

@@ -1,7 +1,10 @@
# Devstack settings
# Supported options are "docker" and "crio".
CONTAINER_ENGINE=${CONTAINER_ENGINE:-docker}
ENABLE_CLEAR_CONTAINER=${ENABLE_CLEAR_CONTAINER:-false}
ENABLE_LIVE_RESTORE=${ENABLE_LIVE_RESTORE:-false}
ENABLE_IPV6=${ENABLE_IPV6:-false}
# Enable container services
enable_service container

View File

@@ -0,0 +1,80 @@
- hosts: primary
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=**/*nose_results.html
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=**/*testr_results.html.gz
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/.testrepository/tmp*
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=**/*testrepository.subunit.gz
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}/tox'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/.tox/*/log/*
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/logs/**
- --include=*/
- --exclude=*
- --prune-empty-dirs

View File

@@ -0,0 +1,69 @@
- hosts: all
name: Autoconverted job legacy-devstack-plugin-container-dsvm from old job gate-devstack-plugin-container-dsvm-nv
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
cat > clonemap.yaml << EOF
clonemap:
- name: openstack/devstack-gate
dest: devstack-gate
EOF
/usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \
https://opendev.org \
openstack/devstack-gate
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
cat << 'EOF' >>"/tmp/dg-local.conf"
[[local|localrc]]
enable_plugin devstack-plugin-container https://opendev.org/openstack/devstack-plugin-container
EOF
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_TEMPEST=0
export BRANCH_OVERRIDE=default
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
fi
export PROJECTS="openstack/devstack-plugin-container $PROJECTS"
# Keep localrc to be able to set some vars in post_test_hook
export KEEP_LOCALRC=1
function gate_hook {
bash -xe $BASE/new/devstack-plugin-container/contrib/gate_hook.sh
}
export -f gate_hook
function post_test_hook {
bash -xe $BASE/new/devstack-plugin-container/contrib/post_test_hook.sh fullstack
}
export -f post_test_hook
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
./safe-devstack-vm-gate-wrap.sh
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'