Skip to content

Commit

Permalink
Refactor README.md: Update example command for running Python app
Browse files Browse the repository at this point in the history
  • Loading branch information
jose-d committed Nov 1, 2024
1 parent 681423e commit cc72085
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# crpropa_singularity

# CRPropa Apptainer Image

This repository contains a recipe to build an [Apptainer](https://apptainer.org/user-guide/introduction.html) image for [CRPropa](https://github.com/CRPropa/CRPropa3) - the Cosmic Ray Propagation Framework.
Expand All @@ -8,24 +6,19 @@ This repository contains a recipe to build an [Apptainer](https://apptainer.org/

A prebuilt container is available in the "releases" section.

To run your Python script (`app.py`) using CRPropa, use the following command:

```bash
./Apptainer.sif python3 app.py
```

Example output:
To run our example Python app (`example.py`), use the following command:

```bash
Python version
3.6.8 (default, Nov 9 2021, 14:44:26)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
we can import crpropa, cool.
apptainer exec crpropa.sif python ./example.py
CosmicRay at z = 0
source: Particle 1000010010, E = 200 EeV, x = 100 0 0 Mpc, p = -1 0 0
current: Particle 1000010010, E = 0.998292 EeV, x = -13173.3 0 0 Mpc, p = -1 0 0
Propagated distance 13273.263588242868 Mpc
```

## Creating the Container
## Advanced: Creating the Container

### Production: Create SIF File
### Create SIF File

To build the SIF file for production, run:

Expand All @@ -47,6 +40,6 @@ apptainer build --fakeroot --sandbox sandbox ./crpropa.def

Follow the [installation guide](https://apptainer.org/docs/admin/main/installation.html) for Apptainer, which works well on recent Ubuntu versions (24.04).

### Additional Notes
## Additional Notes

The container is based on the Rocky Linux 9 Docker image.
The container is currently based on the Rocky Linux 9 Docker image.

0 comments on commit cc72085

Please sign in to comment.