Skip to content

Commit 81d90ea

Browse files
authored
add support for workers argument for container (#38)
* add support for workers argument for container Signed-off-by: vsoch <[email protected]>
1 parent 69e7cda commit 81d90ea

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ The versions coincide with releases on pip. Only major versions will be released
1616
## [0.0.x](https://github.com/flux-framework/flux-restful-api/tree/main) (0.0.x)
1717
- Fixing bug with launcher always being specified (0.0.1)
1818
- catching any errors on creation of fluxjob
19+
- Add support uvicorn workers (>1 needed to run >1 process with Flux)
1920
- Project (faux) skeleton release (0.0.0)

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ FROM fluxrm/flux-sched:focal
22

33
# docker build -t ghcr.io/flux-framework/flux-restful-api .
44

5-
65
# This must be set to work (username / token set won't trigger it alone)
76
ARG use_auth
87
ARG user="fluxuser"
98
ARG token="12345"
109
ARG port="5000"
1110
ARG host="0.0.0.0"
11+
ARG workers="1"
1212
LABEL maintainer="Vanessasaurus <@vsoch>"
1313

1414
USER root
@@ -28,4 +28,5 @@ ENV FLUX_TOKEN=${token}
2828
ENV FLUX_REQUIRE_AUTH=${use_auth}
2929
ENV PORT=${port}
3030
ENV HOST=${host}
31+
ENV WORKERS=${workers}
3132
ENTRYPOINT ["/code/entrypoint.sh"]

docs/getting_started/developer-guide.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Build arguments supported are:
3535
| use_auth | Turn on authentication | unset (meaning false) |
3636
| port | Port to run service on (and expose) | 5000 |
3737
| host | Host to run service on (you probably shouldn't change this) |0.0.0.0 |
38+
| workers | Number of workers to run uvicorn with (required for Flux jobs with >1 process) | 1 |
3839

3940
And run it ensuring you expose port 5000. The container should show you if you've
4041
correctly provided auth (or not):
@@ -65,7 +66,7 @@ needing to push a container to a registry. Here is how to specify a branch (and
6566
or your own repository base:
6667

6768
```bash
68-
$ docker run --env INSTALL_BRANCH=add/feature --env INSTALL_REPO=user/flux-restful-api -d --rm -it -p 5000:5000 ghcr.io/flux-framework/flux-restful-api
69+
$ docker run --env INSTALL_BRANCH=add/feature --env INSTALL_REPO=user/flux-restful-api -d --rm -it -p 5000:5000 ghcr.io/flux-framework/flux-restful-api
6970
```
7071

7172

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ fi
1313

1414
# We always need to start in this PWD
1515
cd /code
16-
flux start uvicorn app.main:app --host=${HOST} --port=${PORT}
16+
flux start uvicorn app.main:app --host=${HOST} --port=${PORT} --workers=${WORKERS}

0 commit comments

Comments
 (0)