|
1 | 1 | ## Docker Tips |
2 | 2 |
|
3 | | -Some things you might find useful while using this setup: |
| 3 | +This section includes some useful tips on running the HPC Toolset Tutorial. |
4 | 4 |
|
5 | | -### Docker Documentation |
6 | | - |
7 | | -https://docs.docker.com |
8 | | - |
9 | | -### Install & Start Docker |
10 | | - |
11 | | -https://docs.docker.com/engine/install/ |
12 | | - |
13 | | -**NOTE: You'll need to make sure the account you're running docker with is in the 'docker' group** |
| 5 | +### Starting/Stopping the HPC Toolset Tutorial |
14 | 6 |
|
15 | | -### Install Docker Compose |
16 | | - |
17 | | -https://docs.docker.com/compose/install/ |
18 | | - |
19 | | -### Verify working Docker |
| 7 | +If you have not already done so, clone this repo: |
20 | 8 |
|
21 | 9 | ``` |
22 | | -docker info |
| 10 | +$ git clone https://github.com/ubccr/hpc-toolset-tutorial.git |
| 11 | +$ cd hpc-toolset-tutorial |
23 | 12 | ``` |
24 | 13 |
|
25 | | -**This should display your system info along with Docker-specific info. If there are any errors, stop/start Docker** |
| 14 | +Ensure you have pulled all the latest changes. This is very important as lots |
| 15 | +has changed from previous years: |
26 | 16 |
|
27 | | -### Error when starting up tutorial containers |
| 17 | +``` |
| 18 | +$ git pull |
| 19 | +``` |
28 | 20 |
|
29 | | -If you get this error when starting the tutorial |
| 21 | +This step is optional, only run this if you've previosly run our tutorial and |
| 22 | +need to remove any old containers, volumes, and images. You can also run this |
| 23 | +if you need to start completely fresh. NOTE: this will delete all the hpcts |
| 24 | +container images and you will need to re-download them: |
30 | 25 |
|
31 | 26 | ``` |
32 | | -ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running? |
| 27 | +$ ./hpcts cleanup |
| 28 | +``` |
33 | 29 |
|
34 | | -or |
| 30 | +Pull down and start the most recent container images: |
35 | 31 |
|
36 | | -ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? |
| 32 | +``` |
| 33 | +$ ./hpcts start |
37 | 34 | ``` |
38 | 35 |
|
39 | | -Try stopping and starting Docker (restart doesn't usually fix the problem). Commands for this differ depending on operating system. |
| 36 | +### If something goes wrong... |
40 | 37 |
|
41 | | -If the error persists, try: |
| 38 | +First, thing to try is stopping the containers, removing the volumes and re-starting: |
42 | 39 |
|
43 | 40 | ``` |
44 | | -export DOCKER_HOST=127.0.0.1 |
| 41 | +$ ./hpcts destroy |
| 42 | +$ ./hpcts start |
45 | 43 | ``` |
46 | 44 |
|
47 | | -NOTE: this is only necessary on some systems so don't use it if the previous command works |
| 45 | +### Docker Documentation |
48 | 46 |
|
49 | | -**Sometimes restarting your operating system is the only solution.** |
| 47 | +- [Docker](https://docs.docker.com) |
| 48 | +- [Install & Start Docker](https://docs.docker.com/engine/install/) |
| 49 | +- [Install Docker Compose](https://docs.docker.com/compose/install/) |
| 50 | +- [Linux](https://docs.docker.com/engine/install/linux-postinstall/) |
| 51 | +- [MacOS Docker Desktop](https://docs.docker.com/docker-for-mac/troubleshoot/) |
| 52 | +- [Windows Docker Desktop](https://docs.docker.com/docker-for-windows/troubleshoot/) |
50 | 53 |
|
51 | | -### Windows Errors |
| 54 | +### Helpful Docker commands |
52 | 55 |
|
53 | | -NOTE: Windows users should get several pop-up messages from Docker Desktop during this process asking to allow local system access to the Docker containers. Please click the "Share it" button: |
54 | | - |
| 56 | +``` |
| 57 | +# Start all HPC Toolset Containers manually |
| 58 | +$ docker-compose up -d |
55 | 59 |
|
56 | | -If you have notifications blocked, you may not see these pop-ups and the authorization will eventually time out. If this happens, you will get this type of error message: |
| 60 | +# Display Tutorial Container Logs |
| 61 | +$ docker-compose logs -f |
| 62 | +$ docker-compose logs -f coldfront |
| 63 | +$ docker-compose logs -f xdmod |
57 | 64 |
|
58 | | -``` |
59 | | -Error response from daemon: user declined directory sharing C:\Users\path_to_my_folder |
60 | | -``` |
61 | | -Open Docker Desktop, navigate to Settings - Resources, and click on File Sharing. Then add the directory where you've cloned the HPC Toolset Tutorial and click "Apply & Restart" |
| 65 | +# Stop containers |
| 66 | +$ docker-compose stop |
62 | 67 |
|
63 | | -Re-run: |
64 | | -``` |
65 | | -./hpcts start |
66 | | -``` |
| 68 | +# Stop containers and remove them |
| 69 | +$ docker-compose down |
67 | 70 |
|
68 | | -If this doesn't work, please run: |
69 | | -``` |
70 | | -./hpcts cleanup |
71 | | -./hpcts start |
72 | | -``` |
| 71 | +# Stop containers,remove them and all volumes |
| 72 | +$ docker-compose down -v |
73 | 73 |
|
| 74 | +# Display Docker processes |
| 75 | +$ docker ps -a |
74 | 76 |
|
75 | | -### Docker Troubleshooting |
| 77 | +# Display Docker containers |
| 78 | +$ docker container list |
76 | 79 |
|
77 | | -Linux: https://docs.docker.com/engine/install/linux-postinstall/ |
78 | | -MacOS - Docker Desktop: https://docs.docker.com/docker-for-mac/troubleshoot/ |
79 | | -Windows - Docker Desktop: https://docs.docker.com/docker-for-windows/troubleshoot/ |
| 80 | +# Display Docker images |
| 81 | +$ docker image list |
80 | 82 |
|
81 | | -### Display Docker processes |
| 83 | +# Display Docker volumes |
| 84 | +$ docker volume list |
82 | 85 |
|
83 | | -``` |
84 | | -docker ps -a |
| 86 | +# Finding IP address of container |
| 87 | +$ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' coldfront |
| 88 | +172.27.0.10 |
85 | 89 | ``` |
86 | 90 |
|
87 | | -### Display Tutorial Container Logs |
| 91 | +### Troubleshooting |
88 | 92 |
|
89 | | -``` |
90 | | -docker-compose logs -f |
91 | | -``` |
| 93 | +General troubleshooting tips to try: |
| 94 | + |
| 95 | +#### Error when starting up tutorial containers |
92 | 96 |
|
93 | | -### Display Docker containers |
| 97 | +If you get this error when starting the tutorial: |
94 | 98 |
|
95 | 99 | ``` |
96 | | -docker container list |
| 100 | +ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? |
97 | 101 | ``` |
98 | 102 |
|
99 | | -### Display Docker images |
| 103 | +Try stopping and starting Docker (restart doesn't usually fix the problem). |
| 104 | +Commands for this differ depending on operating system. |
| 105 | + |
| 106 | +If the error persists, try: |
100 | 107 |
|
101 | 108 | ``` |
102 | | -docker image list |
| 109 | +export DOCKER_HOST=127.0.0.1 |
103 | 110 | ``` |
104 | 111 |
|
105 | | -### Display Docker volumes |
| 112 | +NOTE: this is only necessary on some systems so don't use it if the previous command works |
106 | 113 |
|
107 | | -``` |
108 | | -docker volume list |
109 | | -``` |
| 114 | +**Sometimes restarting your operating system is the only solution.** |
110 | 115 |
|
111 | | -### Shutting down the tutorial containers |
| 116 | +#### Windows Errors |
112 | 117 |
|
113 | | -**NOTE: This is the preferred method to stop/start or tear down the tutorial setup as the containers rely on each other and stopping, starting or deleting them individually usually has unintended side effects** |
| 118 | +NOTE: Windows users should get several pop-up messages from Docker Desktop during this process asking to allow local system access to the Docker containers. Please click the "Share it" button: |
| 119 | + |
114 | 120 |
|
115 | | -To tear down all containers and remove the volumes: |
| 121 | +If you have notifications blocked, you may not see these pop-ups and the authorization will eventually time out. If this happens, you will get this type of error message: |
116 | 122 |
|
117 | 123 | ``` |
118 | | -./hpcts destroy |
| 124 | +Error response from daemon: user declined directory sharing C:\Users\path_to_my_folder |
119 | 125 | ``` |
| 126 | +Open Docker Desktop, navigate to Settings - Resources, and click on File Sharing. Then add the directory where you've cloned the HPC Toolset Tutorial and click "Apply & Restart" |
120 | 127 |
|
121 | | -To tear down all containers, remove volumes, and remove the container images (next time you run start they will be re-downloaded): |
122 | | - |
| 128 | +Re-run: |
123 | 129 | ``` |
124 | | -./hpcts cleanup |
| 130 | +./hpcts start |
125 | 131 | ``` |
126 | 132 |
|
127 | | -### Starting everything up again |
128 | | - |
| 133 | +If this doesn't work, please run: |
129 | 134 | ``` |
130 | | -./hpcts start |
| 135 | +./hpcts cleanup |
| 136 | +./hpcts start |
131 | 137 | ``` |
132 | 138 |
|
133 | | -### Deleting Docker containers/images/volumes manually |
| 139 | +#### Deleting Docker containers/images/volumes manually |
134 | 140 |
|
135 | | -If you really want to clean up images and start fresh: |
| 141 | +If you want to manually clean up images: |
136 | 142 |
|
137 | 143 | ``` |
138 | | -docker image list |
139 | | -docker image rm XX (XX=image id) |
140 | | -docker container list |
141 | | -docker container rm XX (XX=container id) |
142 | | -docker volume list |
143 | | -docker volume rm XX (XX=volume id) |
| 144 | +$ docker image list |
| 145 | +$ docker image rm XX (XX=image id) |
| 146 | +$ docker container list |
| 147 | +$ docker container rm XX (XX=container id) |
| 148 | +$ docker volume list |
| 149 | +$ docker volume rm XX (XX=volume id) |
144 | 150 | ``` |
145 | 151 |
|
146 | | -If you're getting an error about volumes in use but there is nothing running, stop docker, manually delete the files, and start docker again. These commands are different depending on the operating system so we recommend using your favorite search provider to locate instructions for this. |
147 | | - |
148 | | - |
149 | | -### Finding IP address of container |
| 152 | +If you're getting an error about volumes in use but there is nothing running, |
| 153 | +stop docker, manually delete the files, and start docker again. These commands |
| 154 | +are different depending on the operating system so we recommend using your |
| 155 | +favorite search provider to locate instructions for this. |
150 | 156 |
|
151 | | -``` |
152 | | -$ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' coldfront |
153 | | -172.27.0.10 |
154 | | -``` |
155 | 157 | [Back to Start](../README.md) |
0 commit comments