User Guide¶
Pakages provides basic functionality to install, build, and deploy spack packages. If you haven’t installed Pakages yet or shelled into a pre-built container, you should read Installation first. If you want to tweak settings, read Settings. If you are looking to develop, meaning build, test, and deploy your own packages, you should see Developer Guide.
Quick Start¶
After installation, you’ll first need spack to be on your path. If you want control over Pakages settings (discussed next) you should create your own copy of the config file.
# Init your user config
$ pakages config init
This will create a $HOME/.pakages/settings.yml
that you can customize to override
the defaults. To quickly edit:
$ pakages config edit
The settings will let you add trusted package registries to try pulling from (which also can be set on the fly on the command line) along with a default registry to push to, a tag to use, and default cache directory, and others. Browse Settings and ensure the settings are to your liking before continuing. And importantly - if you are just using pakages to install the default provided trusted registry at pakages, you likely don’t need to customize anything. Finally, make sure that you have spack added to your path, to be discovered by pakages. If you are using a pre-built container, this will already be the case.
Commands¶
Pakages allows for easy install of different formats of packages, which currently includes spack and Python (pip).
Spack¶
The goal of the pakages spack builder to to make it easy to:
Host your own package.py recipes in a repository (also allowing for automated update of those recipes)
On any change, trigger an automated build for the package with spack develop
Install to spack using this build cache from GitHub packages.
For development, we provide (currently under development) a set of packages, “pakages” , that you can easily install. The following commands work with the spack builder:
Build¶
Pakages can install from spack just using pakages install (which is installable via pip so it can be on your path more easily or in a Python environment). For Spack, the intended workflow is to build (and optionally push) when you want to create a GitHub packages build cache, and then to install pointing at the cache. If you don’t need to push to GitHub packagese, build would be equivalent to manually creating a spack build cach. First, here is how to do that:
$ pakages --builder spack build zlib
# equivalent to pakages -b spack build zlib
Preparing to install zlib
linux-ubuntu20.04-skylake
[+] /home/vanessa/Desktop/Code/syspack/pakages/pakages/spack/opt/spack/linux-ubuntu20.04-skylake/gcc-9.3.0/zlib-1.2.11-3kmnsdv36qxm3slmcyrb326gkghsp6px
To push to GitHub packages, provide the push prefix (which will be appended with your system architecture):
$ pakages --builder spack build zlib --push ghcr.io/pakages/zlib
The above will be extended to include ghcr.io/pakages/zlib-linux-ubuntu20.04-x86_64:latest
.
Note that if/when we want to support builds with customized names (not including host info) this can be
added - please open an issue. The current functionality is assuming that you are uploading a cache
using the same host you built on.
Note that you can build from a local package repository structured liked this:
./
repos.yaml
packages/
mypackage/
package.py
zlib/
package.py
Install¶
Finally, when you are ready to install (using the GitHub packages build cache) you can do:
$ pakages install --builder spack zlib --use-cache ghcr.io/pakages/zlib-linux-ubuntu20.04-x86_64:latest
The above will prepare the build cache, add it, and then perform the install, allowing spack to decide if a binary and libraries are compatible.
Python¶
The goal of the Python builder is to make it easy to “release” your Python packages to GitHub packages, and then install in a consistent way (not developed yet).
If you have a repository with a setup.py, it is determined to be a Python package and we will attempt to build with traditional approaches (e.g., setuptools). Here is an example:
$ git clone https://github.com/vsoch/citelang /tmp/citelang
$ cd /tmp/citelang
$ pakages build
The above will generate the package archive, and also an sbom as a layer. We have not yet developed a way to install to a common place (coming soon).
$ tree /tmp/pakages-tmp.67efwbmf/
/tmp/pakages-tmp.67efwbmf/
├── citelang-0.0.31.tar.gz
└── sbom.json