Skip to content

Accept Version and Version-Buildnumber in Conda #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 23 additions & 13 deletions invfile.lua.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,30 @@ unattended installation. The enabled channels are passed in as well.
' -p /usr/local --copy --yes '

Metadata for Conda packages is stored in JSON files in
`/opt/conda/pkgs/` `<package-version-build>/` `info/recipe.json`. Since the version
and build is given in a slightly different format (version--build) in the
`packages.tsv`, we have to convert it first:
`/opt/conda/pkgs/` `<package-version-build>/` `info/recipe.json`.

The revision value in `packages.tsv` is used to name the tag of the
corresponding Docker image, which disallows the use of `=`. However, Conda uses
an equal sign to separate version code and build number. As a solution we propose
using a double dash (`--`) instead in the `packages.tsv`, which can then be translated
into an equal sign when communicating with Conda.

We support two formats for the version number: Firstly, a simple specification
of the package version (`1.0.0`). During installation, Conda picks the latest build
for this version and installs it. Secondy, a version and build number specification
of the form `1.0.0--2` which translates to version `1.0.0` and build number `2`.

local packageDirName = ''
local conda_version = ''
if string.find(revision, "--") then
packageDirName = package .. '-' ..
table.concat(split(revision, "--"), "-")
conda_version = table.concat(split(revision, "--"), "=")
else
packageDirName = package .. '-' .. revision .. '-*'
conda_version = '=' .. revision
end

local packageDirName = package .. '-' ..
table.concat(split(revision, "--"), "-")

Extracting the info is as simple as copying the `recipe.json` file into the `/info` directory that is available
to other build steps.
Expand Down Expand Up @@ -297,14 +315,6 @@ is set using the revision from the `packages.tsv`.
.. ' read desc ; echo $desc > /info/description ; '
.. ' echo ' .. revision .. [==[ > /info/version ) ]==]

The revision value in `packages.tsv` is used to name the tag of the
corresponding Docker image, which disallows the use of `=`. However, Conda uses
an equal sign to separate version code and build number. As a solution we propose
using a double dash (`--`) instead in the `packages.tsv`, which can then be translated
into an equal sign when communicating with Conda.

local conda_version = table.concat(split(revision, "--"), "=")

The actual build step utilizes the official `miniconda` image from Continuum Analytics
with a default shell. It executes the install and extract information commands.
Afterwards, with the help of the `jq` utility image, this information is transformed,
Expand Down
2 changes: 2 additions & 0 deletions packages.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ conda cufflinks 2.2.1--py27_1 (cuffmerge --help 2>&1) | grep Options > /dev/null
conda tophat 2.1.0--py27_0 (tophat --version 2>&1) > /dev/null
conda curl 7.45.0--1 curl --fail icanhazip.com
conda bcftools 1.3--0 bcftools --version
conda bfc r181 bfc 2>&1 | grep bfc > /dev/null
conda bfc r181--0 bfc 2>&1 | grep bfc > /dev/null