sebastiendfortier / conda_packaging

MSC project that provides a docker container to build RPN-SI libraries and python libraries to work with MSC standard files
GNU General Public License v3.0
2 stars 0 forks source link

Docker image to build RPN-SI libs for python-rpn python package

Makefile targets

Build

export UBUNTU_IMAGE_TAG=16.04   
make build   

Build without cache

export UBUNTU_IMAGE_TAG=16.04   
make build-nc   

transfer

export CONDA_ARCHIVES=/path  
make transfer   

Run

To export the packages to anaconda, run the container, you should end up in a folder with all built conda archives ready for upload.

export UBUNTU_IMAGE_TAG=16.04   
make run   
# inside the container   
anaconda login   # enter your credentials     
# upload to anaconda    
anaconda upload <pkgname>.tar.bz2        

Clean

Will clean the docker images

export UBUNTU_IMAGE_TAG=16.04    
make clean    

How to make a conda package

Creating a recipe for linux (Example of the rpnpy package)

requirements: build:

test: imports:

about: home: https://wiki.cmc.ec.gc.ca/wiki/Python-RPN license: LGPL-3.0 license_family: LGPL license_file: LICENSE summary: 'MSC python rpn library'

source: path: ../python-rpn

- create the build.sh file that will be used to build the python package from the setup.py file in the project
```shell
vim build.sh

in this particular case we want to copy some activation scripts that will set and unset EC_LD_LIBRARY_PATH

mkdir $PREFIX/etc/ cp -r $RECIPE_DIR/etc/* $PREFIX/etc/

Install the Python package (the source path in the mate.yaml is used implicitly)

$PYTHON setup.py install


- create the conda_build_config.yaml so that on a build every version of the package will be built in one go
```shell
vim conda_build_config.yaml
python:
    - 3.9
    - 3.10
    - 3.11

Build the eccc_rpnpy conda package

Upload the package

. activate builder
anaconda login
# enter your credentials
anaconda upload ~/.conda/envs/builder/conda-bld/linux-64/eccc_rpnpy-2.2.0rc3-py311he53d0f1_0.tar.bz2 ~/.conda/envs/builder/conda-bld/linux-64/eccc_rpnpy-2.2.0rc3-py310he53d0f1_0.tar.bz2 ~/.conda/envs/builder/conda-bld/linux-64/eccc_rpnpy-2.2.0rc3-py39he53d0f1_0.tar.bz2