NVIDIA / ai-assisted-annotation-client

Client side integration example source code and libraries for AI-Assisted Annotation SDK
Other
308 stars 64 forks source link

Make AI-AA server run on localhost inside docker container #69

Closed luiztauffer closed 4 years ago

luiztauffer commented 4 years ago

Hi, I can't make the AI-AA server run on localhost. Instead, it gets automatically allocated at 172.17.0.2

When running:

docker run --runtime=nvidia -it --rm -v /home/<username>/tlt-experiments:/workspace/tlt-experiments $dockerImage start_aas.sh

I get the warning:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message

Here's the full track:

NVIDIA Release 19.09 (build 8044707)
TensorFlow Version 1.14.0

Container image Copyright (c) 2019, NVIDIA CORPORATION.  All rights reserved.
Copyright 2017-2019 The TensorFlow Authors.  All rights reserved.

Various files include modifications (c) NVIDIA CORPORATION.  All rights reserved.
NVIDIA modifications are covered by the license terms that apply to the underlying project or file.

NOTE: MOFED driver for multi-node communication was not detected.
      Multi-node communication performance may be reduced.

/opt/nvidia/medical/aiaa-launch-config.json

ENGINE:: engine=TRTIS
TRTIS:: Backend is enabled

TRTIS:: trtis_ip=localhost
TRTIS:: Will setup TRTIS Server on localhost

TRTIS:: trtis_http_port=8000
TRTIS:: trtis_grpc_port=8001
TRTIS:: trtis_metrics_port=8002
TRTIS:: trtis_proto=grpc
TRTIS:: trtis_model_path=/var/nvidia/aiaa/trtis_models
TRTIS:: trtis_verbose=false
TRTIS:: trtis_log=/var/nvidia/aiaa/logs/host-80/trtis.log
TRTIS:: trtis_start_timeout=120
TRTIS:: trtis_model_timeout=30

TRTIS:: Waiting 1 seconds to fully up...
TRTIS:: Waiting 2 seconds to fully up...
TRTIS:: Server started with pid: 68

AIAA:: aiaa_port=80
AIAA:: aiaa_log_file=/var/nvidia/aiaa/logs/host-80/aiaa.log
AIAA:: aiaa_log_dir=/var/nvidia/aiaa/logs/host-80
AIAA:: aiaa_workspace=/var/nvidia/aiaa
AIAA:: aiaa_ssl=false
AIAA:: aiaa_ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
AIAA:: aiaa_ssl_pkey_file=/etc/ssl/private/ssl-cert-snakeoil.key

 * Stopping Apache httpd web server apache2                                                                                                          *
Site 000-default disabled.
To activate the new configuration, you need to run:
  service apache2 reload
Enabling site AIAA.
To activate the new configuration, you need to run:
  service apache2 reload
Starting AIAA Server...
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message

How can I fix this?

I tried the solutions proposed here (which are similar to suggestions from many other places): https://askubuntu.com/questions/329323/problem-with-restarting-apache-2 The warning message changes, but the container is still accessible only through 172.17.0.2, I want it to be exposed on localhost:5000

SachidanandAlle commented 4 years ago

Inside docker container you can still access it as localhost:80... or 127.0.0.1:80 and outside container it will be your host:5000 or localhost:5000

SachidanandAlle commented 4 years ago

For better support please post your questions related to Clara sdk/aiaa on nvidia blogs

luiztauffer commented 4 years ago

thank you for the prompt response @SachidanandAlle but outside the container it is not on localhost:5000, it is on 172.17.0.2 That's what I want to fix. I'm running with all the default options

SachidanandAlle commented 4 years ago

@YuanTingHsieh ^^

SachidanandAlle commented 4 years ago

i verified.. i can access outside container (the host machine) using localhost, 127.0.01 I guess you can check port mapping

docker run --runtime=nvidia -it --rm -v /home/<username>/tlt-experiments:/workspace/tlt-experiments $dockerImage start_aas.sh

In your command I don't see you have mapped your port... You need something like -p 5678:80 -p 5679:443 or --net=host to map the container port to outside host..

https://docs.docker.com/config/containers/container-networking/

FYI: 172.17.0.2 is the virtual IP Address of your docker container.. I guess you should go through docker insights... it's always helpful.

SachidanandAlle commented 4 years ago

https://docs.nvidia.com/clara/tlt-mi/clara-train-sdk-v3.0/aiaa/installation.html

There is NOTE..

When you run docker, make sure you have docker ports (e.g. http-port: 80) mapped to host machine for external access. You can do that with docker option -p [LOCAL_PORT]:[REMOTE_PORT]. The local port is the host port you want to use while the remote port is the port which AIAA listen to inside the docker container (80 for HTTP, 443 for HTTPS).