feat: added app to fill a pvc in 1GB increments #24

Closed
wjro wants to merge 9 commits from php-fill-volume into master
Owner

WIP: This takes roughly 35 seconds to add 1GB to the db, which I am not sure is fast enough. I tried a bunch of other methods to speed it up, for example:

  • larger data chunks in 8mb and 16mb -> took about double the time,
  • create a file 1Gb file to pass to the container and have the app add that to the db -> then crashed because of the 16mb limit of mysql
  • a couple other things which either which crashed with a php error or crashed the app
WIP: This takes roughly 35 seconds to add 1GB to the db, which I am not sure is fast enough. I tried a bunch of other methods to speed it up, for example: - larger data chunks in 8mb and 16mb -> took about double the time, - create a file 1Gb file to pass to the container and have the app add that to the db -> then crashed because of the 16mb limit of mysql - a couple other things which either which crashed with a php error or crashed the app
wjro added 1 commit 2025-04-29 19:58:13 +00:00
johnride requested changes 2025-04-29 20:08:31 +00:00
@ -3,0 +33,4 @@
// Disk usage (PVC mount path)
$mountPath = '/var/lib/mysql'; // Change this if PVC is mounted elsewhere
$freeBytes = disk_free_space($mountPath);
Owner

Mariadb / mysql is not in the same container as the PHP process. You'll have to query mariadb stats or something else.

Mariadb / mysql is not in the same container as the PHP process. You'll have to query mariadb stats or something else.
wjro added 5 commits 2025-05-01 20:24:05 +00:00
Co-authored-by: tahahawa <tahahawa@gmail.com>
Reviewed-on: https://git.nationtech.io/NationTech/harmony/pulls/23
- Adds a `deploy_database` function to the `LAMPInterpret` struct to deploy a MariaDB database using Helm.
- Integrates `HelmCommand` trait requirement to the `LAMPInterpret` struct.
- Introduces `HelmChartScore` to manage MariaDB deployment.
- Adds namespace configuration for helm deployments.
- Updates trait bounds for `LAMPInterpret` to include `HelmCommand`.
- Implements `get_namespace` function to retrieve the namespace.
- Added functionality to tag and push the built Docker image to a specified registry.
- Modified deployment score to use the full image tag (including registry and project).
- Included error handling and logging for the `docker tag` and `docker push` commands.
- Updated the `K8sDeploymentScore` struct to include a namespace field and environment variables for database credentials.
- Added kebab-case conversion for deployment name and namespace.
- Implemented a check_output function for better error reporting.
wjro added 1 commit 2025-05-02 14:13:05 +00:00
wjro added 1 commit 2025-05-02 14:50:53 +00:00
wjro added 1 commit 2025-05-02 14:59:54 +00:00
johnride requested changes 2025-05-02 15:01:31 +00:00
johnride left a comment
Owner

I think the p-r should be recreated to make sure to have a clean diff.

For now there is only 1 comment for sure : the db_size must move and have a sensible default.

I think the p-r should be recreated to make sure to have a clean diff. For now there is only 1 comment for sure : the db_size must move and have a sensible default.
@ -17,3 +26,4 @@
project_root: "./php".into(),
..Default::default()
},
db_size: "2Gi".to_string(),
Owner

This belongs in the LAMPConfig struct and should use the default option. I think 2G is a sensible default for now.

This belongs in the LAMPConfig struct and should use the default option. I think 2G is a sensible default for now.
@ -40,3 +53,4 @@
fn create_interpret(&self) -> Box<dyn Interpret<T>> {
Box::new(LAMPInterpret {
score: self.clone(),
namespace: "harmony-lamp".to_string(),
Owner

use the score namespace.

But there seems to be something wrong with this p-r. There should not be so many changes.

use the score namespace. But there seems to be something wrong with this p-r. There should not be so many changes.
wjro closed this pull request 2025-05-02 15:43:13 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: NationTech/harmony#24
No description provided.