Skip to content

Conversation

@Yaminyam
Copy link
Member

@Yaminyam Yaminyam commented Sep 17, 2025

Introduces backend.ai-manager.Dockerfile to build and run the Backend.AI Manager service, including wheel installation, directory setup, and port exposure. Adds entrypoint.sh to handle keypair generation, directory creation, and service startup.

resolve #5823 (BA-2328)

docker run -d \
  --name backend-ai-manager \
  --add-host host.docker.internal:host-gateway \
  -p 8091:8091 \
  -v $(pwd)/fixtures:/app/fixtures:ro \
  -v $(pwd)/manager.toml:/etc/backend.ai/manager.toml:ro \
  -v $(pwd)/logs:/var/log/backend.ai \
  -v /tmp/backend.ai/ipc:/tmp/backend.ai/ipc \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e PYTHONUNBUFFERED=1 \
  --restart unless-stopped \
  backend.ai/manager:25.14.3

Checklist: (if applicable)

  • Milestone metadata specifying the target backport version
  • Mention to the original issue

Introduces backend.ai-manager.Dockerfile to build and run the Backend.AI Manager service, including wheel installation, directory setup, and port exposure. Adds entrypoint.sh to handle keypair generation, directory creation, and service startup.
Copilot AI review requested due to automatic review settings September 17, 2025 03:58
@github-actions github-actions bot added the size:M 30~100 LoC label Sep 17, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Introduces Docker containerization support for the Backend.AI Manager service by adding a Dockerfile and entrypoint script to enable deployment as a containerized service.

  • Adds multi-stage Docker build configuration for the Backend.AI Manager
  • Implements entrypoint script for RPC keypair generation and directory setup
  • Exposes port 8091 and sets up necessary volume mount points

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
backend.ai-manager.Dockerfile Multi-stage Docker build with wheel installation and service configuration
entrypoint.sh Bash script for container initialization, keypair generation, and service startup

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

FROM python:${PYTHON_VERSION}
COPY --from=builder /wheels /wheels
RUN mkdir -p /root/.ssh
RUN apt-get update && apt-get install -y vim && rm -rf /var/lib/apt/lists/*
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

Installing vim in a production container image adds unnecessary bloat. Consider removing this package unless it's specifically required for debugging purposes in production environments.

Suggested change
RUN apt-get update && apt-get install -y vim && rm -rf /var/lib/apt/lists/*
# Removed vim installation to reduce image bloat

Copilot uses AI. Check for mistakes.
# fixtures directory creation (default path structure)
mkdir -p /app/fixtures/manager

# RPC keypair not found. Generating...
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

The comment on line 9 is misleading as it states 'RPC keypair not found' before the actual check. This comment should either be removed or moved inside the if block where the keypair is actually determined to be missing.

Suggested change
# RPC keypair not found. Generating...

Copilot uses AI. Check for mistakes.
@Yaminyam Yaminyam marked this pull request as draft September 17, 2025 03:59
@HyeockJinKim HyeockJinKim self-requested a review September 18, 2025 04:14
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the purpose of this script?

Copy link
Member Author

Choose a reason for hiding this comment

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

If the RPC key doesn't exist, you'll need to create it. The execution part has become complicated, so I separated it into an sh file.

Comment on lines +1 to +5
ARG PYTHON_VERSION
FROM python:${PYTHON_VERSION} AS builder
ARG PKGVER
COPY dist /dist
RUN pip wheel --wheel-dir=/wheels --no-cache-dir backend.ai-manager==${PKGVER} --find-links=/dist
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems like we need to do the wheel build inside the dockerfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create manager’s Dockerfile

3 participants