Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Git
.git
.gitignore
.github

# Python
__pycache__
*.pyc
*.pyo
*.pyd
.Python
*.so
*.egg
*.egg-info
dist
build
.venv
venv
env

# IDEs
.vscode
.idea
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

# Documentation
*.md
!README.md

# Docker
Dockerfile
.dockerignore

# Others
.env
.env.*
*.log
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Docker Image

on:
push:
branches: [ main, feat/* ]
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow triggers on branches matching 'feat/', but GitHub Actions branch patterns use 'feat/**' for wildcard matching of all branches under feat/. The single asterisk pattern 'feat/' will only match branches like 'feat/x' but not 'feat/x/y'.

Suggested change
branches: [ main, feat/* ]
branches: [ main, feat/** ]

Copilot uses AI. Check for mistakes.
pull_request:
branches: [ main ]

jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
run: |
docker build --platform linux/amd64 \
-f dockerfiles/Dockerfile \
-t memu-server .

- name: Test image
if: github.event_name == 'push'
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'Test image' step only runs on push events, but it would be valuable to test the image on pull_request events as well to catch issues before merging. Consider removing or adjusting this condition to ensure image functionality is validated in PRs.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow expects the OPENAI_API_KEY secret to be available but doesn't handle the case where it might be missing. Consider adding a conditional check or using a continue-on-error flag to prevent the workflow from failing when the secret is not configured in forks or other repositories.

Suggested change
if: github.event_name == 'push'
if: github.event_name == 'push' && secrets.OPENAI_API_KEY != ''

Copilot uses AI. Check for mistakes.
run: |
docker run -d -p 8005:8000 \
-e OPENAI_API_KEY="${{ secrets.OPENAI_API_KEY }}" \
--name test memu-server
sleep 5
curl -f http://localhost:8005 || exit 1
Comment on lines +30 to +31
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test step exposes port 8005 on the host but the container runs on port 8000, then curls localhost:8005. However, there's no health check or retry logic. The 5-second sleep may not be sufficient for the application to fully start up, especially if it needs to initialize the MemoryService or download models. Consider adding a retry loop with a timeout or using a proper health check endpoint.

Suggested change
sleep 5
curl -f http://localhost:8005 || exit 1
timeout=60
start_time=$(date +%s)
until curl -fsS http://localhost:8005 >/dev/null 2>&1; do
current_time=$(date +%s)
elapsed=$((current_time - start_time))
if [ "$elapsed" -ge "$timeout" ]; then
echo "Service did not become ready within ${timeout}s"
docker logs test || true
docker stop test || true
exit 1
fi
echo "Waiting for service to be ready... (${elapsed}s elapsed)"
sleep 5
done
curl -f http://localhost:8005

Copilot uses AI. Check for mistakes.
docker logs test
docker stop test
Comment on lines +24 to +33
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test step only runs on push events (line 25), which means pull requests won't be tested. This creates a gap in CI coverage where pull request changes won't be validated before merging. Consider removing or adjusting this condition to ensure tests run for both push and pull_request events.

Copilot uses AI. Check for mistakes.

build-linux-arm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up QEMU for multi-architecture
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image for ARM64
run: |
docker buildx build --platform linux/arm64 \
-f dockerfiles/Dockerfile \
-t memu-server:arm64 \
--load \
.
Comment on lines +35 to +52
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ARM64 build job does not include any test step to verify the built image, unlike the AMD64 build job. Consider adding a similar test step for the ARM64 image to ensure cross-platform compatibility and catch architecture-specific issues.

Copilot uses AI. Check for mistakes.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ readme = "README.md"
requires-python = ">=3.14"
dependencies = [
"fastapi[standard]>=0.122.0",
"gunicorn>=23.0.0",
"memu-py==0.6.0",
]

Expand Down
23 changes: 23 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.