-
Notifications
You must be signed in to change notification settings - Fork 22
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
Remote SSH issue with Docker on Push: module 'pygit2.credentials' has no attribute 'GIT_CREDTYPE_SSH_KEY' #301
Comments
BTW, verified, there is a bug in the newest version of the code in git.py
Even though I am past this, I still need guidance on how to properly install id_rsa in docker container to get quitstore to work properly...thanks in advance!! we want to use the quit store in our semantic model curation product, so this is a big deal for us. |
Are you up to having the key inside the container or are you using an auth agent? Have you tried mounting your ssh agent path into the container and set the SSH_AGENT_SOCK in the container accordingly? |
Yes, am actually moving key into container in Dockerfile. No, I haven’t tackled the second point and third points (good tip!) Actually, given our need (to call QuitStore endpoints (including push, etc) from a microservice with managing changes to ontologies), I would really like to have the repo in the container rather than on the host. We plan to host QuitStore as a service rather than the more ‘personal’ scenario it’s current configuration is designed for. Thinking repo ‘inside’ would eliminate the need for volume mapping/binding, reduce the complexity and increase flexibility of uses of the container? Is this something you have tried? Any suggestions on how to configure for this scenario (besides git provisioning commands in Dockerfile)? Thinking outside the box, could dockering the binary/executable be an option to support our need? BTW, I really enjoyed your paper on this subject. I had planned on building something similar for our product and it was great someone else saw the value of such a capability and brought it to life! @white-gecko, any thoughts on this? |
I've been working with @MartyStache on this issue and have discovered a bug related to defining the SSH_AUTH_SOCK in the dockerfile causing unreachable code in git.py. Have a look at the conditional branch that handles whether the pygit2.KeypairFromAgent function or the pygit2.Keypair function is used: Lines 819 to 840 in 79dca06
See the delcaration of the SSH_AUTH_SOCK environment variable in the Dockerfile code below: Line 68 in 79dca06
I believe this environment variable definition should be left to the user that is running the docker container depending on the ssh authentication method they choose. Because SSH_AUTH_SOCK is defined in the container, the else statement that handles Keypair auth method is unreachable unless the environment variable is unset on container startup. What is your preference on how new contributors create a pull request with a proposed solution? |
Hi! I am very interested in using the QuitStore!!
I have a git repository on a remote where I need to use id_rsa/ssh authentication and attemptign to perform a push and receive an attribute error:
AttributeError: module 'pygit2.credentials' has no attribute 'GIT_CREDTYPE_SSH_KEY'
Not sure if this is a bug. I am assuming this is operator error where I am not configuring things properly for the container, and could use some help! I also figure there are others who have the same scenario and could benefit from a detailed explanation.
What has to be configured in order to get the ssh key to be recognized?
I have placed the following in the Dockerfile (and doing build before run) :
-- in builder section
USER root
RUN mkdir /root/.ssh/
RUN echo /Users/username/.ssh/id_rsa > /root/.ssh/id_rsa
-- in deploy section
QUIT_SSH_KEY_HOME=/root/.ssh
Command used to start the container:
docker run -d --name quitstore-esm -p 8080:8080 -v /path/to/repo:/data aksw/quitstore
The text was updated successfully, but these errors were encountered: