pai icon indicating copy to clipboard operation
pai copied to clipboard

Port forwarding from job?

Open k1ngcyk opened this issue 6 years ago • 4 comments

Organization Name: EnjoyMusic Tech

Short summary about the issue/question:

Can I forward a custom port from Job?

Brief what process you are following:

How to reproduce it:

OpenPAI Environment:

  • OpenPAI version: v1.0.1
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Hardware (e.g. core number, memory size, storage size, GPU type etc.):
  • Others:

Anything else we need to know:

k1ngcyk avatar Jun 15 '20 00:06 k1ngcyk

@k1ngcyk thanks for raising questions, may you describe more about (1) which port are you referring? (2) why & how you would like to forwarding the port?

scarlett2018 avatar Jun 15 '20 07:06 scarlett2018

@scarlett2018 For example I ran a job, and I open a port in image like 23333(in image's Dockerfile EXPOSE 23333) or what else for monitoring, can I forward it to the job host so I can access from host:23333 or a custom rule from host:new-port to job:23333?

k1ngcyk avatar Jun 15 '20 08:06 k1ngcyk

  • all jobs use host networking to optimize performance, the port on host is the same in your job.
  • to avoid port conflicts, it's better to specify port number in resources and get the assigned port value in env var PAI_CONTAINER_HOST_name_PORT_LIST, here's an example:

https://github.com/microsoft/pai/blob/c4544885b680625815460ed71a567bfadb75961a/marketplace-v2/tensorflow-serving-mnist.yaml#L34-L38

abuccts avatar Jun 15 '20 08:06 abuccts

@abuccts Thanks for your explanation and example. That's exactly what I need.

k1ngcyk avatar Jun 15 '20 09:06 k1ngcyk