Skip to content

Commit 97270cd

Browse files
committed
Fix entrypoint
Move to cmidair dockerhub
1 parent ea2ef03 commit 97270cd

4 files changed

Lines changed: 13 additions & 73 deletions

File tree

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish Docker image
33
on:
44
push:
55
branches:
6-
- main
6+
- feature/issue-178/build-docker-image
77
tags:
88
- v*
99

@@ -35,7 +35,7 @@ jobs:
3535
id: meta
3636
uses: docker/metadata-action@v5.5.1
3737
with:
38-
images: adamsanto/wristpy
38+
images: cmidair/wristpy
3939

4040

4141
- name: Build and push Docker image

README.md

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ sleep_windows = subject1.sleep_windows_epoch
126126

127127
2. **Pull the Docker image**:
128128
```bash
129-
docker pull adamsanto/wristpy:latest
129+
docker pull cmidair/wristpy:latest
130130
```
131131

132132
3. **Run the Docker image** with your data:
133133
```bash
134134
docker run -it --rm \
135135
-v "/local/path/to/data:/data" \
136136
-v "/local/path/to/output:/output" \
137-
adamsanto/wristpy
137+
cmidair/wristpy
138138
```
139139
Replace `/local/path/to/data` with the path to your input data directory and `/local/path/to/output` with where you want results saved.
140140

@@ -143,38 +143,20 @@ sleep_windows = subject1.sleep_windows_epoch
143143
docker run -it --rm \
144144
-v "/local/path/to/data/file.bin:/data/file.bin" \
145145
-v "/local/path/to/output:/output" \
146-
adamsanto/wristpy
146+
cmidair/wristpy
147147
```
148148

149149
### Customizing the Pipeline:
150150

151-
The Docker image supports multiple environment variables to customize processing. You can set these using the `-e` flag:
151+
The Docker image supports multiple input variables to customize processing. You can set these by simply chaining these inputs as you would for the CLI input:
152152

153153
```bash
154154
docker run -it --rm \
155-
-v "$(pwd)/my_data:/data" \
156-
-v "$(pwd)/results:/output" \
157-
-e CALIBRATOR=ggir \
158-
-e ACTIVITY_METRIC=mad \
159-
-e NONWEAR=ggir,cta \
160-
-e THRESHOLDS=0.1,1.0,1.5 \
161-
-e EPOCH_LENGTH=10 \
162-
adamsanto/wristpy
155+
-v "/local/path/to/data/file.bin:/data/file.bin" \
156+
-v "/local/path/to/output:/output" \
157+
cmidair/wristpy /data --output /output --epoch-length 5 --nonwear-algorithm ggir --nonwear-algorithm detach --thresholds 0.1 0.2 0.4
163158
```
164159

165-
### Available Environment Variables:
166-
167-
| Variable | Description | Default | Options |
168-
|----------|-------------|---------|---------|
169-
| `INPUT_DIR` | Path for input data inside container | `/data` | Any valid path. |
170-
| `OUTPUT_DIR` | Path for output data inside container | `/output` | Any valid path. |
171-
| `OUTPUT_TYPE` | Format for output files | `csv` | `csv`, `parquet` |
172-
| `CALIBRATOR` | Calibration method | `none` | `none`, `ggir`, `gradient` |
173-
| `ACTIVITY_METRIC` | Activity metric for analysis | `enmo` | `enmo`, `mad`, `ag_count` |
174-
| `EPOCH_LENGTH` | Sampling rate in seconds | `5` | Any integer ≥ 1. |
175-
| `NONWEAR` | Non-wear detection algorithm(s) | `ggir` | `ggir`, `cta`, `detach` or comma-separated list. |
176-
| `THRESHOLDS` | Activity level thresholds | `""` | Specify three threshold values as comma-separated numbers. |
177-
178160

179161

180162
For more details on available options, see the [orchestrator documentation](https://childmindresearch.github.io/wristpy/wristpy/core/orchestrator.html#run).

dockerfile

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,6 @@ FROM python:3.11-buster
33
WORKDIR /app
44
COPY . /app/
55

6-
7-
ENV INPUT_DIR=/data
8-
ENV OUTPUT_DIR=/output
9-
ENV OUTPUT_TYPE=.csv
10-
ENV CALIBRATOR=none
11-
ENV ACTIVITY_METRIC=enmo
12-
ENV EPOCH_LENGTH=5
13-
ENV NONWEAR=ggir
14-
ENV THRESHOLDS=""
15-
16-
176
RUN apt-get update && apt-get install -y \
187
build-essential \
198
gfortran \
@@ -23,9 +12,9 @@ RUN pip install poetry && \
2312
poetry config virtualenvs.create false && \
2413
poetry install --only main
2514

26-
RUN mkdir -p $INPUT_DIR $OUTPUT_DIR
15+
RUN mkdir -p /data /output
2716

28-
COPY entrypoint.sh /entrypoint.sh
29-
RUN chmod +x /entrypoint.sh
17+
ENTRYPOINT ["poetry", "run", "wristpy"]
3018

31-
ENTRYPOINT ["/entrypoint.sh"]
19+
CMD ["/data", "--output", "/output", "--output-filetype", ".csv", "--calibrator", "none", \
20+
"--activity-metric", "enmo", "--epoch-length", "5", "--nonwear-algorithm", "ggir"]

entrypoint.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)