From 672f7103a85ebc03c53959dd196e2e5432028598 Mon Sep 17 00:00:00 2001 From: Blake Devcich Date: Wed, 12 Jul 2023 10:28:36 -0500 Subject: [PATCH] Added container port example using python3 http server --- Dockerfile | 6 ++++++ nnf-container-example.yaml | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/Dockerfile b/Dockerfile index f36829a..0976e8d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/nnf-container-example.yaml b/nnf-container-example.yaml index d7b3cb6..ef35c20 100644 --- a/nnf-container-example.yaml +++ b/nnf-container-example.yaml @@ -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: @@ -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: