When coding software / running models / creating extensive configurations, your code space / project folder / configurations will most likely contain a mix of text files, data files and software binaries. All these files need to be place in a repository under version control and need to be managed as a whole. For the text files you will want to be able to compare differences between versions, in order to understand what has changed over time. This will not be the case for binary files or very large data files as humans are generally not well equipped to compare bits and bytes.
In the 'past' SVN was an ideal place to store your whole repository in one place. Currently SVN is in the process of being phased out and as a replacement GITLABhas been introduced. What the advantages / disadvantages of both systems are will not be discussed here. Instead we will focus on how to setup your GITHUB repository to include both your text based files as your larger binaries.
The problem with GIT (and therefor also GITLAB) is that it is not designed to handle large and or binary files. To overcome this problem GIT Large File Storage (LFS) was introduced. The basic idea behind GIT LFS is that the actual binary file is not stored in your GITLAB repository. Instead only a reference to this file is stored. The actual binary file is stored in an Object Storage location (S3 bucket).
GITLAB offers LFS out-of-the-box, using the MinIO server hosted by Deltares .
So in short. You will have a GIT repository in the Deltares GITLAB instance which will contain only your text base files and small data files. While your large files or binary files will be stored on the Deltares Minio server.
To manage all your text-, large- and binary files as a single project you have three options to connect your GITHUB repository to the Deltares MinIO object store:
Prerequisite: In the below guides we expect the user to have a basic understanding of GIT and its related commands.
How to setup GIT-LFS?
Expand | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Setup your GITLAB repository:First you must setup your GITHUB GITLAB repository by cloning this to your computer. If you do not yet have a GITHUB GITLAB repository, you can request one 'Request a repository' page. Once your GITLAB repository is in place and up-to-date, continue with the GIT-LFS instructions. Setup GIT-LFS:Go to the GIT-LFS website and follow the instructions on how to download and install GIT-LFS. A good starting point is the 'Getting Started' section on the home page. GIT-LFS configuration files:.gitattributes: Stored in the root folder of your repository. This file contains patterns of all files that GIT-LFS should track and manage as 'large files'.
Useful examples for .gitattributes can be found here
How this works in practice is as follows:
|
How to setup DVC?
Expand | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Setup your GITHUB repository:First you must setup your GITHUB GITLAB repository by cloning this to your computer. If you do not yet have a GITHUB GITLAB repository, you can request one 'Request a repository' page. Once your GITHUB GITLAB repository is in place and up-to-date, continue with the DVC instructions. Setup DVC:Go to the DVC website and follow the instructions on how to download and install DVC. A good starting point is the 'Get Started' page. DVC configuration files:.dvcignore: Stored in the root folder of your DVC project. This file contains patterns of all files that DVC should ignore.
.dvc/.gitignore: Stored in the .dvc folder. This file is similar to the .dvcignore file however this file contains patterns of all files that GIT should ignore.
.dvc/config: Stored in the .dvc folder. Contains all DVC configuration that can be shared and can be uploaded into your repository.
.dvc/config.local: Stored in the .dvc folder. Contains all DVC configuration that cannot be shared nor uploaded into your repository
|
How to setup custom scripts?
Expand | |||||||
---|---|---|---|---|---|---|---|
How you will setup your scripting environment will strongly depend on the codding language of the source code in your GITHUB repository. But in all cases you can take advantage of the REWIND functionality of MinIO. This functionality allows you to restore your data folder of files to a given point in time. For Python an example can be found here: https://github.com/robin-deltares/minio-py-rewind/blob/main/minio_rewind.py
|
Choosing between the above solutions
Expand |
---|
GIT-LFSgit-lfs is intended to be transparent to git, therefore it requires a customized server. Its learning process is short and fast. Some configuration commands, and bang! it is running, storing large files independently of the git repository. That's its only function, and it does it fine. Having an additional server is not a drawback, but instead a requirement for such transparency. Once configured, files are just handled by git, by means of git hooks (endpoints that are activated after git operations). Limitations of GIT-LFS can are documented here. DVCdvc is intended to provide independent management of large files for the final user. What dvc basically does is this: it just makes git ignore the files that you wish to control (adding them to Some comparisons with related technologies can be found here. Custom scriptsscripting is the most flexible way to go. It allows you to access all MinIO's API functionality in the language of your preference. To help you get started MinIO offers the user a variety of SDKs. Scripting does imply that you as developer have enough coding skills are also the maintainer. However with enough real-word examples this option should not be too difficult. Note to developers: Please provide your examples to github-support@deltares.nl so we can incorporate them into this manual. |