Skip to content

Commit 0729dbc

Browse files
committed
chore(docs): improve documentation
1 parent 6a7799f commit 0729dbc

File tree

1 file changed

+105
-56
lines changed

1 file changed

+105
-56
lines changed

README.md

Lines changed: 105 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -73,87 +73,136 @@ The front-end implementation using React and modern web technologies.
7373

7474
---
7575

76-
## Installation
76+
## Installation Guide
7777

78-
The Annotat3D project can be built and deployed using either **Docker** or **Singularity**, ensuring flexibility for different environments. Follow the steps below based on your preferred containerization technology.
78+
The Annotat3D project can be deployed using **Docker** or **Singularity**, providing flexibility for both local and HPC environments.
79+
80+
---
7981

8082
### Prerequisites
81-
1. **Docker** or **Singularity** installed on your system:
82-
- [Install Docker](https://docs.docker.com/get-docker/)
83-
- [Install Singularity](https://sylabs.io/docs/)
84-
2. Python 3 installed for generating container recipes.
8583

86-
### Building with Docker
84+
1. **Container runtime installed**:
85+
* [Docker](https://docs.docker.com/get-docker/) or [Singularity / Apptainer](https://sylabs.io/docs/)
86+
2. **Python 3** installed (required only for building containers locally).
87+
3. Basic familiarity with command-line tools.
8788

88-
To build and run Annotat3D using Docker:
89+
---
8990

90-
1. Clone the repository:
91-
```bash
92-
git clone https://github.com/cnpem/annotat3d.git
93-
cd annotat3d
94-
```
91+
### Option 1 (Recommended): Use the Prebuilt Docker Image
9592

96-
2. Build the Docker Image
93+
This is the quickest way to run Annotat3D, **no cloning required**.
9794

98-
You can either generate and build the Docker image locally or use the prebuilt image available on Docker Hub.
95+
#### 1. Pull the prebuilt image
9996

100-
***Option 1: Build locally***
97+
```bash
98+
docker pull docker.io/allansp84/annotat3d-prod:latest
99+
```
101100

102-
Run the build script:
103-
```bash
104-
bash container/build_docker.sh
105-
```
106-
This script will:
101+
#### 2. Run the container
107102

108-
- Generate a `Dockerfile` using an HPCCM recipe (`container/hpccm-annotat3d.py`).
109-
- Build the Docker image and tag it as `annotat3dweb-prod:latest`.
103+
```bash
104+
docker run -d -p 8000:8000 annotat3dweb-prod:latest
105+
```
110106

111-
***Option 2: Use the prebuilt image***
107+
* `-d` runs the container in detached mode.
108+
* `-p 8000:8000` maps port 8000 inside the container to your host machine.
112109

113-
Pull the image directly from Docker Hub:
114-
```bash
115-
docker pull docker.io/allansp84/annotat3d-prod:latest
116-
```
110+
#### 3. Access the web application
117111

118-
3. Run the Docker container:
119-
```bash
120-
docker run -d -p 8000:8000 annotat3dweb-prod:latest
121-
```
112+
Open your browser and go to:
122113

123-
4. Access the web application at `http://localhost:8000`.
114+
```
115+
http://localhost:8000
116+
```
124117

125-
### Building with Singularity
118+
---
126119

127-
To build and run Annotat3D using Singularity:
120+
### Option 2: Build Docker Image Locally
128121

129-
1. Clone the repository:
130-
```bash
131-
git clone https://github.com/cnpem/annotat3d.git
132-
cd annotat3d
133-
```
122+
Use this option if you want to **customize the container** or include local changes.
134123

135-
2. Generate the Singularity recipe and build the Singularity image:
136-
```bash
137-
bash container/build_singularity.sh base
138-
bash container/build_singularity.sh production
139-
```
124+
#### 1. Clone the repository
125+
126+
```bash
127+
git clone https://github.com/cnpem/annotat3d.git
128+
cd annotat3d
129+
```
140130

141-
This script will:
142-
- Generate Singularity definition files (`container/Singularity-base.def` and `container/Singularity-productions.def`) using the HPCCM recipe.
143-
- Build the Singularity images base and production (`annotat3d-base.sif` and ``annotat3d-prod.sif``).
131+
#### 2. Build the Docker image
144132

145-
3. Run the Singularity container:
146-
```bash
147-
singularity run --nv annotat3d-prod.sif
148-
```
133+
Run the build script:
134+
135+
```bash
136+
bash container/build_docker.sh
137+
```
138+
139+
This script will:
140+
141+
* Generate a `Dockerfile` from the HPCCM recipe (`container/hpccm-annotat3d.py`).
142+
* Build the Docker image and tag it as `annotat3dweb-prod:latest`.
149143

150-
4. Access the web application at `http://localhost:8000`.
144+
#### 3. Run the Docker container
145+
146+
```bash
147+
docker run -d -p 8000:8000 annotat3dweb-prod:latest
148+
```
149+
150+
#### 4. Access the web application
151+
152+
Open your browser at:
153+
154+
```
155+
http://localhost:8000
156+
```
157+
158+
---
159+
160+
### Option3: Building with Singularity
161+
162+
Use Singularity in HPC or restricted environments where Docker is unavailable.
163+
164+
#### 1. Clone the repository
165+
166+
```bash
167+
git clone https://github.com/cnpem/annotat3d.git
168+
cd annotat3d
169+
```
170+
171+
#### 2. Build Singularity images
172+
173+
```bash
174+
bash container/build_singularity.sh base
175+
bash container/build_singularity.sh production
176+
```
177+
178+
This generates:
179+
180+
* Definition files: `container/Singularity-base.def` and `container/Singularity-production.def`.
181+
* Singularity images: `annotat3d-base.sif` and `annotat3d-prod.sif`.
182+
183+
#### 3. Run the Singularity container
184+
185+
```bash
186+
singularity run --nv annotat3d-prod.sif
187+
```
188+
189+
* `--nv` enables GPU support if available.
190+
191+
#### 4. Access the web application
192+
193+
Open your browser at:
194+
195+
```
196+
http://localhost:8000
197+
```
151198

152199
### Notes
153200

154-
- **HPCCM Recipe**: The `container/hpccm-annotat3d.py` script generates recipes for both Docker and Singularity containers, ensuring compatibility with HPC environments.
155-
- Ensure you execute the build scripts from the project’s root directory to avoid path issues.
156-
- If additional dependencies are required, update the HPCCM recipe file before building the image.
201+
* **HPCCM Recipe** (`container/hpccm-annotat3d.py`) generates container recipes compatible with both Docker and Singularity.
202+
* Execute build scripts from the project root to avoid path issues.
203+
* Update the HPCCM recipe if additional dependencies are required.
204+
* **Option 1 (prebuilt Docker image)** is recommended for quick deployment; no cloning required.
205+
* **Option 2 (local build)** is useful for customization or development.
157206

158207
---
159208

0 commit comments

Comments
 (0)