I built my own image for using Git storage with ss...
# prefect-server
l
I built my own image for using Git storage with ssh by doing what the docs said
Copy code
FROM prefecthq/prefect:latest
RUN apt update && apt install -y openssh-client
However now I get this every run
Failed to load and execute Flow's environment: HangupException('Host key verification failed.\r')
I created a known_hosts file by adding this to the Dockerfile but it didn't help.
Copy code
RUN mkdir ~/.ssh && ssh-keyscan -t rsa <http://github.com|github.com> >> ~/.ssh/known_hosts
Any thoughts?
👀 1
a
according to the docs: SSH keys should be mounted to the /root/.ssh directory. It looks like you’re mounting them to the working directory, which I think by default in Prefect images is /opt/prefect/
@Lon Nix but since you’re using Kubernets and Helm chart, this makes sense in your use case: https://docs.prefect.io/orchestration/flow_config/storage.html#kubernetes-agent-mounting-ssh-keys-as-kubernetes-secrets
l
that is what we're doing
👍 1
we still get that error though, so there's either something wrong with the keys we're loading or something else about the job's ssh setup
a
yeah, some clients require SSH keys to be in a specific format. I’m no SSH expert, but you could look around what type of key is required by the openssh-client package
l
you and me both 🙂
a
it’s hard to test it for me because I don’t use SSH, nor Server, but perhaps you can test the entire set up from scratch this way: • (optional) generate a key https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent • (optional) adding this key to Github or other Git server you use • run your prefect image interactively (this image must be based on PrefectHQ image + the openssh client):
Copy code
docker run -it your_image bash
• manually clone the repo from the interactive terminal in the container: git clone <ssh repo url> to see if this works
l
that's what I was going to try but the image doesn't have
git
on it. I have one other thing to test before installing git and going down that path. Thanks
👍 1