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

1506 WIP: First draft of write heavy volumes documentation. #1519

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

JDDoesDev
Copy link
Member

@JDDoesDev JDDoesDev commented Jul 16, 2021

This is a first draft of the documentation for write heavy volumes documentation as mentioned in #1506 for initial feedback.

DO NOT MERGE

Preview link: https://deploy-preview-1519--docs-docksal-io.netlify.app/use-cases/write-heavy-volumes/

@JDDoesDev JDDoesDev added 🏷documentation do not merge A work in progress PR that should not be merged. labels Jul 16, 2021
@JDDoesDev JDDoesDev requested a review from lmakarov July 16, 2021 02:55
@shelane
Copy link
Member

shelane commented Jul 16, 2021

Is the container name available as a variable? In case someone might want to create a custom command to handle the syncing. I wouldn't want to have to look that rsync command and path up every time if it were me.

Copy link
Member

@lmakarov lmakarov left a comment

Choose a reason for hiding this comment

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

Some minor edits and a new feature request (#1524) =)

@@ -0,0 +1,93 @@
---
title: "Increasing Performance by Keeping Write-heavy Volumes Inside Containers"
Copy link
Member

Choose a reason for hiding this comment

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

Titles have to be short to fit on a single line (ideally) in the sidebar.

Suggested change
title: "Increasing Performance by Keeping Write-heavy Volumes Inside Containers"
title: "Write-heavy Volumes"

need to rely on mounts to the host to read or write data.

The process of keeping write-heavy volumes inside containers involves mounting certain folders as volumes within the CLI container and
interacting with the data directly through the container. For example, in a Composer-based Drupal project, the `/vendor` folder is usually pretty large
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
interacting with the data directly through the container. For example, in a Composer-based Drupal project, the `/vendor` folder is usually pretty large
interacting with the data directly through the container filesystem. For example, in a Composer-based Drupal project, the `vendor` folder is usually pretty large

and mounted at the defined locations within your container.

Because these volumes are only accessible within the container, any commands that interact with them _MUST_ be run within the container. For example,
if you normally run `composer install` outside of the container and rely on the bind mount to link the host data to the container data, you will need
Copy link
Member

Choose a reason for hiding this comment

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

Note: Running composer install directly on the host is not a good practice. I can see why users would be doing so, but it should be highly discouraged.

Assuming that your `cli` container is named `drupal9`, the command to sync the `vendor` folder from container to host without deleting files would be:

```
rsync -e 'docker exec -i' -avP drupal9_cli_1:/var/www/vendor ./vendor
Copy link
Member

Choose a reason for hiding this comment

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

Yes! This should be a built-in command in fin (#1524)

@JDDoesDev
Copy link
Member Author

@shelane and @lmakarov I have written a custom command, but I didn't use a variable name. I'd imagine that you could add the container name as an environment variable and pass that to the command itself.

Here is a gist of what I have as a custom command https://gist.github.com/JDDoesDev/8049b64619530cce8469e22cd4ae837f and I am going to be including a link to it in the docs.

@lmakarov lmakarov added this to In progress in 1.17.0 Aug 4, 2021
@lmakarov lmakarov removed this from In progress in 1.17.0 Mar 1, 2022
@lmakarov lmakarov added this to In progress in 1.19.0 via automation Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge A work in progress PR that should not be merged. 🏷documentation
Projects
1.19.0
In progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants