From 602a4a53e718bd05778a12d82e0d72e785f6468e Mon Sep 17 00:00:00 2001 From: Dario Faccin Date: Tue, 8 Aug 2023 10:47:11 +0200 Subject: [PATCH] OSMENG-1197: Add MON rockcraft.yaml Runs with Python 3.10 using Ubuntu22.04 base image Change-Id: I9727390aadc560a4c5a334756c29e55ca42a8972 Signed-off-by: Dario Faccin --- rockcraft.yaml | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 rockcraft.yaml diff --git a/rockcraft.yaml b/rockcraft.yaml new file mode 100644 index 0000000..474856e --- /dev/null +++ b/rockcraft.yaml @@ -0,0 +1,97 @@ +# 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. +######################################################################################## +name: monitoring +summary: An image for OSM MON +description: | + OSM Monitoring image. +version: master_beta_1 # version format: __ +license: Apache-2.0 +base: ubuntu:22.04 +platforms: + amd64: + +parts: + non-root-user: + plugin: nil + overlay-script: | + chroot ${CRAFT_OVERLAY} + mkdir -p /app/osm_mon + groupadd -g 1001 appuser + useradd -u 1001 -g 1001 -d /app appuser + chown -R appuser:appuser /app + + common: + source: https://osm.etsi.org/gerrit/osm/common.git + source-branch: master + plugin: python + python-requirements: + - requirements.txt + stage-packages: + - python3.10-venv + build-environment: + - PYTHONDONTWRITEBYTECODE: "1" # This does not work as expected, there is a bug and still not fixed. + # Workaround for conflicts related with the bug of PYTHONDONTWRITEBYTECODE + override-build: | + craftctl default + find "$CRAFT_PART_INSTALL" -name '*.pyc' -exec rm {} \; + stage: + - -bin/activate + - -bin/activate.csh + - -bin/activate.fish + - -lib/python3.10/site-packages/pip-23.2.1.dist-info/RECORD + - -lib/python3.10/site-packages/wheel-0.41.1.dist-info/RECORD + - -lib/python3.10/site-packages/charset_normalizer-3.1.0.dist-info/RECORD + + n2vc: + source: https://osm.etsi.org/gerrit/osm/N2VC.git + source-branch: master + plugin: python + python-requirements: + - requirements.txt + stage-packages: + - python3.10-venv + build-environment: + - PYTHONDONTWRITEBYTECODE: "1" # This does not work as expected, there is a bug and still not fixed. + # Workaround for conflicts related with the bug of PYTHONDONTWRITEBYTECODE + override-build: | + craftctl default + find "$CRAFT_PART_INSTALL" -name '*.pyc' -exec rm {} \; + stage: + - -bin/activate + - -bin/activate.csh + - -bin/activate.fish + - -lib/python3.10/site-packages/pip-23.2.1.dist-info/RECORD + - -lib/python3.10/site-packages/wheel-0.41.1.dist-info/RECORD + - -lib/python3.10/site-packages/charset_normalizer-3.1.0.dist-info/RECORD + + mon-startup-script: + plugin: dump + source: https://osm.etsi.org/gerrit/osm/MON.git + source-branch: master + organize: + docker/scripts/start.sh: app/osm_mon/start.sh + stage: + - app/osm_mon/start.sh + + mon: + source: https://osm.etsi.org/gerrit/osm/MON.git + source-branch: master + plugin: python + python-requirements: + - requirements.txt + stage-packages: + - python3.10-venv + build-packages: + - ca-certificates + - openssh-client \ No newline at end of file -- 2.25.1