Browse Source

Merge "Inclusion annotation for upgrade and install chart changes"

Zuul 6 months ago
parent
commit
2b8581dcc2

+ 2
- 0
.zuul.yaml View File

@@ -43,6 +43,7 @@
43 43
     vars:
44 44
       osh_openstack_release: newton
45 45
       zuul_osh_infra_relative_path: ../openstack-helm-infra/
46
+      zuul_osh_relative_path: ../openstack-helm/
46 47
     timeout: 7200
47 48
     pre-run:
48 49
       - tools/gate/playbooks/osh-infra-upgrade-host.yaml
@@ -53,6 +54,7 @@
53 54
     post-run: tools/gate/playbooks/osh-infra-collect-logs.yaml
54 55
     required-projects:
55 56
       - openstack/openstack-helm-infra
57
+      - openstack/openstack-helm
56 58
     nodeset: openstack-helm-ubuntu
57 59
 
58 60
 - job:

+ 2
- 0
ranger-agent/templates/deployment-ranger-agent-api.yaml View File

@@ -28,6 +28,8 @@ apiVersion: apps/v1beta1
28 28
 kind: Deployment
29 29
 metadata:
30 30
   name: ranger-agent-api
31
+  annotations:
32
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
31 33
 spec:
32 34
   replicas: {{ .Values.pod.replicas.api }}
33 35
 {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}

+ 2
- 0
ranger-agent/templates/deployment-ranger-agent-engine.yaml View File

@@ -26,6 +26,8 @@ apiVersion: apps/v1beta1
26 26
 kind: Deployment
27 27
 metadata:
28 28
   name: ranger-agent-engine
29
+  annotations:
30
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
29 31
 spec:
30 32
   replicas: {{ .Values.pod.replicas.engine }}
31 33
 {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}

+ 2
- 2
ranger-agent/values.yaml View File

@@ -35,8 +35,8 @@ labels:
35 35
 
36 36
 images:
37 37
   tags:
38
-    ranger_agent: quay.io/attcomdev/ranger-agent:5d29fd462bb85cf6c1b0acb25bfb898944e62b1a
39
-    ranger-agent_db_sync: quay.io/attcomdev/ranger-agent:5d29fd462bb85cf6c1b0acb25bfb898944e62b1a
38
+    ranger_agent: quay.io/attcomdev/ranger-agent:60529ac023bf550f0e9cb9e0eb4d4eb3dbf2d5c6
39
+    ranger-agent_db_sync: quay.io/attcomdev/ranger-agent:60529ac023bf550f0e9cb9e0eb4d4eb3dbf2d5c6
40 40
     db_drop: docker.io/openstackhelm/heat:newton
41 41
     db_init: docker.io/openstackhelm/heat:newton
42 42
     ks_user: docker.io/openstackhelm/heat:newton

+ 2
- 0
ranger/templates/deployment-ranger-services.yaml View File

@@ -26,6 +26,8 @@ apiVersion: apps/v1beta1
26 26
 kind: Deployment
27 27
 metadata:
28 28
   name: {{ $serviceAccountName }}
29
+  annotations:
30
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
29 31
 spec:
30 32
   replicas: {{ .Values.pod.replicas.ranger }}
31 33
 {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}

+ 11
- 10
ranger/values.yaml View File

@@ -32,8 +32,8 @@ labels:
32 32
 
33 33
 images:
34 34
   tags:
35
-    ranger: docker.io/hosingh000/ranger:0.1.0
36
-    ranger_db_sync: docker.io/hosingh000/ranger:0.1.0
35
+    ranger: quay.io/attcomdev/ranger:d376b6059733a4d9b0c47d1c8ba1edf98c8953e3
36
+    ranger_db_sync: quay.io/attcomdev/ranger:d376b6059733a4d9b0c47d1c8ba1edf98c8953e3
37 37
     db_drop: docker.io/openstackhelm/heat:newton
38 38
     db_init: docker.io/openstackhelm/heat:newton
39 39
     dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.3.1
@@ -54,27 +54,27 @@ conf:
54 54
       pecan_debug: True
55 55
       ranger_base: '/home/ranger/ranger'
56 56
       ssl_verify: False
57
-      log_location: '/var/log/ranger'
57
+      use_handlers: console
58 58
       ranger_agent_https_enable: False
59 59
       ranger_agent_client_cert_path: ''
60 60
     cms:
61
-      log: cms.log
61
+      log: null
62 62
     fms:
63
-      log: fms.log
63
+      log: null
64 64
     ims:
65
-      log: ims.log
65
+      log: null
66 66
     rms:
67
-      log: rms.log
67
+      log: null
68 68
     rds:
69
-      log: rds.log
69
+      log: null
70 70
       repo_local_location: /home/ranger/git_repo
71 71
       repo_remote_location: git@127.0.0.1:/home/repo/ORM.git
72 72
       repo_user: orm
73 73
       repo_email: orm@test.com
74 74
     uuid:
75
-      log: uuid.log
75
+      log: null
76 76
     audit:
77
-      log: audit.log
77
+      log: null
78 78
     cli:
79 79
       base_region: RegionOne
80 80
     database:
@@ -82,6 +82,7 @@ conf:
82 82
     keystone_authtoken:
83 83
       auth_type: password
84 84
       auth_version: v3
85
+      auth_enabled: False
85 86
   ssh:
86 87
     user: ranger
87 88
     user_home: /home/ranger

+ 53
- 1
tools/gate/playbooks/osh-addons-check.yaml View File

@@ -17,6 +17,58 @@
17 17
     - name: Build Charts
18 18
       shell: |
19 19
         set -xe;
20
-        ./tools/gate/scripts/build-charts.sh
20
+        ./tools/gate/scripts/010-setup-client.sh
21
+      args:
22
+        chdir: "{{ zuul_osh_addons_relative_path | default(zuul.project.src_dir) }}"
23
+    - name: Deploy MariaDB
24
+      environment:
25
+        OSH_EXTRA_HELM_ARGS: "{{ zuul_osh_extra_helm_args_relative_path | default('') }}"
26
+        OSH_INFRA_PATH: "{{ zuul_osh_infra_relative_path | default('') }}"
27
+        zuul_site_mirror_fqdn: "{{ zuul_site_mirror_fqdn }}"
28
+      shell: |
29
+        set -xe;
30
+        ./tools/gate/scripts/020-deploy-mariadb.sh
31
+      args:
32
+        chdir: "{{ zuul_osh_addons_relative_path | default(zuul.project.src_dir) }}"
33
+    - name: Deploy RabbitMQ
34
+      environment:
35
+        OSH_EXTRA_HELM_ARGS: "{{ zuul_osh_extra_helm_args_relative_path | default('') }}"
36
+        OSH_INFRA_PATH: "{{ zuul_osh_infra_relative_path | default('') }}"
37
+        zuul_site_mirror_fqdn: "{{ zuul_site_mirror_fqdn }}"
38
+      shell: |
39
+        set -xe;
40
+        ./tools/gate/scripts/030-deploy-rabbitmq.sh
41
+      args:
42
+        chdir: "{{ zuul_osh_addons_relative_path | default(zuul.project.src_dir) }}"
43
+    - name: Deploy Memcached
44
+      environment:
45
+        OSH_EXTRA_HELM_ARGS: "{{ zuul_osh_extra_helm_args_relative_path | default('') }}"
46
+        OSH_INFRA_PATH: "{{ zuul_osh_infra_relative_path | default('') }}"
47
+        zuul_site_mirror_fqdn: "{{ zuul_site_mirror_fqdn }}"
48
+      shell: |
49
+        set -xe;
50
+        ./tools/gate/scripts/040-deploy-memcached.sh
51
+      args:
52
+        chdir: "{{ zuul_osh_addons_relative_path | default(zuul.project.src_dir) }}"
53
+    - name: Deploy Keystone
54
+      environment:
55
+        OSH_EXTRA_HELM_ARGS: "{{ zuul_osh_extra_helm_args_relative_path | default('') }}"
56
+        OSH_PATH: "{{ zuul_osh_relative_path | default('') }}"
57
+        zuul_site_mirror_fqdn: "{{ zuul_site_mirror_fqdn }}"
58
+      shell: |
59
+        set -xe;
60
+        ./tools/gate/scripts/050-deploy-keystone.sh
61
+      args:
62
+        chdir: "{{ zuul_osh_addons_relative_path | default(zuul.project.src_dir) }}"
63
+    - name: Deploy Ranger Charts
64
+      shell: |
65
+        set -xe;
66
+        ./tools/gate/scripts/060-deploy-ranger.sh
67
+      args:
68
+        chdir: "{{ zuul_osh_addons_relative_path | default(zuul.project.src_dir) }}"
69
+    - name: Deploy Ranger Agent Charts
70
+      shell: |
71
+        set -xe;
72
+        ./tools/gate/scripts/070-deploy-ranger-agent.sh
21 73
       args:
22 74
         chdir: "{{ zuul_osh_addons_relative_path | default(zuul.project.src_dir) }}"

+ 39
- 0
tools/gate/scripts/010-setup-client.sh View File

@@ -0,0 +1,39 @@
1
+#!/bin/bash
2
+
3
+# Copyright 2017 The Openstack-Helm Authors.
4
+#
5
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
6
+#    not use this file except in compliance with the License. You may obtain
7
+#    a copy of the License at
8
+#
9
+#         http://www.apache.org/licenses/LICENSE-2.0
10
+#
11
+#    Unless required by applicable law or agreed to in writing, software
12
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+#    License for the specific language governing permissions and limitations
15
+#    under the License.
16
+
17
+set -xe
18
+
19
+sudo -H -E pip install "cmd2<=0.8.7"
20
+sudo -H -E pip install python-openstackclient python-heatclient --ignore-installed
21
+
22
+sudo -H mkdir -p /etc/openstack
23
+sudo -H chown -R $(id -un): /etc/openstack
24
+tee /etc/openstack/clouds.yaml << EOF
25
+clouds:
26
+  openstack_helm:
27
+    region_name: RegionOne
28
+    identity_api_version: 3
29
+    auth:
30
+      username: 'admin'
31
+      password: 'password'
32
+      project_name: 'admin'
33
+      project_domain_name: 'default'
34
+      user_domain_name: 'default'
35
+      auth_url: 'http://keystone.openstack.svc.cluster.local/v3'
36
+EOF
37
+
38
+#NOTE: Build charts
39
+make all

+ 36
- 0
tools/gate/scripts/020-deploy-mariadb.sh View File

@@ -0,0 +1,36 @@
1
+#!/bin/bash
2
+
3
+# Copyright 2017 The Openstack-Helm Authors.
4
+#
5
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
6
+#    not use this file except in compliance with the License. You may obtain
7
+#    a copy of the License at
8
+#
9
+#         http://www.apache.org/licenses/LICENSE-2.0
10
+#
11
+#    Unless required by applicable law or agreed to in writing, software
12
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+#    License for the specific language governing permissions and limitations
15
+#    under the License.
16
+
17
+set -xe
18
+
19
+#NOTE: Lint and package chart
20
+: ${OSH_INFRA_PATH:="../openstack-helm-infra"}
21
+make -C ${OSH_INFRA_PATH} mariadb
22
+
23
+#NOTE: Deploy command
24
+: ${OSH_EXTRA_HELM_ARGS:=""}
25
+helm upgrade --install mariadb ${OSH_INFRA_PATH}/mariadb \
26
+    --namespace=openstack \
27
+    --set pod.replicas.server=1 \
28
+    --set volume.enabled=false \
29
+    ${OSH_EXTRA_HELM_ARGS} \
30
+    ${OSH_EXTRA_HELM_ARGS_MARIADB}
31
+
32
+#NOTE: Wait for deploy
33
+./tools/gate/scripts/wait-for-pods.sh openstack
34
+
35
+#NOTE: Validate Deployment info
36
+helm status mariadb

+ 36
- 0
tools/gate/scripts/030-deploy-rabbitmq.sh View File

@@ -0,0 +1,36 @@
1
+#!/bin/bash
2
+
3
+# Copyright 2017 The Openstack-Helm Authors.
4
+#
5
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
6
+#    not use this file except in compliance with the License. You may obtain
7
+#    a copy of the License at
8
+#
9
+#         http://www.apache.org/licenses/LICENSE-2.0
10
+#
11
+#    Unless required by applicable law or agreed to in writing, software
12
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+#    License for the specific language governing permissions and limitations
15
+#    under the License.
16
+
17
+set -xe
18
+
19
+#NOTE: Lint and package chart
20
+: ${OSH_INFRA_PATH:="../openstack-helm-infra"}
21
+make -C ${OSH_INFRA_PATH} rabbitmq
22
+
23
+#NOTE: Deploy command
24
+: ${OSH_EXTRA_HELM_ARGS:=""}
25
+helm upgrade --install rabbitmq ${OSH_INFRA_PATH}/rabbitmq \
26
+    --namespace=openstack \
27
+    --set pod.replicas.server=1 \
28
+    --set volume.enabled=false \
29
+    ${OSH_EXTRA_HELM_ARGS} \
30
+    ${OSH_EXTRA_HELM_ARGS_RABBITMQ}
31
+
32
+#NOTE: Wait for deploy
33
+./tools/gate/scripts/wait-for-pods.sh openstack
34
+
35
+#NOTE: Validate Deployment info
36
+helm status rabbitmq

+ 34
- 0
tools/gate/scripts/040-deploy-memcached.sh View File

@@ -0,0 +1,34 @@
1
+#!/bin/bash
2
+
3
+# Copyright 2017 The Openstack-Helm Authors.
4
+#
5
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
6
+#    not use this file except in compliance with the License. You may obtain
7
+#    a copy of the License at
8
+#
9
+#         http://www.apache.org/licenses/LICENSE-2.0
10
+#
11
+#    Unless required by applicable law or agreed to in writing, software
12
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+#    License for the specific language governing permissions and limitations
15
+#    under the License.
16
+
17
+set -xe
18
+
19
+#NOTE: Lint and package chart
20
+: ${OSH_INFRA_PATH:="../openstack-helm-infra"}
21
+make -C ${OSH_INFRA_PATH} memcached
22
+
23
+#NOTE: Deploy command
24
+: ${OSH_EXTRA_HELM_ARGS:=""}
25
+helm upgrade --install memcached ${OSH_INFRA_PATH}/memcached \
26
+    --namespace=openstack \
27
+    ${OSH_EXTRA_HELM_ARGS} \
28
+    ${OSH_EXTRA_HELM_ARGS_MEMCACHED}
29
+
30
+#NOTE: Wait for deploy
31
+./tools/gate/scripts/wait-for-pods.sh openstack
32
+
33
+#NOTE: Validate Deployment info
34
+helm status memcached

tools/gate/scripts/build-charts.sh → tools/gate/scripts/050-deploy-keystone.sh View File

@@ -16,4 +16,19 @@
16 16
 
17 17
 set -xe
18 18
 
19
-make all
19
+#NOTE: Lint and package chart
20
+: ${OSH_PATH:="../openstack-helm"}
21
+make -C ${OSH_PATH} keystone
22
+
23
+#NOTE: Deploy command
24
+: ${OSH_EXTRA_HELM_ARGS:=""}
25
+helm upgrade --install keystone ${OSH_PATH}/keystone \
26
+    --namespace=openstack \
27
+    ${OSH_EXTRA_HELM_ARGS} \
28
+    ${OSH_EXTRA_HELM_ARGS_KEYSTONE}
29
+
30
+#NOTE: Wait for deploy
31
+./tools/gate/scripts/wait-for-pods.sh openstack
32
+
33
+#NOTE: Validate Deployment info
34
+helm status keystone

+ 24
- 0
tools/gate/scripts/060-deploy-ranger.sh View File

@@ -0,0 +1,24 @@
1
+set -xe
2
+
3
+#NOTE: Deploy command
4
+
5
+#NOTE: override file
6
+tee /tmp/ranger.yaml << EOF
7
+conf:
8
+  ranger:
9
+    DEFAULT:
10
+      ranger_agent_https_enable: true
11
+      ranger_agent_client_cert_path: '/home/ranger/ord.cert'
12
+  ssh:
13
+    ssh_key: null
14
+    ssh_config: null
15
+  cert:
16
+    ranger_agent_client_cert: null
17
+EOF
18
+
19
+helm upgrade --install ranger ./ranger \
20
+  --namespace=openstack \
21
+  --values=/tmp/ranger.yaml
22
+
23
+#NOTE: Wait for deploy
24
+./tools/gate/scripts/wait-for-pods.sh openstack

+ 78
- 0
tools/gate/scripts/070-deploy-ranger-agent.sh View File

@@ -0,0 +1,78 @@
1
+set -xe
2
+
3
+#NOTE: Deploy command
4
+
5
+#NOTE: override file
6
+tee /tmp/ranger-agent.yaml << EOF
7
+conf:
8
+  ranger_agent:
9
+    DEFAULT:
10
+      enable_rds_callback_check: False
11
+  ssh:
12
+    ssh_key: null
13
+    ssh_config: null
14
+dependencies:
15
+  static:
16
+    api:
17
+      jobs:
18
+        - ranger-agent-db-sync
19
+        - ranger-agent-ks-user
20
+        - ranger-agent-ks-endpoints
21
+        - ranger-agent-rabbit-init
22
+      services:
23
+        - service: oslo_db
24
+          endpoint: internal
25
+    engine:
26
+      jobs:
27
+        - ranger-agent-db-sync
28
+        - ranger-agent-ks-user
29
+        - ranger-agent-rabbit-init
30
+      services:
31
+        - service: oslo_db
32
+          endpoint: internal
33
+        - service: identity
34
+          endpoint: internal
35
+    db_init:
36
+      services:
37
+        - service: oslo_db
38
+          endpoint: internal
39
+    db_sync:
40
+      jobs:
41
+        - ranger-agent-db-init
42
+      services:
43
+        - service: oslo_db
44
+          endpoint: internal
45
+    db_drop:
46
+      services:
47
+        - service: oslo_db
48
+          endpoint: internal
49
+    ks_user:
50
+      services:
51
+        - service: identity
52
+          endpoint: internal
53
+    ks_service:
54
+      services:
55
+        - service: identity
56
+          endpoint: internal
57
+    ks_endpoints:
58
+      jobs:
59
+        - ranger-agent-ks-service
60
+      services:
61
+        - service: identity
62
+          endpoint: internal
63
+    rabbit_init:
64
+      services:
65
+        - service: oslo_messaging
66
+          endpoint: internal
67
+    image_repo_sync:
68
+      services:
69
+        - endpoint: internal
70
+          service: local_image_registry
71
+EOF
72
+
73
+helm upgrade --install ranger-agent ./ranger-agent \
74
+  --namespace=openstack \
75
+  --values=/tmp/ranger-agent.yaml
76
+
77
+#NOTE: Wait for deploy
78
+./tools/gate/scripts/wait-for-pods.sh openstack

+ 43
- 0
tools/gate/scripts/wait-for-pods.sh View File

@@ -0,0 +1,43 @@
1
+#!/bin/bash
2
+
3
+# Copyright 2017 The Openstack-Helm Authors.
4
+#
5
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
6
+#    not use this file except in compliance with the License. You may obtain
7
+#    a copy of the License at
8
+#
9
+#         http://www.apache.org/licenses/LICENSE-2.0
10
+#
11
+#    Unless required by applicable law or agreed to in writing, software
12
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+#    License for the specific language governing permissions and limitations
15
+#    under the License.
16
+set -e
17
+
18
+# From Kolla-Kubernetes, orginal authors Kevin Fox & Serguei Bezverkhi
19
+# Default wait timeout is 600 seconds
20
+end=$(date +%s)
21
+if ! [ -z $2 ]; then
22
+ end=$((end + $2))
23
+else
24
+ end=$((end + 900))
25
+fi
26
+while true; do
27
+    kubectl get pods --namespace=$1 -o json | jq -r \
28
+        '.items[].status.phase' | grep Pending > /dev/null && \
29
+        PENDING=True || PENDING=False
30
+    query='.items[]|select(.status.phase=="Running")'
31
+    query="$query|.status.containerStatuses[].ready"
32
+    kubectl get pods --namespace=$1 -o json | jq -r "$query" | \
33
+        grep false > /dev/null && READY="False" || READY="True"
34
+    kubectl get jobs -o json --namespace=$1 | jq -r \
35
+        '.items[] | .spec.completions == .status.succeeded' | \
36
+        grep false > /dev/null && JOBR="False" || JOBR="True"
37
+    [ $PENDING == "False" -a $READY == "True" -a $JOBR == "True" ] && \
38
+        break || true
39
+    sleep 5
40
+    now=$(date +%s)
41
+    [ $now -gt $end ] && echo containers failed to start. && \
42
+        kubectl get pods --namespace $1 -o wide && exit -1
43
+done

Loading…
Cancel
Save