Home

Awesome

HolyLabRegistry

This registry allows you to use packages from HolyLab in Julia 0.7/1.x.

Usage

If you're using at least Julia 1.1, then you can add this registry with

]registry add git@github.com:HolyLab/HolyLabRegistry.git

(The ] enters Pkg mode when you type it at the REPL prompt, see https://docs.julialang.org/en/v1/stdlib/Pkg/.)

For earlier Julia versions, manually git clone this repository under DEPOT_PATH/registries. (Usually, DEPOT_PATH = /home/username/.julia)

Then, we can use lab private packages (or unregistered public ones) as if they are registered ones.

To use git protocol in GitHub

This instruction is for Linux users and comes from https://help.github.com/articles/connecting-to-github-with-ssh/. For windows users, you can get some information at https://gist.github.com/bsara/5c4d90db3016814a3d2fe38d314f9c23

  1. Specific preparation for Windows

    • Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.

    • Create the following files if they do not already exist (paths begin from the root of your user home folder):

      .ssh/config<br> .bash_profile<br> .bashrc<br>

  2. Create a New SSH Key

    1.1 Generating a new SSH key at a local machine.

    • Open git bash and paste text below, substituting in your GitHub email address.
    $ ssh-keygen -t ecdsa -b 521 -C "your_email@example.com"
    

    Note: Around September 1, 2021, GitHub has added new security requirements for newly added RSA keys. Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

    <!-- Note: It might have error when you install package from Holylab repository after you finished all steps, the error is "ERROR: failed to fetch from git@github.com". If you face this problem, it might be helpful to replace the command above by --> <!-- ``` $ ssh-keygen -m PEM rsa -b 4096 -C "your_email@example.com" ``` -->
    • When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
    Enter a file in which to save the key (/home/you/.ssh/id_ecdsa): [Press enter]
    
    • At the prompt, type a secure passphrase if you want.
    Enter passphrase (empty for no passphrase): [Type a passphrase]
    Enter same passphrase again: [Type passphrase again]
    

    1.2 Adding your SSH key to the ssh-agent

    • Start the ssh-agent in the background.
    $ eval "$(ssh-agent -s)"
    Agent pid 59566
    
    • Add your SSH private key to the ssh-agent
    $ ssh-add ~/.ssh/id_ecdsa
    
  3. Setup SSH Authentication for Git Bash on Windows (Safe to skip for Linux)

    2.1 Configure SSH for Git Hosting Server

    • Add the following text to .ssh/config (.ssh should be found in the root of your user home folder):
    Host github.com<br>
    Hostname github.com<br>
    IdentityFile ~/.ssh/id_ecdsa
    

    2.2 Enable SSH Agent Startup Whenever Git Bash is Started

    • First, ensure that following lines are added to .bash_profile, which should be found in your root user home folder:
    test -f ~/.profile && . ~/.profile
    test -f ~/.bashrc && . ~/.bashrc
    
    • Now, add the following text to .bashrc, which should be found in your root user home folder:
    # Start SSH Agent
    #----------------------------
    
    SSH_ENV="$HOME/.ssh/environment"
    
    function run_ssh_env {
      . "${SSH_ENV}" > /dev/null
    }
    
    function start_ssh_agent {
      echo "Initializing new SSH agent..."
      ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
      echo "succeeded"
      chmod 600 "${SSH_ENV}"
    
      run_ssh_env;
    
      ssh-add ~/.ssh/id_ecdsa;
    }
    
    if [ -f "${SSH_ENV}" ]; then
      run_ssh_env;
      ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
        start_ssh_agent;
      }
    else
      start_ssh_agent;
    fi
    
  4. Adding a new SSH key to your GitHub account

    • Copies the contents of the id_ecdsa.pub file in the local machine to your clipboard
    • Go to GitHub site
    • In the upper-right corner of any page, click your profile photo, then click Settings.
    • In the user settings sidebar, click SSH and GPG keys.
    • Click New SSH key or Add SSH key.
    • In the "Title" field, add a descriptive label for the new key.
    • Paste your copied public key into the "Key" field
    • Click Add SSH key.

For package developers

Preparing your package before registering it

Creating the directory and Project.toml file

You have two options:

Adding dependent packages

Registering your package with HolyLabRegistry

Using LocalRegistry

Check out a local copy of https://github.com/GunnarFarneback/LocalRegistry.jl. Then:

using LocalRegistry, SomeNewPkg
register(SomeNewPkg, "/home/tim/.julia/registries/HolyLabRegistry")

where you replace the specific package name and path to the appropriate value on your system. This will add a new commit to the branch of HolyLabRegistry you just created

$ git checkout master
$ git pull
$ git branch -D teh/SomeNewPkg

Manual approach (not recommended)

Accessing HolyLabRegistry in travis and appveyor tests

This is required only if your package uses other private packages.

Tagging a new release

In the package directory

In HolyLabRegistry

Using LocalRegistry

Just repeat the steps above for the initial registration, except that you don't have to specify the registry.

Manual approach (not recommended)

In the package's directory, update Versions.toml and, if necessary, Compat.toml and Deps.toml. Use the sha from the git cat-file command above.

Making a HolyLab package public on Github

See also