Skip to content

Commit

Permalink
docs(readme): update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Murphy committed Feb 7, 2024
1 parent 7a0281a commit 1128c7a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# nix-container-build-gha
# nix-container-build-gha-cuda

This is a simple testing repo I used to understand how to build python environments in github actions
with nix. I wrote up my thoughts in [this medium post](https://medium.com/@seanrmurphy/building-container-images-using-nix-and-github-actions-ba548ab9080d).
This is a simple testing repo I used to understand how to build python environments which require CUDA
using github actions with nix. It's a small modification to [this git repo](https://github.com/seanrmurphy/nix-container-build-gha). I wrote up a commentary on this
work in [this medium post](https://medium.com/@seanrmurphy/building-container-images-using-nix-and-github-actions-ba548ab9080d).

This is the public version of the repo which anyone can look through; I also maintain a private version
which is linked to some self hosted github runners - I don't want to link the public version to any such
Expand All @@ -15,10 +16,12 @@ The python application was taken from [this repo](https://github.com/mitchellh/f

I have included a couple of unecessary dependencies in the `pyproject.toml` just to understand how these are
handled (`torch`, `jupyter` and `beautifulsoup4`). They are available in the resulting python environment but not used by the application.
In this version, torch should determine that it's being built in a CUDA context and bring in the necessary CUDA content.

## Working locally

This assumes you have a sensible nix configuration and are comfortable using flakes.
This assumes you have a sensible nix configuration and are comfortable using flakes. It assumes that your build environment
has GPU support.

- `nix build` will build the application and put the content in the `result` directory
- `nix build .#ociApplicationImage` will build a container image which runs the application - the resulting container image is a gzip'd tarball in the `result` directory which can be imported to docker using `docker load < result`
Expand All @@ -30,3 +33,5 @@ This assumes you have a sensible nix configuration and are comfortable using fla
The github action was essentially copied from [this repo](https://github.com/wagdav/thewagner.net).

It requires a token called DOCKER_ACCESS_TOKEN to access a docker repository and push the resulting container image there. This repo uses the standard github runners but in the private variant, I was using a self-hosted runner (there are a couple of comments in the github action definition which highlight the small differences).

Note that the action assumes that a runner is available which has multiple labels.

0 comments on commit 1128c7a

Please sign in to comment.