Skip to content

Commit

Permalink
build: push pull request images to ghcr.io
Browse files Browse the repository at this point in the history
Should help with debugging...
  • Loading branch information
plexoos committed Jun 18, 2024
1 parent f7de22f commit 2c95dfd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 28 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,20 @@ jobs:
- name: Set up docker
uses: docker/setup-buildx-action@v3

- name: Login to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
tags: ${{ env.IMAGE_NAME }}:${{ env.TAG }}
load: true
push: true
cache-from: |
type=local,src=/home/runner/.buildx-cache
type=registry,ref=${{ env.IMAGE_NAME }}:latest
Expand Down
45 changes: 17 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ simulation jobs levereging on the Geant4 and NVIDIA OptiX ray tracing capabiliti

### Prerequisites

Before starting, make sure you have the following prerequisites installed:
Before starting, make sure you have the following prerequisites available and installed:

* A CUDA-capable NVIDIA GPU
* [Docker Engine](https://docs.docker.com/engine/install/)
* NVIDIA container toolkit ([installation guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html))


Expand Down Expand Up @@ -68,39 +69,27 @@ Now, the `esi-shell` image can be built locally
docker build -t esi-shell .
```

At runtime, make sure that the environment variable `OPTIX_DIR` is configured to point to the
directory where OptiX is installed, e.g.
For local development with OptiX, install it on your host system. We recommend installing OptiX in
`/usr/local/optix` but any other path will be as good:

```shell
export OPTIX_DIR=/usr/local/optix
```

#### Docker

If preferred, one can pull a tagged release from the registry and work with the images directly. The list of all tagged
releases can be found [here](https://github.com/BNLNPPS/esi-shell/pkgs/container/esi-shell). Run the tagged image with
the local NVIDIA OptiX installation, e.g.:

```shell
docker run --rm -it --gpus all -v /usr/local/optix:/usr/local/optix ghcr.io/bnlnpps/esi-shell:<tag>
export OPTIX_DIR=$HOME/optix
mkdir -p $OPTIX_DIR
./NVIDIA-OptiX-SDK-7.6.0-linux64-x86_64.sh --prefix=$OPTIX_DIR
```

Explanation of the docker command:
When running `esi-shell`, make sure that the environment variable `OPTIX_DIR` is configured to point
to the directory where OptiX is installed. If not set, the default path `OPTIX_DIR=/usr/local/optix`
will be mounted insdie the container at runtime.

```
docker run: Instructs Docker to run a container.
--rm: Ensures that the container is removed after it stops running.
-it: Make the container interactive.
--gpus all: Specifies that all available GPUs should be accessible within the container.
-v /usr/local/optix:/usr/local/optix: Mounts the host directory /usr/local/optix into the container at the same location.
-e HOME=/esi-shell: Sets the environment variable HOME to /esi-shell within the container.
ghcr.io/bnlnpps/esi-shell:1.0.0-beta.4: Image and tag in github package registry.
```

---
#### Docker

Convert gdml geometry to CSG
If preferred, you can pull a tagged release from the registry and work with the images directly. The
list of all tagged releases can be found
[here](https://github.com/BNLNPPS/esi-shell/pkgs/container/esi-shell). Run the tagged image with
the local NVIDIA OptiX installation, e.g.:

```
opticks/g4cx/tests/G4CXOpticks_setGeometry_Test.sh
```shell
docker run --rm -it --gpus all -v /usr/local/optix:$OPTIX_DIR ghcr.io/bnlnpps/esi-shell:<tag>
```

0 comments on commit 2c95dfd

Please sign in to comment.