Skip to content

Commit aab50f9

Browse files
authored
Merge pull request #4 from dneary/readme-update-pr
Update README with Docker and firewall setup instructions
2 parents 8a360d0 + 79f7986 commit aab50f9

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ The **Ampere Optimized AI Playground** is a Gradio-based interface that allows u
1919
To set up Docker and Docker Compose, run the following commands in a terminal:
2020

2121
```bash
22-
# Update package index
22+
# Update package index and base image
2323
sudo apt-get update
24+
sudo apt-get upgrade -y
2425

2526
# Install prerequisites
2627
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
@@ -40,6 +41,7 @@ sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-
4041
sudo chmod +x /usr/local/bin/docker-compose
4142

4243
# Add user to Docker group to run Docker without sudo
44+
# The Docker group should be created when installing the docker-ce package, but if it is not, also run "sudo groupadd docker"
4345
sudo usermod -aG docker $USER
4446
newgrp docker
4547
```
@@ -60,7 +62,10 @@ cd ai-playground
6062
```
6163

6264
### 3. Open Firewall Ports
63-
The playground and demos use ports 7860 (Gradio UI), 7861 (Ollama), 7862 (YOLOv11), and 7863 (Whisper). Open these ports using ```firewall-cmd```:
65+
The playground and demos use ports 7860 (Gradio UI), 7861 (Ollama), 7862 (YOLOv11), and 7863 (Whisper).
66+
In addition, we need to be able to download models from the Internet to the ollama service, which will
67+
require us to NAT traffic from the container bridge network to the host's Ethernet interface.
68+
We accomplish these tasks by using ```firewall-cmd```:
6469

6570
```bash
6671
# Ensure firewalld is installed
@@ -70,15 +75,25 @@ sudo apt-get install -y firewalld
7075
sudo systemctl start firewalld
7176
sudo systemctl enable firewalld
7277

78+
# Find your Ethernet interface name
79+
ip a
80+
81+
# We are looking for the Ethernet device for the host - in recent Linux distributions, these are commonly
82+
# ethX, or begin with en (usually enp or ens)
83+
#
84+
# Add the Ethernet interface to the public Firewall zone, and enable IP masquerading
85+
sudo firewall-cmd --zone=public --add-interface=<YOUR_ETHERNET_DEVICE_NAME> --permanent
86+
sudo firewall-cmd --zone=public --add-masquerade --permanent
87+
7388
# Open ports 7860-7863
7489
sudo firewall-cmd --permanent --add-port=7860-7863/tcp
7590
sudo firewall-cmd --reload
7691
```
7792

78-
Verify the ports are open:
93+
Verify the ports are open, that the Ethernet device is allowed to relay traffic, and that IP Masquerade is set:
7994

8095
```bash
81-
sudo firewall-cmd --list-ports
96+
sudo firewall-cmd --list-all
8297
```
8398
### 4. Port Forwarding for Local and Cloud Instances
8499
For **local instances**, access the playground and demos using ```localhost```. For **cloud instances**, use the public IP address of the instance. Ensure ports 7860-7863 are open in your cloud provider's security group or firewall settings.

0 commit comments

Comments
 (0)