Using Git Repositories For Code

This topic provides instructions to configure your Git repository as the source of code to run dis.co jobs from.

Prerequisites

Before you can add your git repository to dis.co there are a couple steps you will need.

Generating an ssh key and adding it to your repository.

Using the SSH protocol, you can connect and authenticate to remote servers and services. With SSH keys, you can connect to GitHub without supplying your username or password at each visit. You can use either an ssh key or a deploy key. A deploy key is an SSH key that grants access to a single repository. It can also be set as a readonly access key to the repository. You can can use github's excellent guide on how to generate and add your ssh key to github: https://help.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh And you can use the next links to read further about deploy keys: https://developer.github.com/v3/guides/managing-deploy-keys/#deploy-keys https://bitbucket.org/blog/deployment-keys Later you will need to add your private key to dis.co's configuration.

Setting a Git repository

  • In the Dis.co Jobs view, click your profile avatar, then choose Settings:

dis.co jobs window
  • Click the Repositories tab.

  • Click Add Repository.

Repositories settings
  • Provide details of your repository to allow Dis.co to access it.

Add repository
  • Type in the Git URL (in SSH format, for example, git@github.com:Iqoqo/job-example-git.git). You can find the ssh format of the repository on the repository main page under the button "Clone or download", you may need to press the "use ssh" button and copy the URL.

  • Type in a display name.

  • Type or paste in your private SSH key, beginning -----BEGIN RSA PRIVATE KEY-----. If you don't know what is ssh key please consult with the prerequisites section of this document. If you already have an ssh key, please copy the content of the private ssh key file. SSH files come in pairs, private and public. The file for the public key has a pub suffix, the private has no suffix.

  • Click Add.

Your Git repository is finally added to the list of repositories. You can press the 3 dots button (...) on the right of the table to open more options such as:

  • Edit repository display name.

  • Enable/Disable repository.

Using the repository to run a job from the UI

You can run a script from your pre-configured Git repository.

  1. In the Jobs page, click New job.

    The New job form is displayed.

  2. In the Script section, at the bottom choose a repository.

  3. Add the path to the script you want to run from your repository.

  4. At the top of the form, type in the job name and choose the cloud and job size.

  5. (Optionally) Add data files and constant files.

  6. Click Create job.

mceclip8.png