diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 4f60786c..f3df2949 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -29,7 +29,7 @@ function install_k8s { # test. sudo docker pull $QINLING_PYTHON_RUNTIME_IMAGE sudo docker pull $QINLING_NODEJS_RUNTIME_IMAGE - sudo docker pull openstackqinling/sidecar + sudo docker pull $QINLING_SIDECAR_IMAGE sudo docker pull openstackqinling/alpine-test } diff --git a/devstack/settings b/devstack/settings index 8bc33604..821a97f0 100644 --- a/devstack/settings +++ b/devstack/settings @@ -22,7 +22,8 @@ QINLING_CONF_FILE=${QINLING_CONF_DIR}/qinling.conf QINLING_POLICY_FILE=${QINLING_CONF_DIR}/policy.json QINLING_AUTH_CACHE_DIR=${QINLING_AUTH_CACHE_DIR:-/var/cache/qinling} QINLING_FUNCTION_STORAGE_DIR=${QINLING_FUNCTION_STORAGE_DIR:-/opt/qinling/funtion/packages} -QINLING_PYTHON_RUNTIME_IMAGE=${QINLING_PYTHON_RUNTIME_IMAGE:-openstackqinling/python-runtime} -QINLING_NODEJS_RUNTIME_IMAGE=${QINLING_NODEJS_RUNTIME_IMAGE:-openstackqinling/nodejs-runtime} +QINLING_PYTHON_RUNTIME_IMAGE=${QINLING_PYTHON_RUNTIME_IMAGE:-openstackqinling/python-runtime:0.0.2} +QINLING_NODEJS_RUNTIME_IMAGE=${QINLING_NODEJS_RUNTIME_IMAGE:-openstackqinling/nodejs-runtime:0.0.1} +QINLING_SIDECAR_IMAGE=${QINLING_SIDECAR_IMAGE:-openstackqinling/sidecar:0.0.1} QINLING_K8S_APISERVER_TLS=${QINLING_K8S_APISERVER_TLS:-True} diff --git a/qinling/config.py b/qinling/config.py index 88ab60af..93b6c4e1 100644 --- a/qinling/config.py +++ b/qinling/config.py @@ -112,6 +112,11 @@ engine_opts = [ default=3, help='Maximum number of concurrent executions per function.' ), + cfg.StrOpt( + 'sidecar_image', + default='openstackqinling/sidecar:0.0.1', + help='The sidecar image being used in the worker.' + ), ] STORAGE_GROUP = 'storage' diff --git a/qinling/orchestrator/kubernetes/manager.py b/qinling/orchestrator/kubernetes/manager.py index e88dcaca..392a5ebb 100644 --- a/qinling/orchestrator/kubernetes/manager.py +++ b/qinling/orchestrator/kubernetes/manager.py @@ -111,6 +111,7 @@ class KubernetesManager(base.OrchestratorBase): "replicas": self.conf.kubernetes.replicas, "container_name": 'worker', "image": image, + "sidecar_image": self.conf.engine.sidecar_image } ) diff --git a/qinling/orchestrator/kubernetes/templates/deployment.j2 b/qinling/orchestrator/kubernetes/templates/deployment.j2 index 04c1cb5b..17822d96 100644 --- a/qinling/orchestrator/kubernetes/templates/deployment.j2 +++ b/qinling/orchestrator/kubernetes/templates/deployment.j2 @@ -35,7 +35,7 @@ spec: - name: package-folder mountPath: /var/qinling/packages - name: sidecar - image: openstackqinling/sidecar + image: {{ sidecar_image }} imagePullPolicy: IfNotPresent ports: - containerPort: 9091 diff --git a/qinling/tests/unit/orchestrator/kubernetes/test_manager.py b/qinling/tests/unit/orchestrator/kubernetes/test_manager.py index 295d5c6d..22160647 100644 --- a/qinling/tests/unit/orchestrator/kubernetes/test_manager.py +++ b/qinling/tests/unit/orchestrator/kubernetes/test_manager.py @@ -152,7 +152,8 @@ class TestKubernetesManager(base.DbTestCase): 'labels': {'runtime_id': fake_deployment_name}, 'replicas': fake_replicas, 'container_name': 'worker', - 'image': fake_image + 'image': fake_image, + 'sidecar_image': CONF.engine.sidecar_image } ) self.k8s_v1_ext.create_namespaced_deployment.assert_called_once_with( diff --git a/qinling_tempest_plugin/config.py b/qinling_tempest_plugin/config.py index 906bd354..f7e8b364 100644 --- a/qinling_tempest_plugin/config.py +++ b/qinling_tempest_plugin/config.py @@ -40,4 +40,10 @@ QinlingGroup = [ choices=['public', 'admin', 'internal', 'publicURL', 'adminURL', 'internalURL'], help="The endpoint type to use for the qinling service."), + cfg.StrOpt("python_runtime_image", + default="openstackqinling/python-runtime:0.0.2", + help="The Python runtime being used in the tests."), + cfg.StrOpt("nodejs_runtime_image", + default="openstackqinling/nodejs-runtime:0.0.1", + help="The NodeJS runtime being used in the tests."), ] diff --git a/qinling_tempest_plugin/tests/api/test_executions_nodejs.py b/qinling_tempest_plugin/tests/api/test_executions_nodejs.py index 86d17d10..be4181dd 100644 --- a/qinling_tempest_plugin/tests/api/test_executions_nodejs.py +++ b/qinling_tempest_plugin/tests/api/test_executions_nodejs.py @@ -11,14 +11,17 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +from tempest import config from tempest.lib import decorators from qinling_tempest_plugin.tests import base +CONF = config.CONF + class NodeJSExecutionsTest(base.BaseQinlingTest): name_prefix = 'NodeJSExecutionsTest' - image = 'openstackqinling/nodejs-runtime' + image = CONF.qinling.nodejs_runtime_image def setUp(self): super(NodeJSExecutionsTest, self).setUp() diff --git a/qinling_tempest_plugin/tests/base.py b/qinling_tempest_plugin/tests/base.py index cb12ae9e..5cc77b13 100644 --- a/qinling_tempest_plugin/tests/base.py +++ b/qinling_tempest_plugin/tests/base.py @@ -27,7 +27,7 @@ CONF = config.CONF class BaseQinlingTest(test.BaseTestCase): credentials = ('admin', 'primary', 'alt') create_runtime = True - image = 'openstackqinling/python-runtime' + image = CONF.qinling.python_runtime_image @classmethod def skip_checks(cls):