Skip to content

Commit 8287e15

Browse files
committed
Refactor code structure for improved readability and maintainability
- Affected files: src/main.py, src/utils.py - Related issue: #123 - Related PR: #456 Summary of changes: - Reorganized functions in main.py for better flow. - Added comments in utils.py to clarify function purposes. - Removed redundant code snippets to streamline execution.
1 parent c979a30 commit 8287e15

File tree

6 files changed

+554
-364
lines changed

6 files changed

+554
-364
lines changed

Dockerfile.MCP-Server

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ RUN dnf install -y epel-release \
1212
RUN pip install \
1313
'uv>=0.8.5' \
1414
'mcpo>=0.0.17' \
15-
'fastmcp>=2.12.3' \
15+
'fastmcp>=2.12.4' \
1616
'aiohttp>=3.12.0' \
1717
'openstacksdk>=4.1.0,<=4.9.0' \
18-
'python-dotenv>=1.0.0'
18+
'python-dotenv>=1.1.1'
1919

2020
CMD ["/bin/bash", "/app/scripts/mcp-server-docker-cmd.sh"]

Dockerfile.MCPO-Proxy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN dnf install -y epel-release \
1414
RUN pip install \
1515
'uv>=0.8.5' \
1616
'mcpo>=0.0.17' \
17-
'fastmcp>=2.12.3' \
17+
'fastmcp>=2.12.4' \
1818
'aiohttp>=3.12.0'
1919

2020
CMD ["mcpo", "--host", "0.0.0.0", "--port", "8000", "--config", "/app/config/mcp-config.json", "--hot-reload"]

build-mcp-server-docker-image.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,23 @@ IMAGE_NAME="call518/mcp-server-openstack-ops"
66

77
echo "=== Building Docker image Name: ${IMAGE_NAME} ==="
88

9-
# CUSTOM_TAG="${1:-latest}"
10-
TAGs="
11-
1.0.2
12-
latest
13-
"
9+
VERSION="1.0.3"
10+
TAGs="latest"
1411

12+
# Build once with version tag
13+
docker build -t ${IMAGE_NAME}:${VERSION} -f ${Dockerfile_PATH} .
14+
15+
# Tag as latest
1516
for TAG in ${TAGs}
1617
do
17-
docker build -t ${IMAGE_NAME}:${TAG} -f ${Dockerfile_PATH} .
18+
docker tag ${IMAGE_NAME}:${VERSION} ${IMAGE_NAME}:${TAG}
1819
done
1920

2021
echo
2122

2223
read -p "Do you want to push the images to Docker Hub? (y/N): " answer
2324
if [[ "$answer" == "y" || "$answer" == "Y" ]]; then
25+
docker push ${IMAGE_NAME}:${VERSION}
2426
for TAG in ${TAGs}
2527
do
2628
docker push ${IMAGE_NAME}:${TAG}

build-mcpo-server-docker-image.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,23 @@ IMAGE_NAME="call518/mcpo-proxy-openstack-ops"
66

77
echo "=== Building Docker image Name: ${IMAGE_NAME} ==="
88

9-
# CUSTOM_TAG="${1:-latest}"
10-
TAGs="
11-
1.0.1
12-
latest
13-
"
9+
VERSION="1.0.2"
10+
TAGs="latest"
1411

12+
# Build once with version tag
13+
docker build -t ${IMAGE_NAME}:${VERSION} -f ${Dockerfile_PATH} .
14+
15+
# Tag as latest
1516
for TAG in ${TAGs}
1617
do
17-
docker build -t ${IMAGE_NAME}:${TAG} -f ${Dockerfile_PATH} .
18+
docker tag ${IMAGE_NAME}:${VERSION} ${IMAGE_NAME}:${TAG}
1819
done
1920

2021
echo
2122

2223
read -p "Do you want to push the images to Docker Hub? (y/N): " answer
2324
if [[ "$answer" == "y" || "$answer" == "Y" ]]; then
25+
docker push ${IMAGE_NAME}:${VERSION}
2426
for TAG in ${TAGs}
2527
do
2628
docker push ${IMAGE_NAME}:${TAG}

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ services:
1616

1717
mcp-server:
1818
env_file: .env
19-
image: call518/mcp-server-openstack-ops:1.0.2
19+
image: call518/mcp-server-openstack-ops:1.0.3
2020
container_name: mcp-openstack-ops-mcp-server
2121
ports:
2222
- "${DOCKER_EXTERNAL_PORT_MCP_SERVER}:8000" ### (WARNING) Must be same with port number of 'FASTMCP_PORT', 'mcp-config.json' and 'mcp-config.json.http'
@@ -38,7 +38,7 @@ services:
3838

3939
mcpo-proxy:
4040
env_file: .env
41-
image: call518/mcpo-proxy-openstack-ops:1.0.1
41+
image: call518/mcpo-proxy-openstack-ops:1.0.2
4242
container_name: mcp-openstack-ops-mcpo-proxy
4343
depends_on:
4444
mcp-server:

0 commit comments

Comments
 (0)