<commit_before>heat_template_version: 2013-05-23

# Copyright 2014 Zuercher Hochschule fuer Angewandte Wissenschaften
# All Rights Reserved.
#
#    Licensed 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.

description: |
  Deploys the RCB service instance resources.

parameters:
  image:
    type: string
    description: Server image id to use
    default: cyclops-rcb
    constraints:
    - allowed_values:
      - cyclops-rcb
      description: must be a valid cyclops image id

  flavor:
    description: Server flavor id to use
    type: string
    default: m1.medium
    constraints:
    - allowed_values:
      - m1.tiny
      - m1.small
      - m1.medium
      description: must be a valid OpenStack flavor.

  sshkey:
    description: The ssh key name to use with all SM VMs
    type: string
    default: edmo-bart
    label: SSH Key
  
  network_id:
    description: The network to attach the RCB service to
    type: string
    default: 30e8fc23-bef0-4e94-bf31-2a136d95ff90
    label: Network ID


  public_net:
    type: string
    description: >
      ID of public network net04_ext
    default: d6ce8ab6-1be8-4c85-8067-9c77d7600ffa

  private_mgmt_net:
    type: string
    description: >
      ID of private network mgmt
    default: 30e8fc23-bef0-4e94-bf31-2a136d95ff90

resources:
  rcb_si_security_group:
    type: "AWS::EC2::SecurityGroup"
    properties:
      GroupDescription: "RCB SI public ports"
      SecurityGroupIngress:
      - {"CidrIp": 0.0.0.0/0, "FromPort": "22", "ToPort": "22", "IpProtocol": "tcp"}
      - {"CidrIp": 0.0.0.0/0, "FromPort": "8000", "ToPort": "8000", "IpProtocol": "tcp"}

  rcb_port_mgmt:
    type: OS::Neutron::Port
    properties:
      network_id: { get_param: private_mgmt_net }

  rcb_floating_ip:
    type: OS::Neutron::FloatingIP
    properties:
      floating_network_id: { get_param: public_net }
      port_id: { get_resource: rcb_port_mgmt }

  rcb_si:
    type: OS::Nova::Server
    properties:
      name: rcb_si
      image: { get_param: image }
      flavor: { get_param: flavor }
      key_name: { get_param: sshkey }
      security_groups:
      - {get_resource: rcb_si_security_group}
      networks:
        - port : { get_resource: rcb_port_mgmt }
      config_drive: "true"
      user_data:
        str_replace:
          template: |
            #!/bin/bash
            # export DEBIAN_FRONTEND=noninteractive
            # cd /root/icclab-rcb
            # nohup ./run.sh &

outputs:
  mcn.endpoint.rcb.mgt:
    description: "IP addresses of the RCB service:"
      value: { get_attr: [rcb_floating_ip, floating_ip_address] }<commit_msg>fixes to template to fit mcntub tenant<commit_after>heat_template_version: 2013-05-23

# Copyright 2014 <NAME> fuer Angewandte Wissenschaften
# All Rights Reserved.
#
#    Licensed 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.

description: |
  Deploys the RCB service instance resources.

parameters:
  image:
    type: string
    description: Server image id to use
    default: cyclops-rcb
    constraints:
    - allowed_values:
      - cyclops-rcb
      description: must be a valid cyclops image id

  flavor:
    description: Server flavor id to use
    type: string
    default: m1.medium
    constraints:
    - allowed_values:
      - m1.tiny
      - m1.small
      - m1.medium
      description: must be a valid OpenStack flavor.

  sshkey:
    description: The ssh key name to use with all SM VMs
    type: string
    default: edmo-bart
    label: SSH Key
  
  network_id:
    description: The network to attach the RCB service to
    type: string
    default: 30e8fc23-bef0-4e94-bf31-2a136d95ff90
    label: Network ID


  public_net:
    type: string
    description: >
      ID of public network net04_ext
    default: d6ce8ab6-1be8-4c85-8067-9c77d7600ffa

  private_mgmt_net:
    type: string
    description: >
      ID of private network mgmt
    default: 30e8fc23-bef0-4e94-bf31-2a136d95ff90

resources:
  rcb_si_security_group:
    type: "AWS::EC2::SecurityGroup"
    properties:
      GroupDescription: "RCB SI public ports"
      SecurityGroupIngress:
      - {"CidrIp": 0.0.0.0/0, "FromPort": "22", "ToPort": "22", "IpProtocol": "tcp"}
      - {"CidrIp": 0.0.0.0/0, "FromPort": "8000", "ToPort": "8000", "IpProtocol": "tcp"}

  rcb_port_mgmt:
    type: OS::Neutron::Port
    properties:
      network_id: { get_param: private_mgmt_net }

  rcb_floating_ip:
    type: OS::Neutron::FloatingIP
    properties:
      floating_network_id: { get_param: public_net }
      port_id: { get_resource: rcb_port_mgmt }

  rcb_si:
    type: OS::Nova::Server
    properties:
      name: rcb_si
      image: { get_param: image }
      flavor: { get_param: flavor }
      key_name: { get_param: sshkey }
      security_groups:
      - {get_resource: rcb_si_security_group}
      networks:
        - port : { get_resource: rcb_port_mgmt }
      config_drive: "true"
      user_data:
        str_replace:
          template: |
            #!/bin/bash
            # export DEBIAN_FRONTEND=noninteractive
            # cd /root/icclab-rcb
            # nohup ./run.sh &

outputs:
  mcn.endpoint.rcb.mgt:
    description: "IP addresses of the RCB service."
    value: { get_attr: [rcb_floating_ip, floating_ip_address] }
{'fraction_non_alphanumeric': 0.08794371602174608, 'fraction_numerical': 0.032619123760793095, 'mean_word_length': 2.74326750448833, 'pattern_counts': {'":': 16, '<': 4, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3785605', 'n_tokens_mistral': 2167, 'n_tokens_neox': 2068, 'n_words': 589}