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

chore: update documentation for local setup for running cli commands #301

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jerotire
Copy link
Contributor

@jerotire jerotire commented Sep 2, 2024

Description

Added example for exetuting CLI API commands in local setup documentation.

Before submitting (or marking as "ready for review")

  • Does the pull request title follow the conventional commit specification?
  • Have you performed a self-review of the code
  • Have you have added tests that prove the fix or feature is effective and working
  • Did you make sure to update any documentation relating to this change?

Added example for exetuting CLI API commands.
@jerotire jerotire changed the title Update local-setup.md chore: update documentation for local setup for running cli commands Sep 2, 2024
Copy link
Contributor

@JoshuaLicense JoshuaLicense left a comment

Choose a reason for hiding this comment

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

Looks good, few comments!

:::

```sh
docker exec -it \
Copy link
Contributor

Choose a reason for hiding this comment

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

What about using docker compose? Then it'll let you reference the friendly names of the containers.

docker compose exec -it api /bin/sh -c "..." for example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That does mean your current directory needs to be vol-app right? Exiting solution would allow execution from anywhere; unless we prefix with a cd or something.

Copy link
Contributor

@JoshuaLicense JoshuaLicense Sep 2, 2024

Choose a reason for hiding this comment

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

Fair point, but I think documenting less flexible commands is far simpler to maintain for us. We could note that these commands need to be ran from the vol-app root directory?

While it's incredibly minor, we don't control the vol-app-api-1 naming. For example, the separator changed recently from _ to - in Docker Compose v2.

-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \
vol-app-api-1 \
/bin/sh -c "HOME=/tmp php -d memory_limit=1024M /var/www/html/vendor/bin/laminas --container=config/container-cli.php list"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need HOME, or a memory limit setting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking at it, memory setting no as default is 2GB so thats okay. As for HOME, I believe that was done on the old environments because we force to be a /tmp dir (cleaned after reboots etc...). Some commands generate content.

This was largley just a tweak of the old way we used to do it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, okay, I'd probably say it's best we remove both as it's not typical of the command we run on infrastructure. Your call.

-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \
vol-app-api-1 \
Copy link
Contributor

Choose a reason for hiding this comment

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

Remember we have a CLI container for CLI jobs. This container uses the image that's used in AWS batch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see... Okay, I'll try and get it working with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants