Skip to content
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

feat: separate OCI env-building from core packages #10

Merged
merged 2 commits into from
May 10, 2024
Merged
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
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
Loading