OSMENG-1197: Add MON rockcraft.yaml 01/13801/2
authorDario Faccin <dario.faccin@canonical.com>
Tue, 8 Aug 2023 08:47:11 +0000 (10:47 +0200)
committerDario Faccin <dario.faccin@canonical.com>
Wed, 9 Aug 2023 07:40:19 +0000 (09:40 +0200)
Runs with Python 3.10 using Ubuntu22.04 base image

Change-Id: I9727390aadc560a4c5a334756c29e55ca42a8972
Signed-off-by: Dario Faccin <dario.faccin@canonical.com>
rockcraft.yaml [new file with mode: 0644]

diff --git a/rockcraft.yaml b/rockcraft.yaml
new file mode 100644 (file)
index 0000000..474856e
--- /dev/null
@@ -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: <upstream-version>_<base-version>_<version>
+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