Skip to content

Conversation

@jcabrero
Copy link
Member

@jcabrero jcabrero commented Jun 26, 2025

This PR fixes a bug where nilAI may not mount the directory where the config is overwritten on the host when dealing with pre-compiled images. This adds a mountpoint to the default docker-compose to ensure that the latest configs are present. It also adds a /dev/sev-guest mountpoint to the attestation endpoint.

@jcabrero jcabrero requested a review from Copilot June 26, 2025 13:37
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

This PR ensures the host config directory and the AMD SEV device are mounted into the NilAI API containers so that pre-compiled images pick up the latest configuration and can access /dev/sev-guest.

  • Adds a bind-mount for the local src/nilai_api/config/ directory into the API service
  • Repeats the same config mount for the second API replica
  • Adds /dev/sev-guest into the production compose file

Reviewed Changes

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

File Description
docker-compose.yml Mount host config folder into both API service definitions and add SEV device
docker-compose.prod.yml Mount /dev/sev-guest for AMD SEV support in production
Comments suppressed due to low confidence (3)

docker-compose.yml:131

  • Using a relative path for the host config directory can break if docker-compose is run from another working directory. Consider using an absolute path (e.g., ${PWD}/nilai-api/src/nilai_api/config) to ensure the correct directory is always mounted.
      - ./nilai-api/src/nilai_api/config/:/app/nilai-api/src/nilai_api/config/

docker-compose.yml:131

  • The container path mixes hyphens and underscores (/app/nilai-api/src/nilai_api/config/), which may not match the actual filesystem layout. Verify the target path matches the app’s directory structure to avoid missing configs at runtime.
      - ./nilai-api/src/nilai_api/config/:/app/nilai-api/src/nilai_api/config/

docker-compose.yml:131

  • [nitpick] The /dev/sev-guest volume is duplicated across multiple service definitions. Consider extracting this into a shared named volume or using YAML anchors to DRY up the configuration.
      - ./nilai-api/src/nilai_api/config/:/app/nilai-api/src/nilai_api/config/

@jcabrero jcabrero marked this pull request as ready for review June 26, 2025 14:07
@jcabrero jcabrero merged commit 7ca0405 into main Jun 26, 2025
5 checks passed
@jcabrero jcabrero deleted the fix/specific_config_mountpoint branch July 1, 2025 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants