KEDEHub Starter

How to install KEDEHub on your laptop in 10 minutes

Overview

Welcome to an exclusive exploration of KEDEHub!

  1. KEDEHub Starter is free to use for:

    • Small teams with less than 10 active monthly contributors
    • Open Source projects

    If your organization has several small teams then each one of them is alowed to use KEDEHub starter for free.

  2. Duration

    Your journey with KEDEhub is unlimited in duration - hopefully forever!

  3. Feedback & Support

    Your feedback drives our innovation. Share your experience, queries, or challenges anytime during the trial. Our dedicated support team is here to help. Contact us at support@kedehub.com.

Your insights and satisfaction are paramount to us. Dive in, explore, and let's improve your organization together with KEDEHub.

How to install KEDEHUb locally

Prerequisites: Docker Desktop and git. Make sure you have allocated enough resources for Docker. We recommend to allocate at least 4 CPUs, 4GB of RAM and 10GB of disk space. Windows, Linux and MacOS are supported. For Windows, you need WSL2.

Pull KEDEHUb Image

KEDEHub image is hosted on Amazon Elastic Container Registry (ECR) and it is set to be public. You can pull and use the image without needing to authenticate.

  1. Image location.

                                            
    public.ecr.aws/kedehub/kedehub-localhost-image
                                            
                                        

  2. Pull the Image:

    You can pull the image using the docker pull command:

                                            
    docker pull public.ecr.aws/kedehub/kedehub-localhost-image && docker tag public.ecr.aws/kedehub/kedehub-localhost-image kedehub-localhost-image
                                            
                                        

  3. Ensure the Image: is there

    You can list the current images and check if kedehub-localhost-image is there.

                                            
    docker images
                                            
                                        

Run the image

After pulling the image, you can run a container based on the image, by following the below steps:

  1. Create a Docker Volume: Before running the container, create a Docker volume. This volume will store your data, ensuring it persists even if the container is stopped or deleted.

                                            
    docker volume create kedehubdata
                                            
                                        

  2. Ensure the volume: is created

    You can list the current Volumes and check if kedehubdata is there.

                                            
    docker volume ls
                                            
                                        

  3. Run KEDEHub Container: Start the container.

                                            
    docker run --name kedehub-localhost-container -p 8080:80 -p 5400:5400 -v kedehubdata:/var/lib/postgresql/data -d kedehub-localhost-image
                                            
                                        

    When you create a new container and attach the same volume, the data will be available to the new container. With this setup, all the data will be stored in the kedehubdata volume. Even if you stop or remove the container, the data will remain in the volume.

    Check if the container is running:

                                            
    docker container ls -a
                                            
                                        

    You should see something like:

                                            
    CONTAINER ID   IMAGE                     COMMAND                  CREATED          STATUS          PORTS                                                                                        NAMES
    a7d5e3bf41a0   kedehub-localhost-image   "/usr/local/bin/star…"   32 seconds ago   Up 30 seconds   0.0.0.0:5400->5400/tcp, :::5400->5400/tcp, 5432/tcp, 0.0.0.0:8080->80/tcp, :::8080->80/tcp   kedehub-localhost-container
                                            
                                        

  4. Test using the below command if the KEDEHub instance is up and runing:

                                            
    curl -X 'GET' 'http://localhost:8080/api/public/projects/count' -H 'accept: application/json'
    
                                            
                                        

    If everything is OK it should return:

                                            
    {"count": 0}    
                                            
                                        

    See the KEDEHUb Web site

                                            
    http://localhost:8080/  
                                            
                                        

  5. Create a new company
                                        
    http://localhost:8080/signup_company/#/ 
                                        
                                    

    The designated admin user will receive an invitation email on the email address provided during the company creation. Ensure that the company is created by clicking the link in the email.

Analyze Git repositories

KEDEGit is a Python application responsible for:

  1. Analyzing local Git repositories
  2. Sending commands to the KEDEHub

Analysis is performed on local clones of Git repositories, ensuring:

  • Your source code and commit messages remain secure on your premises, with no transfer to KEDEHub
  • No capture of your intellectual property through source code analysis
  • No analysis of commit messages

The client application KEDEGit is an open-source project, which can be found here. KEDEGit must be installed on the same computer along with KEDEHUb and network access to the directory where the target Git repositories are cloned.

Configure KEDEGit

Configuration directory

In this guide the configuration directory is:

                                
~/git/kedegit/docs
                                
                            
You can change it later to any other directory.

Allowed and excluded file types are in ~/git/kedegit/docs/kede-config.json. Edit the file if needed to match your architecture, technology and preferences.

Set configuration file

Execute the below command to create a new empty config.yaml.

                                

cp ~/git/kedegit/docs/docker_empty_config.yaml ~/git/kedegit/docs/config.yaml
                                
                            

Open config.yaml

                            
nano ~/git/kedegit/docs/config.yaml
                            
                        

and add values for company name, user and token from your invitation email.

                            
server:
protocol: http
host: host.docker.internal
port: 5400

company:
name:
user:
token:
                            
                        

Pull the KEDEGit docker image

If you don't want to build the image, then run the following command:

                                
docker pull public.ecr.aws/kedehub/kedegit-image && docker tag public.ecr.aws/kedehub/kedegit-image kedegit-image 
                                
                            

Build the KEDEGit docker image

Navigate to the directory containing kedegit directory and run the following command:

                                
docker build --no-cache -t kedegit-image:latest -f kedegit/dockerize/Dockerfile .   
                                
                            

Run the Docker Container

                                
docker run --rm --add-host=host.docker.internal:host-gateway --name kedegit-container -v ~/git/kedegit/docs:/root/.config/KedeGit kedegit-image:latest list-projects
                                
                            
That command should return nothing.

Initializing a New Project

For testing KEDEGit we will use its source code repository located at https://github.com/kedehub/kedegit. We will clone the repository at `~/git/kedegit`.

Now, using the below command, we will initialize a new project called NEW_PROJECT, with the source code of the local Git repository located at `~/git/kedegit`.

                            
docker run --rm --add-host=host.docker.internal:host-gateway --name kedegit-container -v ~/git/kedegit/docs:/root/.config/KedeGit -v ~/git:/usr/data kedegit-image:latest init-project NEW_PROJECT /usr/data/kedegit
                            
                        

The following is the output from the init-project command:

                            
Adding repo: /usr/data/kedegit to project NEW_PROJECT
Assigned project ID: new_project to project: NEW_PROJECT
Processing Repository: https://github.com/kedehub/kedegit.git
Processing commits: 100%|██████████| 37/37 [00:03:00:00, 10.99it/s]
Updating templates for persons: 100%|██████████| 3/3 [00:00:00:00, 25.92it/s]
Calculating Daily KEDE for persons: 100%|██████████| 3/3 [00:00:00:00, 24.87it/s]
Calculating Weekly KEDE for persons: 100%|██████████| 3/3 [00:00:00:00, 31.39it/s]
Successfully initialized project with ID = new_project 
                            
                        

NEW_PROJECT will be the name you see in KEDEHub web client as explained here.

After successfully initializing the new project, the system will display the new project ID as follows: Assigned project ID: PROJECT_ID to project: PROJECT. Make sure to note down the PROJECT_ID, as it will be essential for all subsequent work related to the newly created PROJECT.

Adding a New Repository to an Existing Project

Now, we will add another repository to `NEW_PROJECT`. That will be the KEDEMatcher located at https://github.com/kedehub/kedematcher. We will clone it in a new local Git repository located at `~/git/kedematcher` Then we can execute the below command:

                            
docker run --rm --add-host=host.docker.internal:host-gateway --name kedegit-container -v ~/git/kedegit/docs:/root/.config/KedeGit -v ~/git:/usr/data kedegit-image:latest add-repository new_project /usr/data/kedematcher
                            
                        

The following is the output from the add-repository command:

                            
Adding repo: /usr/data/kedematcher to project new_project
Assigned project ID: new_project to project: new_project
Processing Repository: https://github.com/kedehub/kedematcher.git
Processing commits: 100%|██████████| 15/15 [00:01:00:00, 13.18it/s]
Processed Repository: https://github.com/kedehub/kedematcher.git
Updating templates for persons: 100%|██████████| 3/3 [00:00:00:00, 23.84it/s]
Calculating Daily KEDE for persons: 100%|██████████| 3/3 [00:00:00:00, 22.29it/s]
Calculating Weekly KEDE for persons:   0%|          | 0/3 [00:00:?, ?it/s]Successfully initialized project with ID = new_project 
Calculating Weekly KEDE for persons: 100%|██████████| 3/3 [00:00:00:00, 29.82it/s]
                            
                        

Updating Project Statistics

The update-projects command performs the following actions:
  1. Analyzes all new commits
  2. Calculates KEDE and other statistics for the new commits

To update the statistics for all projects within a company with new code contributions, execute:

                            
docker run --rm --add-host=host.docker.internal:host-gateway --name kedegit-container -v ~/git/kedegit/docs:/root/.config/KedeGit -v ~/git:/usr/data kedegit-image:latest update-projects   
                            
                        

The following is the output from the update-projects command:

                            
Updating Kedehub for project: new_project, #1 of 1
Processing Repository: https://github.com/kedehub/kedegit.git
Processing commits: 100%|██████████| 39/39 [00:00:00:00, 269.49it/s]
Processed Repository: https://github.com/kedehub/kedegit.git
Processing Repository: https://github.com/kedehub/kedematcher.git
Processing commits: 100%|██████████| 15/15 [00:00:00:00, 409.60it/s]
Processed Repository: https://github.com/kedehub/kedematcher.git
Successfully updated 0 out of 1 projects
                            
                        

To update the statistics for a single existing project, execute:

                            
docker run --rm --add-host=host.docker.internal:host-gateway --name kedegit-container -v ~/git/kedegit/docs:/root/.config/KedeGit -v ~/git:/usr/data kedegit-image:latest update-projects -p PROJECT_ID_1  
                            
                        

To update the statistics for multiple existing projects, execute:

                            
docker run --rm --add-host=host.docker.internal:host-gateway --name kedegit-container -v ~/git/kedegit/docs:/root/.config/KedeGit -v ~/git:/usr/data kedegit-image:latest update-projects -p PROJECT_ID_1 PROJECT_ID_2  
                            
                        

More information here.

Merge Identities

Identity matching in the context of Git involves the process of accurately identifying and distinguishing developers based on the various email addresses and names they use when committing work. Developers may use a range of email types, such as corporate, personal, or even anonymous addresses like "users.noreply.github.com." Similarly, the names they commit under can vary significantly, including full names with or without surnames, names with typographical errors, pseudonyms, or sometimes even missing names. The challenge of identity matching lies in aggregating these diverse identities for each individual developer and differentiating them from the identities of other developers. This process is crucial for obtaining precise information about a developer's contributions and activities in Git repositories.

KEDEMatcher addresses this problem by performing semi-automatic identity recognition The client application KEDEMatcher is an open-source project, which can be found here. KEDEMatcher must be installed on the same computer along with KEDEHUb and network access to the directory where the target Git repositories are cloned. Mac OS M1 architecture is not supported, It is actually an issue with installing This package apjv.

Configuration directory

KEDEMatcher uses the same configuration as KEDEGit. Thus, if not already set up, go and setup KEDEGit as explained here.

Pull the KEDEMatcher docker image

If you don't want to build the image, then run the following command:

                                
docker pull public.ecr.aws/kedehub/kedematcher-image && docker tag public.ecr.aws/kedehub/kedematcher-image kedematcher-image 
                                
                            

Build the KEDEMatcher docker image

Navigate to the directory containing kedematcher directory and run the following command:

                                
docker build --no-cache -t kedematcher-image:latest -f kedematcher/dockerize/Dockerfile .   
                                
                            

Merge identities for a single project

The identity-merge command will:

  1. Determine all authors who belong to the same individual
  2. Create a new KEDEHub user for that individual

To merge identities on a single project, use the below and make sure to use the PROJECT_ID, not project name:

                            
docker run --rm --name kedematcher-container -v ~/git/kedegit/docs:/root/.config/KedeGit kedematcher-image:latest identity-merge  -p PROJECT_ID
                            
                        

The following is the output from the identity-merge command:

                            
First pass...
Matching by: EmailMatcher:  67%|██████▋   | 2/3 [00:00:00:00, 5155.87it/s]
Matching by: EmailNameMatcher:  67%|██████▋   | 2/3 [00:00:00:00, 496.72it/s]
Saving users: 100%|██████████| 2/2 [00:00:00:00, 23.99it/s]
Successfully merged 2 into 2 users with 0 authors for 1 projects. Created 2 new users. 
Second pass...
Matching by: EmailNameMatcher:  67%|██████▋   | 2/3 [00:00:00:00, 3128.91it/s]
Saving users: 100%|██████████| 2/2 [00:00:00:00, 40329.85it/s]
Successfully merged 2 into 2 users with 0 authors for 1 projects. Created 0 new users. 
                            
                        

Merge identities for a company

To merge identities on all projects for a company, use:

                            
docker run --rm --name kedematcher-container -v ~/git/kedegit/docs:/root/.config/KedeGit kedematcher-image:latest identity-merge
                            
                        

More information here.

Getting started