Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dynamic compose for kimai #6773

Merged
merged 4 commits into from
Feb 14, 2025
Merged

Conversation

Lancelot-Enguerrand
Copy link
Collaborator

@Lancelot-Enguerrand Lancelot-Enguerrand commented Feb 14, 2025

Dynamic compose for kimai

This is a kimai update for using dynamic compose.

Situation tested :
  • 👶 Fresh install of the app
  • 💾 Update on existing data
Reaching the app :
In app tests :
  • 📝 Register and log in
  • 👔 Create project, client and activity
  • ⏱ Track an activity
  • 🔄 Check data after restart
Volumes mapping verified :
  • ${APP_DATA_DIR}/data/public:/opt/kimai/public:ro
  • ${APP_DATA_DIR}/data/public:/opt/kimai/public
  • ${APP_DATA_DIR}/data/var:/opt/kimai/var
  • ${APP_DATA_DIR}/data/mysql:/var/lib/mysql
Specific instructions verified :
  • 🌳 Environment
  • 💻 Command
  • 🩺 Healthcheck
  • 🔗 Depends on

Other change

Update to 2.19.1

Summary by CodeRabbit

  • New Features

    • Enabled dynamic configuration for enhanced flexibility.
    • Introduced an updated deployment setup with integrated health checks and service interdependencies.
  • Chores

    • Upgraded application version details and dependency specifications.
    • Updated the core service container to the latest release for improved reliability.

Copy link
Contributor

coderabbitai bot commented Feb 14, 2025

Walkthrough

This pull request updates the Kimai application configuration by adding a new dynamic configuration property and bumping several version numbers. Additionally, a new Docker Compose configuration file is introduced to define and orchestrate three services (proxy, application, and SQL database) with proper interdependencies and health checks. The existing Docker Compose YAML file is also updated to use the new image version for the Kimai service.

Changes

File Change Summary
apps/kimai/config.json Added "dynamic_config": true; updated "tipi_version" from 2 to 3; updated "version" from "fpm-2.1.0-prod" to "fpm-2.19.1-prod"; updated "updated_at".
apps/kimai/docker-compose.json New file added that defines the Docker Compose configuration with three services: kimai-proxy, kimai, and kimai-sqldb, including health checks and volume mounts.
apps/kimai/docker-compose.yml Updated the kimai service image from kimai/kimai2:fpm-2.1.0-prod to kimai/kimai2:fpm-2.19.1-prod.

Sequence Diagram(s)

sequenceDiagram
    participant DC as Docker Compose
    participant DB as Kimai SQLDB
    participant KA as Kimai App
    participant KP as Kimai Proxy
    participant C as Client

    DC->>DB: Start MySQL container
    DC->>KA: Start Kimai container (depends on DB)
    DC->>KP: Start Nginx Proxy container (depends on Kimai)
    C->>KP: Send request
    KP->>KA: Forward request
    KA->>DB: Query database
    DB-->>KA: Return data
    KA-->>KP: Return response
    KP-->>C: Deliver response
Loading

Possibly related PRs

  • Add dynamic compose for mixpost #6106: Introduces the "dynamic_config": true property in configuration files, aligning with the dynamic configuration enhancement in this PR.
  • chore: bump docmost version #6135: Updates the "tipi_version" property in configuration files, mirroring the version update in this change.
  • N8n update #5470: Modifies the versioning fields in the configuration for Kimai, similar to the updates made in this pull request.

Suggested reviewers

  • nicotsx

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
apps/kimai/config.json (1)

48-48: Updated Timestamp.
The "updated_at" value has been refreshed, which appears to correctly reflect the latest change. Ensure that this timestamp is in sync with your deployment or logging systems if required.

apps/kimai/docker-compose.json (1)

17-24: Health Check for Proxy Service.
The healthCheck section (lines 17–24) for kimai-proxy is comprehensive with proper intervals, timeouts, and a test command using wget. Verify that the wget --spider http://kimai-proxy/health || exit 1 command reliably reflects service health in all environments.

apps/kimai/docker-compose.yml (1)

58-64: Volume Mappings and Optional Mount Comments.
The volume mappings are correctly declared. Consider whether the commented-out optional mounts (e.g., LDAP configuration, certificate files) are needed; if not, cleaning them up could improve clarity.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 709dc20 and 796e191.

📒 Files selected for processing (3)
  • apps/kimai/config.json (2 hunks)
  • apps/kimai/docker-compose.json (1 hunks)
  • apps/kimai/docker-compose.yml (1 hunks)
🔇 Additional comments (10)
apps/kimai/config.json (2)

6-6: Dynamic Configuration Property Added.
The addition of "dynamic_config": true enables dynamic adjustments to the configuration, aligning well with the PR’s objective of supporting dynamic compose.


9-10: Version and Tipi Version Bumped.
Updating "tipi_version" from 2 to 3 and "version" to "fpm-2.19.1-prod" ensures consistency with the new Kimai image version. Verify that all usage of these version numbers elsewhere is updated accordingly.

apps/kimai/docker-compose.json (4)

1-10: New Dynamic Compose Configuration Introduced.
The overall structure using "$schema": "../dynamic-compose-schema.json" and the clear definitions for services like kimai-proxy is well executed. This new file lays a good foundation for dynamic service composition.


25-32: Kimai Service Definition.
The kimai service now references the updated image "kimai/kimai2:fpm-2.19.1-prod" and sets the environment variables appropriately. Ensure that the referenced environment variables (e.g., KIMAI_ADMINMAIL, KIMAI_ADMINPASS) are consistently provided during runtime.


33-42: Volume Mappings for Kimai Service.
The volume mappings for both public and variable data are correctly configured, assisting in persistent and shared data use between deployments.


43-70: SQL Database Service Configuration.
The configuration for kimai-sqldb—including environment parameters, volume mapping, command, and health check—is correctly structured. Double-check that the health check command using mysqladmin -p$$MYSQL_ROOT_PASSWORD ping -h localhost behaves as intended in your shell environment.

apps/kimai/docker-compose.yml (4)

1-4: Compose File and Versioning.
The docker-compose file starts with version "3.5" and overall standards seem to adhere to best practices. This file remains coherent with previous configurations.


6-22: Proxy Service Configuration.
The configuration for the nginx service (lines 6–22) is detailed with port mapping, volume setup, restart policies, and health checks. All these are inline with production-ready setups.


50-57: Kimai Service Update with New Image Version.
The kimai service (line 52 updated) now uses the image "kimai/kimai2:fpm-2.19.1-prod", which matches the updated configuration in config.json and the new dynamic compose file. Review that the environment variables provided (ADMINMAIL, ADMINPASS, DATABASE_URL, TRUSTED_HOSTS) are correctly interpreted in the container.


66-90: SQL Database Service Consistency.
The configuration for sqldb (lines 66–90) remains consistent and robust—using MySQL 5.7 with clear environment variables, volume mapping, command definition, and a health check. The use of double dollar signs in mysqladmin -p$$MYSQL_ROOT_PASSWORD is a common approach in docker-compose files, but verify that it expands as expected.

@Lancelot-Enguerrand Lancelot-Enguerrand merged commit 38c948a into master Feb 14, 2025
12 checks passed
@Lancelot-Enguerrand Lancelot-Enguerrand deleted the dynamic-compose/kimai branch February 14, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant