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

Closes issue #153 #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You will need [Docker ^18.06](https://docs.docker.com/install/) to make it work.

## Installation

Everything you need to use benchmark kit is is [hpbenchkit.sh](phpbenchkit.sh).
Everything you need to use benchmark kit is is [phpbenchkit.sh](phpbenchkit.sh).

Install it as global bin and give it execute mode:
```bash
Expand Down
1 change: 1 addition & 0 deletions phpbenchkit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ function startContainer() {

docker exec -it $CONTAINER_NAME /bin/bash -c "echo NGINX_PORT=$nginxPort > $BENCHMARK_KIT_PATH/.env.local"
docker exec -it $CONTAINER_NAME /bin/bash -c "echo HOST_SOURCE_CODE_PATH=$hostSourceCodePath >> $BENCHMARK_KIT_PATH/.env.local"
docker exec -it $CONTAINER_NAME /bin/bash -c "chown -R phpbenchmarks:phpbenchmarks /var/www/benchmark"
Copy link
Author

Choose a reason for hiding this comment

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

I think this approach is about temporary fix.

If fixing permission issue persistently, it should modify docker/Dockerfile.

But I think it's not a great idea because it should release new Docker image version on Docker hub.

Copy link
Member

Choose a reason for hiding this comment

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

Releasing a new version on Duckerhub is not a problem, for now 4.0.0 is in BETA and could be modified if needed.

I'm not sure this is a good idea, because changing permissions on host could be dangerous: if path to source code is / because of a bug or something else, permissions for ALL files on your hosts are modified.

I'm thinking about a warning to tell the user to change permissions manually, with an example, but no doing it automatically.

Copy link
Author

@peter279k peter279k Sep 2, 2020

Choose a reason for hiding this comment

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

We can use Bash if syntax to check the permission and print warning message on this script and remind developers should use this command to change permission by themselves.

Do you have any suggested changes about above my suggestions?

Copy link
Member

Choose a reason for hiding this comment

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

maybe we can try to do the thing, and on error, show the warning? it's easiest and will always work as intendend.

Copy link
Author

Choose a reason for hiding this comment

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

Could you have the suggested changes?


containerStarted=true
}
Expand Down