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

test: bump up emqx_builder to add zsh to erlang container #13055

Closed
wants to merge 1 commit into from

Conversation

zhongwencool
Copy link
Contributor

@zhongwencool zhongwencool commented May 16, 2024

Fixes

No need to test, this just adds zsh to the development erlang docker image for convenient development and debugging.

emqx/emqx-builder#111

Release version: v/e5.8.0

Summary

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

  • Added tests for the changes
  • Added property-based tests for code which performs user input validation
  • Changed lines covered in coverage report
  • Change log has been added to changes/(ce|ee)/(feat|perf|fix|breaking)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • Created PR to emqx-docs if documentation update is required, or link to a follow-up jira ticket
  • Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • If changed package build workflow, pass this action (manual trigger)
  • Change log has been added to changes/ dir for user-facing artifacts update

@zhongwencool zhongwencool requested review from Rory-Z and a team as code owners May 16, 2024 03:05
@@ -316,7 +319,7 @@ set +e
if [ "$STOP" = 'yes' ]; then
$DC down --remove-orphans
elif [ "$ATTACH" = 'yes' ]; then
docker exec -it "$ERLANG_CONTAINER" bash
docker exec -it -u root "$ERLANG_CONTAINER" zsh
Copy link
Contributor Author

@zhongwencool zhongwencool May 16, 2024

Choose a reason for hiding this comment

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

emqx-builder installs zsh using root. Add .zshrc in /root/.zshrc .Some docker-compose.yaml start erlang by the emqx user, which makes zsh unavailable.So if we start with attach, we use root directly.

Copy link
Member

Choose a reason for hiding this comment

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

maybe can add /home/emqx/.zshrc ?
but why do we need zsh ?

Copy link
Contributor

@thalesmg thalesmg May 16, 2024

Choose a reason for hiding this comment

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

I think it's best to not run the shell as root, specially when developing, because it'll create lots of root-owned files in the host file system that then require root to modify/delete, which is very annoying.

@Rory-Z 's idea sounds good, or perhaps there's a way to run zsh with the normal user?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/emqx/emqx/blob/master/.ci/docker-compose-file/docker-compose.yaml#L24
We already mount /emqx to emqx dev home.
Q1: How to add .zshrc and .oh-my-zsh to this dir.
Q2: Sometime we use root to run, if we add .zshrc to emqx user not root, how to enable zsh when use root user ?
https://github.com/emqx/emqx/blob/master/.ci/docker-compose-file/docker-compose.yaml#L31

Copy link
Contributor Author

@zhongwencool zhongwencool May 17, 2024

Choose a reason for hiding this comment

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

but why do we need zsh ?

This builder image is only used for development and running CI tests. It will not be released to users. So adding zsh(oh-my-zsh) is to improve the development experience.

Copy link
Member

Choose a reason for hiding this comment

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

If just improve the development experience, maybe we can add .zshrc by ourself, because just install zsh is not enought, must have a good zshrc to have a good experience.

Other: There may be some differences between zsh and bash in subtle places. Please force our scripts to use bash.

@zhongwencool zhongwencool deleted the bump-emqx-builder branch June 17, 2024 06:15
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.

3 participants