http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c0-cartridge-test-v1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c0-cartridge-test-v1.json b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c0-cartridge-test-v1.json new file mode 100755 index 0000000..eb2cb3e --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c0-cartridge-test-v1.json @@ -0,0 +1,124 @@ +{ + "category": "Data", + "description": "c0-cartridge-test Cartridge", + "displayName": "c0-cartridge-test", + "host": "qmog.cisco.com12", + "iaasProvider": [ + { + "imageId": "RegionOne/16e7e35b-0c88-4605-90ce-cbef9e9d123", + "maxInstanceLimit": "4", + "networkInterfaces": [ + { + "floatingNetworks": [ + { + "name": "private", + "networkUuid": "26b4aa2b-06bc-4e4f-a6eb-c19fbc2112121" + } + ], + "name": "core1", + "networkUuid": "5e107fbd-4820-47ad-84ea-6f1354961212" + } + ], + "property": [ + { + "name": "instanceType", + "value": "RegionOne/2cdbd576-8c9b-4c2d-8b1a-0f79dc4fb812" + }, + { + "name": "keyPair", + "value": "phoenix12" + }, + { + "name": "autoAssignIp", + "value": "true" + }, + { + "name": "securityGroups", + "value": "default123" + } + ], + "type": "mock" + } + ], + "multiTenant": "false", + "portMapping": [ + { + "port": "22", + "protocol": "http", + "proxyPort": "8280" + } + ], + "property": [ + { + "name": "payload_parameter.MB_IP", + "value": "octl.qmog.cisco.com123" + }, + { + "name": "payload_parameter.MB_PORT", + "value": "61617" + }, + { + "name": "payload_parameter.CEP_IP", + "value": "octl.qmog.cisco.com123" + }, + { + "name": "payload_parameter.CEP_PORT", + "value": "7612" + }, + { + "name": "payload_parameter.CEP_ADMIN_USERNAME", + "value": "admin" + }, + { + "name": "payload_parameter.CEP_ADMIN_PASSWORD", + "value": "admin123" + }, + { + "name": "payload_parameter.CERT_TRUSTSTORE", + "value": "/opt/apache-stratos-cartridge-agent/security/client-truststore.jks" + }, + { + "name": "payload_parameter.TRUSTSTORE_PASSWORD", + "value": "wso2carbon" + }, + { + "name": "payload_parameter.ENABLE_DATA_PUBLISHER", + "value": "false" + }, + { + "name": "payload_parameter.MONITORING_SERVER_IP", + "value": "octl.qmog.cisco.com123" + }, + { + "name": "payload_parameter.MONITORING_SERVER_PORT", + "value": "7612" + }, + { + "name": "payload_parameter.MONITORING_SERVER_SECURE_PORT", + "value": "7712" + }, + { + "name": "payload_parameter.MONITORING_SERVER_ADMIN_USERNAME", + "value": "admin" + }, + { + "name": "payload_parameter.MONITORING_SERVER_ADMIN_PASSWORD", + "value": "admin123" + }, + { + "name": "payload_parameter.QTCM_DNS_SEGMENT", + "value": "test123" + }, + { + "name": "payload_parameter.QTCM_NETWORK_COUNT", + "value": "3" + }, + { + "name": "payload_parameter.SIMPLE_PROPERTY", + "value": "value" + } + ], + "provider": "apache", + "type": "c0-cartridge-test", + "version": "1.0" +}
http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c0-cartridge-test.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c0-cartridge-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c0-cartridge-test.json new file mode 100755 index 0000000..056d510 --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c0-cartridge-test.json @@ -0,0 +1,124 @@ +{ + "category": "Application", + "description": "c0-cartridge-test Cartridge", + "displayName": "c0-cartridge-test", + "host": "qmog.cisco.com", + "iaasProvider": [ + { + "imageId": "RegionOne/16e7e35b-0c88-4605-90ce-cbef9e9dde0f", + "maxInstanceLimit": "4", + "networkInterfaces": [ + { + "floatingNetworks": [ + { + "name": "public", + "networkUuid": "26b4aa2b-06bc-4e4f-a6eb-c19fbc211af6" + } + ], + "name": "core", + "networkUuid": "5e107fbd-4820-47ad-84ea-6f135496f889" + } + ], + "property": [ + { + "name": "instanceType", + "value": "RegionOne/2cdbd576-8c9b-4c2d-8b1a-0f79dc4fb809" + }, + { + "name": "keyPair", + "value": "phoenix" + }, + { + "name": "autoAssignIp", + "value": "false" + }, + { + "name": "securityGroups", + "value": "default" + } + ], + "type": "mock" + } + ], + "multiTenant": "false", + "portMapping": [ + { + "port": "22", + "protocol": "http", + "proxyPort": "8280" + } + ], + "property": [ + { + "name": "payload_parameter.MB_IP", + "value": "octl.qmog.cisco.com" + }, + { + "name": "payload_parameter.MB_PORT", + "value": "61616" + }, + { + "name": "payload_parameter.CEP_IP", + "value": "octl.qmog.cisco.com" + }, + { + "name": "payload_parameter.CEP_PORT", + "value": "7611" + }, + { + "name": "payload_parameter.CEP_ADMIN_USERNAME", + "value": "admin" + }, + { + "name": "payload_parameter.CEP_ADMIN_PASSWORD", + "value": "admin" + }, + { + "name": "payload_parameter.CERT_TRUSTSTORE", + "value": "/opt/apache-stratos-cartridge-agent/security/client-truststore.jks" + }, + { + "name": "payload_parameter.TRUSTSTORE_PASSWORD", + "value": "wso2carbon" + }, + { + "name": "payload_parameter.ENABLE_DATA_PUBLISHER", + "value": "false" + }, + { + "name": "payload_parameter.MONITORING_SERVER_IP", + "value": "octl.qmog.cisco.com" + }, + { + "name": "payload_parameter.MONITORING_SERVER_PORT", + "value": "7611" + }, + { + "name": "payload_parameter.MONITORING_SERVER_SECURE_PORT", + "value": "7711" + }, + { + "name": "payload_parameter.MONITORING_SERVER_ADMIN_USERNAME", + "value": "admin" + }, + { + "name": "payload_parameter.MONITORING_SERVER_ADMIN_PASSWORD", + "value": "admin" + }, + { + "name": "payload_parameter.QTCM_DNS_SEGMENT", + "value": "test" + }, + { + "name": "payload_parameter.QTCM_NETWORK_COUNT", + "value": "1" + }, + { + "name": "payload_parameter.SIMPLE_PROPERTY", + "value": "value" + } + ], + "provider": "cisco", + "type": "c0-cartridge-test", + "version": "1.0" +} http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c1-cartridge-test.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c1-cartridge-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c1-cartridge-test.json new file mode 100755 index 0000000..2251af1 --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c1-cartridge-test.json @@ -0,0 +1,124 @@ +{ + "category": "Application", + "description": "c1-cartridge-test Cartridge", + "displayName": "c1-cartridge-test", + "host": "qmog.cisco.com", + "iaasProvider": [ + { + "imageId": "RegionOne/16e7e35b-0c88-4605-90ce-cbef9e9dde0f", + "maxInstanceLimit": "4", + "networkInterfaces": [ + { + "floatingNetworks": [ + { + "name": "public", + "networkUuid": "26b4aa2b-06bc-4e4f-a6eb-c19fbc211af6" + } + ], + "name": "core", + "networkUuid": "5e107fbd-4820-47ad-84ea-6f135496f889" + } + ], + "property": [ + { + "name": "instanceType", + "value": "RegionOne/2cdbd576-8c9b-4c2d-8b1a-0f79dc4fb809" + }, + { + "name": "keyPair", + "value": "phoenix" + }, + { + "name": "autoAssignIp", + "value": "false" + }, + { + "name": "securityGroups", + "value": "default" + } + ], + "type": "mock" + } + ], + "multiTenant": "false", + "portMapping": [ + { + "port": "22", + "protocol": "http", + "proxyPort": "8280" + } + ], + "property": [ + { + "name": "payload_parameter.MB_IP", + "value": "octl.qmog.cisco.com" + }, + { + "name": "payload_parameter.MB_PORT", + "value": "61616" + }, + { + "name": "payload_parameter.CEP_IP", + "value": "octl.qmog.cisco.com" + }, + { + "name": "payload_parameter.CEP_PORT", + "value": "7611" + }, + { + "name": "payload_parameter.CEP_ADMIN_USERNAME", + "value": "admin" + }, + { + "name": "payload_parameter.CEP_ADMIN_PASSWORD", + "value": "admin" + }, + { + "name": "payload_parameter.CERT_TRUSTSTORE", + "value": "/opt/apache-stratos-cartridge-agent/security/client-truststore.jks" + }, + { + "name": "payload_parameter.TRUSTSTORE_PASSWORD", + "value": "wso2carbon" + }, + { + "name": "payload_parameter.ENABLE_DATA_PUBLISHER", + "value": "false" + }, + { + "name": "payload_parameter.MONITORING_SERVER_IP", + "value": "octl.qmog.cisco.com" + }, + { + "name": "payload_parameter.MONITORING_SERVER_PORT", + "value": "7611" + }, + { + "name": "payload_parameter.MONITORING_SERVER_SECURE_PORT", + "value": "7711" + }, + { + "name": "payload_parameter.MONITORING_SERVER_ADMIN_USERNAME", + "value": "admin" + }, + { + "name": "payload_parameter.MONITORING_SERVER_ADMIN_PASSWORD", + "value": "admin" + }, + { + "name": "payload_parameter.QTCM_DNS_SEGMENT", + "value": "test" + }, + { + "name": "payload_parameter.QTCM_NETWORK_COUNT", + "value": "1" + }, + { + "name": "payload_parameter.SIMPLE_PROPERTY", + "value": "value" + } + ], + "provider": "cisco", + "type": "c1-cartridge-test", + "version": "1.0" +} http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c2-cartridge-test.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c2-cartridge-test.json b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c2-cartridge-test.json new file mode 100755 index 0000000..ce821f1 --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/cartridge-test/cartridges/mock/c2-cartridge-test.json @@ -0,0 +1,124 @@ +{ + "category": "Application", + "description": "c2-cartridge-test Cartridge", + "displayName": "c2-cartridge-test", + "host": "qmog.cisco.com", + "iaasProvider": [ + { + "imageId": "RegionOne/16e7e35b-0c88-4605-90ce-cbef9e9dde0f", + "maxInstanceLimit": "4", + "networkInterfaces": [ + { + "floatingNetworks": [ + { + "name": "public", + "networkUuid": "26b4aa2b-06bc-4e4f-a6eb-c19fbc211af6" + } + ], + "name": "core", + "networkUuid": "5e107fbd-4820-47ad-84ea-6f135496f889" + } + ], + "property": [ + { + "name": "instanceType", + "value": "RegionOne/2cdbd576-8c9b-4c2d-8b1a-0f79dc4fb809" + }, + { + "name": "keyPair", + "value": "phoenix" + }, + { + "name": "autoAssignIp", + "value": "false" + }, + { + "name": "securityGroups", + "value": "default" + } + ], + "type": "mock" + } + ], + "multiTenant": "false", + "portMapping": [ + { + "port": "22", + "protocol": "http", + "proxyPort": "8280" + } + ], + "property": [ + { + "name": "payload_parameter.MB_IP", + "value": "octl.qmog.cisco.com" + }, + { + "name": "payload_parameter.MB_PORT", + "value": "61616" + }, + { + "name": "payload_parameter.CEP_IP", + "value": "octl.qmog.cisco.com" + }, + { + "name": "payload_parameter.CEP_PORT", + "value": "7611" + }, + { + "name": "payload_parameter.CEP_ADMIN_USERNAME", + "value": "admin" + }, + { + "name": "payload_parameter.CEP_ADMIN_PASSWORD", + "value": "admin" + }, + { + "name": "payload_parameter.CERT_TRUSTSTORE", + "value": "/opt/apache-stratos-cartridge-agent/security/client-truststore.jks" + }, + { + "name": "payload_parameter.TRUSTSTORE_PASSWORD", + "value": "wso2carbon" + }, + { + "name": "payload_parameter.ENABLE_DATA_PUBLISHER", + "value": "false" + }, + { + "name": "payload_parameter.MONITORING_SERVER_IP", + "value": "octl.qmog.cisco.com" + }, + { + "name": "payload_parameter.MONITORING_SERVER_PORT", + "value": "7611" + }, + { + "name": "payload_parameter.MONITORING_SERVER_SECURE_PORT", + "value": "7711" + }, + { + "name": "payload_parameter.MONITORING_SERVER_ADMIN_USERNAME", + "value": "admin" + }, + { + "name": "payload_parameter.MONITORING_SERVER_ADMIN_PASSWORD", + "value": "admin" + }, + { + "name": "payload_parameter.QTCM_DNS_SEGMENT", + "value": "test" + }, + { + "name": "payload_parameter.QTCM_NETWORK_COUNT", + "value": "1" + }, + { + "name": "payload_parameter.SIMPLE_PROPERTY", + "value": "value" + } + ], + "provider": "cisco", + "type": "c2-cartridge-test", + "version": "1.0" +} http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/common/JMSOutputAdaptor.xml ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/common/JMSOutputAdaptor.xml b/products/stratos/modules/integration/test-integration/src/test/resources/common/JMSOutputAdaptor.xml new file mode 100755 index 0000000..045660b --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/common/JMSOutputAdaptor.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, 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. + +--> + +<outputEventAdaptor name="JMSOutputAdaptor" statistics="disable" + trace="enable" type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager"> + <!--property name="java.naming.provider.url">CEP_HOME/repository/conf/jndi.properties</property--> + <property name="java.naming.provider.url">tcp://localhost:61716</property> + <property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property> + <property name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</property> + <property name="transport.jms.DestinationType">topic</property> +</outputEventAdaptor> http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/common/autoscaler.xml ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/common/autoscaler.xml b/products/stratos/modules/integration/test-integration/src/test/resources/common/autoscaler.xml new file mode 100644 index 0000000..74cabd6 --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/common/autoscaler.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, 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. +--> +<configuration> + <autoscaler> + <cloudController> + <hostname>localhost</hostname> + <port>9543</port> + <!-- CC client timout in ms --> + <clientTimeout>300000</clientTimeout> + </cloudController> + <stratosManager> + <hostname>localhost</hostname> + <port>9543</port> + <!-- SM client timeout in ms --> + <clientTimeout>300000</clientTimeout> + </stratosManager> + <identity> + <hostname>localhost</hostname> + <port>9543</port> + <clientTimeout>300000</clientTimeout> + </identity> + <member> + <spinAfterTerminate>false</spinAfterTerminate> + <!-- this is the maximum time(ms) a member can be in pending member state --> + <pendingMemberExpiryTimeout>900000</pendingMemberExpiryTimeout> + <!-- this is the maximum time(ms) a member can be in obsoleted member state --> + <obsoletedMemberExpiryTimeout>86400000</obsoletedMemberExpiryTimeout> + <!-- this is the maximum time(ms) a member can be in pending termination member state --> + <pendingTerminationMemberExpiryTimeout>1800000</pendingTerminationMemberExpiryTimeout> + </member> + <cluster> + <!-- cluster monitoring interval (ms) --> + <monitorInterval>90000</monitorInterval> + </cluster> + <threadpool> + <identifier>Autoscaler</identifier> + <threadPoolSize>10</threadPoolSize> + </threadpool> + </autoscaler> +</configuration> http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/common/cartridge-config.properties ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/common/cartridge-config.properties b/products/stratos/modules/integration/test-integration/src/test/resources/common/cartridge-config.properties new file mode 100644 index 0000000..677d178 --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/common/cartridge-config.properties @@ -0,0 +1,27 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, 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. +# + +autoscaler.service.url=https://localhost:9543/services/AutoscalerService/ +cloud.controller.service.url=https://localhost:9543/services/CloudControllerService/ +stratos.manager.service.url=https://localhost:9543/services/StratosManagerService/ +puppet.ip=127.0.0.1 +puppet.hostname=puppet.stratos.apache.org +puppet.dns.available=false +puppet.environment=stratos + http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/common/cloud-controller.xml ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/common/cloud-controller.xml b/products/stratos/modules/integration/test-integration/src/test/resources/common/cloud-controller.xml new file mode 100644 index 0000000..a7ac531 --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/common/cloud-controller.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, 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. +--> +<cloudController xmlns:svns="http://org.wso2.securevault/configuration"> + <svns:secureVault provider="org.wso2.securevault.secret.handler.SecretManagerSecretCallbackHandler"/> + + <!-- BAM data publisher configuration --> + <dataPublisher enable="false"> + <bamServer> + <!-- BAM server URL should be specified in carbon.xml --> + <adminUserName>admin</adminUserName> + <adminPassword svns:secretAlias="cloud.controller.bam.server.admin.password">admin</adminPassword> + </bamServer> + <!-- Default cron expression is '1 * * * * ? *' meaning 'first second of every minute'. + Optional element. --> + <cron>1 * * * * ? *</cron> + </dataPublisher> + + <!-- Complete topology event publisher cron configuration --> + <topologySync enable="true"> + <property name="cron" value="1 * * * * ? *"/> + </topologySync> + + <!-- Specify the properties that are common to an IaaS here. This element + is not necessary [0..1]. But you can use this section to avoid specifying + same property over and over again. --> + <iaasProviders> + <!-- iaasProvider type="openstack" name="Openstack"> + <className>org.apache.stratos.cloud.controller.iaases.openstack.OpenstackIaas</className> + <provider>openstack-nova</provider> + <identity svns:secretAlias="cloud.controller.openstack.identity">project:username</identity> + <credential svns:secretAlias="cloud.controller.openstack.credential">credential</credential> + <property name="jclouds.endpoint" value="http://192.168.16.99:5000/v2.0" /> + <property name="jclouds.openstack-nova.auto-create-floating-ips" value="false"/> + <property name="jclouds.api-version" value="2.0/" /> + <property name="openstack.networking.provider" value="nova" /> + <property name="keyPair" value="keypair-name" /> + <property name="securityGroups" value="default" /> + </iaasProvider --> + <!-- iaasProvider type="ec2" name="Amazon EC2"> + <className>org.apache.stratos.cloud.controller.iaases.ec2.EC2Iaas</className> + <provider>aws-ec2</provider> + <identity svns:secretAlias="cloud.controller.ec2.identity">identity</identity> + <credential svns:secretAlias="cloud.controller.ec2.credential">credential</credential> + <property name="jclouds.ec2.ami-query" value="owner-id=owner-id;state=available;image-type=machine"/> + <property name="availabilityZone" value="ap-southeast-1b"/> + <property name="securityGroups" value="default"/> + <property name="autoAssignIp" value="true" /> + <property name="keyPair" value="keypair-name"/> + </iaasProvider --> + <iaasProvider type="kubernetes" name="Kubernetes"> + <className>org.apache.stratos.cloud.controller.iaases.kubernetes.KubernetesIaas</className> + <provider>kubernetes</provider> + <identity svns:secretAlias="cloud.controller.kubernetes.identity">identity</identity> + <credential svns:secretAlias="cloud.controller.kubernetes.credential">credential</credential> + </iaasProvider> + <iaasProvider type="mock" name="Mock"> + <className>org.apache.stratos.cloud.controller.iaases.mock.MockIaas</className> + <provider>mock</provider> + <identity svns:secretAlias="cloud.controller.mock.identity">identity</identity> + <credential svns:secretAlias="cloud.controller.mock.credential">credential</credential> + <property name="api.endpoint" value="https://localhost:9543/mock-iaas/api"/> + </iaasProvider> + </iaasProviders> +</cloudController> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/common/identity.xml ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/common/identity.xml b/products/stratos/modules/integration/test-integration/src/test/resources/common/identity.xml new file mode 100644 index 0000000..3547372 --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/common/identity.xml @@ -0,0 +1,260 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, 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. + --> + +<Server xmlns="http://wso2.org/projects/carbon/carbon.xml"> + + <JDBCPersistenceManager> + <DataSource> + <!-- Include a data source name (jndiConfigName) from the set of data + sources defined in master-datasources.xml --> + <Name>jdbc/WSO2CarbonDB</Name> + </DataSource> + <!-- If the identity database is created from another place and if it is + required to skip schema initialization during the server start up, set the + following property to "true". --> + <!-- <SkipDBSchemaCreation>false</SkipDBSchemaCreation> --> + </JDBCPersistenceManager> + + <!-- Security configurations --> + <Security> + <UserTrustedRPStore> + <Location>${carbon.home}/repository/resources/security/userRP.jks + </Location> + <!-- Keystore type (JKS/PKCS12 etc.) --> + <Type>JKS</Type> + <!-- Keystore password --> + <Password>wso2carbon</Password> + <!-- Private Key password --> + <KeyPassword>wso2carbon</KeyPassword> + </UserTrustedRPStore> + + <!-- The directory under which all other KeyStore files will be stored --> + <KeyStoresDir>${carbon.home}/conf/keystores</KeyStoresDir> + </Security> + + <Identity> + <IssuerPolicy>SelfAndManaged</IssuerPolicy> + <TokenValidationPolicy>CertValidate</TokenValidationPolicy> + <BlackList></BlackList> + <WhiteList></WhiteList> + <System> + <KeyStore></KeyStore> + <StorePass></StorePass> + </System> + </Identity> + + <OpenID> + <OpenIDServerUrl>https://localhost:9543/openidserver</OpenIDServerUrl> + <OpenIDUserPattern>https://localhost:9543/openid/</OpenIDUserPattern> + <!-- If the users must be prompted for approval --> + <OpenIDSkipUserConsent>false</OpenIDSkipUserConsent> + <!-- Expiry time of the OpenID RememberMe token in minutes --> + <OpenIDRememberMeExpiry>7200</OpenIDRememberMeExpiry> + <!-- Multifactor Authentication configuration --> + <UseMultifactorAuthentication>false</UseMultifactorAuthentication> + <!-- To enable or disable openid dumb mode --> + <DisableOpenIDDumbMode>false</DisableOpenIDDumbMode> + <!-- remember me session timeout in seconds --> + <SessionTimeout>36000</SessionTimeout> + <!-- skips authentication if valid SAML2 Web SSO browser session available --> + <AcceptSAMLSSOLogin>false</AcceptSAMLSSOLogin> + <ClaimsRetrieverImplClass>org.wso2.carbon.identity.provider.openid.claims.DefaultClaimsRetriever</ClaimsRetrieverImplClass> + </OpenID> + + <OAuth> + <RequestTokenUrl>https://localhost:9543/oauth/request-token</RequestTokenUrl> + <AccessTokenUrl>https://localhost:9543/oauth/access-token</AccessTokenUrl> + <AuthorizeUrl>https://localhost:9543/oauth/authorize-url</AuthorizeUrl> + <!-- Default validity period for Authorization Code in seconds --> + <AuthorizationCodeDefaultValidityPeriod>300</AuthorizationCodeDefaultValidityPeriod> + <!-- Default validity period for user access tokens in seconds --> + <AccessTokenDefaultValidityPeriod>3602</AccessTokenDefaultValidityPeriod> + <!-- Default validity period for application access tokens in seconds --> + <UserAccessTokenDefaultValidityPeriod>3603</UserAccessTokenDefaultValidityPeriod> + <!-- Validity period for refresh token --> + <RefreshTokenValidityPeriod>84600</RefreshTokenValidityPeriod> + <!-- Timestamp skew in seconds --> + <TimestampSkew>300</TimestampSkew> + <!-- Enable OAuth caching --> + <EnableOAuthCache>true</EnableOAuthCache> + <!-- Enable renewal of refresh token for refresh_token grant --> + <RenewRefreshTokenForRefreshGrant>true</RenewRefreshTokenForRefreshGrant> + <!-- Process the token before storing it in database, e.g. encrypting --> + <TokenPersistenceProcessor>org.wso2.carbon.identity.oauth.tokenprocessor.PlainTextPersistenceProcessor</TokenPersistenceProcessor> + <!-- Supported Client Autnetication Methods --> + <ClientAuthHandlers> + <ClientAuthHandlerImplClass>org.wso2.carbon.identity.oauth2.token.handlers.clientauth.BasicAuthClientAuthHandler</ClientAuthHandlerImplClass> + </ClientAuthHandlers> + <!-- Supported Response Types --> + <SupportedResponseTypes> + <SupportedResponseType> + <ResponseTypeName>token</ResponseTypeName> + <ResponseTypeHandlerImplClass>org.wso2.carbon.identity.oauth2.authz.handlers.TokenResponseTypeHandler</ResponseTypeHandlerImplClass> + </SupportedResponseType> + <SupportedResponseType> + <ResponseTypeName>code</ResponseTypeName> + <ResponseTypeHandlerImplClass>org.wso2.carbon.identity.oauth2.authz.handlers.CodeResponseTypeHandler</ResponseTypeHandlerImplClass> + </SupportedResponseType> + </SupportedResponseTypes> + <!-- Supported Grant Types --> + <SupportedGrantTypes> + <SupportedGrantType> + <GrantTypeName>authorization_code</GrantTypeName> + <GrantTypeHandlerImplClass>org.wso2.carbon.identity.oauth2.token.handlers.grant.AuthorizationCodeGrantHandler</GrantTypeHandlerImplClass> + </SupportedGrantType> + <SupportedGrantType> + <GrantTypeName>password</GrantTypeName> + <GrantTypeHandlerImplClass>org.wso2.carbon.identity.oauth2.token.handlers.grant.PasswordGrantHandler</GrantTypeHandlerImplClass> + </SupportedGrantType> + <SupportedGrantType> + <GrantTypeName>refresh_token</GrantTypeName> + <GrantTypeHandlerImplClass>org.wso2.carbon.identity.oauth2.token.handlers.grant.RefreshGrantHandler</GrantTypeHandlerImplClass> + </SupportedGrantType> + <SupportedGrantType> + <GrantTypeName>client_credentials</GrantTypeName> + <GrantTypeHandlerImplClass>org.apache.stratos.custom.handlers.granttype.ClientCredentialsGrantHandler</GrantTypeHandlerImplClass> + </SupportedGrantType> + <SupportedGrantType> + <GrantTypeName>urn:ietf:params:oauth:grant-type:saml2-bearer</GrantTypeName> + <GrantTypeHandlerImplClass>org.wso2.carbon.identity.oauth2.token.handlers.grant.saml.SAML2BearerGrantHandler</GrantTypeHandlerImplClass> + </SupportedGrantType> + <SupportedGrantType> + <GrantTypeName>iwa:ntlm</GrantTypeName> + <GrantTypeHandlerImplClass>org.wso2.carbon.identity.oauth2.token.handlers.grant.iwa.ntlm.NTLMAuthenticationGrantHandler</GrantTypeHandlerImplClass> + </SupportedGrantType> + </SupportedGrantTypes> + <OAuthCallbackHandlers> + <OAuthCallbackHandler Class="org.wso2.carbon.identity.oauth.callback.DefaultCallbackHandler" /> + </OAuthCallbackHandlers> + <!--TokenValidators> + <TokenValidator type="bearer" class="org.wso2.carbon.identity.oauth2.validators.DefaultOAuth2TokenValidator"/> + </TokenValidators--> + <!-- Assertions can be used to embedd parameters into access token. --> + <EnableAssertions> + <UserName>false</UserName> + </EnableAssertions> + + <!-- This should be set to true when using multiple user stores and keys + should saved into different tables according to the user store. By default + all the application keys are saved in to the same table. UserName Assertion + should be 'true' to use this. --> + <EnableAccessTokenPartitioning>false</EnableAccessTokenPartitioning> + <!-- user store domain names and mapping to new table name. eg: if you + provide 'A:foo.com', foo.com should be the user store domain name and 'A' + represent the relavant mapping of token store table, i.e. tokens will be + added to a table called IDN_OAUTH2_ACCESS_TOKEN_A. --> + <AccessTokenPartitioningDomains><!-- A:foo.com, B:bar.com --> + </AccessTokenPartitioningDomains> + <AuthorizationContextTokenGeneration> + <Enabled>false</Enabled> + <TokenGeneratorImplClass>org.wso2.carbon.identity.oauth2.authcontext.JWTTokenGenerator</TokenGeneratorImplClass> + <ClaimsRetrieverImplClass>org.wso2.carbon.identity.oauth2.authcontext.DefaultClaimsRetriever</ClaimsRetrieverImplClass> + <ConsumerDialectURI>http://wso2.org/claims</ConsumerDialectURI> + <SignatureAlgorithm>SHA256withRSA</SignatureAlgorithm> + <AuthorizationContextTTL>15</AuthorizationContextTTL> + </AuthorizationContextTokenGeneration> + <SAML2Grant> + <!--SAML2TokenHandler></SAML2TokenHandler--> + </SAML2Grant> + <OpenIDConnect> + <IDTokenBuilder>org.wso2.carbon.identity.openidconnect.DefaultIDTokenBuilder</IDTokenBuilder> + <IDTokenIssuerID>https://localhost:9543/oauth2endpoints/token</IDTokenIssuerID> + <IDTokenSubjectClaim>http://wso2.org/claims/givenname</IDTokenSubjectClaim> + <IDTokenCustomClaimsCallBackHandler>org.wso2.carbon.identity.openidconnect.SAMLAssertionClaimsCallback</IDTokenCustomClaimsCallBackHandler> + <IDTokenExpiration>-1</IDTokenExpiration> + <UserInfoEndpointClaimDialect>http://wso2.org/claims</UserInfoEndpointClaimDialect> + <UserInfoEndpointClaimRetriever>org.wso2.carbon.identity.oauth.endpoint.user.impl.UserInfoUserStoreClaimRetriever</UserInfoEndpointClaimRetriever> + <UserInfoEndpointRequestValidator>org.wso2.carbon.identity.oauth.endpoint.user.impl.UserInforRequestDefaultValidator</UserInfoEndpointRequestValidator> + <UserInfoEndpointAccessTokenValidator>org.wso2.carbon.identity.oauth.endpoint.user.impl.UserInfoISAccessTokenValidator</UserInfoEndpointAccessTokenValidator> + <UserInfoEndpointResponseBuilder>org.wso2.carbon.identity.oauth.endpoint.user.impl.UserInfoJSONResponseBuilder</UserInfoEndpointResponseBuilder> + <SkipUserConsent>false</SkipUserConsent> + </OpenIDConnect> + </OAuth> + + <MultifactorAuthentication> + <XMPPSettings> + <XMPPConfig> + <XMPPProvider>gtalk</XMPPProvider> + <XMPPServer>talk.google.com</XMPPServer> + <XMPPPort>5222</XMPPPort> + <XMPPExt>gmail.com</XMPPExt> + <XMPPUserName>[email protected]</XMPPUserName> + <XMPPPassword>wso2carbon</XMPPPassword> + </XMPPConfig> + </XMPPSettings> + </MultifactorAuthentication> + + <SSOService> + <EntityId>localhost</EntityId> + <IdentityProviderURL>https://localhost:9543/samlsso</IdentityProviderURL> + <SingleLogoutRetryCount>5</SingleLogoutRetryCount> + <SingleLogoutRetryInterval>60000</SingleLogoutRetryInterval> <!-- in milli seconds --> + <TenantPartitioningEnabled>false</TenantPartitioningEnabled> + <SessionTimeout>36000</SessionTimeout> <!-- remember me session timeout in seconds --> + <!-- skips authentication if valid SAML2 Web SSO browser session available --> + <AttributeStatementBuilder>org.wso2.carbon.identity.sso.saml.attributes.UserAttributeStatementBuilder</AttributeStatementBuilder> + <AttributesClaimDialect>http://wso2.org/claims</AttributesClaimDialect> + <AcceptOpenIDLogin>false</AcceptOpenIDLogin> + <ClaimsRetrieverImplClass>org.wso2.carbon.identity.sso.saml.builders.claims.DefaultClaimsRetriever</ClaimsRetrieverImplClass> + <SAMLSSOEncrypter>org.wso2.carbon.identity.sso.saml.builders.encryption.DefaultSSOEncrypter</SAMLSSOEncrypter> + <SAMLSSOSigner>org.wso2.carbon.identity.sso.saml.builders.signature.DefaultSSOSigner</SAMLSSOSigner> + <SAML2HTTPRedirectSignatureValidator>org.wso2.carbon.identity.sso.saml.validators.SAML2HTTPRedirectDeflateSignatureValidator</SAML2HTTPRedirectSignatureValidator> + <!--SAMLSSOResponseBuilder>org.wso2.carbon.identity.sso.saml.builders.DefaultResponseBuilder</SAMLSSOResponseBuilder--> + + <!-- SAML Token validity period in minutes --> + <SAMLResponseValidityPeriod>5</SAMLResponseValidityPeriod> + <UseAuthenticatedUserDomain>false</UseAuthenticatedUserDomain> + </SSOService> + + <EntitlementSettings> + <!-- Uncomment this to enable on-demand policy loading --> + <!--OnDemandPolicyLoading> <Enable>true</Enable> <MaxInMemoryPolicies>100</MaxInMemoryPolicies> + </OnDemandPolicyLoading --> + <DecisionCaching> + <Enable>true</Enable> + <CachingInterval>36000</CachingInterval> + </DecisionCaching> + <AttributeCaching> + <Enable>true</Enable> + </AttributeCaching> + <ThirftBasedEntitlementConfig> + <EnableThriftService>true</EnableThriftService> + <ReceivePort>${Ports.ThriftEntitlementReceivePort}</ReceivePort> + <ClientTimeout>10000</ClientTimeout> + <KeyStore> + <Location>${carbon.home}/repository/resources/security/wso2carbon.jks</Location> + <Password>wso2carbon</Password> + </KeyStore> + </ThirftBasedEntitlementConfig> + </EntitlementSettings> + + <SCIMAuthenticators> + <Authenticator class="org.wso2.carbon.identity.scim.provider.auth.BasicAuthHandler"> + <Property name="Priority">5</Property> + </Authenticator> + <Authenticator class="org.wso2.carbon.identity.scim.provider.auth.OAuthHandler"> + <Property name="Priority">10</Property> + <Property name="AuthorizationServer">local://services</Property> + <!--Property name="AuthorizationServer">https://localhost:9443/services</Property> + <Property name="UserName">admin</Property> + <Property name="Password">admin</Property--> + </Authenticator> + </SCIMAuthenticators> +</Server> http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/common/jndi.properties ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/common/jndi.properties b/products/stratos/modules/integration/test-integration/src/test/resources/common/jndi.properties new file mode 100644 index 0000000..f2d6baf --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/common/jndi.properties @@ -0,0 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, 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. +# + +connectionfactoryName=TopicConnectionFactory +java.naming.provider.url=tcp://localhost:61716 +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/common/log4j.properties ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/common/log4j.properties b/products/stratos/modules/integration/test-integration/src/test/resources/common/log4j.properties new file mode 100644 index 0000000..72ad1c4 --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/common/log4j.properties @@ -0,0 +1,206 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, 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. +# + +# +# This is the log4j configuration file used by Stratos +# + +log4j.rootLogger=INFO, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY, CARBON_SYS_LOG + +log4j.logger.AUDIT_LOG=INFO, AUDIT_LOGFILE +log4j.logger.org.apache.axis2.wsdl.codegen.writer.PrettyPrinter=ERROR, CARBON_LOGFILE, CARBON_MEMORY +log4j.logger.org.apache.axis2.clustering=INFO +log4j.logger.org.apache=INFO +log4j.logger.org.apache.catalina=WARN +log4j.logger.org.apache.tomcat=WARN +log4j.logger.org.wso2.carbon.apacheds=WARN +log4j.logger.org.apache.directory.server.ldap=WARN +log4j.logger.org.apache.directory.server.core.event=WARN +log4j.logger.com.atomikos=INFO,ATOMIKOS +log4j.logger.org.quartz=WARN +log4j.logger.org.apache.jackrabbit.webdav=WARN +log4j.logger.org.apache.juddi=ERROR +log4j.logger.org.apache.commons.digester.Digester=WARN +log4j.logger.org.apache.jasper.compiler.TldLocationsCache=WARN +log4j.logger.org.apache.qpid=WARN +log4j.logger.org.apache.qpid.server.Main=INFO +log4j.logger.qpid.message=WARN +log4j.logger.qpid.message.broker.listening=INFO +log4j.logger.org.apache.tiles=WARN +log4j.logger.org.apache.commons.httpclient=ERROR +log4j.logger.org.apache.coyote=WARN +log4j.logger.org.apache.solr=ERROR +log4j.logger.org.infinispan=WARN +log4j.logger.org.jgroups=ERROR +log4j.logger.me.prettyprint.cassandra.hector.TimingLogger=ERROR +log4j.logger.org.wso2=INFO + +# Apache Stratos logging configuration +log4j.logger.org.apache.stratos.manager=INFO +log4j.logger.org.apache.stratos.autoscaler=INFO +log4j.logger.org.apache.stratos.messaging=INFO +log4j.logger.org.apache.stratos.cloud.controller=INFO +log4j.logger.org.wso2.andes.client=ERROR +# Autoscaler rule logs +log4j.logger.org.apache.stratos.autoscaler.rule.RuleLog=INFO + +# Apache jclouds +#log4j.logger.jclouds.wire=DEBUG +#log4j.logger.jclouds.headers=DEBUG +#log4j.logger.org.jclouds=DEBUG + +# CEP Window processors +#log4j.logger.org.apache.stratos.cep.extension.FaultHandlingWindowProcessor=DEBUG + +log4j.logger.org.apache.axis2.enterprise=FATAL, CARBON_LOGFILE, CARBON_MEMORY +log4j.logger.org.opensaml.xml=WARN, CARBON_LOGFILE, CARBON_MEMORY +log4j.logger.org.apache.directory.shared.ldap=WARN, CARBON_LOGFILE, CARBON_MEMORY +log4j.logger.org.apache.directory.server.ldap.handlers=WARN, CARBON_LOGFILE, CARBON_MEMORY + +# Following are to remove false error messages from startup (IS) +log4j.logger.org.apache.directory.shared.ldap.entry.DefaultServerAttribute=FATAL, CARBON_LOGFILE, CARBON_MEMORY +log4j.logger.org.apache.directory.server.core.DefaultDirectoryService=ERROR, CARBON_LOGFILE, CARBON_MEMORY +log4j.logger.org.apache.directory.shared.ldap.ldif.LdifReader=ERROR, CARBON_LOGFILE, CARBON_MEMORY +log4j.logger.org.apache.directory.server.ldap.LdapProtocolHandler=ERROR, CARBON_LOGFILE, CARBON_MEMORY +log4j.logger.org.apache.directory.server.core=ERROR, CARBON_LOGFILE, CARBON_MEMORY + +# Hive logging configuration +log4j.logger.DataNucleus=ERROR +log4j.logger.Datastore=ERROR +log4j.logger.Datastore.Schema=ERROR +log4j.logger.JPOX.Datastore=ERROR +log4j.logger.JPOX.Plugin=ERROR +log4j.logger.JPOX.MetaData=ERROR +log4j.logger.JPOX.Query=ERROR +log4j.logger.JPOX.General=ERROR +log4j.logger.JPOX.Enhancer=ERROR +log4j.logger.org.apache.hadoop.hive=WARN +log4j.logger.hive=WARN +log4j.logger.ExecMapper=WARN +log4j.logger.ExecReducer=WARN +log4j.logger.net.sf.ehcache.config.ConfigurationFactory=ERROR +log4j.logger.org.apache.axis2.clustering.tribes.Axis2GroupChannel=FATAL + +log4j.logger.trace.messages=TRACE,CARBON_TRACE_LOGFILE + +log4j.additivity.org.apache.axis2.clustering=false +log4j.additivity.com.atomikos=false + +# CARBON_CONSOLE is set to be a ConsoleAppender using a PatternLayout. +log4j.appender.CARBON_CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.CARBON_CONSOLE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout +# ConversionPattern will be overridden by the configuration setting in the DB +log4j.appender.CARBON_CONSOLE.layout.ConversionPattern=[%d] %P%5p {%c} - %x %m%n +log4j.appender.CARBON_CONSOLE.layout.TenantPattern=%U%@%D[%T] +log4j.appender.CARBON_CONSOLE.threshold=DEBUG + +# CARBON_MEMORY is set to be a MemoryAppender using a PatternLayout. +log4j.appender.CARBON_MEMORY=org.wso2.carbon.logging.appenders.MemoryAppender +log4j.appender.CARBON_MEMORY.layout=org.apache.log4j.PatternLayout +log4j.appender.CARBON_MEMORY.bufferSize=200 +# ConversionPattern will be overridden by the configuration setting in the DB +#log4j.appender.CARBON_MEMORY.layout.ConversionPattern=[%d] %5p - %x %m {%c}%n +log4j.appender.CARBON_MEMORY.layout.ConversionPattern=[%d] %5p {%c} - %x %m%n +log4j.appender.CARBON_MEMORY.threshold=DEBUG + + +# CARBON_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout. +log4j.appender.CARBON_LOGFILE=org.apache.log4j.RollingFileAppender +log4j.appender.CARBON_LOGFILE.MaxFileSize=10000KB +log4j.appender.CARBON_LOGFILE.MaxBackupIndex=10 +# Log file will be overridden by the configuration setting in the DB +# This path should be relative to WSO2 Carbon Home +log4j.appender.CARBON_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon${instance.log}.log +log4j.appender.CARBON_LOGFILE.Append=true +log4j.appender.CARBON_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout +# ConversionPattern will be overridden by the configuration setting in the DB +log4j.appender.CARBON_LOGFILE.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m%n +log4j.appender.CARBON_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] +log4j.appender.CARBON_LOGFILE.threshold=DEBUG + +log4j.appender.CARBON_SYS_LOG = org.apache.log4j.net.SyslogAppender +log4j.appender.CARBON_SYS_LOG.layout=org.apache.log4j.PatternLayout +log4j.appender.CARBON_SYS_LOG.layout.ConversionPattern=[%d] %5p {%c} - %x %m%n +log4j.appender.CARBON_SYS_LOG.SyslogHost=localhost +log4j.appender.CARBON_SYS_LOG.Facility=USER +log4j.appender.CARBON_SYS_LOG.threshold=DEBUG + +# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT +log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender +log4j.appender.LOGEVENT.url=tcp://10.100.3.103:7611 +log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout +log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace +log4j.appender.LOGEVENT.userName=admin +log4j.appender.LOGEVENT.password=admin + +# Appender config to CARBON_TRACE_LOGFILE +log4j.appender.CARBON_TRACE_LOGFILE=org.apache.log4j.DailyRollingFileAppender +log4j.appender.CARBON_TRACE_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon-trace-messages${instance.log}.log +log4j.appender.CARBON_TRACE_LOGFILE.Append=true +log4j.appender.CARBON_TRACE_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout +log4j.appender.CARBON_TRACE_LOGFILE.layout.ConversionPattern=[%d] %P%5p {%c} - %x %m%n +log4j.appender.CARBON_TRACE_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] +log4j.appender.CARBON_TRACE_LOGFILE.threshold=TRACE +log4j.additivity.trace.messages=false + +# Appender config to AUDIT_LOGFILE +log4j.appender.AUDIT_LOGFILE=org.apache.log4j.DailyRollingFileAppender +log4j.appender.AUDIT_LOGFILE.File=${carbon.home}/repository/logs/audit.log +log4j.appender.AUDIT_LOGFILE.Append=true +log4j.appender.AUDIT_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout +log4j.appender.AUDIT_LOGFILE.layout.ConversionPattern=[%d] %P%5p - %x %m %n +log4j.appender.AUDIT_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S] +log4j.appender.AUDIT_LOGFILE.threshold=INFO +log4j.additivity.AUDIT_LOG=false + +# The event trace logger dumps enough information @INFO level. +# Writes events received by DataBridge +log4j.category.LOG_AGGREGATOR_LOGGER=INFO, LOG_AGGREGATOR_FILE_APPENDER +log4j.additivity.LOG_AGGREGATOR_LOGGER=false +log4j.appender.LOG_AGGREGATOR_FILE_APPENDER=org.apache.log4j.DailyRollingFileAppender +log4j.appender.LOG_AGGREGATOR_FILE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/aggregate${instance.log}.log +log4j.appender.LOG_AGGREGATOR_FILE_APPENDER.Append=true +log4j.appender.LOG_AGGREGATOR_FILE_APPENDER.layout=org.apache.log4j.PatternLayout +log4j.appender.LOG_AGGREGATOR_FILE_APPENDER.layout.ConversionPattern=%m%n + +# The event trace logger dumps enough information @INFO level, but maybe pushed upto TRACE. +# Writes only run-time/event processing time tracing/debug messages for event passing through trace +# enabled transport adapters event formatters, builders and processors. Enabling event tracing on these has a performance impact +log4j.category.EVENT_TRACE_LOGGER=INFO, EVENT_TRACE_APPENDER +log4j.additivity.EVENT_TRACE_LOGGER=false +log4j.appender.EVENT_TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender +log4j.appender.EVENT_TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-cep-trace${instance.log}.log +log4j.appender.EVENT_TRACE_APPENDER.Append=true +log4j.appender.EVENT_TRACE_APPENDER.layout=org.apache.log4j.PatternLayout +log4j.appender.EVENT_TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n + +# Appender config to send Atomikos transaction logs to new log file tm.out. +log4j.appender.ATOMIKOS = org.apache.log4j.RollingFileAppender +log4j.appender.ATOMIKOS.File = repository/logs/tm.out +log4j.appender.ATOMIKOS.Append = true +log4j.appender.ATOMIKOS.layout = org.apache.log4j.PatternLayout +log4j.appender.ATOMIKOS.layout.ConversionPattern=%p %t %c - %m%n + +# This file is used to override the default logger settings, and is used to remove unwanted logs from Shindig appearing on the console. + +# Specification of Handler used by Console Logger +handlers=java.util.logging.ConsoleHandler + +# Replacing default INFO level with SEVERE +java.util.logging.ConsoleHandler.level=SEVERE http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/common/mock-iaas.xml ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/common/mock-iaas.xml b/products/stratos/modules/integration/test-integration/src/test/resources/common/mock-iaas.xml new file mode 100644 index 0000000..47a95f0 --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/common/mock-iaas.xml @@ -0,0 +1,123 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, 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. + --> + +<mock-iaas enabled="true"> + <health-statistics> + <cartridge type="tomcat"> + <!-- factor:memory-consumption|load-average|requests-in-flight--> + <!-- mode:loop|continue|stop --> + <!-- Mode defines the action needs to be taken after the last sample value: + loop: start from beginning + continue: continue the last sample value + stop: stop publishing statistics --> + <pattern factor="memory-consumption" mode="continue"> + <!-- Sample values --> + <sampleValues>20,30,40,50,60,70,50,40,30,20</sampleValues> + <!-- Duration of each sample value in seconds --> + <sampleDuration>60</sampleDuration> + </pattern> + <pattern factor="load-average" mode="continue"> + <!-- Sample values --> + <sampleValues>20</sampleValues> + <!-- Duration of each sample value in seconds --> + <sampleDuration>60</sampleDuration> + </pattern> + </cartridge> + <cartridge type="c7-single-cluster-scaling-test"> + <!-- factor:memory-consumption|load-average|requests-in-flight--> + <!-- mode:loop|continue|stop --> + <!-- Mode defines the action needs to be taken after the last sample value: + loop: start from beginning + continue: continue the last sample value + stop: stop publishing statistics --> + <pattern factor="memory-consumption" mode="continue"> + <!-- Sample values --> + <sampleValues>60,60,10,10,10,10,10,10</sampleValues> + <!-- Duration of each sample value in seconds --> + <sampleDuration>60</sampleDuration> + </pattern> + <pattern factor="load-average" mode="continue"> + <!-- Sample values --> + <sampleValues>60,60,10,10,10,10,10,10</sampleValues> + <!-- Duration of each sample value in seconds --> + <sampleDuration>60</sampleDuration> + </pattern> + </cartridge> + <cartridge type="c7-partition-round-robin-test"> + <!-- factor:memory-consumption|load-average|requests-in-flight--> + <!-- mode:loop|continue|stop --> + <!-- Mode defines the action needs to be taken after the last sample value: + loop: start from beginning + continue: continue the last sample value + stop: stop publishing statistics --> + <pattern factor="memory-consumption" mode="stop"> + <!-- Sample values --> + <sampleValues>20,20,20,20</sampleValues> + <!-- Duration of each sample value in seconds --> + <sampleDuration>30</sampleDuration> + </pattern> + <pattern factor="load-average" mode="stop"> + <!-- Sample values --> + <sampleValues>20,20,20,20</sampleValues> + <!-- Duration of each sample value in seconds --> + <sampleDuration>30</sampleDuration> + </pattern> + </cartridge> + <!--<cartridge type="c3-group-termination-behavior-test"> + <!– factor:memory-consumption|load-average|requests-in-flight–> + <!– mode:loop|continue|stop –> + <!– Mode defines the action needs to be taken after the last sample value: + loop: start from beginning + continue: continue the last sample value + stop: stop publishing statistics –> + <pattern factor="memory-consumption" mode="stop"> + <!– Sample values –> + <sampleValues>20,20,20,</sampleValues> + <!– Duration of each sample value in seconds –> + <sampleDuration>60</sampleDuration> + </pattern> + <pattern factor="load-average" mode="stop"> + <!– Sample values –> + <sampleValues>20,20,20</sampleValues> + <!– Duration of each sample value in seconds –> + <sampleDuration>60</sampleDuration> + </pattern> + </cartridge>--> + <cartridge type="php"> + <!-- factor:memory-consumption|load-average|requests-in-flight--> + <!-- mode:loop|continue|stop --> + <!-- Mode defines the action needs to be taken after the last sample value: + loop: start from beginning + continue: continue the last sample value + stop: stop publishing statistics --> + <pattern factor="memory-consumption" mode="continue"> + <!-- Sample values --> + <sampleValues>20,30,40,50,60,70,50,40,30,20</sampleValues> + <!-- Duration of each sample value in seconds --> + <sampleDuration>60</sampleDuration> + </pattern> + <pattern factor="load-average" mode="continue"> + <!-- Sample values --> + <sampleValues>20</sampleValues> + <!-- Duration of each sample value in seconds --> + <sampleDuration>60</sampleDuration> + </pattern> + </cartridge> + </health-statistics> +</mock-iaas> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/common/scaling.drl ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/common/scaling.drl b/products/stratos/modules/integration/test-integration/src/test/resources/common/scaling.drl new file mode 100644 index 0000000..69d9111 --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/common/scaling.drl @@ -0,0 +1,311 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, 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. + */ + +package org.apache.stratos.autoscaler + +import org.apache.stratos.messaging.domain.topology.Service; +import org.apache.stratos.messaging.domain.topology.Cluster; +import org.apache.stratos.autoscaler.context.AutoscalerContext; +import org.apache.stratos.autoscaler.context.member.MemberStatsContext; +import org.apache.stratos.autoscaler.util.AutoscalerConstants; +import org.apache.stratos.autoscaler.context.partition.network.NetworkPartitionContext; +import org.apache.stratos.autoscaler.pojo.policy.PolicyManager; +import org.apache.stratos.autoscaler.pojo.policy.autoscale.AutoscalePolicy; +import org.apache.stratos.autoscaler.pojo.policy.autoscale.RequestsInFlight; +import org.apache.stratos.autoscaler.pojo.policy.autoscale.LoadThresholds; +import org.apache.stratos.autoscaler.pojo.policy.autoscale.MemoryConsumption; +import org.apache.stratos.autoscaler.pojo.policy.autoscale.LoadAverage; +import org.apache.stratos.autoscaler.algorithms.PartitionAlgorithm; +import org.apache.stratos.autoscaler.algorithms.partition.OneAfterAnother; +import org.apache.stratos.autoscaler.algorithms.partition.RoundRobin; +import org.apache.stratos.autoscaler.context.partition.ClusterLevelPartitionContext; +import org.apache.stratos.autoscaler.rule.AutoscalerRuleEvaluator; +import org.apache.stratos.cloud.controller.stub.domain.Partition; +import org.apache.stratos.cloud.controller.stub.domain.MemberContext; +import org.apache.stratos.autoscaler.context.cluster.ClusterInstanceContext; + +import org.apache.stratos.autoscaler.pojo.policy.autoscale.LoadAverage +import org.apache.stratos.autoscaler.pojo.policy.autoscale.MemoryConsumption + +global org.apache.stratos.autoscaler.rule.RuleLog log; +global org.apache.stratos.autoscaler.rule.RuleTasksDelegator delegator; +global org.apache.stratos.autoscaler.pojo.policy.autoscale.AutoscalePolicy autoscalePolicy; +global java.lang.String applicationId; +global java.lang.String clusterId; +global java.lang.Boolean rifReset; +global java.lang.Boolean mcReset; +global java.lang.Boolean laReset; +global java.lang.Boolean arspiReset; +global java.lang.String algorithmName; + +rule "Scaling Rule" +dialect "mvel" + when + clusterInstanceContext : ClusterInstanceContext () + + loadThresholds : LoadThresholds() from autoscalePolicy.getLoadThresholds() + partitionAlgorithm : PartitionAlgorithm() from delegator.getPartitionAlgorithm(algorithmName) + + eval(log.debug("Running scale up rule: [network-partition] " + clusterInstanceContext.getNetworkPartitionId() + + " [cluster] " + clusterId)) + eval(log.debug("[scaling] [network-partition] " + clusterInstanceContext.getNetworkPartitionId() + " [cluster] " + + clusterId + " Algorithm name: " + algorithmName)) + + + rifThreshold : Float() from loadThresholds.getRequestsInFlightThreshold() + + rifAverage : Float() from clusterInstanceContext.getAverageRequestsInFlight() + rifGradient : Float() from clusterInstanceContext.getRequestsInFlightGradient() + rifSecondDerivative : Float() from clusterInstanceContext.getRequestsInFlightSecondDerivative() + rifPredictedValue : Double() from delegator.getPredictedValueForNextMinute(rifAverage, rifGradient, rifSecondDerivative, 1) + + mcThreshold : Float() from loadThresholds.getMemoryConsumptionThreshold() + + mcPredictedValue : Double() from delegator.getMemoryConsumptionPredictedValue(clusterInstanceContext) + + laThreshold : Float() from loadThresholds.getLoadAverageThreshold() + + laPredictedValue : Double() from delegator.getLoadAveragePredictedValue(clusterInstanceContext) + + activeInstancesCount : Integer() from clusterInstanceContext.getActiveMemberCount() + maxInstancesCount : Integer() from clusterInstanceContext.getMaxInstanceCount() + minInstancesCount : Integer() from clusterInstanceContext.getMinInstanceCount() + requestsServedPerInstance : Float() from clusterInstanceContext.getRequestsServedPerInstance() + averageRequestsServedPerInstance : Float() from clusterInstanceContext.getAverageRequestsServedPerInstance() + + numberOfInstancesReuquiredBasedOnRif : Integer() from delegator.getNumberOfInstancesRequiredBasedOnRif( + rifPredictedValue, rifThreshold) + numberOfInstancesReuquiredBasedOnMemoryConsumption : Integer() from + delegator.getNumberOfInstancesRequiredBasedOnMemoryConsumption(mcThreshold, mcPredictedValue, minInstancesCount, + maxInstancesCount) + numberOfInstancesReuquiredBasedOnLoadAverage : Integer() from + delegator.getNumberOfInstancesRequiredBasedOnLoadAverage(laThreshold, laPredictedValue, minInstancesCount) + + numberOfRequiredInstances : Integer() from delegator.getMaxNumberOfInstancesRequired( + numberOfInstancesReuquiredBasedOnRif, numberOfInstancesReuquiredBasedOnMemoryConsumption, mcReset, + numberOfInstancesReuquiredBasedOnLoadAverage, laReset) + + + + scaleUp : Boolean() from (activeInstancesCount < numberOfRequiredInstances) + scaleDown : Boolean() from (activeInstancesCount > numberOfRequiredInstances || (numberOfRequiredInstances == 1 && activeInstancesCount == 1)) + + + eval(log.debug("[scaling] " + "[cluster] " + clusterId + " RIF Resetted?: " + rifReset)) + eval(log.debug("[scaling] " + "[cluster] " + clusterId + " RIF predicted value: " + rifPredictedValue)) + eval(log.debug("[scaling] " + "[cluster] " + clusterId + " RIF threshold: " + rifThreshold)) + + eval(log.debug("[scaling] " + "[cluster] " + clusterId + " MC predicted value: " + mcPredictedValue)) + eval(log.debug("[scaling] " + "[cluster] " + clusterId + " MC threshold: " + mcThreshold)) + + eval(log.debug("[scaling] " + "[cluster] " + clusterId + " LA predicted value: " + laPredictedValue)) + eval(log.debug("[scaling] " + "[cluster] " + clusterId + " LA threshold: " + laThreshold)) + + eval(log.debug("[scaling] " + "[cluster] " + clusterId + " Scale-up action: " + scaleUp)) + eval(log.debug("[scaling] " + "[cluster] " + clusterId + " Scale-down action: " + scaleDown)) + + then + + log.debug("[scaling] Number of required instances based on stats: " + numberOfRequiredInstances + " " + + "[active instances count] " + activeInstancesCount + " [network-partition] " + + clusterInstanceContext.getNetworkPartitionId() + " [cluster] " + clusterId); + + int nonTerminatedMembers = clusterInstanceContext.getNonTerminatedMemberCount(); + if(scaleUp){ + + int clusterMaxMembers = clusterInstanceContext.getMaxInstanceCount(); + if (nonTerminatedMembers < clusterMaxMembers) { + + int additionalInstances = 0; + if(clusterMaxMembers < numberOfRequiredInstances){ + + additionalInstances = clusterMaxMembers - nonTerminatedMembers; + log.info("[scale-up] Required member count based on stat based scaling is higher than max, hence" + + " notifying to parent for possible group scaling or app bursting. [cluster] " + clusterId + + " [instance id]" + clusterInstanceContext.getId() + " [max] " + clusterMaxMembers + + " [number of required instances] " + numberOfRequiredInstances + + " [additional instances to be created] " + additionalInstances); + delegator.delegateScalingOverMaxNotification(clusterId, clusterInstanceContext.getNetworkPartitionId(), + clusterInstanceContext.getId()); + } else { + + additionalInstances = numberOfRequiredInstances - nonTerminatedMembers; + } + + clusterInstanceContext.resetScaleDownRequestsCount(); + + log.debug("[scale-up] " + " [has scaling dependents] " + clusterInstanceContext.hasScalingDependants() + + " [cluster] " + clusterId ); + if(clusterInstanceContext.hasScalingDependants()) { + + log.debug("[scale-up] Notifying dependencies [cluster] " + clusterId); + delegator.delegateScalingDependencyNotification(clusterId, clusterInstanceContext.getNetworkPartitionId(), + clusterInstanceContext.getId(), numberOfRequiredInstances, clusterInstanceContext.getMinInstanceCount()); + } else { + + boolean partitionsAvailable = true; + int count = 0; + + while(count != additionalInstances && partitionsAvailable){ + + ClusterLevelPartitionContext partitionContext = (ClusterLevelPartitionContext) partitionAlgorithm.getNextScaleUpPartitionContext(clusterInstanceContext.getPartitionCtxtsAsAnArray()); + if(partitionContext != null){ + + log.info("[scale-up] Partition available, hence trying to spawn an instance to scale up! " + + " [application id] " + applicationId + + " [cluster] " + clusterId + " [instance id] " + clusterInstanceContext.getId() + + " [network-partition] " + clusterInstanceContext.getNetworkPartitionId() + + " [partition] " + partitionContext.getPartitionId() + + " scaleup due to RIF: " + (rifReset && (rifPredictedValue > rifThreshold)) + + " [rifPredictedValue] " + rifPredictedValue + " [rifThreshold] " + rifThreshold + + " scaleup due to MC: " + (mcReset && (mcPredictedValue > mcThreshold)) + + " [mcPredictedValue] " + mcPredictedValue + " [mcThreshold] " + mcThreshold + + " scaleup due to LA: " + (laReset && (laPredictedValue > laThreshold)) + + " [laPredictedValue] " + laPredictedValue + " [laThreshold] " + laThreshold); + + log.debug("[scale-up] " + " [partition] " + partitionContext.getPartitionId() + " [cluster] " + clusterId ); + delegator.delegateSpawn(partitionContext, clusterId, clusterInstanceContext.getId()); + count++; + } else { + + log.warn("[scale-up] No more partition available even though " + + "cartridge-max is not reached!, [cluster] " + clusterId + + " Please update deployment-policy with new partitions or with higher " + + "partition-max"); + partitionsAvailable = false; + } + } + } + } else { + log.info("[scale-up] Trying to scale up over max, hence not scaling up cluster itself and + notifying to parent for possible group scaling or app bursting. + [cluster] " + clusterId + " [instance id]" + clusterInstanceContext.getId() + + " [max] " + clusterMaxMembers); + delegator.delegateScalingOverMaxNotification(clusterId, clusterInstanceContext.getNetworkPartitionId(), + clusterInstanceContext.getId()); + } + } else if(scaleDown){ + + if(nonTerminatedMembers > clusterInstanceContext.getMinInstanceCount){ + + log.debug("[scale-down] Decided to Scale down [cluster] " + clusterId); + if(clusterInstanceContext.getScaleDownRequestsCount() >= 0 ){ + + log.debug("[scale-down] Reached scale down requests threshold [cluster] " + clusterId + " Count " + + clusterInstanceContext.getScaleDownRequestsCount()); + + if(clusterInstanceContext.hasScalingDependants()) { + + log.debug("[scale-up] Notifying dependencies [cluster] " + clusterId); + delegator.delegateScalingDependencyNotification(clusterId, clusterInstanceContext.getNetworkPartitionId(), + clusterInstanceContext.getId(), numberOfRequiredInstances, clusterInstanceContext.getMinInstanceCount()); + } else{ + + MemberStatsContext selectedMemberStatsContext = null; + double lowestOverallLoad = 0.0; + boolean foundAValue = false; + ClusterLevelPartitionContext partitionContext = (ClusterLevelPartitionContext) partitionAlgorithm.getNextScaleDownPartitionContext(clusterInstanceContext.getPartitionCtxtsAsAnArray()); + if(partitionContext != null) { + log.info("[scale-down] Partition available to scale down " + + " [application id] " + applicationId + + " [cluster] " + clusterId + " [instance id] " + clusterInstanceContext.getId() + + " [network-partition] " + clusterInstanceContext.getNetworkPartitionId() + + " [partition] " + partitionContext.getPartitionId() + + " scaledown due to RIF: " + (rifReset && (rifPredictedValue < rifThreshold)) + + " [rifPredictedValue] " + rifPredictedValue + " [rifThreshold] " + rifThreshold + + " scaledown due to MC: " + (mcReset && (mcPredictedValue < mcThreshold)) + + " [mcPredictedValue] " + mcPredictedValue + " [mcThreshold] " + mcThreshold + + " scaledown due to LA: " + (laReset && (laPredictedValue < laThreshold)) + + " [laPredictedValue] " + laPredictedValue + " [laThreshold] " + laThreshold + ); + + + for(MemberStatsContext memberStatsContext: partitionContext.getMemberStatsContexts().values()){ + + LoadAverage loadAverage = memberStatsContext.getLoadAverage(); + log.debug("[scale-down] " + " [cluster] " + + clusterId + " [member] " + memberStatsContext.getMemberId() + " Load average: " + loadAverage); + + MemoryConsumption memoryConsumption = memberStatsContext.getMemoryConsumption(); + log.debug("[scale-down] " + " [partition] " + partitionContext.getPartitionId() + " [cluster] " + + clusterId + " [member] " + memberStatsContext.getMemberId() + " Memory consumption: " + + memoryConsumption); + + double predictedCpu = delegator.getPredictedValueForNextMinute(loadAverage.getAverage(), + loadAverage.getGradient(),loadAverage.getSecondDerivative(), 1); + log.debug("[scale-down] " + " [partition] " + partitionContext.getPartitionId() + " [cluster] " + + clusterId + " [member] " + memberStatsContext.getMemberId() + " Predicted CPU: " + predictedCpu); + + double predictedMemoryConsumption = delegator.getPredictedValueForNextMinute( + memoryConsumption.getAverage(),memoryConsumption.getGradient(),memoryConsumption.getSecondDerivative(), 1); + log.debug("[scale-down] " + " [partition] " + partitionContext.getPartitionId() + " [cluster] " + + clusterId + " [member] " + memberStatsContext.getMemberId() + " Predicted memory consumption: " + + predictedMemoryConsumption); + + double overallLoad = (predictedCpu + predictedMemoryConsumption) / 2; + log.debug("[scale-down] " + " [partition] " + partitionContext.getPartitionId() + " [cluster] " + + clusterId + " [member] " + memberStatsContext.getMemberId() + " Overall load: " + overallLoad); + + if(!foundAValue){ + foundAValue = true; + selectedMemberStatsContext = memberStatsContext; + lowestOverallLoad = overallLoad; + } else if(overallLoad < lowestOverallLoad){ + selectedMemberStatsContext = memberStatsContext; + lowestOverallLoad = overallLoad; + } + + } + if(selectedMemberStatsContext != null) { + log.info("[scale-down] Trying to terminating an instace to scale down!" ); + log.debug("[scale-down] " + " [partition] " + partitionContext.getPartitionId() + " [cluster] " + + clusterId + " Member with lowest overall load: " + selectedMemberStatsContext.getMemberId()); + + delegator.delegateTerminate(partitionContext, selectedMemberStatsContext.getMemberId()); + } + } else { + log.warn("Partition is not available to scale-down..!!!!"); + } + } + } else{ + log.debug("[scale-down] Not reached scale down requests threshold. " + clusterId + " Count " + + clusterInstanceContext.getScaleDownRequestsCount()); + clusterInstanceContext.increaseScaleDownRequestsCount(); + + } + } else { + log.debug("[scale-down] Min is reached, hence not scaling down [cluster] " + clusterId + " [instance id]" + + clusterInstanceContext.getId()); + //if(clusterInstanceContext.isInGroupScalingEnabledSubtree()){ + + delegator.delegateScalingDownBeyondMinNotification(clusterId, clusterInstanceContext.getNetworkPartitionId(), + clusterInstanceContext.getId()); + //} + } + } else{ + log.debug("[scaling] No decision made to either scale up or scale down ... [cluster] " + clusterId + " [instance id]" + + clusterInstanceContext.getId()); + + } + +end + + + + http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/common/thrift-client-config.xml ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/common/thrift-client-config.xml b/products/stratos/modules/integration/test-integration/src/test/resources/common/thrift-client-config.xml new file mode 100644 index 0000000..1751bdf --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/common/thrift-client-config.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, 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. + --> + +<!-- Apache thrift client configuration for publishing statistics to WSO2 CEP --> +<thriftClientConfiguration> + <username>admin</username> + <password>admin</password> + <ip>localhost</ip> + <port>7711</port> +</thriftClientConfiguration> http://git-wip-us.apache.org/repos/asf/stratos/blob/395be450/products/stratos/modules/integration/test-integration/src/test/resources/deployment-policy-test/deployment-policies/deployment-policy-deployment-policy-test-1.json ---------------------------------------------------------------------- diff --git a/products/stratos/modules/integration/test-integration/src/test/resources/deployment-policy-test/deployment-policies/deployment-policy-deployment-policy-test-1.json b/products/stratos/modules/integration/test-integration/src/test/resources/deployment-policy-test/deployment-policies/deployment-policy-deployment-policy-test-1.json new file mode 100644 index 0000000..edab5bd --- /dev/null +++ b/products/stratos/modules/integration/test-integration/src/test/resources/deployment-policy-test/deployment-policies/deployment-policy-deployment-policy-test-1.json @@ -0,0 +1,32 @@ +{ + "id": "deployment-policy-deployment-policy-test-1", + "networkPartitions": [ + { + "id": "network-partition-deployment-policy-test-1", + "partitionAlgo": "one-after-another", + "partitions": [ + { + "id": "partition-1", + "partitionMax": 20 + } + ] + }, + { + "id": "network-partition-deployment-policy-test-2", + "partitionAlgo": "round-robin", + "partitions": [ + { + "id": "network-partition-6-partition-1", + "partitionMax": 10 + }, + { + "id": "network-partition-6-partition-2", + "partitionMax": 9 + } + ] + } + ] +} + + +
