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

Mount bash_history to persist it among containers #635

Open
wants to merge 8 commits into
base: 1.6.x
Choose a base branch
from

Conversation

alexandrajulius
Copy link

@alexandrajulius alexandrajulius commented Nov 10, 2021

This should solve the following issue
#627

@kierenevans kierenevans linked an issue Nov 10, 2021 that may be closed by this pull request
@kierenevans kierenevans added the enhancement New feature or request label Nov 10, 2021
@kierenevans kierenevans added this to the 1.2.0 milestone Nov 10, 2021
@kierenevans
Copy link
Contributor

I realised now that with my advice from yesterday, this won't survive harness updates (ws harness update existing and ws harness update fresh).

Perhaps it should end up being stored in the project root and added to the various application/skeleton/.gitignore files?

@alexandrajulius
Copy link
Author

alexandrajulius commented Nov 11, 2021

good point, we can certainly do that on Teufel, but where should i add it (empty .bash_history + .gitignore entry) to provide it in skeletons for new projects?

@andytson-inviqa
Copy link
Contributor

Copy link
Contributor

@andytson-inviqa andytson-inviqa left a comment

Choose a reason for hiding this comment

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

still needs gitignoring

.gitignore Outdated
@@ -3,3 +3,4 @@
/tests/
/tmp-test/
.idea
.bash_history
Copy link
Contributor

@andytson-inviqa andytson-inviqa Nov 19, 2021

Choose a reason for hiding this comment

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

sorry, not that file, all the others in the skeleton directories

Copy link
Author

@alexandrajulius alexandrajulius Nov 19, 2021

Choose a reason for hiding this comment

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

Ah nice :) I see where the skeletons are. Will revert this, and add to the other gitignores

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm we'll have another problem if the file has to exist, as tho the skeleton will be there on ws create, the file wont on any other person's clones

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you're right though, just we'd need to create the file some other way

Copy link
Contributor

@andytson-inviqa andytson-inviqa Nov 19, 2021

Choose a reason for hiding this comment

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

actually it wouldn't help on the ws create either.

It'd be something like the enable.sh running touch .bash_history

Copy link
Contributor

Choose a reason for hiding this comment

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

otherwise if the file doesn't already exist, docker-compose would create a directory and bind that to the container, which isn't what we'd want

Copy link
Author

@alexandrajulius alexandrajulius Nov 19, 2021

Choose a reason for hiding this comment

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

yes, that's what docker-compose does... i can add touch .bash_history to
src/_base/harness/config/events.yml

after('harness.install'): |
  #!bash
  ws enable

but then the file does not survive a refresh/install? I think it's better than not having it tho.
Alternatively people would have to create that file manually in their project root. Which is weird i think

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest https://github.com/inviqa/harness-base-php/blob/995a60cf25b378708c812ff8b926829c39d825c8/src/_base/harness/scripts/enable.sh.twig rather than the after event itself.

The file will survive in this way, as touch only creates the file if it doesn't exist

@@ -47,6 +47,7 @@ enable_all()
initial_start

touch .my127ws/.flag-built
touch .bash_history
Copy link
Author

Choose a reason for hiding this comment

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

@andytson-inviqa is this the right place?

@kierenevans kierenevans modified the milestones: 1.2.0, 1.3.0 Dec 10, 2021
@Chemaclass
Copy link
Contributor

Hi! Any updates on this PR?

@andytson-inviqa andytson-inviqa removed this from the 1.3.0 milestone Apr 1, 2022
@kierenevans kierenevans changed the base branch from 1.2.x to 1.4.x April 21, 2022 06:27
@Chemaclass
Copy link
Contributor

@kierenevans @andytson-inviqa is there any missing work to be done in this PR? I just wonder why it was postpone that much, because it's already half a year open without any new feedback 🤔

@kierenevans
Copy link
Contributor

kierenevans commented May 6, 2022

@Chemaclass Unfortunately it's making the .bash_history as a directory via docker-compose:

➜  tmp-test git:(feature/persist-bash-history-among-containers) ls -la
total 336
drwxr-xr-x  9 kevans  1000   4096 May  6 10:04 .
drwxr-xr-x  7 kevans users   4096 May  6 10:03 ..
-rw-r--r--  1 kevans  1000    142 May  6 10:03 auth.json
drwxr-xr-x  2 root   root       6 May  6 10:03 .bash_history

I'll try to fix

@kierenevans kierenevans force-pushed the feature/persist-bash-history-among-containers branch from f113e7f to 80d5917 Compare May 6, 2022 07:14
@andytson-inviqa andytson-inviqa changed the base branch from 1.4.x to 1.5.x May 19, 2022 14:22
@kierenevans kierenevans changed the base branch from 1.5.x to 1.6.x May 16, 2023 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Persist bash history for console between containers
4 participants