Skip to content
Notes
Dockerfile Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Document
images
tutorial
README.md

README.md

PM-Server

I also copy this repo to
https://spirit.cs.ucdavis.edu/workstation

Internal Maintenance Version

Advisor: Prof. Prasant Mohapatra

For updated info or reporting issues, please go to
https://github.com/dtczhl/PM-Server

Access Docker Environment

Important!

  • Please remove unused docker images and containers to save space.
  • Please do NOT use the server to store your data. We have a data station to save your data there.

Port Allocation

  • Huanle Zhang: 50000 - 50999
  • Abhishek Roy: 51000 - 51999
  • Anshuman Chhabra: 52000 - 52999
  • Debraj Basu: 53000 - 53999
  • Hao Fu: 54000 - 54999
  • Tianbo Gu: 55000 - 55999
  • Zheng Fang: 56000 - 56999
  • Muchen Wu: 57000 - 57999
  • Jiuming Chen: 58000 - 58999

Tutorial

This tutorial shows how to run Tensorflow with GPU support.

  1. Add container

  2. Type in Name, Image (e.g., tensorflow/tensorflow:1.12.0-gpu-py3), enable Publish all exposed ports, Port mapping 22 for ssh, 8888 for Jupyter, etc. For easy management, I have allocated a port range for each one before. Below is an example

  3. Under Advanced container settings: Command & logging, choose Console Interactive & TTY (-i -t)

  4. Under Runtime & Resources. Choose Runtime to nvidia

  5. Click Deploy the container. Your container is running now.

  6. To enable SSH login into your container. Click Console of your container, and connects. Type in the following commands to install SSH

    apt-get update
    apt-get install ssh
    service ssh restart
    
  7. You need to create a non-root user for SSH

    adduser USERNAME
    
  8. Connect to your container (you can regard it as your own standalone computer)

    ssh USERNAME@IP -p Port  
    

Notes

  • Tensorflow GPU Compatibility

    • 1.13.0
    • 1.12.0
    • 1.11.0
    • 1.10.0
    • 1.5.0
  • If you encounter unexpected errors such as "not enough shared memory", contact the administrator. Once you get a normal user account of the workstation (not Portainer account) from the administrator, you can then ssh into the workstation and use docker command options (e.g. --shm-size). The following command provides a Tensorflow code example, you can use it check whether your environment is good.

    docker run --runtime=nvidia -it --shm-size=256m --rm tensorflow/tensorflow:1.12.0-gpu-py3    python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"
    

    Just replace the content after -c of the above command to your code.

Run Basic Programs (Not Recommended)

Discontinued! SFTP is disabled and Volumes are deleted

This tutorial will show you how to use the server.

  1. Download the tutorial folder

  2. app.py is the program as shown below. It prints out some messages, and write a string to a file named /data/tutorial.txt.

  3. requirements.txt specifies external packages your program is dependent on. Since we only use builtin time and os packages in this tutorial, this file is empty.

  4. Dockerfile specifies how to run your program.

  5. Build docker image. Under this tutorial folder, run

    docker build --tag=my_tutorial .
    

    --tag is your docker image name

  6. After executing the previous command, the docker image has been installed in you host machine already. To show your docker images, run

    docker image ls
    

    You can see my_tutorial docker image as shown below

  7. To save my_tutorial docker as an archive file so that you can upload to the server. Run

    docker save -o my_tutorial.tar my_tutorial
    

    -o specifies the output path/filename. my_tutorial is the docker name

  8. Upload to server. Login into the server, under images tag, click Import button

  9. Upload my_tutorial.tar

  10. Go to Containers tag, click Add container, fill in Name, Image, scroll down to the Volumes tag, click map additional volume, type in /data (because we save a file to /data/tutorial.txt), select your volume named FirstnameLastname (everyone is pre-allocated with one)

  11. Click Deploy the container. Your docker image is running automatically. It stops after it finish running the program.

  12. Click the Logs under Quick actions, you can see the output from print()

  13. To access /data/tutorial.txt, login in using any SFTP client you like (I'm using FileZilla in Ubuntu). Type in the IP address (same as the server, but without the port number), username (FirstnameLastname), your password, and port 22. You can find the tutorial.txt file under your Volume directory

You can’t perform that action at this time.