Skip to content

Commit 672f710

Browse files
committed
Added container port example using python3 http server
1 parent b504c84 commit 672f710

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,11 @@ RUN make
1616
# Final stage - start fresh and don't carry over the build artifacts
1717
FROM ghcr.io/nearnodeflash/nnf-mfu:master
1818

19+
# Install python3 to make a simple http server available
20+
RUN apt-get update && apt-get install -y \
21+
python3 \
22+
curl \
23+
&& rm -rf /var/lib/apt/lists/*
24+
1925
# Copy application from build stage into final stage
2026
COPY --from=build /src/mpi_hello_world /usr/bin/mpi_hello_world

nnf-container-example.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ data:
88
storages:
99
- name: DW_JOB_my_storage
1010
optional: false
11+
# $NNF_CONTAINER_PORT can be used to get the port number(s)
12+
numPorts: 1
1113
mpiSpec:
1214
mpiReplicaSpecs:
1315
Launcher:
@@ -20,6 +22,12 @@ data:
2022
- mpirun
2123
- mpi_hello_world
2224
- "$(DW_JOB_my_storage)"
25+
# An example webserver can be started using python
26+
# - mpirun
27+
# - python3
28+
# - -m
29+
# - http.server
30+
# - $(NNF_CONTAINER_PORT)
2331
Worker:
2432
template:
2533
spec:

0 commit comments

Comments
 (0)