Skip to content

Create a new Docker image with package contents for Docker Compose integration #1164

@junhaoliao

Description

@junhaoliao

Request

We currently build a clp-execution-base-ubuntu-jammy Docker image that only includes the dependencies required to run CLP components. The actual CLP package contents (binaries, Python packages, configuration files, etc.) are mapped into the container at runtime by the start_clp.py script. This approach is inconvenient as we plan to migrate to Docker Compose for starting package components.

The current workflow requires the start_clp.py script to:

  1. Create Docker mount options for the package directories
  2. Map the package contents into containers at runtime
  3. Handle various configuration files and environment variables

This approach is not compatible with Docker Compose which expects all necessary files to be present in the container image.

We need to create a new Docker image that includes all the CLP package contents directly in the image, allowing us to use Docker Compose without requiring the start_clp.py script to map package contents at runtime.

Possible implementation

  1. Create a new Dockerfile:

    • Create a new Dockerfile at tools/docker-images/
    • Use a new container name clp-execution-package-ubuntu-jammy to avoid compatibility issues with clp-execution-base-ubuntu-jammy
    • Duplicate the base image setup from clp-execution-base-ubuntu-jammy instead of using clp-execution-base-ubuntu-jammy as a base
    • Copy the built CLP package contents directly into the image during build time
    • Set appropriate ownership and permissions for the copied files
  2. Add a new Taskfile task:

    • Add a new task in taskfile.yaml to build this new Docker image
    • The task should depend on the package task to ensure the package is built first
    • Name the task something like docker-image-package-ubuntu-jammy
  3. Integration approach:

    • The new image should contain all necessary files in the expected locations:
      • Binaries in /opt/clp/bin
      • Python packages in /opt/clp/lib/python3/site-packages
      • Configuration files in /opt/clp/etc
      • Web UI files in /opt/clp/var/www/webui
      • Other necessary directories and files
    • Environment variables should be pre-configured or easily configurable via Docker Compose
    • The image should be self-contained and able to run CLP components without external volume mounts for package contents
  4. Build process modifications:

    • The new Dockerfile should reference the built package from build/clp-package
    • The build task should properly tag the image for use with Docker Compose
    • Consider adding build arguments for customization if needed
  5. CI/CD workflow updates:

    • Create a new GitHub Actions workflow similar to clp-execution-image-build.yaml
    • The workflow should automatically build and publish the new image when changes are made to its Dockerfile or related files
    • Use path filtering to trigger builds only when relevant files change
    • Follow the same pattern as the existing workflow for consistency
  6. Migration path:

    • The new image should maintain backward compatibility with existing configurations where possible
    • Documentation should be updated to reflect the new approach
    • The start_clp.py script will be modified in a later phase to support both approaches during transition

When implementing this feature, we should carefully review how the current package build process works in taskfile.yaml and ensure the Docker image build integrates seamlessly with it. The new image should be built after the package is built, and should include all the contents that are currently mapped at runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions