{"id":22408513,"url":"https://github.com/geertvangeest/aws-docker-gpu","last_synced_at":"2025-08-17T07:07:58.113Z","repository":{"id":47706079,"uuid":"397207845","full_name":"GeertvanGeest/AWS-docker-gpu","owner":"GeertvanGeest","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-13T15:26:01.000Z","size":101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T01:48:47.777Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GeertvanGeest.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-17T10:22:03.000Z","updated_at":"2022-01-13T15:26:04.000Z","dependencies_parsed_at":"2022-09-16T09:41:12.949Z","dependency_job_id":null,"html_url":"https://github.com/GeertvanGeest/AWS-docker-gpu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GeertvanGeest/AWS-docker-gpu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeertvanGeest%2FAWS-docker-gpu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeertvanGeest%2FAWS-docker-gpu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeertvanGeest%2FAWS-docker-gpu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeertvanGeest%2FAWS-docker-gpu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeertvanGeest","download_url":"https://codeload.github.com/GeertvanGeest/AWS-docker-gpu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeertvanGeest%2FAWS-docker-gpu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270817175,"owners_count":24650945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-05T11:17:58.682Z","updated_at":"2025-08-17T07:07:58.078Z","avatar_url":"https://github.com/GeertvanGeest.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS-docker\n\nScripts to employ multiple docker containers simultaneously for teaching. \n\nThis is a fork of [github.com/GeertvanGeest/AWS-docker](github.com/GeertvanGeest/AWS-docker) which enables running containers with a gpu. \n\n## Preparation\n\nUse an AWS deep learning AMI, e.g. [AWS Deep Learning Base AMI](https://aws.amazon.com/marketplace/pp/prodview-dxk3xpeg6znhm?sr=0-1\u0026ref_=beagle\u0026applicationId=AWSMPContessa). These AMI directly support gpu integration.\n\nClone this repository to the AWS instance:\n\n```sh\ngit clone https://github.com/GeertvanGeest/AWS-docker-gpu.git\n```\n\n## Generate credentials\n\nNote that one GPU is assigned to each container. So the number of users should not be more than the number of available GPU!\n\nYou can generate credentials from a tab-delimited list of users, with four columns: first name, last name, e-mail, instance IP. Here's an example:\n\n```\nJan\tde Wandelaar\tjan.wandel@somedomain.com\t18.192.64.150\nPiet\tKopstoot\tp.kopstoot@anotherdomain.ch\t18.192.64.150\nJoop\tZoetemelk\tjoop.zoet@lekkerfietsen.nl\t18.192.64.150\n```\n\nRun the script `generate_credentials.sh` like this (use `-l` to specify the user list):\n\n```sh\n./generate_credentials \\\n-l examples/user_list_credentials.txt \\\n-o ./credentials\n-p 9001\n```\n\nThe option `-o` specifies an output directory in which the following files are created:\n\n* `input_docker_start.txt`: A file that serves as input to deploy the docker containers on the server\n* `user_info.txt`: A file with user names, passwords and links that can be used to communicate credentials to the participants\n\nThe option `-p` is used to generate an individual port for each user. Ports will be assigned in an increasing number from `-p` to each user. So, in the example above, the first user gets port 9001, the second 9002, the third 9003, etc. **Be aware that port 7000 and 8000 are reserved for the admin containers!**\n\n## Deploying containers\n\nUse the script `./generate_credentials.sh` to generate a list of ports, usernames and passwords (or generate it manually otherwise). It should look like this:\n\n```\n9001\tjdewandelaar\tOZDRqwMRmkjKzM48v+I=\n9002\tpkopstoot\tYTnSh6SmhsVUe+aC2HY=\n9003\tjzoetemelk\tLadwVbiYY4rH0S5TjeI=\n```\n\nOnce deployed, the jupyter notebook or rstudio server will be available through `[HOST IP]:[PORT]`. If you want to have both rstudio server and jupyter notebook running on the same instance, you can generate two tab-delimited files (on for rstudio and one for jupyter) and give them the same passwords for convenience. **Note that each container uses a single port, so the files should contain different ports!**\n\n### Deploy containers based on tensorflow jupyter notebook\n\nPrepare an image that you want to use for the course. This image should be based on a tensorflow jupyter notebook container, e.g. [tensorflow/tensorflow:latest-gpu-jupyter](https://hub.docker.com/r/tensorflow/tensorflow/tags?page=1\u0026ordering=last_updated), and should be available from `dockerhub`. More info [here](https://www.tensorflow.org/install/docker).\n\nRun the script `run_jupyter_notebooks`:\n\n```sh\nrun_jupyter_notebooks \\\n-i jupyter/base-notebook \\\n-u examples/credentials_jupyter/input_docker_start.txt \\\n-p test1234\n```\n\nHere, `-i` is the image tag, `-u` is the user list as generated by `./generate_credentials.sh`, and `-p` is the password for the admin container.\nNo username is required to log on to a jupyter notebook.\n\nTo access the admin container, go to `[HOST IP]:8000`.\n\nNote that each container gets one GPU assigned. So the number of users should not be more than the number of available GPU!\n\n### Deploy containers based on Rstudio server\n\nPrepare an image that you want to use for the course. This image should be based on a rocker ml image, e.g. [rocker/ml](https://hub.docker.com/r/rocker/ml), and should be available from `dockerhub`.\n\nRun the script `run_rstudio_server`:\n\n```sh\nrun_rstudio_server \\\n-i rocker/rstudio \\\n-u examples/credentials_rstudio/input_docker_start.txt \\\n-p test1234\n```\n\nSee above for the meaning of the options.\n\nThe username to log on to rstudio server is `rstudio`.\n\nTo access the admin container, go to `[HOST IP]:7000`\n\n## Restricting resource usage\n\nTo prevent overcommitment of the server, it can be convenient to restrict resource usage per participant. You can do that with the options `-c` and `-m`, which are passed to the arguments `--cpus` and `--memory` of `docker run`. Use it like this:\n\n```sh\nrun_rstudio_server \\\n-i rocker/rstudio \\\n-u examples/credentials_rstudio/input_docker_start.txt \\\n-p test1234 \\\n-c 2 \\\n-m 4g\n```\n\nResulting in a hard limit of 2 cpu and 4 Gb of memory for each user. By default these are 2 cpu and 16 Gb of memory. These restrictions are not applied to the admin container.\n\n## Container \u0026 volume infrastructure\n\nBelow you can find an example of the container infrastructure. Blue squares are containers, yellow are volumes. Arrows indicate accessibility. The data volume is meant to harbour read-only data (e.g. raw data). The group volume is meant as a shared directory, where everybody can read and write.\n\n![container infrastructure](infrastructure.png)\n\n## How to use admin privileges\n\nThe admin container (i.e. with sudo rights) is available from port 8000 for the jupyter containers and 7000 for the rstudio containers. The regular users at the ports specified in the tab-delimited text file.\n\nYou can check out a user volume with `mount_user_volume.sh`:\n\n```sh\n./mount_user_volume.sh user01\n```\n\nThis will create an ubuntu container directly accessing the home directory of user01. As an alternative to this ubuntu container, you can mount the user volume to any other container.\n\n## Stopping services\n\nYou can stop all services (containers and volumes) with the script `stop_services.sh`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeertvangeest%2Faws-docker-gpu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeertvangeest%2Faws-docker-gpu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeertvangeest%2Faws-docker-gpu/lists"}