From 504cddc2b9f22e0417bbb1e4440d562ead392585 Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Mon, 7 Jan 2019 08:59:21 -0600 Subject: [PATCH 1/3] Updating helm build process to not require networking The spec files for openstack-helm-infra and openstack-helm have been updated to not require networking, and therefore can be built the same as other std targets rather than as a container target. helm init --client-only was using networking and DNS lookup. This commit sets up helm without running that command. Story: 2004005 Task: 28793 Change-Id: I35c9b547a98fac559793bc2ec00012f6eded8ffa Signed-off-by: Al Bailey --- centos_pkg_dirs | 2 ++ .../centos/openstack-helm-infra.spec | 21 ++++++++++-- .../files/repositories.yaml | 12 +++++++ .../openstack-helm/centos/openstack-helm.spec | 32 ++++++++++++++++--- openstack/openstack-helm/files/index.yaml | 4 +++ .../openstack-helm/files/repositories.yaml | 12 +++++++ 6 files changed, 77 insertions(+), 6 deletions(-) create mode 100644 openstack/openstack-helm-infra/files/repositories.yaml create mode 100644 openstack/openstack-helm/files/index.yaml create mode 100644 openstack/openstack-helm/files/repositories.yaml diff --git a/centos_pkg_dirs b/centos_pkg_dirs index 55483d9d..2abea092 100644 --- a/centos_pkg_dirs +++ b/centos_pkg_dirs @@ -53,3 +53,5 @@ openstack/python-wsme openstack/distributedcloud openstack/distributedcloud-client openstack/stx-ocf-scripts +openstack/openstack-helm +openstack/openstack-helm-infra diff --git a/openstack/openstack-helm-infra/centos/openstack-helm-infra.spec b/openstack/openstack-helm-infra/centos/openstack-helm-infra.spec index abd9c952..70fe4584 100644 --- a/openstack/openstack-helm-infra/centos/openstack-helm-infra.spec +++ b/openstack/openstack-helm-infra/centos/openstack-helm-infra.spec @@ -11,6 +11,7 @@ Packager: Wind River URL: https://github.com/openstack/openstack-helm-infra Source0: %{name}-%{sha}.tar.gz +Source1: repositories.yaml BuildArch: noarch @@ -31,8 +32,20 @@ Openstack Helm Infra charts %build # initialize helm and build the toolkit -helm init --client-only -make helm-toolkit +# helm init --client-only does not work if there is no networking +# The following commands do essentially the same as: helm init +%define helm_home %{getenv:HOME}/.helm +mkdir %{helm_home} +mkdir %{helm_home}/repository +mkdir %{helm_home}/repository/cache +mkdir %{helm_home}/repository/local +mkdir %{helm_home}/plugins +mkdir %{helm_home}/starters +mkdir %{helm_home}/cache +mkdir %{helm_home}/cache/archive + +# Stage a repository file that only has a local repo +cp %{SOURCE1} %{helm_home}/repository/repositories.yaml # Host a server for the charts helm serve /tmp/charts --address localhost:8879 --url http://localhost:8879/charts & @@ -40,6 +53,7 @@ helm repo rm local helm repo add local http://localhost:8879/charts # Make the charts. These produce tgz files +make helm-toolkit make gnocchi make ingress make libvirt @@ -48,6 +62,9 @@ make memcached make openvswitch make rabbitmq +# terminate helm server (the last backgrounded task) +kill %1 + %install install -d -m 755 ${RPM_BUILD_ROOT}%{helm_folder} install -p -D -m 755 *.tgz ${RPM_BUILD_ROOT}%{helm_folder} diff --git a/openstack/openstack-helm-infra/files/repositories.yaml b/openstack/openstack-helm-infra/files/repositories.yaml new file mode 100644 index 00000000..7fbaebd4 --- /dev/null +++ b/openstack/openstack-helm-infra/files/repositories.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: v1 +generated: 2019-01-02T15:19:36.215111369-06:00 +repositories: + - caFile: "" + cache: /builddir/.helm/repository/cache/local-index.yaml + certFile: "" + keyFile: "" + name: local + password: "" + url: http://127.0.0.1:8879/charts + username: "" diff --git a/openstack/openstack-helm/centos/openstack-helm.spec b/openstack/openstack-helm/centos/openstack-helm.spec index 9c408130..95b6d0c5 100644 --- a/openstack/openstack-helm/centos/openstack-helm.spec +++ b/openstack/openstack-helm/centos/openstack-helm.spec @@ -13,6 +13,8 @@ Packager: Wind River URL: https://github.com/openstack/openstack-helm Source0: %{name}-%{sha}.tar.gz +Source1: repositories.yaml +Source2: index.yaml BuildArch: noarch @@ -38,10 +40,29 @@ Openstack Helm charts %patch05 -p1 %build -# initialize helm and stage the toolkit -helm init --client-only +# initialize helm and build the toolkit +# helm init --client-only does not work if there is no networking +# The following commands do essentially the same as: helm init +%define helm_home %{getenv:HOME}/.helm +mkdir %{helm_home} +mkdir %{helm_home}/repository +mkdir %{helm_home}/repository/cache +mkdir %{helm_home}/repository/local +mkdir %{helm_home}/plugins +mkdir %{helm_home}/starters +mkdir %{helm_home}/cache +mkdir %{helm_home}/cache/archive + +# Stage a repository file that only has a local repo +cp %{SOURCE1} %{helm_home}/repository/repositories.yaml + +# Stage a local repo index that can be updated by the build +cp %{SOURCE2} %{helm_home}/repository/local/index.yaml + +# Stage helm-toolkit in the local repo +cp %{helm_folder}/helm-toolkit-%{toolkit_version}.tgz . + # Host a server for the charts -cp %{helm_folder}/helm-toolkit-%{toolkit_version}.tgz . helm serve --repo-path . & helm repo rm local helm repo add local http://localhost:8879/charts @@ -61,8 +82,11 @@ make neutron make nova make panko +# terminate helm server (the last backgrounded task) +kill %1 + # Remove the helm-toolkit tarball -rm helm-toolkit-%{toolkit_version}.tgz +rm helm-toolkit-%{toolkit_version}.tgz %install # helm_folder is created by openstack-helm-infra diff --git a/openstack/openstack-helm/files/index.yaml b/openstack/openstack-helm/files/index.yaml new file mode 100644 index 00000000..166dfefd --- /dev/null +++ b/openstack/openstack-helm/files/index.yaml @@ -0,0 +1,4 @@ +--- +apiVersion: v1 +entries: {} +generated: 2019-01-07T12:33:46.098166523-06:00 diff --git a/openstack/openstack-helm/files/repositories.yaml b/openstack/openstack-helm/files/repositories.yaml new file mode 100644 index 00000000..7fbaebd4 --- /dev/null +++ b/openstack/openstack-helm/files/repositories.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: v1 +generated: 2019-01-02T15:19:36.215111369-06:00 +repositories: + - caFile: "" + cache: /builddir/.helm/repository/cache/local-index.yaml + certFile: "" + keyFile: "" + name: local + password: "" + url: http://127.0.0.1:8879/charts + username: "" From 4171f83a8c9629cb9dcbdc133eec911aab2282c7 Mon Sep 17 00:00:00 2001 From: Don Penney Date: Tue, 15 Jan 2019 15:00:39 -0500 Subject: [PATCH 2/3] Update stx-gnocchi.master to use forked gnocchi repo Until the ceph upgrade is complete, a forked gnocchi repo will be used for the stx-gnocchi image to allow temporary changes to the gnocchi source to support the older ceph version. Change-Id: I370086ca01e95e8b4907951328f29d833847b6b7 Story: 2004520 Task: 28912 Signed-off-by: Don Penney --- .../centos/stx-gnocchi.master_docker_image | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openstack/python-gnocchi/centos/stx-gnocchi.master_docker_image b/openstack/python-gnocchi/centos/stx-gnocchi.master_docker_image index 44d69001..2af1e991 100644 --- a/openstack/python-gnocchi/centos/stx-gnocchi.master_docker_image +++ b/openstack/python-gnocchi/centos/stx-gnocchi.master_docker_image @@ -1,8 +1,14 @@ BUILDER=loci LABEL=stx-gnocchi PROJECT=gnocchi -PROJECT_REPO=https://github.com/gnocchixyz/gnocchi.git +# Temporarily pointing to forked gnocchi repo +# This is necessary to revert a specific commit that does +# not support the older CEPH currently in starlingx. +# Once the CEPH upgrade is complete, we can go back +# to using the main repo +PROJECT_REPO=https://github.com/donpenney/gnocchi.git PIP_PACKAGES="pylint SQLAlchemy SQLAlchemy-Utils oslo.db keystonemiddleware gnocchiclient pymemcache psycopg2" -DIST_PACKAGES="python-rados" +# python-rados is provided by ceph, so specify an older version to install +DIST_PACKAGES="python-rados-10.2.5" PROFILES="gnocchi apache" From 2462f3015a5601a9398400beef2fadc56cbaa89f Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Sat, 12 Jan 2019 23:21:53 -0500 Subject: [PATCH 3/3] Clean up the stale files The keystone-api pod gets stuck in CrashLoopBackOff on AIO-SX lock/unlock attempt. When Kubernetes decides to kill the keystone-api pod due to readiness probe failure or other reasons, it calls the preStop hook immediately before the container is terminated. This hook starts a graceful shutdown process which includes removing pid, shared memory segment and wsgi sock files. If the container is not terminated within the grace period, a SIGKILL is sent, and the container is forced to shut down. When the container was forced to terminate without clean up, the stale files were left behind. On the restart, the application detected the file existed, and treated it as configuration failure, hence the exit. As a result, the pod went into a crash loop. This update removes any stale files when the pod starts. Story: 2004520 Task: 28392 Change-Id: I613a0db674de9578b3f9d1fa781a1612d9caf214 Signed-off-by: Tao Liu --- openstack/openstack-helm/centos/build_srpm.data | 2 +- .../Remove-stale-Apache2-service-pids-when-a-POD-starts.patch | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openstack/openstack-helm/centos/build_srpm.data b/openstack/openstack-helm/centos/build_srpm.data index da17aaf7..2bcbdedb 100644 --- a/openstack/openstack-helm/centos/build_srpm.data +++ b/openstack/openstack-helm/centos/build_srpm.data @@ -5,4 +5,4 @@ TAR="$TAR_NAME-$SHA.tar.gz" COPY_LIST="${CGCS_BASE}/downloads/$TAR $PKG_BASE/files/* " -TIS_PATCH_VER=6 +TIS_PATCH_VER=7 diff --git a/openstack/openstack-helm/files/Remove-stale-Apache2-service-pids-when-a-POD-starts.patch b/openstack/openstack-helm/files/Remove-stale-Apache2-service-pids-when-a-POD-starts.patch index 78814baa..29b4c913 100644 --- a/openstack/openstack-helm/files/Remove-stale-Apache2-service-pids-when-a-POD-starts.patch +++ b/openstack/openstack-helm/files/Remove-stale-Apache2-service-pids-when-a-POD-starts.patch @@ -56,8 +56,8 @@ index 217d942..a5950a4 100644 source /etc/apache2/envvars fi -+ # Get rid of stale pid file if present. -+ rm -f /var/run/apache2/*.pid ++ # Get rid of stale pid, shared memory segment and wsgi sock files if present. ++ rm -f /var/run/apache2/* + # Start Apache2 exec apache2 -DFOREGROUND