From 5c1b7b00c0894c67f2ec6defe012aeaac8e07026 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Fri, 11 Oct 2024 13:22:57 +0200 Subject: [PATCH 1/5] minor change --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 358015b..16c59d7 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ - [Common API Framework (CAPIF)](#common-api-framework-capif) - [CAPIF\_API\_Services](#capif_api_services) - [Documentation](#documentation) +- [Install and Run](#install-and-run) + - [(to be added in Getting Started section of Documentation)](#to-be-added-in-getting-started-section-of-documentation) - [How to run CAPIF services in this Repository](#how-to-run-capif-services-in-this-repository) - [Run All CAPIF Services locally with Docker images](#run-all-capif-services-locally-with-docker-images) - [Run All CAPIF Services locally with Docker images and deploy monitoring stack](#run-all-capif-services-locally-with-docker-images-and-deploy-monitoring-stack) @@ -173,3 +175,4 @@ Frequently asked questions can be found here: [FAQ Directory] [FAQ Directory]: https://ocf.etsi.org/documentation/latest/FAQ/ "FAQ Url" [OCF Documentation]: https://ocf.etsi.org/documentation/latest/ "OCF Documentation" +aaa \ No newline at end of file -- GitLab From a13da7bb206f9085cad8527e489cbc3066d766c4 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 22 Oct 2024 15:05:30 +0200 Subject: [PATCH 2/5] Add configuration of mock server port, due to change from Release1 and new staging version --- README.md | 2 -- helm/scripts/install_capif.sh | 2 ++ helm/scripts/variables.sh | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 16c59d7..b8f1e18 100644 --- a/README.md +++ b/README.md @@ -174,5 +174,3 @@ Frequently asked questions can be found here: [FAQ Directory] [Testing with Robot Framework]: ./docs/testing_with_robot/README.md "Testing with Robot Framework" [FAQ Directory]: https://ocf.etsi.org/documentation/latest/FAQ/ "FAQ Url" [OCF Documentation]: https://ocf.etsi.org/documentation/latest/ "OCF Documentation" - -aaa \ No newline at end of file diff --git a/helm/scripts/install_capif.sh b/helm/scripts/install_capif.sh index 791b976..11614cd 100755 --- a/helm/scripts/install_capif.sh +++ b/helm/scripts/install_capif.sh @@ -123,6 +123,8 @@ helm $KUBECONFIG upgrade --install -n $CAPIF_NAMESPACE $CAPIF_NAME_VERSION_CHART --set mock-server.ingress.hosts[0].paths[0].path="/" \ --set mock-server.ingress.hosts[0].paths[0].pathType="Prefix" \ --set mock-server.env.logLevel="DEBUG" \ +--set mock-server.service.port=$MOCK_SERVER_PORT \ +--set mock-server.livenessProbe.tcpSocket.port=$MOCK_SERVER_PORT \ --set mongo-register.persistence.storageClass=$CAPIF_STORAGE_CLASS \ --set mongo-register.persistence.storage=$CAPIF_MONGO_REGISTER_STORAGE_SIZE \ --set mongo-register.extraFlags[0]="--repair" \ diff --git a/helm/scripts/variables.sh b/helm/scripts/variables.sh index 02756d0..2abf7de 100755 --- a/helm/scripts/variables.sh +++ b/helm/scripts/variables.sh @@ -94,6 +94,8 @@ export PROMETHEUS_URL="http://$MONITORING_SERVICE_NAME-prometheus.$MONITORING_NA export VAULT_INTERNAL_HOSTNAME="$VAULT_SERVICE_NAME.$VAULT_NAMESPACE.svc.cluster.local" export VAULT_PORT="8200" export VAULT_ACCESS_TOKEN="dev-only-token" +## Only for testing purpouses, configuration of mock-server port +export MOCK_SERVER_PORT="9100" ######### POST PROCESSING VARIABLES SET ######## ### To deploy in other environment we need to setup urls according to it and also using specific kubeconfig: -- GitLab From 0050d10c3c72b2db7fbdcc388688845157954604 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 22 Oct 2024 15:14:57 +0200 Subject: [PATCH 3/5] Added scripts to create and upload images for ARM64 and AMD64 architectures to ETSI Registry --- tools/base_images_scripts/common.sh | 6 ++++ .../create_and_push_robot_image.sh | 23 +++++++++++++ .../push_base_images_ocf.sh | 32 +++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 tools/base_images_scripts/common.sh create mode 100755 tools/base_images_scripts/create_and_push_robot_image.sh create mode 100755 tools/base_images_scripts/push_base_images_ocf.sh diff --git a/tools/base_images_scripts/common.sh b/tools/base_images_scripts/common.sh new file mode 100644 index 0000000..b0d212b --- /dev/null +++ b/tools/base_images_scripts/common.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# Directories variables setup (no modification needed) +export IMAGE_SCRIPTS_DIR=$(dirname "$(readlink -f "$0")") +export TOOLS_DIR=$(dirname "$IMAGE_SCRIPTS_DIR") +export CAPIF_BASE_DIR=$(dirname "$TOOLS_DIR") \ No newline at end of file diff --git a/tools/base_images_scripts/create_and_push_robot_image.sh b/tools/base_images_scripts/create_and_push_robot_image.sh new file mode 100755 index 0000000..b2c3159 --- /dev/null +++ b/tools/base_images_scripts/create_and_push_robot_image.sh @@ -0,0 +1,23 @@ +#!/bin/bash +source $(dirname "$(readlink -f "$0")")/common.sh + +DOCKER_ROBOT_IMAGE=labs.etsi.org:5050/ocf/capif/robot-tests-image +DOCKER_ROBOT_IMAGE_VERSION=1.0 + +TEST_FOLDER=$CAPIF_BASE_DIR/tests +RESULT_FOLDER=$CAPIF_BASE_DIR/results +ROBOT_DOCKER_FILE_FOLDER=$TOOLS_DIR/robot + +cd $ROBOT_DOCKER_FILE_FOLDER +docker login labs.etsi.org:5050 + +docker build --no-cache --platform linux/amd64 -t ${DOCKER_ROBOT_IMAGE}:${DOCKER_ROBOT_IMAGE_VERSION}-amd64 . +docker push ${DOCKER_ROBOT_IMAGE}:${DOCKER_ROBOT_IMAGE_VERSION}-amd64 + +docker build --no-cache --platform linux/arm64 -t ${DOCKER_ROBOT_IMAGE}:${DOCKER_ROBOT_IMAGE_VERSION}-arm64 . +docker push ${DOCKER_ROBOT_IMAGE}:${DOCKER_ROBOT_IMAGE_VERSION}-arm64 + +docker manifest create ${DOCKER_ROBOT_IMAGE}:${DOCKER_ROBOT_IMAGE_VERSION} \ + --amend ${DOCKER_ROBOT_IMAGE}:${DOCKER_ROBOT_IMAGE_VERSION}-amd64 \ + --amend ${DOCKER_ROBOT_IMAGE}:${DOCKER_ROBOT_IMAGE_VERSION}-arm64 +docker manifest push ${DOCKER_ROBOT_IMAGE}:${DOCKER_ROBOT_IMAGE_VERSION} diff --git a/tools/base_images_scripts/push_base_images_ocf.sh b/tools/base_images_scripts/push_base_images_ocf.sh new file mode 100755 index 0000000..0407dae --- /dev/null +++ b/tools/base_images_scripts/push_base_images_ocf.sh @@ -0,0 +1,32 @@ +#!/bin/bash +source $(dirname "$(readlink -f "$0")")/common.sh + +PLATFORMS=("linux/arm64" +"linux/amd64") + +BASIC_IMAGES=("python:3-slim-bullseye" +"nginx:1.27.1" +"vault:1.13.2" +"ubuntu:20.04") + + +docker login labs.etsi.org:5050 +for basic_image in "${BASIC_IMAGES[@]}"; do + echo "$basic_image processing" + MANIFEST_AMEND="" + for platform in "${PLATFORMS[@]}";do + docker pull $basic_image --platform $platform + echo "$basic_image pulled for platform $platform" + tag=$(echo $platform | awk -F'/' '{print $NF}') + docker tag $basic_image labs.etsi.org:5050/ocf/capif/$basic_image-$tag + echo "labs.etsi.org:5050/ocf/capif/$basic_image-$tag tagged" + docker push labs.etsi.org:5050/ocf/capif/$basic_image-$tag + echo "labs.etsi.org:5050/ocf/capif/$basic_image-$tag pushed" + MANIFEST_AMEND="$MANIFEST_AMEND --amend labs.etsi.org:5050/ocf/capif/$basic_image-$tag" + done + + docker manifest create labs.etsi.org:5050/ocf/capif/$basic_image $MANIFEST_AMEND + echo "labs.etsi.org:5050/ocf/capif/$basic_image Manifest created with amend $MANIFEST_AMEND" + docker manifest push labs.etsi.org:5050/ocf/capif/$basic_image + echo "labs.etsi.org:5050/ocf/capif/$basic_image Manifest pushed" +done -- GitLab From 1650ab3176e33ab780567f1e246d15e5d8aa7912 Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 22 Oct 2024 15:19:13 +0200 Subject: [PATCH 4/5] Remove not used section in README.md --- README.md | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/README.md b/README.md index b8f1e18..e77d0c3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ - [CAPIF\_API\_Services](#capif_api_services) - [Documentation](#documentation) - [Install and Run](#install-and-run) - - [(to be added in Getting Started section of Documentation)](#to-be-added-in-getting-started-section-of-documentation) - [How to run CAPIF services in this Repository](#how-to-run-capif-services-in-this-repository) - [Run All CAPIF Services locally with Docker images](#run-all-capif-services-locally-with-docker-images) - [Run All CAPIF Services locally with Docker images and deploy monitoring stack](#run-all-capif-services-locally-with-docker-images-and-deploy-monitoring-stack) @@ -27,20 +26,6 @@ Please refer to [OCF Documentation] for more detailed information. # Install and Run -### (to be added in Getting Started section of Documentation) -``` -mkdir OpenCAPIF - -cd OpenCAPIF - -# The link must be changed when finally merged with the default branch and be permanent -wget https://labs.etsi.org/rep/ocf/capif/-/raw/OCF19-local-installation-of-capif-downloading-script/deploy.sh - -chmod +x deploy.sh - -# ./deploy.sh [branch to fetch] [true or false (default) to install monitoring stack or not] -./deploy.sh staging -``` ## How to run CAPIF services in this Repository Capif services are developed under /service/ folder. -- GitLab From f4f057e2b196b9707e3c2e3d2b72a23b7ad2878a Mon Sep 17 00:00:00 2001 From: Jorge Moratinos Salcines Date: Tue, 22 Oct 2024 15:54:47 +0200 Subject: [PATCH 5/5] Setup execution permission --- tools/base_images_scripts/common.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/base_images_scripts/common.sh diff --git a/tools/base_images_scripts/common.sh b/tools/base_images_scripts/common.sh old mode 100644 new mode 100755 -- GitLab