-
Notifications
You must be signed in to change notification settings - Fork 14
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
Move ssh agent start script to home prepare script #360
Conversation
Tested with aiidalab-launch locally and the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@unkcpz I've tested this locally and this approach does not seem to work. Because in this case the .bashrc
file already exists, it will never get appended.
Have you tested with a brand new environment (e.g. by running aiidalab-launch reset
)
I test by creating a new profile.
I think this is the expected behavior, no? The |
If you look at the earliest implement which the append is in the dockerfile aiidalab-docker-stack/stack/base/Dockerfile Lines 48 to 53 in 24787bf
|
For me the bashrc is always there, even on the first startup so in the current implementation it never get appended. Are you using bind mount or volume mount? |
The same problem of my test as #359, I forget to update the image in the profile. I'll check it again. |
I remember there is a discrepancy between the docker and deployment by using jupyterhub. The |
92b2681
to
c442257
Compare
c442257
to
6593433
Compare
# Set sshagent by source load-singlesshagent.sh script | ||
# append the command text of source to .bashrc if the script /opt/bin/load-singlesshagen.sh is present | ||
# and the command text is not already present in .bashrc | ||
if [[ -f /opt/bin/load-singlesshagent.sh ]] && ! grep -q "# Load singlesshagent on shell startup." /home/${NB_USER}/.bashrc; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use a variable here
header="# Load singlesshagent on shell startup."
Otherwise looks okay, LMK when you want me to test this again @unkcpz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀 I tested locally and it works.
fixes #357
The sshagent source command is added everytime where the notebook start. I move the append to bashrc command to the script which create the bashrc and only attach the command the first time bashrc created.