Skip to content

Commit

Permalink
feat: Separate OCI env-building from core packages (#10)
Browse files Browse the repository at this point in the history
* feat: Separate OCI env-building from core packages
* docs: Improve usage guidance (#11)
  • Loading branch information
ships authored May 10, 2024
1 parent 051fd3e commit 8703176
Show file tree
Hide file tree
Showing 9 changed files with 499 additions and 301 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ jobs:
nix build \
-L \
-o ./imgGensqlQuery \
'.#ociImgGensqlQuery'
'./envs-flake#ociImgGensqlQuery'
- name: build Loom image
run: |
nix build \
-L \
-o ./imgLoom \
'.#ociImgLoom'
'./envs-flake#ociImgLoom'
- name: Login to Docker Hub
# only run this when running on main, because
Expand All @@ -57,4 +57,4 @@ jobs:
if: github.ref == 'refs/heads/main'
run: |
docker load -i ./imgLoom
docker push --all-tags probcomp/inferenceql.loom
docker push --all-tags probcomp/gensql.loom
48 changes: 44 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ This repo holds Nix flake, modules, packages, and reusable utility Nix language
Currently, you can build a package directly like so:

```bash
nix build github.com:OpenGen/nix#ociImgBase
nix build github.com:OpenGen/nix#sppl
```

### Build an OCI image with an environment

OCI images consume these libraries and ones from other OpenGen repos, and are specified in another flake (excepting the `base` oci image):

```bash
nix build github.com:OpenGen/nix#ociImgLoom
```

### Import utility code
Expand All @@ -20,13 +28,45 @@ To access the `lib` code exported by this flake, declare this repo as a flake in
{
inputs = {
nixpkgs.url = ...
gensqlnix.url = "github:OpenGen/nix";
opengen.url = "github:OpenGen/nix";
};
outputs = inputs@{ nixpkgs, gensqlnix, ... }: let
outputs = inputs@{ nixpkgs, opengen, ... }: let
# call some function
toolbox = gensqlnix.lib.basicTools "aarch64-darwin";
toolbox = opengen.lib.basicTools "aarch64-darwin";
in {
...
};
};
```

## Packages

### `.#sppl`

Python [library by ProbSys](https://github.com/probsys/sppl) packaged for python3.9 .

### `.#loom`

Implementation of [CrossCat in Python](https://github.com/posterior/loom). NOTE: this ONLY builds for `x86_64` architectures and only runs on linux, because it depends on
platform-dependent `distributions`.

Your options are:

```bash
nix build '.#packages.x86_64-linux.loom' # same as `.#loom` if that is your OS/arch
nix build './envs-flake#packages.x86_64-darwin.ociImgLoom'
```

If you are running on Mac silicon (`aarch64-darwin`), that OCI image will run but behavior is not defined or supported.

#### `.#loom.morePackages.distributions`

Native library for probability distributions in python used by Loom. NOTE: this ONLY builds for `x86_64` architectures and only runs on linux.

#### `.#loom.morePackages.parsable`
#### `.#loom.morePackages.pymetis`
#### `.#loom.morePackages.goftests`
#### `.#loom.morePackages.tcmalloc`

Other upstream python packages required by Distributions and/or Loom.

Loading

0 comments on commit 8703176

Please sign in to comment.