Starcraft Clinics

Hello everyone,

I am pleased to announce that the Snapcraft Clinics are back, in the form of the Starcraft Clinics, where we will mostly cover Snapcraft and Rockcraft issues while developing snaps or rocks.

The event will take place every fortnight, the first one being 2023-07-07T13:00:00Z β†’ 2023-07-07T14:00:00Z

Any one is welcome to join, even if to listen in, we will be over at https://meet.google.com/ixc-nucm-hjn

Cheers,
Sergio

5 Likes

Here’s a quick update on what happened during the first session, we worked on a transforming someones current rockcraft.yaml

name: nbi
summary: An image for OSM NBI
description: |
  OSM North Bound Interface image.
version: master_beta_3 # version format: <upstream-version>_<base-version>_<version>
license: Apache-2.0
base: ubuntu:22.04
platforms:
  amd64:

services:
  nbi:
    override: replace
    command: /usr/bin/python3.10 -m /app/osm_nbi.nbi
    startup: enabled
    user: appuser
    group: appuser

parts:
  non-root-user:
    plugin: nil
    overlay-script: |
      chroot ${CRAFT_OVERLAY}
      mkdir -p /app/osm_nbi
      mkdir -p /app/storage/kafka
      mkdir -p /app/log
      groupadd -g 1000 appuser
      useradd -u 1000 -g 1000 -d /app appuser
      chown -R appuser:appuser /app

  nbi:
    after: [non-root-user]
    plugin: python
    source-type: git
    source: https://osm.etsi.org/gerrit/osm/NBI
    stage-packages:
      - python3.10
    build-packages:
      - gcc
      - git
      - python3.10
      - python3-dev
      - python3-venv
      - python3-pip
      - python3-setuptools
      - wget
    override-build: |
      pip install --upgrade pip
      python3 -m pip install -U pip build
      git clone -b master https://osm.etsi.org/gerrit/osm/common.git
      git clone -b master https://osm.etsi.org/gerrit/osm/IM.git
      python3 -m pip install --force-reinstall -r requirements.txt -r common/requirements.txt -r IM/requirements.txt --no-cache-dir
      python3 -m build common && python3 -m pip install common/dist/*.whl
      python3 -m build IM && python3 -m pip install IM/dist/*.whl
      python3 -m build ${CRAFT_PART_BUILD} && python3 -m pip install ${CRAFT_PART_BUILD}/dist/*.whl
      mkdir -p app/osm_nbi/html_public
      cp -R /usr/local/lib/python3.10/dist-packages/osm_nbi/html_public app/osm_nbi/html_public
      cp /usr/local/lib/python3.10/dist-packages/osm_nbi/nbi.cfg app/osm_nbi/
      cp -R /usr/local/lib/python3.10/dist-packages/osm_nbi/http app/osm_nbi/

Into a more declarative one

name: nbi
summary: An image for OSM NBI
description: |
  OSM North Bound Interface image.
version: master_beta_3 # version format: <upstream-version>_<base-version>_<version>
license: Apache-2.0
base: ubuntu:22.04
platforms:
  amd64:

services:
  nbi:
    override: replace
    command: /usr/bin/python3.10 -m /app/osm_nbi.nbi
    startup: enabled
    user: appuser
    group: appuser

parts:
  non-root-user:
    plugin: nil
    overlay-script: |
      chroot ${CRAFT_OVERLAY}
      mkdir -p /app/osm_nbi
      mkdir -p /app/storage/kafka
      mkdir -p /app/log
      groupadd -g 1000 appuser
      useradd -u 1000 -g 1000 -d /app appuser
      chown -R appuser:appuser /app

  common:
    source: https://osm.etsi.org/gerrit/osm/common.git
    plugin: python
    python-requirements:
      - requirements.txt
    stage-packages:
      - python3.10-venv
    build-environment:
      - PYTHONDONTWRITEBYTECODE: "1"
    # Workaround for conflicts (Issue: ...)
    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.1.2.dist-info/RECORD
      - -lib/python3.10/site-packages/wheel-0.40.0.dist-info/RECORD
      
  im:
    source: https://osm.etsi.org/gerrit/osm/IM.git
    plugin: python
    python-requirements:
      - requirements.txt
    stage-packages:
      - python3.10-venv
    build-environment:
      - PYTHONDONTWRITEBYTECODE: "1"
    # Workaround for conflicts (Issue: ...)
    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.1.2.dist-info/RECORD
      - -lib/python3.10/site-packages/wheel-0.40.0.dist-info/RECORD

  nbi:
    source: https://osm.etsi.org/gerrit/osm/NBI.git
    plugin: python
    stage-packages:
      - python3.10
    build-packages:
      - gcc
      - git
      - python3.10
      - python3-dev
      - python3-venv
      - python3-pip
      - python3-setuptools
      - wget
    organize:
      lib/python3.10/site-packages/osm_nbi/nbi.cfg: app/osm_nbi/nbi.cfg
      lib/python3.10/site-packages/html_public: app/osm_nbi/html_public
      lib/python3.10/site-packages/http: app/osm_nbi/http
2 Likes

A reminder that the Clinic starts shy of 30 minutes from now!

A reminder that our fortnightly call is Today!

2023-08-18T13:00:00Z β†’ 2023-08-18T14:00:00Z

The next edition of the Starcraft Clinics is this Friday! Come chat and get support for Snapcraft, Charmcraft, Rockcraft, or the Craft libraries in general!
See you then: 2024-02-02T14:00:00Z

Hi, it’s about that time again. The next edition of the Starcraft Clinics is this Friday: 2024-02-16T14:00:00Zβ†’2024-02-16T14:50:00Z