# 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 scripts automates deployment of kafka-admin-api application (creates required service instances). """ from app_deployment_helpers import cf_cli from app_deployment_helpers import cf_helpers APP_NAME = "kafka-admin-api" PARSER = cf_helpers.get_parser(APP_NAME) ARGS = PARSER.parse_args() CF_INFO = cf_helpers.get_info(ARGS) cf_cli.login(CF_INFO) cf_cli.create_service('kafka', 'shared', 'kafka-instance') PROJECT_DIR = ARGS.project_dir if ARGS.project_dir else \ cf_helpers.get_project_dir() cf_helpers.prepare_package(work_dir=PROJECT_DIR) cf_helpers.push(work_dir=PROJECT_DIR, options="{0} -n {0} --no-start".format(ARGS.app_name)) cf_cli.start(APP_NAME)
# 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 scripts automates deployment of ws2kafka application (creates required service instances, pushes to TAP instance). """ from app_deployment_helpers import cf_cli from app_deployment_helpers import cf_helpers APP_NAME = "ws2kafka" PARSER = cf_helpers.get_parser(APP_NAME) ARGS = PARSER.parse_args() CF_INFO = cf_helpers.get_info(ARGS) cf_cli.login(CF_INFO) cf_cli.create_service('kafka', 'shared', 'kafka-inst') PROJECT_DIR = ARGS.project_dir if ARGS.project_dir else \ cf_helpers.get_project_dir() cf_helpers.push(work_dir=PROJECT_DIR, options=ARGS.app_name)
# # 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 scripts automates deployment of mqtt-listener application (creates required service instances and pushes application to Cloud Foundry using manifest file). """ from app_deployment_helpers import cf_cli from app_deployment_helpers import cf_helpers PARSER = cf_helpers.get_parser("mqtt-listener") ARGS = PARSER.parse_args() CF_INFO = cf_helpers.get_info(ARGS) cf_cli.login(CF_INFO) cf_cli.create_service('mosquitto14', 'free', 'mqtt-listener-messages') cf_cli.create_service('kafka', 'shared', 'kafka-mqtt-instance') PROJECT_DIR = ARGS.project_dir if ARGS.project_dir else \ cf_helpers.get_project_dir() cf_helpers.prepare_package(work_dir=PROJECT_DIR) cf_helpers.push(work_dir=PROJECT_DIR, options=ARGS.app_name)
""" This scripts automates deployment of gearpump-app application (creates required gearpump instance, uploads package to gearpump using instance's REST API, sends hbase and kafka instances' credentials). """ from app_deployment_helpers import cf_cli from app_deployment_helpers import cf_helpers from app_deployment_helpers import cf_api from app_deployment_helpers import gearpump_helpers import logging logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO) PARSER = cf_helpers.get_parser("gearpump-app") PARSER.add_argument('-n', '--gearpump_instance', type=str, required=True, help='Name of Gearpump instance to be created') ARGS = PARSER.parse_args() CF_INFO = cf_helpers.get_info(ARGS) cf_cli.login(CF_INFO) logging.info("Creating Gearpump service instance") cf_cli.create_service('gearpump', '1 worker', ARGS.gearpump_instance) logging.info("Preparing package") PROJECT_DIR = cf_helpers.get_project_dir()
# # 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 scripts automates deployment of mqtt-listener application (creates required service instances and pushes application to Cloud Foundry using manifest file). """ from app_deployment_helpers import cf_cli from app_deployment_helpers import cf_helpers PARSER = cf_helpers.get_parser("mqtt-listener") ARGS = PARSER.parse_args() CF_INFO = cf_helpers.get_info(ARGS) cf_cli.login(CF_INFO) cf_cli.create_service('mosquitto14', 'free', 'mqtt-listener-messages') cf_cli.create_service('kafka', 'shared', 'kafka-mqtt-instance') PROJECT_DIR = ARGS.project_dir if ARGS.project_dir else \ cf_helpers.get_project_dir() cf_helpers.prepare_package(work_dir=PROJECT_DIR) cf_helpers.push(work_dir=PROJECT_DIR, options=ARGS.app_name)
This scripts automates deployment of space-shuttle-demo application (creates required service instances, uploads model to HDFS and pushes application to Cloud Foundry using manifest file). """ import os import json import logging from app_deployment_helpers import cf_cli from app_deployment_helpers import cf_helpers logging.basicConfig(level=logging.INFO) LOGGER = logging.getLogger(__name__) PARSER = cf_helpers.get_parser("space-shuttle-demo") PARSER.add_argument('--path_to_model', type=str, help='Path to a model for scoring-engine on local ' 'machine, eg. /path/to/model/model.tar, ' 'default path is "./model.tar"') PARSER.add_argument('--no_build', action='store_true', help='Do not build project package with Maven') ARGS = PARSER.parse_args() CF_INFO = cf_helpers.get_info(ARGS) cf_cli.login(CF_INFO) LOGGER.info('Uploading model to HDFS...') LOCAL_MODEL_PATH = ARGS.path_to_model if ARGS.path_to_model else 'model.tar'
""" This scripts automates deployment of gearpump-app application (creates required gearpump instance, uploads package to gearpump using instance's REST API, sends hbase and kafka instances' credentials). """ from app_deployment_helpers import cf_cli from app_deployment_helpers import cf_helpers from app_deployment_helpers import cf_api from app_deployment_helpers import gearpump_helpers import logging logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.INFO) PARSER = cf_helpers.get_parser("gearpump-app") PARSER.add_argument( "-n", "--gearpump_instance", type=str, required=True, help="Name of Gearpump instance to be created" ) ARGS = PARSER.parse_args() CF_INFO = cf_helpers.get_info(ARGS) cf_cli.login(CF_INFO) logging.info("Creating Gearpump service instance") cf_cli.create_service("gearpump", "1 worker", ARGS.gearpump_instance) logging.info("Preparing package") PROJECT_DIR = cf_helpers.get_project_dir() cf_helpers.prepare_package(work_dir=PROJECT_DIR)