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

"Update" button for simpler upgrades of TruBudget versions #1863

Closed
jzakotnik opened this issue Jun 5, 2024 Discussed in #1754 · 1 comment · Fixed by #1951
Closed

"Update" button for simpler upgrades of TruBudget versions #1863

jzakotnik opened this issue Jun 5, 2024 Discussed in #1754 · 1 comment · Fixed by #1951
Assignees
Labels
feature Indicates a new feature implementation low Label for nice to have features which are low prio

Comments

@jzakotnik
Copy link
Contributor

Discussed in #1754

Originally posted by jzakotnik March 27, 2024
One pain point from the pilots is that the upgrading is a somewhat complex process and no "update" Button exists in TruBudget. What would be the options and architecture how this could be done?

@jzakotnik jzakotnik added the feature Indicates a new feature implementation label Jun 5, 2024
@georgimld georgimld added this to the Trubudget 2.12.0 milestone Jun 5, 2024
@galethil galethil self-assigned this Jun 6, 2024
@galethil
Copy link
Collaborator

galethil commented Jun 6, 2024

Hi @jzakotnik I believe that in order to accomplish this we will need to introduce new piece of infrastructure on the level of server where docker is running.

Here's a high-level description of the solution:

High-Level Steps to Enable an "Upgrade" Button for Docker Infrastructure

  1. Host-Level Script:

    • Create a shell script (upgrade.sh) on the host machine that:
      • Updates the environment variable with the new Docker image tag.
      • Pulls the new Docker images.
      • Restarts the services using Docker Compose.
  2. Host-Level API Service:

    • Set up a lightweight API server on the host machine using Node.js and Express.
    • This server will expose an endpoint to trigger the upgrade.sh script.
  3. Backend Service:

    • Modify your backend service (running in a container) to send HTTP requests to the host-level API.
    • This backend service will handle requests from the frontend to initiate the upgrade process.
  4. Frontend Integration:

    • Add an "Upgrade" button to your frontend.
    • This button will send a request to the backend service with the desired new version tag.
  5. Secure Communication:

    • Ensure secure communication between the backend service and the host-level API to prevent unauthorized access.

Workflow

  1. User Interaction:

    • A user clicks the "Upgrade" button on the frontend and enters the desired version tag.
  2. Frontend Request:

    • The frontend sends the version tag to the backend service.
  3. Backend Processing:

    • The backend service forwards the version tag to the host-level API.
  4. Host-Level Execution:

    • The host-level API triggers the upgrade.sh script to update the environment variables, pull the new images, and restart the services using Docker Compose.

By following these high-level steps, you can set up your infrastructure to support an "Upgrade" button on the frontend, allowing seamless upgrades of your Docker-based application.

graph TD;
    A[Frontend] -->|1. Click 'Upgrade' Button| B[Backend Service];
    B -->|2. Send Version Tag| C[Host-Level API];
    C -->|3. Trigger upgrade.sh| D[upgrade.sh Script];
    D -->|4. Update .env and Pull New Images| E[Docker Compose];
    E -->|5. Restart Services| F[Docker Services];

    style A fill:#f9f,stroke:#333,stroke-width:4px;
    style B fill:#bbf,stroke:#333,stroke-width:4px;
    style C fill:#f96,stroke:#333,stroke-width:4px;
    style D fill:#ff9,stroke:#333,stroke-width:4px;
    style E fill:#96f,stroke:#333,stroke-width:4px;
    style F fill:#6f9,stroke:#333,stroke-width:4px;
Loading

@jzakotnik jzakotnik added the low Label for nice to have features which are low prio label Jul 11, 2024
@galethil galethil removed their assignment Jul 24, 2024
@galethil galethil self-assigned this Aug 6, 2024
@galethil galethil mentioned this issue Aug 22, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Indicates a new feature implementation low Label for nice to have features which are low prio
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants