export UBUNTU_IMAGE_TAG=16.04
make build
export UBUNTU_IMAGE_TAG=16.04
make build-nc
export CONDA_ARCHIVES=/path
make transfer
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
Will clean the docker images
export UBUNTU_IMAGE_TAG=16.04
make clean
create a base folder for your project
mkdir eccc_rpnpy
cd eccc_rpnpy
create a folder named conda.recipe for the package you whish to build
mkdir conda.recipe
clone the repository of the python package in the same folder as conda.recipe
git clone <git url>
in the conda.recipe create the following file
cd conda.recipe
vim meta.yaml
example of the eccc_rpnpy meta.yaml
package:
name: eccc_rpnpy
version: 2.2.0rc3
requirements: build:
setuptools
run:
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
#!/bin/bash
mkdir $PREFIX/etc/ cp -r $RECIPE_DIR/etc/* $PREFIX/etc/
$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
cd into the right folder
#cd <folder containing the conda.recipe folder>
cd eccc_rpnpy
create a conda environment for building conda packages
. ssmuse-sh -x /fs/ssm/eccc/cmd/cmds/apps/mamba/master/mamba_2023.11.23_all
mamba create -q -y -n builder conda-build conda-verify boa anaconda-client
. activate builder
build the package
conda mambabuild conda.recipe -c <necessary channels to find dependencies other than conda-forge>
result should look like this
~/.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
. 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