summaryrefslogtreecommitdiffstats
path: root/models-sim/packages/models-simulator-docker
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2022-10-21 17:42:50 +0100
committerliamfallon <liam.fallon@est.tech>2022-10-21 17:42:50 +0100
commit84f728930527d34821a827ec6681ce9313989cab (patch)
tree438cc9e65e705e5a1a1ab80b6f8fdcbf70042aaa /models-sim/packages/models-simulator-docker
parentdfc241e57c4f261f1983886582ba0c4ff83b79fb (diff)
Set snapshot and/or references of policy/models for new release
policy/models updated to its latest own and reference snapshots *** This commit is generated by a PF release script *** Issue-ID: POLICY-4408 Signed-off-by: liamfallon <liam.fallon@est.tech> Change-Id: Ie62a24c34694977b9bbbab9554bce5b54648afb7
Diffstat (limited to 'models-sim/packages/models-simulator-docker')
-rw-r--r--models-sim/packages/models-simulator-docker/pom.xml2
-rw-r--r--models-sim/packages/models-simulator-docker/src/main/docker/Dockerfile2
2 files changed, 2 insertions, 2 deletions
diff --git a/models-sim/packages/models-simulator-docker/pom.xml b/models-sim/packages/models-simulator-docker/pom.xml
index 251f88a4e..9259148d3 100644
--- a/models-sim/packages/models-simulator-docker/pom.xml
+++ b/models-sim/packages/models-simulator-docker/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.policy.models.sim</groupId>
<artifactId>models-sim-packages</artifactId>
- <version>2.7.2-SNAPSHOT</version>
+ <version>2.8.0-SNAPSHOT</version>
</parent>
<artifactId>models-simulator-docker</artifactId>
diff --git a/models-sim/packages/models-simulator-docker/src/main/docker/Dockerfile b/models-sim/packages/models-simulator-docker/src/main/docker/Dockerfile
index 2a64151c5..d424ca553 100644
--- a/models-sim/packages/models-simulator-docker/src/main/docker/Dockerfile
+++ b/models-sim/packages/models-simulator-docker/src/main/docker/Dockerfile
@@ -26,7 +26,7 @@ RUN mkdir /packages /extracted
COPY /maven/lib/models-simulator.tar.gz /packages/
RUN tar xvzf /packages/models-simulator.tar.gz --directory /extracted/
-FROM onap/policy-jre-alpine:2.5.2-SNAPSHOT
+FROM onap/policy-jre-alpine:2.6.0-SNAPSHOT
LABEL maintainer="Policy Team"
LABEL org.opencontainers.image.title="Policy Models Simulator"
} /* Name.Entity */ .highlight .ne { color: #a6e22e } /* Name.Exception */ .highlight .nf { color: #a6e22e } /* Name.Function */ .highlight .nl { color: #f8f8f2 } /* Name.Label */ .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ .highlight .nx { color: #a6e22e } /* Name.Other */ .highlight .py { color: #f8f8f2 } /* Name.Property */ .highlight .nt { color: #f92672 } /* Name.Tag */ .highlight .nv { color: #f8f8f2 } /* Name.Variable */ .highlight .ow { color: #f92672 } /* Operator.Word */ .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ .highlight .mb { color: #ae81ff } /* Literal.Number.Bin */ .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ .highlight .sa { color: #e6db74 } /* Literal.String.Affix */ .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ .highlight .sc { color: #e6db74 } /* Literal.String.Char */ .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */ .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ .highlight .se { color: #ae81ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
#!/bin/bash
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2018
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

set -o errexit
set -o nounset
set -o pipefail
#set -o xtrace

source _common_test.sh
source _functions.sh
source _common.sh

if [ ${1:+1} ]; then
    if [ "$1" == "--external" ]; then
        onap_svc_node_port=30498
        base_url="http://$(control_plane_ip):$onap_svc_node_port/v1"
    fi
fi

base_url=${base_url:-"http://localhost:9015/v1"}
kubeconfig_path="$HOME/.kube/config"
csar_eaa_id=8030a02a-7253-11ea-bc55-0242ac130003
csar_sample_app_id=150da0b3-aa8c-481e-b661-2620b810765e
rb_eaa_name="eaa"
rb_sample_app_name="sample_app"
rb_version="plugin_test"
chart_eaa_name="eaa"
chart_sample_app_name="sample-app"
profile_eaa_name="test_eaa_profile"
profile_sample_app_name="test_sample_app_profile"
release_name="test-release"
namespace_eaa="openness"
namespace_sample_app="default"
cloud_region_id="kud"
cloud_region_owner="localhost"

# Setup
install_deps
populate_CSAR_eaa_rbdefinition "$csar_eaa_id"

print_msg "Registering resource bundle for EAA"
payload="$(cat <<EOF
{
    "rb-name": "${rb_eaa_name}",
    "rb-version": "${rb_version}",
    "chart-name": "${chart_eaa_name}"
}
EOF
)"
call_api -d "${payload}" "${base_url}/rb/definition"

print_msg "Uploading resource bundle content for EAA"
call_api --data-binary "@${CSAR_DIR}/${csar_eaa_id}/rb_definition.tar.gz" \
         "${base_url}/rb/definition/${rb_eaa_name}/${rb_version}/content"

print_msg "Registering rb's profile for EAA"
payload="$(cat <<EOF
{
    "rb-name": "${rb_eaa_name}",
    "rb-version": "${rb_version}",
    "profile-name": "${profile_eaa_name}",
    "release-name": "${release_name}",
    "namespace": "${namespace_eaa}"
}
EOF
)"
call_api -d "${payload}" "${base_url}/rb/definition/${rb_eaa_name}/${rb_version}/profile"

print_msg "Uploading profile data for EAA"
call_api --data-binary "@${CSAR_DIR}/${csar_eaa_id}/rb_profile.tar.gz" \
         "${base_url}/rb/definition/${rb_eaa_name}/${rb_version}/profile/${profile_eaa_name}/content"

print_msg "Setup cloud data"
payload="$(cat <<EOF
{
    "cloud-region": "$cloud_region_id",
    "cloud-owner": "$cloud_region_owner"
}
EOF
)"
call_api -F "metadata=$payload" \
         -F "file=@$kubeconfig_path" \
         "${base_url}/connectivity-info" >/dev/null #massive output

print_msg "Creating EAA"
payload="$(cat <<EOF
{
    "rb-name": "${rb_eaa_name}",
    "rb-version": "${rb_version}",
    "profile-name": "${profile_eaa_name}",
    "cloud-region": "${cloud_region_id}"
}
EOF
)"
response="$(call_api -d "${payload}" "${base_url}/instance")"
echo "$response"
vnf_eaa_id="$(jq -r '.id' <<< "${response}")"

wait_for_deployment eaa 1

#Create sample producer and sample consumer
populate_CSAR_eaa_sample_app_rbdefinition "$csar_sample_app_id"

print_msg "Registering resource bundle for Sample App"
payload="$(cat <<EOF
{
    "rb-name": "${rb_sample_app_name}",
    "rb-version": "${rb_version}",
    "chart-name": "${chart_sample_app_name}"
}
EOF
)"
call_api -d "${payload}" "${base_url}/rb/definition"

print_msg "Uploading resource bundle content for Sample App"
call_api --data-binary "@${CSAR_DIR}/${csar_sample_app_id}/rb_definition.tar.gz" \
         "${base_url}/rb/definition/${rb_sample_app_name}/${rb_version}/content"

print_msg "Registering rb's profile for Sample App"
payload="$(cat <<EOF
{
    "rb-name": "${rb_sample_app_name}",
    "rb-version": "${rb_version}",
    "profile-name": "${profile_sample_app_name}",
    "release-name": "${release_name}",
    "namespace": "${namespace_sample_app}"
}
EOF
)"
call_api -d "${payload}" "${base_url}/rb/definition/${rb_sample_app_name}/${rb_version}/profile"

print_msg "Uploading profile data for Sample App"
call_api --data-binary "@${CSAR_DIR}/${csar_sample_app_id}/rb_profile.tar.gz" \
         "${base_url}/rb/definition/${rb_sample_app_name}/${rb_version}/profile/${profile_sample_app_name}/content"

print_msg "Creating Sample Apps: producer and consumer"
payload="$(cat <<EOF
{
    "rb-name": "${rb_sample_app_name}",
    "rb-version": "${rb_version}",
    "profile-name": "${profile_sample_app_name}",
    "cloud-region": "${cloud_region_id}"
}
EOF
)"
response="$(call_api -d "${payload}" "${base_url}/instance")"
echo "$response"
vnf_sample_app_id="$(jq -r '.id' <<< "${response}")"

wait_for_deployment producer 1
wait_for_deployment consumer 1

print_msg "Validating EAA is running"
kubectl get --namespace=${namespace_eaa} pods | grep eaa

print_msg "Validating sample producer and sample consumer are running"
kubectl get --namespace=${namespace_sample_app}  pods | grep producer
kubectl get --namespace=${namespace_sample_app} pods | grep consumer

print_msg "Validating logs of EAA"
EAA=`kubectl get --namespace=${namespace_eaa} pods | grep eaa | awk '{print $1}'`
kubectl logs --namespace=${namespace_eaa}  ${EAA}

print_msg "Validating logs of sample producer and sample consumer"
# sleep 5 seconds to let producer and consumer generate some logs
sleep 5
PRODUCER=`kubectl get --namespace=${namespace_sample_app} pods | grep producer | awk '{print $1}'`
CONSUMER=`kubectl get --namespace=${namespace_sample_app} pods | grep consumer | awk '{print $1}'`
kubectl logs --namespace=${namespace_sample_app} ${PRODUCER}
kubectl logs --namespace=${namespace_sample_app} ${CONSUMER}

print_msg "Retrieving EAA details"
call_api "${base_url}/instance/${vnf_eaa_id}"

print_msg "Retrieving Sample App details"
call_api "${base_url}/instance/${vnf_sample_app_id}"

#Teardown
print_msg "Deleting sample apps: producer and consumer"
delete_resource "${base_url}/instance/${vnf_sample_app_id}"

print_msg "Deleting Profile for sample app"
delete_resource "${base_url}/rb/definition/${rb_sample_app_name}/${rb_version}/profile/${profile_sample_app_name}"

print_msg "Deleting Resource Bundle for sample app"
delete_resource "${base_url}/rb/definition/${rb_sample_app_name}/${rb_version}"

print_msg "Deleting EAA"
delete_resource "${base_url}/instance/${vnf_eaa_id}"

print_msg "Deleting Profile for EAA"
delete_resource "${base_url}/rb/definition/${rb_eaa_name}/${rb_version}/profile/${profile_eaa_name}"

print_msg "Deleting Resource Bundle for EAA"
delete_resource "${base_url}/rb/definition/${rb_eaa_name}/${rb_version}"

print_msg "Deleting ${cloud_region_id} cloud region connection"
delete_resource "${base_url}/connectivity-info/${cloud_region_id}"