Lecture09 Version Control
Lecture09 Version Control
MacOS
https://www.josean.com/posts/terminal-setup
Window WSL
https://blog.joaograssi.com/windows-subsystem-for-linux-with-
oh-my-zsh-conemu
Outline
• Conda: A package manager that simplifies the installation and management of
software dependencies, primarily for data science and machine learning.
• Git: A version control system that helps manage and track changes in code,
facilitating collaboration among developers.
5
Conda channel
• The locations where packages are stored.
• Conda will download the packages from channels and install them to
conda environment.
https://conda.io/projects/conda/en/latest/user-guide/concepts/environments.html
6
Conda channel
The installer
(conda/mamba)
Channels Environments
default
base
- Python
- Base package
Stored packages 7
Conda managing channels
Conda channels are the locations where packages are stored.
Conda environment
• a directory that contains a specific collection of conda packages that
you have installed.
• You can easily activate or deactivate environments
• You can easily add and remove bioinformatics package
https://conda.io/projects/conda/en/latest/user-guide/concepts/environments.html
9
Basic of conda environment
The installer
(conda/mamba)
Channels Environments
conda-forge
V1.0.1
V1.0.1
V1.0.2
V1.0.2
Why GIT
• Free Version Control System
• Open Source
• Super Fast
• Scalable
• Cheap Branching/Merging
Me You
V1.0.0
V1.0.1
V1.0.2
Install Git
• Debian/Ubuntu
For the latest stable version for your release of Debian/Ubuntu
$ apt-get install git
• macOS
Install homebrew if you don't already have it, then:
$ brew install git
https://git-scm.com/downloads
Configurating Git
true input
Windows macOS
Line Ending
• Window
git config --global core.autocrlf true
• macOS / Linux
git config --global core.autocrlf input
CR LF LF LF
true input
Windows macOS
Start to work with Git
$ mkdir git_test
$ cd git_test
$ git init
Git Workflow
Staging Area
add
Local directory
A special intermediate area .git directory
git add tao lion
Git Workflow
Staging Area
add commit
Local directory
A special intermediate area .git directory
Staging Area
add commit
Local directory
A special intermediate area .git directory
.git directory
Real Example
Create tao and lion files
Real Example
Add tao and lion files to staging area
Git Workflow
Staging Area
add
Local directory
A special intermediate area .git directory
git add tao lion
Real Example
In case remove lion from staging area
Real Example
Re-add lion file to staging aear
Real Example
Commit tao and lion files and save snapshot in .git database
Staging Area
add commit
Local directory
A special intermediate area .git directory
Staging Area
add commit
Local directory
A special intermediate area .git directory
=/
Reasons
• One or more files missing
• Software version mismatch
• Different configuration settings
=
Docker run the same environment across
platform and machines
Virtual Machine vs Container
Mac Machine
VirtualBox
Hypervisor VMware Container
Hyper-v (Window only)
Process / Application
VM VM VM
Docker Architecture
REST API
CLIENT SERVER or DOCKER ENGINE
Docker Hub
3 major parts:
1. Docker Host
2. Docker Client
3. Registry
Docker image and container
Docker Image:
• Definition: A Docker image is a lightweight, standalone,
and immutable package that includes everything needed
to run a piece of software, including the code, runtime,
libraries, environment variables, and configurations.
• State: Static (read-only).
• Purpose: Serves as a blueprint or template for creating
Docker containers.
Docker Container:
• Definition: A Docker container is an instance of a Docker
image. It is a runnable entity that is created from a Docker
image and can be started, stopped, and modified.
• State: Dynamic (read-write). Containers can run, pause,
and execute commands.
• Purpose: To run applications. Containers isolate the
application and its dependencies from the host system.
How to use Docker
• docker build
• Build from published image
• Build from Dockerfile
• docker images
• To list all available images
• docker push
• To push the image to registry (i.e. DockerHub)
• docker pull
• To pull the image back to local
• docker rmi
• To remove image from local
• docker run
• To run a Docker container
• Run with binding storage -v $PWD:$PWD -w $PWD
Assignments
• https://forms.gle/S7BGcqrcATkw6FCaA