SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
Hg and version control for bioinformatics
                  2
What you will learn from this talk
●   Graphical interfaces to hg repos
●   Working with a remote copy of the repo on
    bitbucket
●   Working together with other people
Graphical interfaces to hg
Graphical interfaces to hg
●   In the last talk we saw hg as a command line
    tool
●   However there are many graphical interfaces to
    it
    ●   Learning all the hg commands may be silly
    ●   Complex repositories may be difficult to navigate
        without the help of a graphical interface
tortoiseHG
●   TortoiseHG is a multi-platform graphical
    interface that integrates with your file manager
●   Once installed, it:
    ●   adds a few voices in the right-click menu on a file or
        folder
    ●   install a tool called repository explorer
TortoiseHG on your desktop
●   This directory contains a hg repository
●   Green and red symbols mark files tracked by hg
TortoiseHG right-click menu
●   Right click on the folder and look at the new
    voices in the menu
Right-click on a file
●   Right click on a file
    gives you more
    options
    ●   Commit changes if
        the file differs from
        last saved version
    ●   Check the history of
        the file
    ●   Revert it to previous
        version
    ●   Etc...
The tortoise-hg repository exporer
●   The tortoise repository
    explorer is a graphical
    tool to manage a hg
    repository:
    ●   Browse the historial
    ●   Commit changes
    ●   Manage branches
    ●   Upload to a remote server
The repository explorer


                                                1. Historial of
                                                changes




2. Files changed in the   3. Changes made to selected
selected commit           files in selected commit
Making a commit from the
  Repository explorer
        Tools menu → Commit
Setting up a repository
      on bitbucket
Having a copy of your repository on
        a remote location
●   In the real world, people always keep a copy of
    their repository on a remote server
●   Advantages:
    ●   backups
    ●   Can access the code from anywhere
●   The smartest thing is to use a free code hosting
    service (github, bitbucket, etc..)
Code hosting services
●   There are many ~free code hosting services:
    ●   Bitbucket (hg)
    ●   Github, Gitorious (git)
    ●   Launchpad (bzr)
    ●   Sourceforge (svn, various)
●   Bitbucket has fairly good conditions for our case:
    ●   Unlimited private and public repositories
    ●   Unlimited disk space
    ●   Only limit is: 5 collaborators max per account
Register a free account
     on bitbucket




 http://bitbucket.org
Recommended: set up a ssh key
●   After registering to bitbucket,
    the first thing you should do is
    setting up a ssh key
●   Go to 'Account' → Add SSH
    Keys
●   Safer transfers through Internet
●   Don't have to type password
    every time
Creating a Repo on bitbucket
●   Just click on
    'Repositories'
    → create new
    repo
Creating a Repo on bitbucket
●   Just keep
    following the
    instructions
●   ssh key is
    recommended
Cloning a repo
●   After creating a repository on bitbucket, it will give you an url
    that you can use to download the repo on your computer.
●   Example:
        https://bitbucket.org/dalloliogm/secret-repo
        ssh://bitbucket.org/dalloliogm/secret-repo
●   Just use the hg clone command:
        hg clone ssh://bitbucket.org/dalloliogm/secret-repo
●   You can also clone a repository created by someone else
    ●   (or clone your repository on another computer/directory)
Synchronizing an existing repo with
            bitbucket
●   What happens if you have created your
    repository in local before creating it on
    bitbucket?
●   No problem, follow the instructions and you can
    synchronize them
Setting up remote repo (tortoise)
●   Go to Tools → Settings → Synchronize
Setting up remote repo (manually)
●   Open the .hg/hgrc file inside the repo main
    directory
●   Add the following:
    [paths]
    default = ssh://bitbucket.org/dalloliogm/secret-repo
Working with remote repos
Now, let's get serious!
●   You have successfully set up a remote copy of
    your code on bitbucket
●   Let's see how it works
Hg – working with remote repos
●   hg clone → get a copy of an existing repo (only
    once)
●   hg pull → get the list of changes from the latest
    version on the remote repository
●   hg update → apply the changes from the latest
    pulled version to the current working directory
●   hg merge → merge conflicting versions
●   hg push → push the local changes to the remote
    repository
Hg clone
●   This command creates a copy of a repository
    on your computer
    ●   For example, a copy of a repository on bitbucket
●   Launch it only once per repository
Hg pull & update
●   Hg pull gets the list of changes made to the remote
    repository since the last time you cloned/pulled it
    ●   It checks whether one of your colleagues has updated a
        new version to the remote repo
●   These changes are not applied automatically to the
    current working directory;
    ●   You have to do a hg update after a hg pull to update your
        local files
    ●   hg pull -u → pulls & updates
Hg push
●   The hg push command sends the changes you
    have made in local to the remote server
●   The command fails if other people have pushed
    other changes before you
    ●   You always have to make a pull&update (and
        merge) before doing a push
    ●   More on this later
Exercise
●   Try to use bitbucket as a repository for your
    own script
●   Commit your versions in local, and push them
    to bitbucket as a backup copy
●   You can clone (and later pull&update) the repo
    on your computer at home
Hg for our pipeline
Applying hg to our pipeline
●   Someone should initialize a repo on the root
    directory (only once)
●   Add, commit, document
●   Push a copy of the repo on bitbucket
●   Everybody will clone the repo from there, and
    pull/push changes from there
What to include in the repo
●   Code, documentation
●   We may create another repository for results
    and parameters
●   For each set of results, we should be able to
    know which version of the scripts and which
    parameters have been used
Executing the pipeline on the cluster
●   Connect to the cluster
●   Hg pull & update from bitbucket (to get the
    latest code)
●   Test to verify whether it works correctly on the
    cluster?
●   Execute the pipeline
Proposal: code reviews
●   One person may be in charge of writing the
    core pipeline
●   Other people can clone the repository and
    improve it (code review)
●   So we will work on the same code, and
    hopefully make it better
Collective code ownership
●   In the perfect group, nobody is 'the only author'
    of a script
●   Code is just a medium :-)
●   A single script written by two persons is much
    better than two redundant scripts
The daily pull
●   Every day, the first thing you should do is a hg
    pull & update to get the latest version of the
    code
●   Make your changes in local and commit them.
●   When you are ready, pull&update again to align
    your code to the remote copy, then push to
    bitbucket
●   Beware of conflicting changes..
Merging and conflicts
●   What happens when two people work on the
    same code on different computers?
    ●   Two different versions of the code will exist
●   How to merge them?
    ●   Ask me :-)
    ●   Never force the push (hg push -f) – you will delete
        other people's work
    ●   Always do a hg pull&update before a push;
        eventually use hg merge to integrate other people's
        changes
Making changes to the pipeline
●   Get the latest copy of the pipeline from
    bitbucket (pull&update)
●   Make changes, commit
●   pull&update, push to bitbucket
●   Connect to cluster, pull&update, execute
    pipeline

Más contenido relacionado

La actualidad más candente

Software Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and EclipseSoftware Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and EclipseHüseyin Ergin
 
What is version control software and why do you need it?
What is version control software and why do you need it?What is version control software and why do you need it?
What is version control software and why do you need it?Leonid Mamchenkov
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and githubAderemi Dadepo
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github Max Claus Nunes
 
Git - The Incomplete Introduction
Git - The Incomplete IntroductionGit - The Incomplete Introduction
Git - The Incomplete Introductionrschwietzke
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes DesignerSlobodan Lohja
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitRobert Lee-Cann
 
HacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubHacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubGDSCIIITBbsr
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git TutorialSage Sharp
 
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)Per Henrik Lausten
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHubNicolás Tourné
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitColin Su
 

La actualidad más candente (20)

Software Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and EclipseSoftware Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and Eclipse
 
Mini git tutorial
Mini git tutorialMini git tutorial
Mini git tutorial
 
What is version control software and why do you need it?
What is version control software and why do you need it?What is version control software and why do you need it?
What is version control software and why do you need it?
 
Introduction to git and github
Introduction to git and githubIntroduction to git and github
Introduction to git and github
 
Git Basics
Git BasicsGit Basics
Git Basics
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
From SVN to Git
From SVN to GitFrom SVN to Git
From SVN to Git
 
Git - The Incomplete Introduction
Git - The Incomplete IntroductionGit - The Incomplete Introduction
Git - The Incomplete Introduction
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes Designer
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
HacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubHacktoberFest-Git&GitHub
HacktoberFest-Git&GitHub
 
Version controll.pptx
Version controll.pptxVersion controll.pptx
Version controll.pptx
 
Git hub
Git hubGit hub
Git hub
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 

Destacado (9)

Agile bioinf
Agile bioinfAgile bioinf
Agile bioinf
 
Wagner chapter 5
Wagner chapter 5Wagner chapter 5
Wagner chapter 5
 
Wagner chapter 2
Wagner chapter 2Wagner chapter 2
Wagner chapter 2
 
Wagner chapter 3
Wagner chapter 3Wagner chapter 3
Wagner chapter 3
 
Wagner chapter 4
Wagner chapter 4Wagner chapter 4
Wagner chapter 4
 
Wagner chapter 1
Wagner chapter 1Wagner chapter 1
Wagner chapter 1
 
Plotting data with python and pylab
Plotting data with python and pylabPlotting data with python and pylab
Plotting data with python and pylab
 
Linux intro 1 definitions
Linux intro 1  definitionsLinux intro 1  definitions
Linux intro 1 definitions
 
Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...
Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...
Thesis defence of Dall'Olio Giovanni Marco. Applications of network theory to...
 

Similar a Hg for bioinformatics, second part

Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2Derek Jacoby
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Derek Jacoby
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git WorkshopBeckhamWee
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git聖文 鄭
 
Beginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfBeginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfGDSCKNUST
 
Git for standalone use
Git for standalone useGit for standalone use
Git for standalone useIkuru Kanuma
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hubNaveen Pandey
 
Setting up Git.pptx
Setting up Git.pptxSetting up Git.pptx
Setting up Git.pptxtapanvyas11
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configurationKishor Kumar
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with gitgdgjss
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of GitDivineOmega
 

Similar a Hg for bioinformatics, second part (20)

Hacktoberfest 2022
Hacktoberfest 2022Hacktoberfest 2022
Hacktoberfest 2022
 
Git & Github
Git & GithubGit & Github
Git & Github
 
Open source
Open sourceOpen source
Open source
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git Workshop
 
GitHub Event.pptx
GitHub Event.pptxGitHub Event.pptx
GitHub Event.pptx
 
GDSC Git event 2023.pptx
GDSC Git event 2023.pptxGDSC Git event 2023.pptx
GDSC Git event 2023.pptx
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
 
Formation git
Formation gitFormation git
Formation git
 
Beginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfBeginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdf
 
Git for standalone use
Git for standalone useGit for standalone use
Git for standalone use
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Setting up Git.pptx
Setting up Git.pptxSetting up Git.pptx
Setting up Git.pptx
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Hello, Git!
Hello, Git!Hello, Git!
Hello, Git!
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 
Advance workshop on git
Advance workshop on gitAdvance workshop on git
Advance workshop on git
 
Day 2_ Get Git with It! A Developer's Workshop.pptx
Day 2_ Get Git with It! A Developer's Workshop.pptxDay 2_ Get Git with It! A Developer's Workshop.pptx
Day 2_ Get Git with It! A Developer's Workshop.pptx
 

Más de Giovanni Marco Dall'Olio (13)

Fehrman Nat Gen 2014 - Journal Club
Fehrman Nat Gen 2014 - Journal ClubFehrman Nat Gen 2014 - Journal Club
Fehrman Nat Gen 2014 - Journal Club
 
Linux intro 5 extra: awk
Linux intro 5 extra: awkLinux intro 5 extra: awk
Linux intro 5 extra: awk
 
Linux intro 5 extra: makefiles
Linux intro 5 extra: makefilesLinux intro 5 extra: makefiles
Linux intro 5 extra: makefiles
 
Linux intro 4 awk + makefile
Linux intro 4  awk + makefileLinux intro 4  awk + makefile
Linux intro 4 awk + makefile
 
Linux intro 3 grep + Unix piping
Linux intro 3 grep + Unix pipingLinux intro 3 grep + Unix piping
Linux intro 3 grep + Unix piping
 
Linux intro 2 basic terminal
Linux intro 2   basic terminalLinux intro 2   basic terminal
Linux intro 2 basic terminal
 
The true story behind the annotation of a pathway
The true story behind the annotation of a pathwayThe true story behind the annotation of a pathway
The true story behind the annotation of a pathway
 
Pycon
PyconPycon
Pycon
 
Makefiles Bioinfo
Makefiles BioinfoMakefiles Bioinfo
Makefiles Bioinfo
 
biopython, doctest and makefiles
biopython, doctest and makefilesbiopython, doctest and makefiles
biopython, doctest and makefiles
 
Web 2.0 e ricerca scientifica - Web 2.0 and scientific research
Web 2.0 e ricerca scientifica - Web 2.0 and scientific researchWeb 2.0 e ricerca scientifica - Web 2.0 and scientific research
Web 2.0 e ricerca scientifica - Web 2.0 and scientific research
 
Perl Bioinfo
Perl BioinfoPerl Bioinfo
Perl Bioinfo
 
(draft) perl e bioinformatica - presentazione per ipw2008
(draft) perl e bioinformatica - presentazione per ipw2008(draft) perl e bioinformatica - presentazione per ipw2008
(draft) perl e bioinformatica - presentazione per ipw2008
 

Último

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Último (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Hg for bioinformatics, second part

  • 1. Hg and version control for bioinformatics 2
  • 2. What you will learn from this talk ● Graphical interfaces to hg repos ● Working with a remote copy of the repo on bitbucket ● Working together with other people
  • 4. Graphical interfaces to hg ● In the last talk we saw hg as a command line tool ● However there are many graphical interfaces to it ● Learning all the hg commands may be silly ● Complex repositories may be difficult to navigate without the help of a graphical interface
  • 5. tortoiseHG ● TortoiseHG is a multi-platform graphical interface that integrates with your file manager ● Once installed, it: ● adds a few voices in the right-click menu on a file or folder ● install a tool called repository explorer
  • 6. TortoiseHG on your desktop ● This directory contains a hg repository ● Green and red symbols mark files tracked by hg
  • 7. TortoiseHG right-click menu ● Right click on the folder and look at the new voices in the menu
  • 8. Right-click on a file ● Right click on a file gives you more options ● Commit changes if the file differs from last saved version ● Check the history of the file ● Revert it to previous version ● Etc...
  • 9. The tortoise-hg repository exporer ● The tortoise repository explorer is a graphical tool to manage a hg repository: ● Browse the historial ● Commit changes ● Manage branches ● Upload to a remote server
  • 10. The repository explorer 1. Historial of changes 2. Files changed in the 3. Changes made to selected selected commit files in selected commit
  • 11. Making a commit from the Repository explorer Tools menu → Commit
  • 12. Setting up a repository on bitbucket
  • 13. Having a copy of your repository on a remote location ● In the real world, people always keep a copy of their repository on a remote server ● Advantages: ● backups ● Can access the code from anywhere ● The smartest thing is to use a free code hosting service (github, bitbucket, etc..)
  • 14. Code hosting services ● There are many ~free code hosting services: ● Bitbucket (hg) ● Github, Gitorious (git) ● Launchpad (bzr) ● Sourceforge (svn, various) ● Bitbucket has fairly good conditions for our case: ● Unlimited private and public repositories ● Unlimited disk space ● Only limit is: 5 collaborators max per account
  • 15. Register a free account on bitbucket http://bitbucket.org
  • 16. Recommended: set up a ssh key ● After registering to bitbucket, the first thing you should do is setting up a ssh key ● Go to 'Account' → Add SSH Keys ● Safer transfers through Internet ● Don't have to type password every time
  • 17. Creating a Repo on bitbucket ● Just click on 'Repositories' → create new repo
  • 18. Creating a Repo on bitbucket ● Just keep following the instructions ● ssh key is recommended
  • 19. Cloning a repo ● After creating a repository on bitbucket, it will give you an url that you can use to download the repo on your computer. ● Example: https://bitbucket.org/dalloliogm/secret-repo ssh://bitbucket.org/dalloliogm/secret-repo ● Just use the hg clone command: hg clone ssh://bitbucket.org/dalloliogm/secret-repo ● You can also clone a repository created by someone else ● (or clone your repository on another computer/directory)
  • 20. Synchronizing an existing repo with bitbucket ● What happens if you have created your repository in local before creating it on bitbucket? ● No problem, follow the instructions and you can synchronize them
  • 21. Setting up remote repo (tortoise) ● Go to Tools → Settings → Synchronize
  • 22. Setting up remote repo (manually) ● Open the .hg/hgrc file inside the repo main directory ● Add the following: [paths] default = ssh://bitbucket.org/dalloliogm/secret-repo
  • 24. Now, let's get serious! ● You have successfully set up a remote copy of your code on bitbucket ● Let's see how it works
  • 25. Hg – working with remote repos ● hg clone → get a copy of an existing repo (only once) ● hg pull → get the list of changes from the latest version on the remote repository ● hg update → apply the changes from the latest pulled version to the current working directory ● hg merge → merge conflicting versions ● hg push → push the local changes to the remote repository
  • 26. Hg clone ● This command creates a copy of a repository on your computer ● For example, a copy of a repository on bitbucket ● Launch it only once per repository
  • 27. Hg pull & update ● Hg pull gets the list of changes made to the remote repository since the last time you cloned/pulled it ● It checks whether one of your colleagues has updated a new version to the remote repo ● These changes are not applied automatically to the current working directory; ● You have to do a hg update after a hg pull to update your local files ● hg pull -u → pulls & updates
  • 28. Hg push ● The hg push command sends the changes you have made in local to the remote server ● The command fails if other people have pushed other changes before you ● You always have to make a pull&update (and merge) before doing a push ● More on this later
  • 29. Exercise ● Try to use bitbucket as a repository for your own script ● Commit your versions in local, and push them to bitbucket as a backup copy ● You can clone (and later pull&update) the repo on your computer at home
  • 30. Hg for our pipeline
  • 31. Applying hg to our pipeline ● Someone should initialize a repo on the root directory (only once) ● Add, commit, document ● Push a copy of the repo on bitbucket ● Everybody will clone the repo from there, and pull/push changes from there
  • 32. What to include in the repo ● Code, documentation ● We may create another repository for results and parameters ● For each set of results, we should be able to know which version of the scripts and which parameters have been used
  • 33. Executing the pipeline on the cluster ● Connect to the cluster ● Hg pull & update from bitbucket (to get the latest code) ● Test to verify whether it works correctly on the cluster? ● Execute the pipeline
  • 34. Proposal: code reviews ● One person may be in charge of writing the core pipeline ● Other people can clone the repository and improve it (code review) ● So we will work on the same code, and hopefully make it better
  • 35. Collective code ownership ● In the perfect group, nobody is 'the only author' of a script ● Code is just a medium :-) ● A single script written by two persons is much better than two redundant scripts
  • 36. The daily pull ● Every day, the first thing you should do is a hg pull & update to get the latest version of the code ● Make your changes in local and commit them. ● When you are ready, pull&update again to align your code to the remote copy, then push to bitbucket ● Beware of conflicting changes..
  • 37. Merging and conflicts ● What happens when two people work on the same code on different computers? ● Two different versions of the code will exist ● How to merge them? ● Ask me :-) ● Never force the push (hg push -f) – you will delete other people's work ● Always do a hg pull&update before a push; eventually use hg merge to integrate other people's changes
  • 38. Making changes to the pipeline ● Get the latest copy of the pipeline from bitbucket (pull&update) ● Make changes, commit ● pull&update, push to bitbucket ● Connect to cluster, pull&update, execute pipeline