monocle icon indicating copy to clipboard operation
monocle copied to clipboard

[spec] Provide a monoclectl script to manage a deployment

Open TristanCacqueray opened this issue 4 years ago • 1 comments

12. Deployment of monocle services

  • Date: 2021-08-09

Context and Problem Statement

There are two strategies to deploy the Monocle services:

  • docker-compose (and soon kubectl apply), or,
  • shell scripts to start the service on the local host.

We would like to use a single strategy to provide a consistent experience between local dev and production deployment.

Considered Options

  • Nix
  • Containers

Decision Outcome

Chosen option: "Containers", because it comes out best (see below).

Positive Consequences

  • We simplify the deployment and contributor story.
  • We improve the developer experience by offering a production like environment.

To achieve that we provide a monoclectl command to manage the service, for example using podman, compose or kubernete. The command feature three functions:

  • deploy to start the service using the existing images.
  • develop to start the service using the local source and development images.
  • build to build the images.

Negative Consequences

  • Increased disk space requirement.

Pros and Cons of the Options

Nix

  • Bad, because it is not readily available.

Containers

  • Bad, because it needs lot of diskspace.
  • Good, because it is the target environment.

TristanCacqueray avatar Aug 09 '21 22:08 TristanCacqueray

To realize this spec, I suggest these 2 stories:

  • [ ] Minimal monoclectl devel working with kind to validate hot-reload.
  • [ ] monoclectl build to replace docker-compose build.
  • [ ] monoclectl compose deploy to replace docker-compose.yml.img.

Then assuming this is working as expected, we can finish the migration:

  • [ ] Use monoclectl in the CI.
  • [ ] Publish the compose/kubernetes configuration with the release.
  • [ ] Remove the Dockerfiles and compose/kubernetes configuration from the repo.

TristanCacqueray avatar Aug 18 '21 21:08 TristanCacqueray