Adcm bundles paker

Adcm_sdk_pack - part of adcm_client package. Purposes that a resolved:

  • build .tgz files from dirs with sources.
  • set version of bundle and name of builded artifact in ci cirle.
  • support spec files.
usage: adcm_sdk_pack [-h] -n NAME -p PATH [-t TARPATH] [-w WORKSPACE] [-c]
           [-m MASTER_BRANCHES [MASTER_BRANCHES ...]]

Builds bundles from sources.

optional arguments:
  -h, --help            show this help message and exit
  -n NAME, --name NAME  bundle name
  -p PATH, --path PATH  path where to seek configs
  -t TARPATH, --tarpath TARPATH
            path where to save
  -w WORKSPACE, --workspace WORKSPACE
            workspace where to build
  -c, --dont-clean-ws   remove temporary files from ws
  -m MASTER_BRANCHES [MASTER_BRANCHES ...], --master-branches MASTER_BRANCHES [MASTER_BRANCHES ...]
            non default master branches

Naming rules

Master branch Other branches No .git catalog PR to master branch
"${VERSION}-1" "${VERSION}-{$BRANCH_NAME}" "${VERSION}-1" "${VERSION}-rc${PRNUMBER}${BUILDTIME}

Spec files

---
version: "1.0"
editions:
 - name: None
   exclude:
   - tests/
   - build/
   - _config.yaml
   - pylintrc
   - (.*/)?(\..+)
   - .*README\.md
   - spec.yaml
   - tests_token
   - module_struct.py
   - requirements.yml
   - yandexcloud_module/
   - tests\.sh

   preprocessors:
   - type: script
     script: build/config_builder.py
     args:
     - _config.yaml

   - type: python_mod_req
     requirements: requirements.yml
     prepared_image: ci.arenadata.io/adcm:yandexcloud  # for local debug purposes
     image: arenadata/adcm:2020013015

   - type: script
     script: ./module_struct.py

   - type: splitter
     files:
      - EULA.txt.j2

Version 1.0 functionality:

  • exclude files and dir from beeing packed by regular expression

  • process prepack actions. Types:

    • script - execute script from repository. Params:

      • script: path to script
      • args: list of arguments that are passed to script
    • python_mod_req - install python package to bundle. Params:

      • requirements: file with required packages. Format:
      # List of utils that are not present in image to proceed 
      # packages build and must be installed before python packages.
      # Not required.
      system_pkg:  
        - gcc
        - g++
        - linux-headers
      # List of python packages.
      # Required.
      python_mod:
        - yandexcloud==0.20.0
      
      • image: image that will be used as base to install packages
      • prepared_image: for local debug purposes. An image prepared from image specified in image parameter by installation of required python packages. Used to optimize build time in case of local tests running.
    • splitter - generate file from jinja2 templates. Variable “edition” is set to current edition name parameter. New file name is obtained by removing “.j2” file extension from template name.