Skip to content

Commit

Permalink
Added container port example using python3 http server
Browse files Browse the repository at this point in the history
  • Loading branch information
bdevcich committed Jul 25, 2023
1 parent b504c84 commit 672f710
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@ RUN make
# Final stage - start fresh and don't carry over the build artifacts
FROM ghcr.io/nearnodeflash/nnf-mfu:master

# Install python3 to make a simple http server available
RUN apt-get update && apt-get install -y \
python3 \
curl \
&& rm -rf /var/lib/apt/lists/*

# Copy application from build stage into final stage
COPY --from=build /src/mpi_hello_world /usr/bin/mpi_hello_world
8 changes: 8 additions & 0 deletions nnf-container-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ data:
storages:
- name: DW_JOB_my_storage
optional: false
# $NNF_CONTAINER_PORT can be used to get the port number(s)
numPorts: 1
mpiSpec:
mpiReplicaSpecs:
Launcher:
Expand All @@ -20,6 +22,12 @@ data:
- mpirun
- mpi_hello_world
- "$(DW_JOB_my_storage)"
# An example webserver can be started using python
# - mpirun
# - python3
# - -m
# - http.server
# - $(NNF_CONTAINER_PORT)
Worker:
template:
spec:
Expand Down

0 comments on commit 672f710

Please sign in to comment.