> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trainy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Git SSH Key Upload

> Example task yamls for cloud storage

## Prerequisites

#### Config.yaml (`~/.konduktor/config.yaml`)

```
allowed_clouds:
  - {s3, gs}
```

#### Setup

1. Set up a GitHub SSH key <a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account" target="_blank">
   here</a>.
2. For this example, the generated private key will be in `test_ssh_key`
3. Set up cloud storage credentials
4. Check cloud storage setup with:

```
$ konduktor check {gs, s3}
```

For more details, check out the setup of cloud storage <a href="/setup#optional-setup-cloud-storage-credentials" target="_blank">
here</a>.

#### Current Working Directory

```
$ ls
task.yaml   test_ssh_key
$ cat test_ssh_key
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAaAAAABNlY2RzYS
1zaGEyLW5pc3RwMjU2AAAACG5pc3RwMjU2AAAAQQR9WZPeBSvixkhjQOh9yCXXlEx5CN9M
yh94CJJ1rigf8693gc90HmahIR5oMGHwlqMoS7kKrRw+4KpxqsF7LGvxAAAAqJZtgRuWbY
EbAAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBH1Zk94FK+LGSGNA
6H3IJdeUTHkI30zKH3gIknWuKB/zr3eBz3QeZqEhHmgwYfCWoyhLuQqtHD7gqnGqwXssa/
EAAAAgBzKpRmMyXZ4jnSt3ARz0ul6R79AXAr5gQqDAmoFeEKwAAAAOYWpAYm93aWUubG9j
YWwBAg==
-----END OPENSSH PRIVATE KEY-----
```

#### Launching

```
$ konduktor launch task.yaml
```

## Task.yaml

```
name: private-repo-ssh

resources:
  cpus: 1
  memory: 1
  image_id: ubuntu
  labels:
    kueue.x-k8s.io/queue-name: user-queue
    maxRunDurationSeconds: "600"

file_mounts:
  # `file_mount` keys are 
  # <remote_path>: <local_path>
  ~/.ssh/test-ssh-key: test_ssh_key

run: |
  apt-get update && apt-get install -y git openssh-client

  if [[ -f ~/.ssh/test-ssh-key && -s ~/.ssh/test-ssh-key ]]; then
    echo "SSH key mounted and non-empty"
  else
    echo "SSH key missing or empty"
    exit 1
  fi

  chmod 600 ~/.ssh/test-ssh-key
  echo -e "Host github.com\n\tIdentityFile ~/.ssh/test-ssh-key\n\tStrictHostKeyChecking no\n" > ~/.ssh/config

  git clone git@github.com:<user-name>/<app-name>.git
```
