https://docs.uabgrid.uab.edu/w/api.php?action=feedcontributions&user=Ravi89%40uab.edu&feedformat=atomCheaha - User contributions [en]2024-03-28T08:46:46ZUser contributionsMediaWiki 1.38.2https://docs.uabgrid.uab.edu/w/index.php?title=Getting_Help&diff=6165Getting Help2021-04-06T18:54:28Z<p>Ravi89@uab.edu: /* Contact Us */</p>
<hr />
<div>UAB IT Research Computing provides comprehensive support for researchers that use Cheaha, develop and maintain the cluster, and provide advanced software and consulting support if needed by researchers. Research Computing staff also maintain proposal support documentation, such as letters of commitment and facilities descriptions, to allow researchers a tighter focus on their projects.<br />
<br />
<br />
== Monthly Training ==<br />
Second Wednesday of each month 1 - 2:30 pm, held virtually via [https://www.youtube.com/channel/UCZoOS2e699Ge0DND1oy1BJQ YouTube].<br />
<br />
<br />
Some of the past topics include:<br />
* Job Scheduling<br />
* GPU Computation<br />
* Jupyter Notebooks<br />
* Requesting Resources<br />
<br />
<br />
== Virtual Office Hours ==<br />
* Mondays 10 am - noon held virtually via [https://uasystem.zoom.us/j/526282301 Zoom].<br />
* Wednesdays 1 - 3 pm held virtually via [https://uab.zoom.us/j/97296139490?pwd=K3FFblNhZjlJWTUzMnBCVGRwYUtsUT09 Zoom].<br />
* Thursdays 10 am - noon held virtually via [https://uab.zoom.us/j/96229651103?pwd=RmpsWG1NYkxjclgxTThXb1h2bVBndz09 Zoom].<br />
<br />
<br />
== Data Science club ==<br />
A weekly exploration of the practical use of data science<br />
<br />
Fridays 9:30 - 10:30 am, held virtually via [https://www.youtube.com/channel/UCZoOS2e699Ge0DND1oy1BJQ YouTube].<br />
<br />
== Contact Us ==<br />
Call us : (205) 996-4300 <br />
<br />
Mail us: [mailto:support@listserv.uab.edu support@listserv.uab.edu]</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Getting_Help&diff=6164Getting Help2021-04-06T18:52:58Z<p>Ravi89@uab.edu: Initial Help page</p>
<hr />
<div>UAB IT Research Computing provides comprehensive support for researchers that use Cheaha, develop and maintain the cluster, and provide advanced software and consulting support if needed by researchers. Research Computing staff also maintain proposal support documentation, such as letters of commitment and facilities descriptions, to allow researchers a tighter focus on their projects.<br />
<br />
<br />
== Monthly Training ==<br />
Second Wednesday of each month 1 - 2:30 pm, held virtually via [https://www.youtube.com/channel/UCZoOS2e699Ge0DND1oy1BJQ YouTube].<br />
<br />
<br />
Some of the past topics include:<br />
* Job Scheduling<br />
* GPU Computation<br />
* Jupyter Notebooks<br />
* Requesting Resources<br />
<br />
<br />
== Virtual Office Hours ==<br />
* Mondays 10 am - noon held virtually via [https://uasystem.zoom.us/j/526282301 Zoom].<br />
* Wednesdays 1 - 3 pm held virtually via [https://uab.zoom.us/j/97296139490?pwd=K3FFblNhZjlJWTUzMnBCVGRwYUtsUT09 Zoom].<br />
* Thursdays 10 am - noon held virtually via [https://uab.zoom.us/j/96229651103?pwd=RmpsWG1NYkxjclgxTThXb1h2bVBndz09 Zoom].<br />
<br />
<br />
== Data Science club ==<br />
A weekly exploration of the practical use of data science<br />
<br />
Fridays 9:30 - 10:30 am, held virtually via [https://www.youtube.com/channel/UCZoOS2e699Ge0DND1oy1BJQ YouTube].<br />
<br />
== Contact Us ==<br />
Call us : (205)996-4300 <br />
<br />
Mail us: [mailto:support@listserv.uab.edu support@listserv.uab.edu]</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Anaconda&diff=6104Anaconda2020-09-16T18:21:09Z<p>Ravi89@uab.edu: /* Moving conda directory */</p>
<hr />
<div>[https://conda.io/docs/user-guide/overview.html Conda] is a powerful package manager and environment manager. Conda allows you to maintain distinct environments for your different projects, with dependency packages defined and installed for each project.<br />
<br />
===Creating a Conda virtual environment===<br />
First step, direct conda to store files in $USER_DATA to avoid filling up $HOME. Create the '''$HOME/.condarc''' file by running the following code:<br />
<pre><br />
cat << "EOF" > ~/.condarc<br />
pkgs_dirs:<br />
- $USER_DATA/.conda/pkgs<br />
envs_dirs:<br />
- $USER_DATA/.conda/envs<br />
EOF<br />
</pre><br />
<br />
Load one of the conda environments available on Cheaha (Note, starting with Anaconda 2018.12, Anaconda releases changed to using YYYY.MM format for version numbers):<br />
<pre><br />
$ module -t avail Anaconda<br />
...<br />
Anaconda3/5.3.0<br />
Anaconda3/5.3.1<br />
Anaconda3/2019.10<br />
<br />
</pre><br />
<pre><br />
$ module load Anaconda3/2019.10 <br />
</pre><br />
<br />
Once you have loaded Anaconda, you can create an environment using the following command (change '''test_env''' to whatever you want to name your environment):<br />
<pre><br />
$ conda create --name test_env<br />
<br />
Solving environment: done<br />
<br />
## Package Plan ##<br />
<br />
environment location: /home/ravi89/.conda/envs/test_env<br />
<br />
added / updated specs:<br />
- setuptools<br />
<br />
<br />
The following packages will be downloaded:<br />
<br />
package | build<br />
---------------------------|-----------------<br />
python-3.7.0 | h6e4f718_3 30.6 MB<br />
wheel-0.32.1 | py37_0 35 KB<br />
setuptools-40.4.3 | py37_0 556 KB<br />
------------------------------------------------------------<br />
Total: 31.1 MB<br />
<br />
The following NEW packages will be INSTALLED:<br />
<br />
ca-certificates: 2018.03.07-0<br />
certifi: 2018.8.24-py37_1<br />
libedit: 3.1.20170329-h6b74fdf_2<br />
libffi: 3.2.1-hd88cf55_4<br />
libgcc-ng: 8.2.0-hdf63c60_1<br />
libstdcxx-ng: 8.2.0-hdf63c60_1<br />
ncurses: 6.1-hf484d3e_0<br />
openssl: 1.0.2p-h14c3975_0<br />
pip: 10.0.1-py37_0<br />
python: 3.7.0-h6e4f718_3<br />
readline: 7.0-h7b6447c_5<br />
setuptools: 40.4.3-py37_0<br />
sqlite: 3.25.2-h7b6447c_0<br />
tk: 8.6.8-hbc83047_0<br />
wheel: 0.32.1-py37_0<br />
xz: 5.2.4-h14c3975_4<br />
zlib: 1.2.11-ha838bed_2<br />
<br />
Proceed ([y]/n)? y<br />
<br />
Downloading and Extracting Packages<br />
python-3.7.0 | 30.6 MB | ########################################################################### | 100%<br />
wheel-0.32.1 | 35 KB | ########################################################################### | 100%<br />
setuptools-40.4.3 | 556 KB | ########################################################################### | 100%<br />
Preparing transaction: done<br />
Verifying transaction: done<br />
Executing transaction: done<br />
#<br />
# To activate this environment, use:<br />
# > source activate test_env<br />
#<br />
# To deactivate an active environment, use:<br />
# > source deactivate<br />
#<br />
</pre><br />
<br />
You can also specify the packages that you want to install in the conda virtual environment:<br />
<pre><br />
$ conda create --name test_env PACKAGE_NAME<br />
</pre><br />
<br />
===Listing all your conda virtual environments===<br />
In case you forget the name of your virtual environments, you can list all your virtual environments by running '''conda env list'''<br />
<pre><br />
$ conda env list<br />
# conda environments:<br />
#<br />
jupyter_test /home/ravi89/.conda/envs/jupyter_test<br />
modeller /home/ravi89/.conda/envs/modeller<br />
psypy3 /home/ravi89/.conda/envs/psypy3<br />
test /home/ravi89/.conda/envs/test<br />
test_env /home/ravi89/.conda/envs/test_env<br />
test_pytorch /home/ravi89/.conda/envs/test_pytorch<br />
tomopy /home/ravi89/.conda/envs/tomopy<br />
base * /share/apps/rc/software/Anaconda3/5.2.0<br />
DeepNLP /share/apps/rc/software/Anaconda3/5.2.0/envs/DeepNLP<br />
ubrite-jupyter-base-1.0 /share/apps/rc/software/Anaconda3/5.2.0/envs/ubrite-jupyter-base-1.0<br />
</pre><br />
NOTE: Virtual environment with the asterisk(*) next to it is the one that's currently active.<br />
<br />
===Activating a conda virtual environment===<br />
You can activate your virtual environment for use by running '''source activate''' followed by '''conda activate ENV_NAME'''<br />
<br />
<pre><br />
$ source activate<br />
$ conda activate test_env<br />
(test_env) $<br />
</pre><br />
<br />
NOTE: Your shell prompt would also include the name of the virtual environment that you activated.<br />
<br />
<br />
'''IMPORTANT!'''<br />
<br />
'''source activate <env>''' is not idempotent. Using it twice with the same environment in a given session can lead to unexpected behavior. The recommended workflow is to use '''source activate''' to source the '''conda activate''' script, followed by '''conda activate <env>'''.<br />
<br />
===Locate and install packages===<br />
Conda allows you to search for packages that you want to install:<br />
<pre><br />
(test_env) $ conda search BeautifulSoup4<br />
Loading channels: done<br />
# Name Version Build Channel<br />
beautifulsoup4 4.4.0 py27_0 pkgs/free<br />
beautifulsoup4 4.4.0 py34_0 pkgs/free<br />
beautifulsoup4 4.4.0 py35_0 pkgs/free<br />
...<br />
beautifulsoup4 4.6.3 py35_0 pkgs/main<br />
beautifulsoup4 4.6.3 py36_0 pkgs/main<br />
beautifulsoup4 4.6.3 py37_0 pkgs/main<br />
(test_env) $<br />
</pre><br />
NOTE: Search is case-insensitive<br />
<br />
You can install the packages in conda environment using<br />
<pre><br />
(test_env) $ conda install beautifulsoup4<br />
Solving environment: done<br />
<br />
## Package Plan ##<br />
<br />
environment location: /home/ravi89/.conda/envs/test_env<br />
<br />
added / updated specs:<br />
- beautifulsoup4<br />
<br />
<br />
The following packages will be downloaded:<br />
<br />
package | build<br />
---------------------------|-----------------<br />
beautifulsoup4-4.6.3 | py37_0 138 KB<br />
<br />
The following NEW packages will be INSTALLED:<br />
<br />
beautifulsoup4: 4.6.3-py37_0<br />
<br />
Proceed ([y]/n)? y<br />
<br />
<br />
Downloading and Extracting Packages<br />
beautifulsoup4-4.6.3 | 138 KB | ########################################################################### | 100%<br />
Preparing transaction: done<br />
Verifying transaction: done<br />
Executing transaction: done<br />
(test_env) $<br />
</pre><br />
<br />
===Deactivating your virtual environment===<br />
You can deactivate your virtual environment using '''source deactivate'''<br />
<pre><br />
(test_env) $ source deactivate<br />
$<br />
</pre><br />
<br />
===Sharing an environment===<br />
You may want to share your environment with someone for testing or other purposes. Sharing the environemnt file for your virtual environment is the most starightforward metohd which allows other person to quickly create an environment identical to you.<br />
====Export environment====<br />
* Activate the virtual environment that you want to export.<br />
* Export an environment.yml file<br />
<pre><br />
conda env export -n test_env > environment.yml<br />
</pre><br />
* Now you can send the recently created environment.yml file to the other person.<br />
<br />
====Create a virtual environment using environment.yml====<br />
<pre><br />
conda env create -f environment.yml -n test_env<br />
</pre><br />
<br />
===Delete a conda virtual environment===<br />
You can use the '''remove''' parameter of conda to delete a conda virtual environment that you don't need:<br />
<pre><br />
$ conda remove --name test_env --all<br />
<br />
Remove all packages in environment /home/ravi89/.conda/envs/test_env:<br />
<br />
<br />
## Package Plan ##<br />
<br />
environment location: /home/ravi89/.conda/envs/test_env<br />
<br />
<br />
The following packages will be REMOVED:<br />
<br />
beautifulsoup4: 4.6.3-py37_0<br />
ca-certificates: 2018.03.07-0<br />
certifi: 2018.8.24-py37_1<br />
libedit: 3.1.20170329-h6b74fdf_2<br />
libffi: 3.2.1-hd88cf55_4<br />
libgcc-ng: 8.2.0-hdf63c60_1<br />
libstdcxx-ng: 8.2.0-hdf63c60_1<br />
ncurses: 6.1-hf484d3e_0<br />
openssl: 1.0.2p-h14c3975_0<br />
pip: 10.0.1-py37_0<br />
python: 3.7.0-h6e4f718_3<br />
readline: 7.0-h7b6447c_5<br />
setuptools: 40.4.3-py37_0<br />
sqlite: 3.25.2-h7b6447c_0<br />
tk: 8.6.8-hbc83047_0<br />
wheel: 0.32.1-py37_0<br />
xz: 5.2.4-h14c3975_4<br />
zlib: 1.2.11-ha838bed_2<br />
<br />
Proceed ([y]/n)? y<br />
</pre><br />
<br />
===Moving conda directory===<br />
As you build new conda environments, you may find that it is taking a lot of space in your $HOME directory. Here are 2 methods:<br />
<br />
Method 1: Move a pre-existing conda directory and create a symlink<br />
<pre><br />
cd ~<br />
mv ~/.conda $USER_DATA/<br />
ln -s $USER_DATA/.conda .conda<br />
</pre><br />
<br />
Method 2: Create a "$HOME/.condarc" file in the $HOME directory by running the following code<br />
<pre><br />
cat << "EOF" > ~/.condarc<br />
pkgs_dirs:<br />
- $USER_DATA/.conda/pkgs<br />
envs_dirs:<br />
- $USER_DATA/.conda/envs<br />
EOF<br />
</pre></div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Open_OnDemand_Sandbox&diff=6102Open OnDemand Sandbox2020-08-11T22:44:11Z<p>Ravi89@uab.edu: /* Setting up sandbox for your profile */</p>
<hr />
<div>[https://rc.uab.edu Open OnDemand] is a web interface to Cheaha HPC resources. We have setup multiple general purpose apps, such as HPC Desktop, Jupyter, RStudio etc, on cheaha, to make the process of accessing these basic softwares easier. OnDemand also allows users to setup their own personal apps in the OnDemand, as [https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps.html sandbox] apps.<br />
<br />
===Setting up sandbox for your profile===<br />
Setting up sandbox is pretty simple and straightforward. <br />
* You need to create a dev folder in your '''$USER_DATA/ondemand''' folder<br />
<pre><br />
mkdir -p $USER_DATA/ondemand/dev<br />
</pre><br />
<br />
* Then go to [https://rc.uab.edu Cheaha OnDemand] , login, and under '''Help''', click on '''Restart Web Server'''<br />
<br />
* You have successfully enabled sandbox for your environment, and you should see a new '''Develop''' tab.<br />
<br />
<br />
'''NOTE:''' This is a one time setup<br />
<br />
===Building your first dev app===<br />
<br />
Over here you have instructions to create your first example dev app:<br />
<br />
====IGV====<br />
<br />
* Under '''Develop''' tab , click on '''My SandBox Apps (Development)'''<br />
<br />
* Now click on '''New App''' tab<br />
<br />
* Now we are going to import an already existing git repo for an app, by clicking on '''Clone Existing App'''<br />
<br />
* Add the following values in the form:<br />
<pre><br />
Directory Name: IGV<br />
Git Remote: https://github.com/uabrc/sandbox_app_template<br />
</pre><br />
and '''Submit'''<br />
<br />
'''Note:''' You can also check the line, about creating a new git repo, if you want to use it to maintain your own instance of the app.<br />
<br />
* Now click on '''Files''' to take a look at the files for the app (local git repo working directory), that you just cloned.<br />
<br />
* Let's modify '''manifest.yml''' file (highlight the file, and click on '''edit''') to change metadata for the sandbox app. Change the SOFTWARE_NAME and SOFTWARE_LINK variables appropriately.<br />
In this case change then to following:<br />
<pre><br />
SOFTWARE_NAME : IGV<br />
SOFTWARE_LINK : http://software.broadinstitute.org/software/igv/<br />
</pre><br />
<br />
* Next, highlight '''form.yml''' and click on '''Edit''' . Uncomment version section in the file, and change that section as follows:<br />
<br />
Change '''SOFTWARE_NAME''' appropriately. Under options change '''display_version''' to the the version that you want to display on the form, and change '''corresponding_cheaha_module''' to matching module name on cheaha.<br />
<br />
Here we are specifying what the form for the app is going to look like, and changing available parameters for Cheaha.<br />
<pre><br />
version:<br />
widget: select<br />
label: "IGV version"<br />
help: "This defines the version of IGV you want to load."<br />
options:<br />
- [ "2.5.0-Java-11", "IGV/2.5.0-Java-11" ]<br />
</pre><br />
and save the file, and close the tab.<br />
<br />
The "native" section in '''submit.yml.erb''' includes the slurm parameters you would use with sbatch and describes the resources needed for the app. These can include variable names defined in the form above which will get substituted for the user provided values when the app is run.<br />
<br />
* Now, go into '''template''' and edit file '''script.sh.erb''', by adding following lines at the end of the file. This is the actual job script that will be submitted to the cluster, just like you would submit with sbatch from the command line.<br />
<pre><br />
igvtools_gui.command &<br />
igv.sh<br />
</pre><br />
Save the file, and close the tab. <br />
This script runs the app executable after loading the appropriate module, based on the version you choose in the form.<br />
<br />
* Close the file browser for your app.<br />
<br />
* Click on '''Launch IGV''', and submit the job with desired parameters.<br />
<br />
You should have your first dev app (IGV) running.<br />
<br />
<br />
====FSL====<br />
* Under '''Develop''' tab , click on '''My SandBox Apps (Development)'''<br />
<br />
* Now click on '''New App''' tab<br />
<br />
* Now we are going to import an already existing git repo for an app, by clicking on '''Clone Existing App'''<br />
<br />
* Add the following values in the form:<br />
<pre><br />
Directory Name: FSL<br />
Git Remote: https://github.com/uabrc/sandbox_app_template<br />
</pre><br />
and '''Submit'''<br />
<br />
'''Note:''' You can also check the line, about creating a new git repo, if you want to use it to maintain your own instance of the app.<br />
<br />
* Now click on '''Files''' to take a look at the files for the app (local git repo working directory), that you just cloned.<br />
<br />
* Let's modify '''manifest.yml''' file (highlight the file, and click on '''edit''') to change metadata for the sandbox app. Change the SOFTWARE_NAME and SOFTWARE_LINK variables appropriately.<br />
In this case change then to following:<br />
<pre><br />
SOFTWARE_NAME : FSL<br />
SOFTWARE_LINK : https://www.fmrib.ox.ac.uk/fsl<br />
</pre><br />
<br />
* Next, highlight '''form.yml''' and click on '''Edit''' . Uncomment version section in the file, and change that section as follows:<br />
<pre><br />
version:<br />
widget: select<br />
label: "FSL version"<br />
help: "This defines the version of FSL you want to load."<br />
options:<br />
- [ "6.0.3", "FSL/6.0.3" ]<br />
</pre><br />
and save the file, and close the tab.<br />
<br />
Change '''SOFTWARE_NAME''' appropriately. Under options change '''display_version''' to the the version that you want to display on the form, and change '''corresponding_cheaha_module''' to matching module name on cheaha.<br />
<br />
Here we are specifying what the form for the app is going to look like, and changing available parameters for Cheaha.<br />
<br />
The "native" section in '''submit.yml.erb''' includes the slurm parameters you would use with sbatch and describes the resources needed for the app. These can include variable names defined in the form above which will get substituted for the user provided values when the app is run.<br />
<br />
* Now, go into '''template''' and edit file '''script.sh.erb''', by adding following lines at the end of the file. This is the actual job script that will be submitted to the cluster, just like you would submit with sbatch from the command line.<br />
<pre><br />
source /share/apps/rc/software/FSL/6.0.3/fsl/etc/fslconf/fsl.sh<br />
fsl<br />
</pre><br />
Save the file, and close the tab. <br />
This script runs the app executable after loading the appropriate module, based on the version you choose in the form.<br />
<br />
* Close the file browser for your app.<br />
<br />
* Click on '''Launch IGV''', and submit the job with desired parameters.<br />
<br />
You should have your first dev app (IGV) running.<br />
<br />
===More info===<br />
To get more example apps to build or to build passenger apps, look [https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps.html here].<br />
<br />
<br />
[mailto:support@listserv.uab.edu?Subject=OOD%20SandBox:%20 Contact us] if you run into any issues, or to discuss any new app.</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Open_OnDemand_Sandbox&diff=6100Open OnDemand Sandbox2020-08-10T15:12:35Z<p>Ravi89@uab.edu: /* Building your first dev app */</p>
<hr />
<div>[https://rc.uab.edu Open OnDemand] is a web interface to Cheaha HPC resources. We have setup multiple general purpose apps, such as HPC Desktop, Jupyter, RStudio etc, on cheaha, to make the process of accessing these basic softwares easier. OnDemand also allows users to setup their own personal apps in the OnDemand, as [https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps.html sandbox] apps.<br />
<br />
===Setting up sandbox for your profile===<br />
Setting up sandbox is pretty simple and straightforward. <br />
* You need to create a dev folder in your '''$USER_DATA/ondemand''' folder<br />
<pre><br />
mkdir -p $USER_DATA/ondemand/dev<br />
</pre><br />
<br />
* Then go to [https://rc.uab.edu Cheaha OnDemand] , login, and under '''Help''', click on '''Restart Web Server'''<br />
<br />
* You have successfully enabled sandbox for your environment, and you should see a new '''Develop''' tab.<br />
<br />
===Building your first dev app===<br />
<br />
Over here you have instructions to create your first example dev app:<br />
<br />
====IGV====<br />
<br />
* Under '''Develop''' tab , click on '''My SandBox Apps (Development)'''<br />
<br />
* Now click on '''New App''' tab<br />
<br />
* Now we are going to import an already existing git repo for an app, by clicking on '''Clone Existing App'''<br />
<br />
* Add the following values in the form:<br />
<pre><br />
Directory Name: IGV<br />
Git Remote: https://github.com/uabrc/sandbox_app_template<br />
</pre><br />
and '''Submit'''<br />
<br />
'''Note:''' You can also check the line, about creating a new git repo, if you want to use it to maintain your own instance of the app.<br />
<br />
* Now click on '''Files''' to take a look at the files for the app (local git repo working directory), that you just cloned.<br />
<br />
* Let's modify '''manifest.yml''' file (highlight the file, and click on '''edit''') to change metadata for the sandbox app. Change the SOFTWARE_NAME and SOFTWARE_LINK variables appropriately.<br />
In this case change then to following:<br />
<pre><br />
SOFTWARE_NAME : IGV<br />
SOFTWARE_LINK : http://software.broadinstitute.org/software/igv/<br />
</pre><br />
<br />
* Next, highlight '''form.yml''' and click on '''Edit''' . Uncomment version section in the file, and change that section as follows:<br />
<pre><br />
version:<br />
widget: select<br />
label: "IGV version"<br />
help: "This defines the version of IGV you want to load."<br />
options:<br />
- [ "2.5.0-Java-11", "IGV/2.5.0-Java-11" ]<br />
</pre><br />
and save the file, and close the tab.<br />
<br />
Change '''SOFTWARE_NAME''' appropriately. Under options change '''display_version''' to the the version that you want to display on the form, and change '''corresponding_cheaha_module''' to matching module name on cheaha.<br />
<br />
Here we are specifying what the form for the app is going to look like, and changing available parameters for Cheaha.<br />
<br />
The "native" section in '''submit.yml.erb''' includes the slurm parameters you would use with sbatch and describes the resources needed for the app. These can include variable names defined in the form above which will get substituted for the user provided values when the app is run.<br />
<br />
* Now, go into '''template''' and edit file '''script.sh.erb''', by adding following lines at the end of the file. This is the actual job script that will be submitted to the cluster, just like you would submit with sbatch from the command line.<br />
<pre><br />
igvtools_gui.command &<br />
igv.sh<br />
</pre><br />
Save the file, and close the tab. <br />
This script runs the app executable after loading the appropriate module, based on the version you choose in the form.<br />
<br />
* Close the file browser for your app.<br />
<br />
* Click on '''Launch IGV''', and submit the job with desired parameters.<br />
<br />
You should have your first dev app (IGV) running.<br />
<br />
<br />
====FSL====<br />
* Under '''Develop''' tab , click on '''My SandBox Apps (Development)'''<br />
<br />
* Now click on '''New App''' tab<br />
<br />
* Now we are going to import an already existing git repo for an app, by clicking on '''Clone Existing App'''<br />
<br />
* Add the following values in the form:<br />
<pre><br />
Directory Name: FSL<br />
Git Remote: https://github.com/uabrc/sandbox_app_template<br />
</pre><br />
and '''Submit'''<br />
<br />
'''Note:''' You can also check the line, about creating a new git repo, if you want to use it to maintain your own instance of the app.<br />
<br />
* Now click on '''Files''' to take a look at the files for the app (local git repo working directory), that you just cloned.<br />
<br />
* Let's modify '''manifest.yml''' file (highlight the file, and click on '''edit''') to change metadata for the sandbox app. Change the SOFTWARE_NAME and SOFTWARE_LINK variables appropriately.<br />
In this case change then to following:<br />
<pre><br />
SOFTWARE_NAME : FSL<br />
SOFTWARE_LINK : https://www.fmrib.ox.ac.uk/fsl<br />
</pre><br />
<br />
* Next, highlight '''form.yml''' and click on '''Edit''' . Uncomment version section in the file, and change that section as follows:<br />
<pre><br />
version:<br />
widget: select<br />
label: "FSL version"<br />
help: "This defines the version of FSL you want to load."<br />
options:<br />
- [ "6.0.3", "FSL/6.0.3" ]<br />
</pre><br />
and save the file, and close the tab.<br />
<br />
Change '''SOFTWARE_NAME''' appropriately. Under options change '''display_version''' to the the version that you want to display on the form, and change '''corresponding_cheaha_module''' to matching module name on cheaha.<br />
<br />
Here we are specifying what the form for the app is going to look like, and changing available parameters for Cheaha.<br />
<br />
The "native" section in '''submit.yml.erb''' includes the slurm parameters you would use with sbatch and describes the resources needed for the app. These can include variable names defined in the form above which will get substituted for the user provided values when the app is run.<br />
<br />
* Now, go into '''template''' and edit file '''script.sh.erb''', by adding following lines at the end of the file. This is the actual job script that will be submitted to the cluster, just like you would submit with sbatch from the command line.<br />
<pre><br />
source /share/apps/rc/software/FSL/6.0.3/fsl/etc/fslconf/fsl.sh<br />
fsl<br />
</pre><br />
Save the file, and close the tab. <br />
This script runs the app executable after loading the appropriate module, based on the version you choose in the form.<br />
<br />
* Close the file browser for your app.<br />
<br />
* Click on '''Launch IGV''', and submit the job with desired parameters.<br />
<br />
You should have your first dev app (IGV) running.<br />
<br />
===More info===<br />
To get more example apps to build or to build passenger apps, look [https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps.html here].<br />
<br />
<br />
[mailto:support@listserv.uab.edu?Subject=OOD%20SandBox:%20 Contact us] if you run into any issues, or to discuss any new app.</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Open_OnDemand_Sandbox&diff=6095Open OnDemand Sandbox2020-08-07T17:49:02Z<p>Ravi89@uab.edu: /* Building your first dev app */</p>
<hr />
<div>[https://rc.uab.edu Open OnDemand] is a web interface to Cheaha HPC resources. We have setup multiple general purpose apps, such as HPC Desktop, Jupyter, RStudio etc, on cheaha, to make the process of accessing these basic softwares easier. OnDemand also allows users to setup their own personal apps in the OnDemand, as [https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps.html sandbox] apps.<br />
<br />
===Setting up sandbox for your profile===<br />
Setting up sandbox is pretty simple and straightforward. <br />
* You need to create a dev folder in your '''DATA_USER/ondemand''' folder<br />
<pre><br />
mkdir -p /data/user/$USER/ondemand/dev<br />
</pre><br />
<br />
* Then go to [https://rc.uab.edu Cheaha OnDemand] , login, and under '''Help''', click on '''Restart Web Server'''<br />
<br />
* You have successfully enabled sandbox for your environment, and you should see a new '''Develop''' tab.<br />
<br />
<br />
===Building your first dev app===<br />
<br />
Over here we provide instructions to create your first example dev script:<br />
<br />
* Under '''Develop''' tab , click on '''My SandBox Apps (Development)'''<br />
<br />
* Now click on '''New App''' tab<br />
<br />
* Now we are going to import an already existing git repo for an app, by clicking on '''Clone Existing App'''<br />
<br />
* Add the following values in the form:<br />
<pre><br />
Directory Name: IGV<br />
Git Remote: https://github.com/uabrc/ood_igv.git<br />
</pre><br />
and '''Submit'''<br />
<br />
'''Note:''' You can also check the line, about creating a new git repo, if you want to use it to maintain your own instance of the app.<br />
<br />
* Now click on '''Files''' to take a look at the files for the app (git repo), that you just cloned.<br />
<br />
* Highlight '''form.yml''' and click on '''Edit''' . Change the file to the following content:<br />
<pre><br />
---<br />
cluster: "SLURM_CLUSTER"<br />
attributes:<br />
bc_num_hours:<br />
value: 1<br />
<br />
bc_num_slots:<br />
label: Number of CPU<br />
value: 1<br />
min: 1<br />
max: 24<br />
step: 1<br />
<br />
bc_num_mems:<br />
widget: "number_field"<br />
label: Memory per CPU (GB)<br />
value: 4<br />
min: 1<br />
max: 128<br />
step: 1<br />
<br />
bc_partition:<br />
widget: select<br />
label: Partition<br />
options:<br />
- [ "express", "express" ]<br />
- [ "short", "short" ]<br />
- [ "medium", "medium" ]<br />
- [ "long", "long" ]<br />
- [ "interactive", "interactive" ]<br />
- [ "pascalnodes", "pascalnodes" ]<br />
<br />
version:<br />
widget: select<br />
label: "IGV version"<br />
help: "This defines the version of IGV you want to load."<br />
options:<br />
- [ "2.5.0-Java-11", "IGV/2.5.0-Java-11" ]<br />
<br />
form:<br />
- version<br />
- bc_num_hours<br />
- bc_partition<br />
- bc_num_slots<br />
- bc_num_mems<br />
- bc_email_on_started<br />
</pre><br />
and save the file, and close the tab.<br />
<br />
Here we are specifying what the form for the app is going to look like, and changing available parameters for Cheaha.<br />
<br />
* Now again in the file explorer for your app, click on '''New File''' with name '''submit.yml.erb'''<br />
<br />
* Edit the file submit.yml.erb, with the following content.<br />
<pre><br />
---<br />
batch_connect:<br />
template: "vnc"<br />
script:<br />
native:<br />
- "-N 1"<br />
- "-n <%= bc_num_slots.blank? ? 1 : bc_num_slots.to_i %>"<br />
- "--mem-per-cpu=<%= bc_num_mems.blank? ? 4 : bc_num_mems.to_i %>G"<br />
- "--partition=<%= bc_partition %>"<br />
- "--time=<%= bc_num_hours.blank? ? 1 : bc_num_hours.to_i %>:00:00"<br />
- "--job-name=ood-igv"<br />
<%- if bc_partition == "pascalnodes" -%><br />
- "--gres=gpu:1"<br />
<%- end -%><br />
</pre><br />
SAve the file, and close the tab<br />
<br />
* Now, go into '''template''' folder and create a new file '''script.sh.erb''', and add following content to it:<br />
<pre><br />
#!/usr/bin/env bash<br />
<br />
<br />
# Clean the environment<br />
module reset<br />
<br />
# Set working directory to home directory<br />
cd "${HOME}"<br />
<br />
#<br />
# Launch Xfce Window Manager and Panel<br />
#<br />
<br />
(<br />
export SEND_256_COLORS_TO_REMOTE=1<br />
export XDG_CONFIG_HOME="<%= session.staged_root.join("config") %>"<br />
export XDG_DATA_HOME="<%= session.staged_root.join("share") %>"<br />
export XDG_CACHE_HOME="$(mktemp -d)"<br />
module restore<br />
set -x<br />
xfwm4 --compositor=off --daemon --sm-client-disable<br />
xsetroot -solid "#D3D3D3"<br />
xfsettingsd --sm-client-disable<br />
xfce4-panel --sm-client-disable<br />
) &<br />
<br />
#<br />
# Start Integrative Genomics Viewer<br />
#<br />
<br />
# Load the required environment<br />
module load <%= context.version %><br />
# Launch IGV<br />
module list<br />
set -x<br />
igvtools_gui.command &<br />
igv.sh<br />
</pre><br />
Save the file, and close the tab. Now click on '''Open in terminal''', and run <br />
<pre><br />
chmod +x script.sh.erb<br />
</pre><br />
, and then close the terminal. This script needs to be an executable file.<br />
<br />
This script runs the app executable after loading the appropriate module, based on the version you choose in the form.<br />
<br />
* Now close the file browser for your app.<br />
<br />
* Now click, on 'Launch IGV', and submit the job.<br />
<br />
You should have your first dev app running.<br />
<br />
===More info===<br />
To get more example apps to build or to build passenger apps, look [https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps.html here].<br />
<br />
<br />
[mailto:support@listserv.uab.edu?Subject=OOD%20SandBox:%20 Contact us] if you run into any issues, or to discuss any new app.</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Open_OnDemand_Sandbox&diff=6094Open OnDemand Sandbox2020-08-07T17:47:52Z<p>Ravi89@uab.edu: </p>
<hr />
<div>[https://rc.uab.edu Open OnDemand] is a web interface to Cheaha HPC resources. We have setup multiple general purpose apps, such as HPC Desktop, Jupyter, RStudio etc, on cheaha, to make the process of accessing these basic softwares easier. OnDemand also allows users to setup their own personal apps in the OnDemand, as [https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps.html sandbox] apps.<br />
<br />
===Setting up sandbox for your profile===<br />
Setting up sandbox is pretty simple and straightforward. <br />
* You need to create a dev folder in your '''DATA_USER/ondemand''' folder<br />
<pre><br />
mkdir -p /data/user/$USER/ondemand/dev<br />
</pre><br />
<br />
* Then go to [https://rc.uab.edu Cheaha OnDemand] , login, and under '''Help''', click on '''Restart Web Server'''<br />
<br />
* You have successfully enabled sandbox for your environment, and you should see a new '''Develop''' tab.<br />
<br />
<br />
===Building your first dev app===<br />
<br />
Over here we provide instructions to create your first example dev script:<br />
<br />
* Under '''Develop''' tab , click on '''My SandBox Apps (Development)'''<br />
<br />
* Now click on '''New App''' tab<br />
<br />
* Now we are going to import an already existing git repo for an app, by clicking on '''Clone Existing App'''<br />
<br />
* Add the following values in the form:<br />
<pre><br />
Directory Name: IGV<br />
Git Remote: https://github.com/uabrc/ood_igv.git<br />
</pre><br />
and '''Submit'''<br />
<br />
'''Note:''' You can also check the line, about creating a new git repo, if you want to use it to maintain your own instance of the app.<br />
<br />
* Now click on '''Files''' to take a look at the files for the app (git repo), that you just cloned.<br />
<br />
* Highlight '''form.yml''' and click on '''Edit''' . Change the file to the following content:<br />
<pre><br />
---<br />
cluster: "SLURM_CLUSTER"<br />
attributes:<br />
bc_num_hours:<br />
value: 1<br />
<br />
bc_num_slots:<br />
label: Number of CPU<br />
value: 1<br />
min: 1<br />
max: 24<br />
step: 1<br />
<br />
bc_num_mems:<br />
widget: "number_field"<br />
label: Memory per CPU (GB)<br />
value: 4<br />
min: 1<br />
max: 128<br />
step: 1<br />
<br />
bc_partition:<br />
widget: select<br />
label: Partition<br />
options:<br />
- [ "express", "express" ]<br />
- [ "short", "short" ]<br />
- [ "medium", "medium" ]<br />
- [ "long", "long" ]<br />
- [ "interactive", "interactive" ]<br />
- [ "pascalnodes", "pascalnodes" ]<br />
<br />
version:<br />
widget: select<br />
label: "IGV version"<br />
help: "This defines the version of IGV you want to load."<br />
options:<br />
- [ "2.5.0-Java-11", "IGV/2.5.0-Java-11" ]<br />
<br />
form:<br />
- version<br />
- bc_num_hours<br />
- bc_partition<br />
- bc_num_slots<br />
- bc_num_mems<br />
- bc_email_on_started<br />
</pre><br />
and save the file, and close the tab.<br />
<br />
Here we are specifying what the form for the app is going to look like, and changing available parameters for Cheaha.<br />
<br />
* Now again in the file explorer for your app, click on '''New File''' with name '''submit.yml.erb'''<br />
<br />
* Edit the file submit.yml.erb, with the following content.<br />
<pre><br />
---<br />
batch_connect:<br />
template: "vnc"<br />
script:<br />
native:<br />
- "-N 1"<br />
- "-n <%= bc_num_slots.blank? ? 1 : bc_num_slots.to_i %>"<br />
- "--mem-per-cpu=<%= bc_num_mems.blank? ? 4 : bc_num_mems.to_i %>G"<br />
- "--partition=<%= bc_partition %>"<br />
- "--time=<%= bc_num_hours.blank? ? 1 : bc_num_hours.to_i %>:00:00"<br />
- "--job-name=ood-igv"<br />
<%- if bc_partition == "pascalnodes" -%><br />
- "--gres=gpu:1"<br />
<%- end -%><br />
</pre><br />
SAve the file, and close the tab<br />
<br />
* Now, go into '''template''' folder and create a new file '''script.sh.erb''', and add following content to it:<br />
<pre><br />
#!/usr/bin/env bash<br />
<br />
<br />
# Clean the environment<br />
module reset<br />
<br />
# Set working directory to home directory<br />
cd "${HOME}"<br />
<br />
#<br />
# Launch Xfce Window Manager and Panel<br />
#<br />
<br />
(<br />
export SEND_256_COLORS_TO_REMOTE=1<br />
export XDG_CONFIG_HOME="<%= session.staged_root.join("config") %>"<br />
export XDG_DATA_HOME="<%= session.staged_root.join("share") %>"<br />
export XDG_CACHE_HOME="$(mktemp -d)"<br />
module restore<br />
set -x<br />
xfwm4 --compositor=off --daemon --sm-client-disable<br />
xsetroot -solid "#D3D3D3"<br />
xfsettingsd --sm-client-disable<br />
xfce4-panel --sm-client-disable<br />
) &<br />
<br />
#<br />
# Start Integrative Genomics Viewer<br />
#<br />
<br />
# Load the required environment<br />
module load <%= context.version %><br />
# Launch IGV<br />
module list<br />
set -x<br />
igvtools_gui.command &<br />
igv.sh<br />
</pre><br />
Save the file, and close the tab. Now click on '''Open in terminal''', and run <br />
<pre><br />
chmod +x script.sh.erb<br />
</pre><br />
This script needs to be an executable file.<br />
<br />
This script runs the executable after loading the appropriate module, absed on the version you choose in the form.<br />
<br />
* Now close the file browser for your app.<br />
<br />
* Now click, on 'Launch IGV', and submit the job.<br />
<br />
You should have your first dev app running. <br />
<br />
===More info===<br />
To get more example apps to build or to build passenger apps, look [https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps.html here].<br />
<br />
<br />
[mailto:support@listserv.uab.edu?Subject=OOD%20SandBox:%20 Contact us] if you run into any issues, or to discuss any new app.</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Open_OnDemand_Sandbox&diff=6093Open OnDemand Sandbox2020-08-07T17:40:21Z<p>Ravi89@uab.edu: </p>
<hr />
<div>[https://rc.uab.edu Open OnDemand] is a web interface to Cheaha HPC resources. We have setup multiple general purpose apps, such as HPC Desktop, Jupyter, RStudio etc, on cheaha, to make the process of accessing these basic softwares easier. OnDemand also allows users to setup their own personal apps in the OnDemand, as [https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps.html sandbox] apps.<br />
<br />
===Setting up sandbox for your profile===<br />
Setting up sandbox is pretty simple and straightforward. <br />
* You need to create a dev folder in your '''DATA_USER/ondemand''' folder<br />
<pre><br />
mkdir -p /data/user/$USER/ondemand/dev<br />
</pre><br />
<br />
* Then go to [https://rc.uab.edu Cheaha OnDemand] , login, and under '''Help''', click on '''Restart Web Server'''<br />
<br />
* You have successfully enabled sandbox for your environment, and you should see a new '''Develop''' tab.<br />
<br />
<br />
===Building your first dev app===<br />
<br />
Over here we provide instructions to create your first example dev script:<br />
<br />
* Under '''Develop''' tab , click on '''My SandBox Apps (Development)'''<br />
<br />
* Now click on '''New App''' tab<br />
<br />
* Now we are going to import an already existing git repo for an app, by clicking on '''Clone Existing App'''<br />
<br />
* Add the following values in the form:<br />
<pre><br />
Directory Name: IGV<br />
Git Remote: https://github.com/uabrc/ood_igv.git<br />
</pre><br />
and '''Submit'''<br />
<br />
'''Note:''' You can also check the line, about creating a new git repo, if you want to use it to maintain your own instance of the app.<br />
<br />
* Now click on '''Files''' to take a look at the files for the app (git repo), that you just cloned.<br />
<br />
* Highlight '''form.yml''' and click on '''Edit''' . Change the file to the following content:<br />
<pre><br />
---<br />
cluster: "SLURM_CLUSTER"<br />
attributes:<br />
bc_num_hours:<br />
value: 1<br />
<br />
bc_num_slots:<br />
label: Number of CPU<br />
value: 1<br />
min: 1<br />
max: 24<br />
step: 1<br />
<br />
bc_num_mems:<br />
widget: "number_field"<br />
label: Memory per CPU (GB)<br />
value: 4<br />
min: 1<br />
max: 128<br />
step: 1<br />
<br />
bc_partition:<br />
widget: select<br />
label: Partition<br />
options:<br />
- [ "express", "express" ]<br />
- [ "short", "short" ]<br />
- [ "medium", "medium" ]<br />
- [ "long", "long" ]<br />
- [ "interactive", "interactive" ]<br />
- [ "pascalnodes", "pascalnodes" ]<br />
<br />
version:<br />
widget: select<br />
label: "IGV version"<br />
help: "This defines the version of IGV you want to load."<br />
options:<br />
- [ "2.5.0-Java-11", "IGV/2.5.0-Java-11" ]<br />
<br />
form:<br />
- version<br />
- bc_num_hours<br />
- bc_partition<br />
- bc_num_slots<br />
- bc_num_mems<br />
- bc_email_on_started<br />
</pre><br />
and save the file, and close the tab.<br />
<br />
Here we are specifying what the form for the app is going to look like, and changing available parameters for Cheaha.<br />
<br />
* Now again in the file explorer for your app, click on '''New File''' with name '''submit.yml.erb'''<br />
<br />
* Edit the file submit.yml.erb, with the following content.<br />
<pre><br />
---<br />
batch_connect:<br />
template: "vnc"<br />
script:<br />
native:<br />
- "-N 1"<br />
- "-n <%= bc_num_slots.blank? ? 1 : bc_num_slots.to_i %>"<br />
- "--mem-per-cpu=<%= bc_num_mems.blank? ? 4 : bc_num_mems.to_i %>G"<br />
- "--partition=<%= bc_partition %>"<br />
- "--time=<%= bc_num_hours.blank? ? 1 : bc_num_hours.to_i %>:00:00"<br />
- "--job-name=ood-igv"<br />
<%- if bc_partition == "pascalnodes" -%><br />
- "--gres=gpu:1"<br />
<%- end -%><br />
</pre><br />
SAve the file, and close the tab<br />
<br />
* Now, go into '''template''' folder and create a new file '''script.sh.erb''', and add following content to it:<br />
<pre><br />
#!/usr/bin/env bash<br />
<br />
<br />
# Clean the environment<br />
module reset<br />
<br />
# Set working directory to home directory<br />
cd "${HOME}"<br />
<br />
#<br />
# Launch Xfce Window Manager and Panel<br />
#<br />
<br />
(<br />
export SEND_256_COLORS_TO_REMOTE=1<br />
export XDG_CONFIG_HOME="<%= session.staged_root.join("config") %>"<br />
export XDG_DATA_HOME="<%= session.staged_root.join("share") %>"<br />
export XDG_CACHE_HOME="$(mktemp -d)"<br />
module restore<br />
set -x<br />
xfwm4 --compositor=off --daemon --sm-client-disable<br />
xsetroot -solid "#D3D3D3"<br />
xfsettingsd --sm-client-disable<br />
xfce4-panel --sm-client-disable<br />
) &<br />
<br />
#<br />
# Start Integrative Genomics Viewer<br />
#<br />
<br />
# Load the required environment<br />
module load <%= context.version %><br />
# Launch IGV<br />
module list<br />
set -x<br />
igvtools_gui.command &<br />
igv.sh<br />
</pre><br />
Save the file, and close the tab.<br />
<br />
This script runs the executable after loading the appropriate module, absed on the version you choose in the form.<br />
<br />
* Now close the file browser for your app.<br />
<br />
* Now click, on 'Launch IGV', and submit the job.<br />
<br />
You have your first dev app running. <br />
<br />
===More info===<br />
To get more example apps to build or to build passenger apps, look [https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps.html here].<br />
<br />
<br />
[mailto:support@listserv.uab.edu?Subject=OOD%20SandBox:%20 Contact us] if you run into any issues, or to discuss any new app.</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Open_OnDemand_Sandbox&diff=6092Open OnDemand Sandbox2020-08-07T17:35:46Z<p>Ravi89@uab.edu: building first dev app</p>
<hr />
<div>[https://rc.uab.edu Open OnDemand] is a web interface to Cheaha HPC resources. We have setup multiple general purpose apps, such as HPC Desktop, Jupyter, RStudio etc, on cheaha, to make the process of accessing these basic softwares easier. OnDemand also allows users to setup their own personal apps in the OnDemand, as [https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps.html sandbox] apps.<br />
<br />
===Setting up sandbox for your profile===<br />
Setting up sandbox is pretty simple and straightforward. <br />
* You need to create a dev folder in your '''DATA_USER/ondemand''' folder<br />
<pre><br />
mkdir -p /data/user/$USER/ondemand/dev<br />
</pre><br />
<br />
* Then go to [https://rc.uab.edu Cheaha OnDemand] , login, and under '''Help''', click on '''Restart Web Server'''<br />
<br />
* You have successfully enabled sandbox for your environment, and you should see a new '''Develop''' tab.<br />
<br />
<br />
===Building your first dev app===<br />
<br />
* Under '''Develop''' tab , click on '''My SandBox Apps (Development)'''<br />
<br />
* Now click on '''New App''' tab<br />
<br />
* Now we are going to import an already existing git repo for an app, by clicking on '''Clone Existing App'''<br />
<br />
* Add the following values in the form:<br />
<pre><br />
Directory Name: IGV<br />
Git Remote: https://github.com/uabrc/ood_igv.git<br />
</pre><br />
and '''Submit'''<br />
<br />
'''Note:''' You can also check the line, about creating a new git repo, if you want to use it to maintain your own instance of the app.<br />
<br />
* Now click on '''Files''' to take a look at the files for the app (git repo), that you just cloned.<br />
<br />
* Highlight '''form.yml''' and click on '''Edit''' . Change the file to the following content:<br />
<pre><br />
---<br />
cluster: "SLURM_CLUSTER"<br />
attributes:<br />
bc_num_hours:<br />
value: 1<br />
<br />
bc_num_slots:<br />
label: Number of CPU<br />
value: 1<br />
min: 1<br />
max: 24<br />
step: 1<br />
<br />
bc_num_mems:<br />
widget: "number_field"<br />
label: Memory per CPU (GB)<br />
value: 4<br />
min: 1<br />
max: 128<br />
step: 1<br />
<br />
bc_partition:<br />
widget: select<br />
label: Partition<br />
options:<br />
- [ "express", "express" ]<br />
- [ "short", "short" ]<br />
- [ "medium", "medium" ]<br />
- [ "long", "long" ]<br />
- [ "interactive", "interactive" ]<br />
- [ "pascalnodes", "pascalnodes" ]<br />
<br />
version:<br />
widget: select<br />
label: "IGV version"<br />
help: "This defines the version of IGV you want to load."<br />
options:<br />
- [ "2.5.0-Java-11", "IGV/2.5.0-Java-11" ]<br />
<br />
form:<br />
- version<br />
- bc_num_hours<br />
- bc_partition<br />
- bc_num_slots<br />
- bc_num_mems<br />
- bc_email_on_started<br />
</pre><br />
and save the file, and close the tab.<br />
<br />
Here we are specifying what the form for the app is going to look like, and changing available parameters for Cheaha.<br />
<br />
* Now again in the file explorer for your app, click on '''New File''' with name '''submit.yml.erb'''<br />
<br />
* Edit the file submit.yml.erb, with the following content.<br />
<pre><br />
---<br />
batch_connect:<br />
template: "vnc"<br />
script:<br />
native:<br />
- "-N 1"<br />
- "-n <%= bc_num_slots.blank? ? 1 : bc_num_slots.to_i %>"<br />
- "--mem-per-cpu=<%= bc_num_mems.blank? ? 4 : bc_num_mems.to_i %>G"<br />
- "--partition=<%= bc_partition %>"<br />
- "--time=<%= bc_num_hours.blank? ? 1 : bc_num_hours.to_i %>:00:00"<br />
- "--job-name=ood-igv"<br />
<%- if bc_partition == "pascalnodes" -%><br />
- "--gres=gpu:1"<br />
<%- end -%><br />
</pre><br />
SAve the file, and close the tab<br />
<br />
* Now, go into '''template''' folder and create a new file '''script.sh.erb''', and add following content to it:<br />
<pre><br />
#!/usr/bin/env bash<br />
<br />
<br />
# Clean the environment<br />
module reset<br />
<br />
# Set working directory to home directory<br />
cd "${HOME}"<br />
<br />
#<br />
# Launch Xfce Window Manager and Panel<br />
#<br />
<br />
(<br />
export SEND_256_COLORS_TO_REMOTE=1<br />
export XDG_CONFIG_HOME="<%= session.staged_root.join("config") %>"<br />
export XDG_DATA_HOME="<%= session.staged_root.join("share") %>"<br />
export XDG_CACHE_HOME="$(mktemp -d)"<br />
module restore<br />
set -x<br />
xfwm4 --compositor=off --daemon --sm-client-disable<br />
xsetroot -solid "#D3D3D3"<br />
xfsettingsd --sm-client-disable<br />
xfce4-panel --sm-client-disable<br />
) &<br />
<br />
#<br />
# Start Integrative Genomics Viewer<br />
#<br />
<br />
# Load the required environment<br />
module load <%= context.version %><br />
# Launch IGV<br />
module list<br />
set -x<br />
igvtools_gui.command &<br />
igv.sh<br />
</pre><br />
Save the file, and close the tab.<br />
<br />
This script runs the executable after loading the appropriate module, absed on the version you choose in the form.<br />
<br />
* Now close the file browser for your app.<br />
<br />
* Now click, on 'Launch IGV', and submit the job.<br />
<br />
You have your first dev app running. [mailto:support@listserv.uab.edu?Subject=OOD%20SandBox:%20 Contact us] if you run into any issues, or to discuss any new app.</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Open_OnDemand_Sandbox&diff=6091Open OnDemand Sandbox2020-08-07T16:27:33Z<p>Ravi89@uab.edu: setting up sandbox</p>
<hr />
<div>[https://rc.uab.edu Open OnDemand] is a web interface to Cheaha HPC resources. We have setup multiple general purpose apps, such as HPC Desktop, Jupyter, RStudio etc, on cheaha, to make the process of accessing these basic softwares easier. OnDemand also allows users to setup their own personal apps in the OnDemand, as [https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps.html sandbox] apps.<br />
<br />
===Setting up sandbox for your profile===<br />
Setting up sandbox is pretty simple and straightforward. <br />
* You need to create a dev folder in your '''DATA_USER/ondemand''' folder<br />
<pre><br />
mkdir -p /data/user/$USER/ondemand/dev<br />
</pre><br />
<br />
* Then go to [https://rc.uab.edu Cheaha OnDemand] , login, and under '''Help''', click on '''Restart Web Server'''<br />
<br />
* You have successfully enabled sandbox for your environment, and you should see a new '''Develop''' tab.</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Open_OnDemand_Sandbox&diff=6090Open OnDemand Sandbox2020-08-07T14:56:11Z<p>Ravi89@uab.edu: Intro</p>
<hr />
<div>[https://rc.uab.edu Open OnDemand] is a web interface to Cheaha HPC resources. We have setup multiple general purpose apps, such as HPC Desktop, Jupyter, RStudio etc, on cheaha, to make the process of accessing these basic softwares easier. OnDemand also allows users to setup their own personal apps in the OnDemand, as [https://osc.github.io/ood-documentation/master/app-development/tutorials-interactive-apps.html sandbox] apps.</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Remote_Editing&diff=6064Remote Editing2020-04-01T19:33:36Z<p>Ravi89@uab.edu: </p>
<hr />
<div>== [[Visual Studio Code]] ==<br />
To use the the SSH extension to access files on Cheaha, please follow the instructions in the documentation for installation. Once it is installed, follow these instructions to set up the SSH config file. The following assumes SSH is installed locally, and that a config file exists in the usual location for your operating system. The commands assume you have an open Visual Studio Code window.<br />
<br />
# Open the command palette, default hotkey "Ctrl + Shift + P".<br />
# Locate "Remote-SSH: Connect to Host..." by typing part of the command at the prompt.<br />
#: [[File:Remote-editing-vscode-palette.png]]<br />
# Click the command in the palette prompt.<br />
# Click "Configure SSH Hosts...".<br />
#: [[File:Remote-editing-vscode-ssh-choices.png]]<br />
# Choose the location of the existing config file.<br />
#: [[File:Remote-editing-vscode-ssh-file.png]]<br />
# In the new editor window that opened, add the following lines then save the file.<br />
<br />
<pre><br />
Host cheaha<br />
HostName cheaha.rc.uab.edu<br />
User <username><br />
</pre><br />
<br />
The text <username> should be replaced by the user name you use to access Cheaha. The "User" line is not necessary but can save some time.<br />
<br />
== SSH ==<br />
<br />
=== With tmux ===<br />
<br />
First, ssh into VM like normal:<br />
<pre><br />
ssh blazerid@cheaha.rc.uab.edu<br />
</pre><br />
<br />
If you are trying to edit file on VM, not Cheaha, make sure you have tmux installed on system.<br />
<br />
<pre><br />
# Ubuntu<br />
sudo apt install tmux<br />
<br />
# CentOS<br />
sudo yum install tmux<br />
</pre><br />
<br />
Now, create a tmux session and detach right away.<br />
<br />
<pre><br />
tmux new<br />
<br />
# Ctrl+B then D<br />
^B d<br />
</pre><br />
<br />
You can exit this ssh connection now.<br />
<pre><br />
exit<br />
</pre><br />
<br />
This time, ssh with remote command and special option <code> -t Force pseudo-terminal allocation.</code><br />
<pre><br />
ssh -t blazerid@cheaha.rc.uab.edu "tmux -CC attach"<br />
</pre></div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Data_Movement&diff=5922Data Movement2019-08-15T15:51:55Z<p>Ravi89@uab.edu: </p>
<hr />
<div>'''NOTE: If you find better and faster methods/tools, please add them to this page as well''<br />
<br />
There are various Linux native commands that you can use to move your data within the HPC cluster, such as [https://linux.die.net/man/1/mv mv], [https://linux.die.net/man/1/cp cp], [https://linux.die.net/man/1/scp scp] etc. One of the most powerful tools for data movement on Linux is [https://linux.die.net/man/1/rsync rsync], which we'll be using in our examples below. <br />
<br />
'''rsync''' and '''scp''' can also be used for moving data from a local storage to Cheaha.<br />
<br />
==RSync==<br />
To find out more information such as flags, usage etc. about any of the above mentioned tools, you can use '''man TOOL_NAME'''.<br />
<pre><br />
[build@c0051 ~]$ man rsync<br />
<br />
NAME<br />
rsync - a fast, versatile, remote (and local) file-copying tool<br />
<br />
SYNOPSIS<br />
Local: rsync [OPTION...] SRC... [DEST]<br />
<br />
Access via remote shell:<br />
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]<br />
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST<br />
<br />
Access via rsync daemon:<br />
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST]<br />
rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]<br />
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST<br />
rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST<br />
<br />
Usages with just one SRC arg and no DEST arg will list the source files<br />
instead of copying.<br />
<br />
DESCRIPTION<br />
.<br />
.<br />
.<br />
</pre><br />
<br />
If you are interested in finding out about various methods of moving data and various tools which can be used to achieve that aim, this page provides a very good description/guide : [http://moo.nac.uci.edu/~hjm/HOWTO_move_data.html How to transfer large amounts of data via network.].<br />
<br />
===Moving local data to Cheaha===<br />
To move data from your local storage to cheaha, using rsync, you can use the following command, on your local system:<br />
<pre><br />
rsync -aP PATH_TO_FILE_OR_DIRECTORY BLAZERID@cheaha.rc.uab.edu:PATH_ON_CHEAHA<br />
</pre><br />
where,<br />
* PATH_TO_FILE_OR_DIRECTORY is the full/relative path to file or directory that you want to move to cheaha. If transferring a directory, a trailing slash on the source creates an additional directory level at the destination. You can think of a trailing / on a source as meaning "copy the contents of this directory" as opposed to "copy the directory by name"<br />
* PATH_ON_CHEAHA is the full path on cheaha, where you want to move your directory. Remember, you have 20GB of space in your HOME directory, os if you are moving raw data to cheaha, please move it in either, /data/user/$BLAZERID or /data/scratch/$BLAZERID<br />
<br />
===Moving data on Cheaha to your local storage===<br />
To move data from cheaha to your local storage, using rsync, you can use the following command, on your local system:<br />
<pre><br />
rsync -aP BLAZERID@cheaha.rc.uab.edu:PATH_TO_FILE_OR_DIRECTORY_ON_CHEAHA PATH_ON_LOCAL_STORAGE<br />
</pre><br />
where,<br />
* PATH_TO_FILE_OR_DIRECTORY_ON_CHEAHA is the full path to file or directory on cheaha that you want to move to your local storage. If transferring a directory, a trailing slash on the source creates an additional directory level at the destination. You can think of a trailing / on a source as meaning "copy the contents of this directory" as opposed to "copy the directory by name"<br />
* PATH_ON_LOCAL_STORAGE is the full/relative path on cheaha, where you want to move your directory.<br />
<br />
== Privacy ==<br />
{{SensitiveInformation}}<br />
<br />
==Moving large amount of data on cheaha==<br />
<br />
If the data that you are moving is large, then you should always use either an interactive session or a job script for your data movement. This ensures that the process for your data movement isn't using and slowing login nodes for a long time, and instead is performing these operations on a compute node.<br />
<br />
===Interactive session===<br />
<br />
* Start an interactive session using srun<br />
<pre><br />
srun --ntasks=1 --mem-per-cpu=1024 --time=08:00:00 --partition=medium --job-name=DATA_TRANSFER --pty /bin/bash<br />
</pre><br />
'''NOTE:''' Please change the time required and the corresponding [https://docs.uabgrid.uab.edu/wiki/SLURM#Slurm_Partitions partition] according to your need.<br />
<br />
* Start an rsync process to start the transfer, once you have moved from login001 to c00XX node:<br />
<pre><br />
[build@c0051 Salmon]$ rsync -aP SOURCE_PATH DESTINATION_PATH<br />
</pre><br />
<br />
===Job Script===<br />
<pre>#!/bin/bash<br />
#<br />
#SBATCH --job-name=test<br />
#SBATCH --output=res.txt<br />
#SBATCH --ntasks=1<br />
#SBATCH --partition=express<br />
#<br />
# Time format = HH:MM:SS, DD-HH:MM:SS<br />
#<br />
#SBATCH --time=10:00<br />
#<br />
# Mimimum memory required per allocated CPU in MegaBytes. <br />
#<br />
#SBATCH --mem-per-cpu=2048<br />
#SBATCH --mail-type=FAIL<br />
#SBATCH --mail-user=YOUR_EMAIL_ADDRESS<br />
<br />
rsync -aP SOURCE_PATH DESTINATION_PATH<br />
</pre><br />
<br />
'''NOTE:''' <br />
* Please change the time required and the corresponding [https://docs.uabgrid.uab.edu/wiki/SLURM#Slurm_Partitions partition] according to your need.<br />
* After modifications to the given job script, submit it using : '''sbatch JOB_SCRIPT'''<br />
<br />
==FileZilla==<br />
<br />
'''Installation<br />
'''<br />
<br />
FileZilla can be downloaded from the website https://filezilla-project.org/ under Quick download links. Download the FileZilla Client version to transfer from local to Cheaha.<br />
<br />
A setup wizard window should be launched. Once the wizard is running, simply follow the prompts until the installation process is completed. After the installation procedure has been completed and the setup wizard has terminated, open FileZilla and proceed to connect it to Cheaha.<br />
<br />
<br />
'''Connect to Cheaha (FTP Server)<br />
'''<br />
The first thing to do is connecting to a server. There are 2 ways to connect to Cheaha<br />
<br />
1. Basic method<br />
Go to : File- Site Manager- New Site<br />
* Hostname cheaha.rc.uab.edu<br />
* Username and password would be the same as cheaha login details<br />
* Port : 22<br />
* Logon type – Normal<br />
* Protocol – SFTP -SSH File Transfer Protocol<br />
<br />
2. Quick connect<br />
Enter the hostname into the quickconnect bar's Host: field, the username into the Username: field as well as the password into the Password: field. You may leave the Port: field empty unless your login information specifies a certain port to use. Now click on Quickconnect.<br />
<br />
<br />
'''Transferring Data (Upload and Download Files)<br />
'''<br />
<br />
1. Upload Data<br />
<br />
First - in the local pane - bring the directory into view which contains data to be uploaded (e.g. index.html and images/). Now, navigate to the desired target directory on the server (using the server pane's file listings). To upload the data, select the respective files/directories and drag them from the local to the remote pane. You will notice that the files will be added to the transfer queue at the bottom of the window and soon thereafter get removed again - since they were (hopefully, if nothing went wrong) just uploaded to the server. The uploaded files and directories should now be displayed in the server content listing at the right side of the window.<br />
<br />
2. Download Data<br />
<br />
Downloading files, or complete directories, works essentially the same way as uploading - you just drag the files/directories from the remote pane to the local pane this time, instead of the other way round.</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Data_Movement&diff=5921Data Movement2019-08-15T15:51:32Z<p>Ravi89@uab.edu: </p>
<hr />
<div>'''NOTE: If you find better and faster methods/tools, please' add them to this page as well''<br />
<br />
There are various Linux native commands that you can use to move your data within the HPC cluster, such as [https://linux.die.net/man/1/mv mv], [https://linux.die.net/man/1/cp cp], [https://linux.die.net/man/1/scp scp] etc. One of the most powerful tools for data movement on Linux is [https://linux.die.net/man/1/rsync rsync], which we'll be using in our examples below. <br />
<br />
'''rsync''' and '''scp''' can also be used for moving data from a local storage to Cheaha.<br />
<br />
==RSync==<br />
To find out more information such as flags, usage etc. about any of the above mentioned tools, you can use '''man TOOL_NAME'''.<br />
<pre><br />
[build@c0051 ~]$ man rsync<br />
<br />
NAME<br />
rsync - a fast, versatile, remote (and local) file-copying tool<br />
<br />
SYNOPSIS<br />
Local: rsync [OPTION...] SRC... [DEST]<br />
<br />
Access via remote shell:<br />
Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]<br />
Push: rsync [OPTION...] SRC... [USER@]HOST:DEST<br />
<br />
Access via rsync daemon:<br />
Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST]<br />
rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]<br />
Push: rsync [OPTION...] SRC... [USER@]HOST::DEST<br />
rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST<br />
<br />
Usages with just one SRC arg and no DEST arg will list the source files<br />
instead of copying.<br />
<br />
DESCRIPTION<br />
.<br />
.<br />
.<br />
</pre><br />
<br />
If you are interested in finding out about various methods of moving data and various tools which can be used to achieve that aim, this page provides a very good description/guide : [http://moo.nac.uci.edu/~hjm/HOWTO_move_data.html How to transfer large amounts of data via network.].<br />
<br />
===Moving local data to Cheaha===<br />
To move data from your local storage to cheaha, using rsync, you can use the following command, on your local system:<br />
<pre><br />
rsync -aP PATH_TO_FILE_OR_DIRECTORY BLAZERID@cheaha.rc.uab.edu:PATH_ON_CHEAHA<br />
</pre><br />
where,<br />
* PATH_TO_FILE_OR_DIRECTORY is the full/relative path to file or directory that you want to move to cheaha. If transferring a directory, a trailing slash on the source creates an additional directory level at the destination. You can think of a trailing / on a source as meaning "copy the contents of this directory" as opposed to "copy the directory by name"<br />
* PATH_ON_CHEAHA is the full path on cheaha, where you want to move your directory. Remember, you have 20GB of space in your HOME directory, os if you are moving raw data to cheaha, please move it in either, /data/user/$BLAZERID or /data/scratch/$BLAZERID<br />
<br />
===Moving data on Cheaha to your local storage===<br />
To move data from cheaha to your local storage, using rsync, you can use the following command, on your local system:<br />
<pre><br />
rsync -aP BLAZERID@cheaha.rc.uab.edu:PATH_TO_FILE_OR_DIRECTORY_ON_CHEAHA PATH_ON_LOCAL_STORAGE<br />
</pre><br />
where,<br />
* PATH_TO_FILE_OR_DIRECTORY_ON_CHEAHA is the full path to file or directory on cheaha that you want to move to your local storage. If transferring a directory, a trailing slash on the source creates an additional directory level at the destination. You can think of a trailing / on a source as meaning "copy the contents of this directory" as opposed to "copy the directory by name"<br />
* PATH_ON_LOCAL_STORAGE is the full/relative path on cheaha, where you want to move your directory.<br />
<br />
== Privacy ==<br />
{{SensitiveInformation}}<br />
<br />
==Moving large amount of data on cheaha==<br />
<br />
If the data that you are moving is large, then you should always use either an interactive session or a job script for your data movement. This ensures that the process for your data movement isn't using and slowing login nodes for a long time, and instead is performing these operations on a compute node.<br />
<br />
===Interactive session===<br />
<br />
* Start an interactive session using srun<br />
<pre><br />
srun --ntasks=1 --mem-per-cpu=1024 --time=08:00:00 --partition=medium --job-name=DATA_TRANSFER --pty /bin/bash<br />
</pre><br />
'''NOTE:''' Please change the time required and the corresponding [https://docs.uabgrid.uab.edu/wiki/SLURM#Slurm_Partitions partition] according to your need.<br />
<br />
* Start an rsync process to start the transfer, once you have moved from login001 to c00XX node:<br />
<pre><br />
[build@c0051 Salmon]$ rsync -aP SOURCE_PATH DESTINATION_PATH<br />
</pre><br />
<br />
===Job Script===<br />
<pre>#!/bin/bash<br />
#<br />
#SBATCH --job-name=test<br />
#SBATCH --output=res.txt<br />
#SBATCH --ntasks=1<br />
#SBATCH --partition=express<br />
#<br />
# Time format = HH:MM:SS, DD-HH:MM:SS<br />
#<br />
#SBATCH --time=10:00<br />
#<br />
# Mimimum memory required per allocated CPU in MegaBytes. <br />
#<br />
#SBATCH --mem-per-cpu=2048<br />
#SBATCH --mail-type=FAIL<br />
#SBATCH --mail-user=YOUR_EMAIL_ADDRESS<br />
<br />
rsync -aP SOURCE_PATH DESTINATION_PATH<br />
</pre><br />
<br />
'''NOTE:''' <br />
* Please change the time required and the corresponding [https://docs.uabgrid.uab.edu/wiki/SLURM#Slurm_Partitions partition] according to your need.<br />
* After modifications to the given job script, submit it using : '''sbatch JOB_SCRIPT'''<br />
<br />
==FileZilla==<br />
<br />
'''Installation<br />
'''<br />
<br />
FileZilla can be downloaded from the website https://filezilla-project.org/ under Quick download links. Download the FileZilla Client version to transfer from local to Cheaha.<br />
<br />
A setup wizard window should be launched. Once the wizard is running, simply follow the prompts until the installation process is completed. After the installation procedure has been completed and the setup wizard has terminated, open FileZilla and proceed to connect it to Cheaha.<br />
<br />
<br />
'''Connect to Cheaha (FTP Server)<br />
'''<br />
The first thing to do is connecting to a server. There are 2 ways to connect to Cheaha<br />
<br />
1. Basic method<br />
Go to : File- Site Manager- New Site<br />
* Hostname cheaha.rc.uab.edu<br />
* Username and password would be the same as cheaha login details<br />
* Port : 22<br />
* Logon type – Normal<br />
* Protocol – SFTP -SSH File Transfer Protocol<br />
<br />
2. Quick connect<br />
Enter the hostname into the quickconnect bar's Host: field, the username into the Username: field as well as the password into the Password: field. You may leave the Port: field empty unless your login information specifies a certain port to use. Now click on Quickconnect.<br />
<br />
<br />
'''Transferring Data (Upload and Download Files)<br />
'''<br />
<br />
1. Upload Data<br />
<br />
First - in the local pane - bring the directory into view which contains data to be uploaded (e.g. index.html and images/). Now, navigate to the desired target directory on the server (using the server pane's file listings). To upload the data, select the respective files/directories and drag them from the local to the remote pane. You will notice that the files will be added to the transfer queue at the bottom of the window and soon thereafter get removed again - since they were (hopefully, if nothing went wrong) just uploaded to the server. The uploaded files and directories should now be displayed in the server content listing at the right side of the window.<br />
<br />
2. Download Data<br />
<br />
Downloading files, or complete directories, works essentially the same way as uploading - you just drag the files/directories from the remote pane to the local pane this time, instead of the other way round.</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Collaborator_Account&diff=5903Collaborator Account2019-04-10T21:37:51Z<p>Ravi89@uab.edu: </p>
<hr />
<div>This Page lays down the step for you as a UAB employee to request for a cheaha account for your collaborator.<br />
<br />
==Create XIAS Account==<br />
XIAS Accounts or external access account allows UAB employees to sponsor external collaborators to utilize some of the UAB resources for which the user has been granted access. Creating XIAS account is a self-service interface which allows you to sponsor and create an account for your collaborator at [https://idm.uab.edu/cgi-cas/xrmi/sites XIAS website].<br />
<br />
'''When you go through the sponsorship process you are stating that you know the individual(s) and are responsible for their actions while they are using the XIAS accounts.'''<br />
<br />
===Create a site===<br />
When you go to the [https://idm.uab.edu/cgi-cas/xrmi/sites XIAS website], you'll notice two options on the left-hand panel: [https://idm.uab.edu/cgi-cas/xrmi/sites Manage Projects/Sites] and [https://idm.uab.edu/cgi-cas/xrmi/users Manage Users.]<br />
<br />
* Choose Manage Projects/sites.<br />
* Over there click on '''New''' to create a new site.<br />
* Fill in all the information i.e. Short Description, Long Description, Start date and End date. <br />
** Remember that your users cannot have '''End date''' beyond your sites '''End date'''.<br />
** Note that the start and end dates should be in the format YYYY-MM-DD<br />
** URIs are the resources that the sponsored users should have access to. If the resources are applications or servers then the manager of that resource must do what is necessary within that resource to authorize the external users to gain access.<br />
* In the URIs section: fill out '''VPN.DPO.UAB.EDU''' and '''cheaha.rc.uab.edu''' <br />
* Click on '''Add''' button to create the site.<br />
<br />
=== Create a user===<br />
<br />
* Now choose [https://idm.uab.edu/cgi-cas/xrmi/users Manage Users.] from the left hand panel.<br />
* In the drop-down select your XIAS site.<br />
* To add new users click the '''Register''' button. To review the users already there and change their end date click the '''List''' button.<br />
* To register new user(s) enter an end date for that user’s access. <br />
** The date must be on or before the end date for the site and in the format YYYY-MM-DD<br />
* Enter the email addresses of the user(s) (your collaborator's email) in the box under the end date. You can add multiple users by putting each on a separate line.<br />
<br />
=== Collaborator===<br />
Once you have gone through the above steps, your collaborator should receive an automated email from XIAS with a code, that he can use to complete their registration.<br />
<br />
==Request an account on cheaha==<br />
Once you have completed the steps of adding/sponsoring XIAS account for your collaborator, send us an email on support@listserv.uab.edu with information about the collaborator. Please don't forget to include their PrimaryID and email address which you used to create their XIAS account, as it would become their Username on [[Cheaha]].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Collaborator_Account&diff=5902Collaborator Account2019-04-10T21:32:56Z<p>Ravi89@uab.edu: </p>
<hr />
<div>This Page lays down the step for you as a UAB employee to create a temporary account for your collaborator.<br />
<br />
==Create XIAS Account==<br />
XIAS Accounts or external access account allows UAB employees to sponsor external collaborators to utilize some of the UAB resources for which the user has been granted access. Creating XIAS account is a self-service interface which allows you to sponsor and create an account for your collaborator at [https://idm.uab.edu/cgi-cas/xrmi/sites XIAS website].<br />
<br />
'''When you go through the sponsorship process you are stating that you know the individual(s) and are responsible for their actions while they are using the XIAS accounts.'''<br />
<br />
===Create a site===<br />
When you go to the [https://idm.uab.edu/cgi-cas/xrmi/sites XIAS website], you'll notice two options on the left-hand panel: [https://idm.uab.edu/cgi-cas/xrmi/sites Manage Projects/Sites] and [https://idm.uab.edu/cgi-cas/xrmi/users Manage Users.]<br />
<br />
* Choose Manage Projects/sites.<br />
* Over there click on '''New''' to create a new site.<br />
* Fill in all the information i.e. Short Description, Long Description, Start date and End date. <br />
** Remember that your users cannot have '''End date''' beyond your sites '''End date'''.<br />
** Note that the start and end dates should be in the format YYYY-MM-DD<br />
** URIs are the resources that the sponsored users should have access to. If the resources are applications or servers then the manager of that resource must do what is necessary within that resource to authorize the external users to gain access.<br />
* In the URIs section: fill out '''VPN.DPO.UAB.EDU''' and '''cheaha.rc.uab.edu''' <br />
* Click on '''Add''' button to create the site.<br />
<br />
=== Create a user===<br />
<br />
* Now choose [https://idm.uab.edu/cgi-cas/xrmi/users Manage Users.] from the left hand panel.<br />
* In the drop-down select your XIAS site.<br />
* To add new users click the '''Register''' button. To review the users already there and change their end date click the '''List''' button.<br />
* To register new user(s) enter an end date for that user’s access. <br />
** The date must be on or before the end date for the site and in the format YYYY-MM-DD<br />
* Enter the email addresses of the user(s) (your collaborator's email) in the box under the end date. You can add multiple users by putting each on a separate line.<br />
<br />
=== Collaborator===<br />
Once you have gone through the above steps, your collaborator should receive an automated email from XIAS with a code, that he can use to complete their registration.<br />
<br />
==Request an account on cheaha==<br />
Once you have completed the steps of adding/sponsoring XIAS account for your collaborator, send us an email on support@listserv.uab.edu with information about the collaborator. Please don't forget to include their PrimaryID and email address which you used to create their XIAS account, as it would become their Username on [[Cheaha]].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Cheaha_GettingStarted&diff=5901Cheaha GettingStarted2019-04-10T21:18:28Z<p>Ravi89@uab.edu: Adding steps for creating an external collaborator account</p>
<hr />
<div>Cheaha is a cluster computing environment for UAB researchers. Information about the history and future plans for Cheaha is available on the [[Cheaha]] page.<br />
<br />
== Access (Cluster Account Request) ==<br />
<br />
To request an account on [[Cheaha]], please {{CheahaAccountRequest}}. Please include some background information about the work you plan on doing on the cluster and the group you work with, ie. your lab or affiliation.<br />
<br />
Usage of Cheaha is governed by [http://www.uabgrid.uab.edu/aup UAB's Acceptable Use Policy (AUP)] for computer resources. <br />
<br />
The official DNS name of Cheaha's frontend machine is ''cheaha.rc.uab.edu''. If you want to refer to the machine as ''cheaha'', you'll have to either add the "rc.uab.edu" to you computer's DNS search path. On Unix-derived systems (Linux, Mac) you can edit your computers /etc/resolv.conf as follows (you'll need administrator access to edit this file)<br />
<pre><br />
search rc.uab.edu<br />
</pre><br />
Or you can customize your SSH configuration to use the short name "cheaha" as a connection name. On systems using OpenSSH you can add the following to your ~/.ssh/config file<br />
<br />
<pre><br />
Host cheaha<br />
Hostname cheaha.rc.uab.edu<br />
</pre><br />
<br />
=== External Collaborator===<br />
To request an account for an external collaborator, please follow the steps [https://docs.uabgrid.uab.edu/wiki/Collaborator_Account here.]<br />
<br />
== Login ==<br />
===Overview===<br />
Once your account has been created, you'll receive an email containing your user ID, generally your Blazer ID. Logging into Cheaha requires an SSH client. Most UAB Windows workstations already have an SSH client installed, possibly named '''SSH Secure Shell Client''' or [http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY]. Linux and Mac OS X systems should have an SSH client installed by default.<br />
<br />
Usage of Cheaha is governed by [http://www.uabgrid.uab.edu/aup UAB's Acceptable Use Policy (AUP)] for computer resources.<br />
<br />
===Client Configuration===<br />
This section will cover steps to configure Windows, Linux and Mac OS X clients to connect to Cheaha.<br />
====Linux====<br />
Linux systems, regardless of the flavor (RedHat, SuSE, Ubuntu, etc...), should already have an SSH client on the system as part of the default install.<br />
# Start a terminal (on RedHat click Applications -> Accessories -> Terminal, on Ubuntu Ctrl+Alt+T)<br />
# At the prompt, enter the following command to connect to Cheaha ('''Replace blazerid with your Cheaha userid''')<br />
ssh '''blazerid'''@cheaha.rc.uab.edu<br />
<br />
====Mac OS X====<br />
Mac OS X is a Unix operating system (BSD) and has a built in ssh client.<br />
# Start a terminal (click Finder, type Terminal and double click on Terminal under the Applications category)<br />
# At the prompt, enter the following command to connect to Cheaha ('''Replace blazerid with your Cheaha userid''')<br />
ssh '''blazerid'''@cheaha.rc.uab.edu<br />
<br />
====Windows====<br />
There are many SSH clients available for Windows, some commercial and some that are free (GPL). This section will cover two clients that are commonly found on UAB Windows systems.<br />
=====MobaXterm=====<br />
[http://mobaxterm.mobatek.net/ MobaXterm] is a free (also available for a price in a Profession version) suite of SSH tools. Of the Windows clients we've used, MobaXterm is the easiest to use and feature complete. [http://mobaxterm.mobatek.net/features.html Features] include (but not limited to):<br />
* SSH client (in a handy web browser like tabbed interface)<br />
* Embedded Cygwin (which allows Windows users to run many Linux commands like grep, rsync, sed)<br />
* Remote file system browser (graphical SFTP)<br />
* X11 forwarding for remotely displaying graphical content from Cheaha<br />
* Installs without requiring Windows Administrator rights<br />
<br />
Start MobaXterm and click the Session toolbar button (top left). Click SSH for the session type, enter the following information and click OK. Once finished, double click cheaha.rc.uab.edu in the list of Saved sessions under PuTTY sessions:<br />
{| border="1" cellpadding="5"<br />
!Field<br />
!Cheaha Settings<br />
|-<br />
|'''Remote host'''<br />
|cheaha.rc.uab.edu<br />
|-<br />
|'''Port'''<br />
|22<br />
|-<br />
|}<br />
<br />
=====PuTTY=====<br />
[http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY] is a free suite of SSH and telnet tools written and maintained by [http://www.pobox.com/~anakin/ Simon Tatham]. PuTTY supports SSH, secure FTP (SFTP), and X forwarding (XTERM) among other tools.<br />
<br />
* Start PuTTY (Click START -> All Programs -> PuTTY -> PuTTY). The 'PuTTY Configuration' window will open<br />
* Use these settings for each of the clusters that you would like to configure<br />
{| border="1" cellpadding="5"<br />
!Field<br />
!Cheaha Settings<br />
|-<br />
|'''Host Name (or IP address)'''<br />
|cheaha.rc.uab.edu<br />
|-<br />
|'''Port'''<br />
|22<br />
|-<br />
|'''Protocol'''<br />
|SSH<br />
|-<br />
|'''Saved Sessions'''<br />
|cheaha.rc.uab.edu<br />
|-<br />
|}<br />
* Click '''Save''' to save the configuration, repeat the previous steps for the other clusters<br />
* The next time you start PuTTY, simply double click on the cluster name under the 'Saved Sessions' list<br />
<br />
=====SSH Secure Shell Client=====<br />
SSH Secure Shell is a commercial application that is installed on many Windows workstations on campus and can be configured as follows:<br />
* Start the program (Click START -> All Programs -> SSH Secure Shell -> Secure Shell Client). The 'default - SSH Secure Shell' window will open<br />
* Click File -> Profiles -> Add Profile to open the 'Add Profile' window<br />
* Type in the name of the cluster (for example: cheaha) in the field and click 'Add to Profiles'<br />
* Click File -> Profiles -> Edit Profiles to open the 'Profiles' window<br />
* Single click on your new profile name<br />
* Use these settings for the clusters<br />
{| border="1" cellpadding="5"<br />
!Field<br />
!Cheaha Settings<br />
|-<br />
|'''Host name'''<br />
|cheaha.rc.uab.edu<br />
|-<br />
|'''User name'''<br />
|blazerid (insert your blazerid here)<br />
|-<br />
|'''Port'''<br />
|22<br />
|-<br />
|'''Protocol'''<br />
|SSH<br />
|-<br />
|'''Encryption algorithm'''<br />
|<Default><br />
|-<br />
|'''MAC algorithm'''<br />
|<Default><br />
|-<br />
|'''Compression'''<br />
|<None><br />
|-<br />
|'''Terminal answerback'''<br />
|vt100<br />
|-<br />
|}<br />
* Leave 'Connect through firewall' and 'Request tunnels only' unchecked<br />
* Click '''OK''' to save the configuration, repeat the previous steps for the other clusters<br />
* The next time you start SSH Secure Shell, click 'Profiles' and click the cluster name<br />
<br />
=== Logging in to Cheaha ===<br />
No matter which client you use to connect to the Cheaha, the first time you connect, the SSH client should display a message asking if you would like to import the hosts public key. Answer '''Yes''' to this question.<br />
<br />
* Connect to Cheaha using one of the methods listed above<br />
* Answer '''Yes''' to import the cluster's public key<br />
** Enter your BlazerID password<br />
<br />
* After successfully logging in for the first time, You may see the following message '''just press ENTER for the next three prompts, don't type any passphrases!'''<br />
<br />
It doesn't appear that you have set up your ssh key.<br />
This process will make the files:<br />
/home/joeuser/.ssh/id_rsa.pub<br />
/home/joeuser/.ssh/id_rsa<br />
/home/joeuser/.ssh/authorized_keys<br />
<br />
Generating public/private rsa key pair.<br />
Enter file in which to save the key (/home/joeuser/.ssh/id_rsa):<br />
** Enter file in which to save the key (/home/joeuser/.ssh/id_rsa):'''Press Enter'''<br />
** Enter passphrase (empty for no passphrase):'''Press Enter'''<br />
** Enter same passphrase again:'''Press Enter'''<br />
Your identification has been saved in /home/joeuser/.ssh/id_rsa.<br />
Your public key has been saved in /home/joeuser/.ssh/id_rsa.pub.<br />
The key fingerprint is:<br />
f6:xx:xx:xx:xx:dd:9a:79:7b:83:xx:f9:d7:a7:d6:27 joeuser@cheaha.rc.uab.edu<br />
<br />
==== Users without a blazerid (collaborators from other universities) ====<br />
** If you were issued a temporary password, enter it (Passwords are CaSE SensitivE!!!) You should see a message similar to this<br />
You are required to change your password immediately (password aged)<br />
<br />
WARNING: Your password has expired.<br />
You must change your password now and login again!<br />
Changing password for user joeuser.<br />
Changing password for joeuser<br />
(current) UNIX password:<br />
*** (current) UNIX password: '''Enter your temporary password at this prompt and press enter'''<br />
*** New UNIX password: '''Enter your new strong password and press enter'''<br />
*** Retype new UNIX password: '''Enter your new strong password again and press enter'''<br />
*** After you enter your new password for the second time and press enter, the shell may exit automatically. If it doesn't, type exit and press enter<br />
*** Log in again, this time use your new password<br />
<br />
Congratulations, you should now have a command prompt and be ready to start [[Cheaha_GettingStarted#Example_Batch_Job_Script | submitting jobs]]!!!<br />
<br />
== Hardware ==<br />
[[Image:Chehah2_2016.png|center|thumb|450px|Logical Diagram of Cheaha Configuration]]<br />
<br />
The Cheaha Compute Platform includes commodity compute hardware, totaling 2800 compute cores and over 4.7PB of usable storage (6.6PB raw capacity). The following descriptions highlight the current hardware profile that provides an aggregate theoretical peak performance of 468 teraflops.<br />
<br />
* Compute <br />
** 36 Compute Nodes with two 12 core processors (Intel Xeon E5-2680 v3 2.5GHz) with 128GB DDR4 RAM, FDR InfiniBand and 10GigE network cards<br />
** 38 Compute Nodes with two 12 core processors (Intel Xeon E5-2680 v3 2.5GHz) with 256GB DDR4 RAM, FDR InfiniBand and 10GigE network cards<br />
** 14 Compute Nodes with two 12 core processors (Intel Xeon E5-2680 v3 2.5GHz) with 384GB DDR4 RAM, FDR InfiniBand and 10GigE network cards<br />
** 4 Compute Nodes with Nvidia Tesla K80 and two 12 core processors (Intel Xeon E5-2680 v3 2.5GHz) with 128GB DDR4 RAM, FDR InfiniBand and 10GigE network cards<br />
** 4 Compute Nodes with Intel Phi coprocessor SE10/7120 and two 12 core processors (Intel Xeon E5-2680 v3 2.5GHz) with 128GB DDR4 RAM, FDR InfiniBand and 10GigE network cards<br />
** 18 Compute Nodes with two 14 core processors (Intel Xeon E5-2680 v4 2.4GHz)with 256GB DDR4 RAM, four NVIDIA Tesla P100 16GB GPUs, EDR InfiniBand and 10GigE network cards<br />
<br />
* Networking<br />
**FDR and EDR InfiniBand Switch<br />
** 10Gigabit Ethernet Switch<br />
<br />
* Storage -- DDN SFA12KX with GPFS) <br />
** 2 x 12KX40D-56IB controllers<br />
** 10 x SS8460 disk enclosures<br />
** 825 x 4K SAS drives<br />
<br />
* Management <br />
** Management node and gigabit switch for cluster management<br />
** Bright Advanced Cluster Management software licenses<br />
<br />
== Cluster Software ==<br />
* BrightCM 7.2<br />
* CentOS 7.2 x86_64<br />
* [[Slurm]] 15.08<br />
<br />
== Queuing System ==<br />
All work on Cheaha must be submitted to '''our queuing system ([[Slurm]])'''. A common mistake made by new users is to run 'jobs' on the login node. This section gives a basic overview of what a queuing system is and why we use it.<br />
=== What is a queuing system? ===<br />
* Software that gives users fair allocation of the cluster's resources<br />
* Schedules jobs based using resource requests (the following are commonly requested resources, there are many more that are available)<br />
** Number of processors (often referred to as "slots")<br />
** Maximum memory (RAM) required per slot<br />
** Maximum run time<br />
* Common queuing systems:<br />
** '''[[Slurm]]'''<br />
** Sun Grid Engine (Also know as SGE, OGE, GE)<br />
** OpenPBS<br />
** Torque<br />
** LSF (load sharing facility)<br />
<br />
[http://slurm.schedmd.com/ Slurm] is a queue management system and stands for Simple Linux Utility for Resource Management. Slurm was developed at the Lawrence Livermore National Lab and currently runs some of the largest compute clusters in the world. '''[[Slurm]]''' is now the primary job manager on Cheaha, it replaces SUN Grid Engine ([[https://docs.uabgrid.uab.edu/wiki/Cheaha_GettingStarted_deprecated SGE]]) the job manager used earlier. Instructions of using SLURM and writing SLURM scripts for jobs submission on Cheaha can be found '''[[Slurm | here]]'''.<br />
<br />
=== Typical Workflow ===<br />
* Stage data to $USER_SCRATCH (your scratch directory)<br />
* Research how to run your code in "batch" mode. Batch mode typically means the ability to run it from the command line without requiring any interaction from the user.<br />
* Identify the appropriate resources needed to run the job. The following are mandatory resource requests for all jobs on Cheaha<br />
** Maximum memory (RAM) required per slot<br />
** Maximum runtime<br />
* Write a job script specifying queuing system parameters, resource requests and commands to run program<br />
* Submit script to queuing system (sbatch script.job)<br />
* Monitor job (squeue)<br />
* Review the results and resubmit as necessary<br />
* Clean up the scratch directory by moving or deleting the data off of the cluster<br />
<br />
=== Resource Requests ===<br />
Accurate resource requests are extremely important to the health of the over all cluster. In order for Cheaha to operate properly, the queing system must know how much runtime and RAM each job will need.<br />
<br />
==== Mandatory Resource Requests ====<br />
<br />
* -t, --time=<time><br />
Set a limit on the total run time of the job allocation. If the requested time limit exceeds the partition's time limit, the job will be left in a PENDING state (possibly indefinitely).<br />
* For Array jobs, this represents the maximum run time for each task<br />
** For serial or parallel jobs, this represents the maximum run time for the entire job<br />
<br />
* --mem-per-cpu=<MB><br />
Mimimum memory required per allocated CPU in MegaBytes.<br />
<br />
==== Other Common Resource Requests ====<br />
* -N, --nodes=<minnodes[-maxnodes]><br />
Request that a minimum of minnodes nodes be allocated to this job. A maximum node count may also be specified with maxnodes. If only one number is specified, this is used as both the minimum and maximum node count.<br />
<br />
* -n, --ntasks=<number><br />
sbatch does not launch tasks, it requests an allocation of resources and submits a batch script. This option advises the Slurm controller that job steps run within the allocation will launch a maximum of number tasks and to provide for sufficient resources. The default is one task per node<br />
<br />
* --mem=<MB><br />
Specify the real memory required per node in MegaBytes.<br />
<br />
* -c, --cpus-per-task=<ncpus><br />
Advise the Slurm controller that ensuing job steps will require ncpus number of processors per task. Without this option, the controller will just try to allocate one processor per task.<br />
<br />
* -p, --partition=<partition_names><br />
Request a specific partition for the resource allocation. Available partitions are: express(max 2 hrs), short(max 12 hrs), medium(max 50 hrs), long(max 150 hrs), sinteractive(0-2 hrs)<br />
<br />
=== Submitting Jobs ===<br />
Batch Jobs are submitted on Cheaha by using the "sbatch" command. The full manual for sbtach is available by running the following command<br />
man sbatch<br />
<br />
==== Job Script File Format ====<br />
To submit a job to the queuing systems, you will first define your job in a script (a text file) and then submit that script to the queuing system.<br />
<br />
The script file needs to be '''formatted as a UNIX file''', not a Windows or Mac text file. In geek speak, this means that the end of line (EOL) character should be a line feed (LF) rather than a carriage return line feed (CRLF) for Windows or carriage return (CR) for Mac.<br />
<br />
If you submit a job script formatted as a Windows or Mac text file, your job will likely fail with misleading messages, for example that the path specified does not exist.<br />
<br />
Windows '''Notepad''' does not have the ability to save files using the UNIX file format. Do NOT use Notepad to create files intended for use on the clusters. Instead use one of the alternative text editors listed in the following section.<br />
<br />
===== Converting Files to UNIX Format =====<br />
====== Dos2Unix Method ======<br />
The lines below that begin with $ are commands, the $ represents the command prompt and should not be typed!<br />
<br />
The dos2unix program can be used to convert Windows text files to UNIX files with a simple command. After you have copied the file to your home directory on the cluster, you can identify that the file is a Windows file by executing the following (Windows uses CR LF as the line terminator, where UNIX uses only LF and Mac uses only CR):<br />
<pre><br />
$ file testfile.txt<br />
<br />
testfile.txt: ASCII text, with CRLF line terminators<br />
</pre><br />
<br />
Now, convert the file to UNIX<br />
<pre><br />
$ dos2unix testfile.txt<br />
<br />
dos2unix: converting file testfile.txt to UNIX format ...<br />
</pre><br />
<br />
Verify the conversion using the file command<br />
<pre><br />
$ file testfile.txt<br />
<br />
testfile.txt: ASCII text<br />
</pre><br />
<br />
====== Alternative Windows Text Editors ======<br />
There are many good text editors available for Windows that have the capability to save files using the UNIX file format. Here are a few:<br />
* [[http://www.geany.org/ Geany]] is an excellent free text editor for Windows and Linux that supports Windows, UNIX and Mac file formats, syntax highlighting and many programming features. To convert from Windows to UNIX click '''Document''' click '''Set Line Endings''' and then '''Convert and Set to LF (Unix)'''<br />
* [[http://notepad-plus.sourceforge.net/uk/site.htm Notepad++]] is a great free Windows text editor that supports Windows, UNIX and Mac file formats, syntax highlighting and many programming features. To convert from Windows to UNIX click '''Format''' and then click '''Convert to UNIX Format'''<br />
* [[http://www.textpad.com/ TextPad]] is another excellent Windows text editor. TextPad is not free, however.<br />
<br />
==== Example Batch Job Script ====<br />
A shared cluster environment like Cheaha uses a job scheduler to run tasks on the cluster to provide optimal resource sharing among users. Cheaha uses a job scheduling system call Slurm to schedule and manage jobs. A user needs to tell Slurm about resource requirements (e.g. CPU, memory) so that it can schedule jobs effectively. These resource requirements along with actual application code can be specified in a single file commonly referred as 'Job Script/File'. Following is a simple job script that prints job number and hostname.<br />
<br />
'''Note:'''Jobs '''must request''' the appropriate partition (ex: ''--partition=short'') to satisfy the jobs resource request (maximum runtime, number of compute nodes, etc...)<br />
<pre><br />
#!/bin/bash<br />
#<br />
#SBATCH --job-name=test<br />
#SBATCH --output=res.txt<br />
#SBATCH --ntasks=1<br />
#SBATCH --partition=express<br />
#SBATCH --time=10:00<br />
#SBATCH --mem-per-cpu=100<br />
#SBATCH --mail-type=FAIL<br />
#SBATCH --mail-user=YOUR_EMAIL_ADDRESS<br />
<br />
srun hostname<br />
srun sleep 60<br />
</pre><br />
<br />
Lines starting with '#SBATCH' have a special meaning in the Slurm world. Slurm specific configuration options are specified after the '#SBATCH' characters. Above configuration options are useful for most job scripts and for additional configuration options refer to Slurm commands manual. A job script is submitted to the cluster using Slurm specific commands. There are many commands available, but following three commands are the most common:<br />
* sbatch - to submit job<br />
* scancel - to delete job<br />
* squeue - to view job status<br />
<br />
We can submit above job script using sbatch command:<br />
<pre><br />
$ sbatch HelloCheaha.sh<br />
Submitted batch job 52707<br />
</pre><br />
<br />
When the job script is submitted, Slurm queues it up and assigns it a job number (e.g. 52707 in above example). The job number is available inside job script using environment variable $JOB_ID. This variable can be used inside job script to create job related directory structure or file names.<br />
<br />
=== Interactive Resources ===<br />
Login Node (the host that you connected to when you setup the SSH connection to Cheaha) is supposed to be used for submitting jobs and/or lighter prep work required for the job scripts. '''Do not run heavy computations on the login node'''. If you have a heavier workload to prepare for a batch job (eg. compiling code or other manipulations of data) or your compute application requires interactive control, you should request a dedicated interactive node for this work.<br />
<br />
Interactive resources are requested by submitting an "interactive" job to the scheduler. Interactive jobs will provide you a command line on a compute resource that you can use just like you would the command line on the login node. The difference is that the scheduler has dedicated the requested resources to your job and you can run your interactive commands without having to worry about impacting other users on the login node.<br />
<br />
Interactive jobs, that can be run on command line, are requested with the '''srun''' command. <br />
<br />
<pre><br />
srun --ntasks=1 --cpus-per-task=4 --mem-per-cpu=4096 --time=08:00:00 --partition=medium --job-name=JOB_NAME --pty /bin/bash<br />
</pre><br />
<br />
This command requests for 4 cores (--cpus-per-task) for a single task (--ntasks) with each cpu requesting size 4GB of RAM (--mem-per-cpu) for 8 hrs (--time).<br />
<br />
More advanced interactive scenarios to support graphical applications are available using [https://docs.uabgrid.uab.edu/wiki/Setting_Up_VNC_Session VNC] or X11 tunneling [http://www.uab.edu/it/software X-Win32 2014 for Windows]<br />
<br />
Interactive jobs that requires running a graphical application, are requested with the '''sinteractive''' command, via '''Terminal''' on your VNC window.<br />
<pre><br />
sinteractive --ntasks=1 --cpus-per-task=4 --mem-per-cpu=4096 --time=08:00:00 --partition=medium --job-name=JOB_NAME<br />
</pre><br />
Please note, sinteractive starts your shell in a screen session. Screen is a terminal emulator that is designed to make it possible to detach and reattach a session. This feature can mostly be ignored. If you application uses `ctrl-a` as a special command sequence (e.g. Emacs), however, you may find the application doesn't receive this special character. When using screen, you need to type `ctrl-a a` (ctrl-a followed by a single "a" key press) to send a ctrl-a to your application. Screen uses ctrl-a as it's own command character, so this special sequence issues the command to screen to "send ctrl-a to my app". Learn more about [https://www.gnu.org/software/screen/manual/html_node/Overview.html#Overview screen from it's documentation].<br />
<br />
== Storage ==<br />
=== Privacy ===<br />
{{SensitiveInformation}}<br />
=== No Automatic Backups ===<br />
<br />
There is no automatic back up of any data on the cluster (home, scratch, or whatever). All data back up is managed by you. If you aren't managing a data back up process, then you have no backup data.<br />
<br />
=== Home directories ===<br />
<br />
Your home directory on Cheaha is NFS-mounted to the compute nodes as /home/$USER or $HOME. It is acceptable to use your home directory as a location to store job scripts, custom code, and libraries. You are responsible for keeping your home directory under 10GB in size!<br />
<br />
'''The home directory must not be used to store large amounts of data.''' Please use $USER_SCRATCH <br />
for actively used data sets and $USER_DATA for storage of non scratch data.<br />
<br />
=== Scratch ===<br />
Research Computing policy requires that all bulky input and output must be located on the scratch space. The home directory is intended to store your job scripts, log files, libraries and other supporting files.<br />
<br />
'''Important Information:'''<br />
* Scratch space (network and local) '''is not backed up'''.<br />
* Research Computing expects each user to keep their scratch areas clean. The cluster scratch area are not to be used for archiving data.<br />
<br />
Cheaha has two types of scratch space, network mounted and local.<br />
* Network scratch ($USER_SCRATCH) is available on the login node and each compute node. This storage is a GPFS high performance file system providing roughly 4.7PB of usable storage. This should be your jobs primary working directory, unless the job would benefit from local scratch (see below).<br />
* Local scratch is physically located on each compute node and is not accessible to the other nodes (including the login node). This space is useful if the job performs a lot of file I/O. Most of the jobs that run on our clusters do not fall into this category. Because the local scratch is inaccessible outside the job, it is important to note that you must move any data between local scratch to your network accessible scratch within your job. For example, step 1 in the job could be to copy the input from $USER_SCRATCH to ${USER_SCRATCH}, step 2 code execution, step 3 move the data back to $USER_SCRATCH.<br />
<br />
==== Network Scratch ====<br />
Network scratch is available using the environment variable $USER_SCRATCH or directly by /data/scratch/$USER<br />
<br />
It is advisable to use the environment variable whenever possible rather than the hard coded path.<br />
<br />
==== Local Scratch ====<br />
Each compute node has a local scratch directory that is accessible via the variable '''$LOCAL_SCRATCH'''. If your job performs a lot of file I/O, the job should use $LOCAL_SCRATCH rather than $USER_SCRATCH to prevent bogging down the network scratch file system. The amount of scratch space available is approximately 800GB.<br />
<br />
The $LOCAL_SCRATCH is a special temporary directory and it's important to note that this directory is deleted when the job completes, so the job script has to move the results to $USER_SCRATCH or other location prior to the job exiting.<br />
<br />
Note that $LOCAL_SCRATCH is only useful for jobs in which all processes run on the same compute node, so MPI jobs are not candidates for this solution.<br />
<br />
The following is an array job example that uses $LOCAL_SCRATCH by transferring the inputs into $LOCAL_SCRATCH at the beginning of the script and the result out of $LOCAL_SCRATCH at the end of the script.<br />
<br />
<pre><br />
#!/bin/bash<br />
#SBATCH --array=1-10<br />
#SBATCH --share<br />
#SBATCH --partition=express<br />
#<br />
# Name your job to make it easier for you to track<br />
#<br />
#SBATCH --job-name=R_array_job<br />
#<br />
# Set your error and output files<br />
#<br />
#SBATCH --error=R_array_job.err<br />
#SBATCH --output=R_array_job.out<br />
#SBATCH --ntasks=1<br />
#<br />
# Tell the scheduler only need 10 minutes and the appropriate partition<br />
#<br />
#SBATCH --time=00:10:00<br />
#SBATCH --mem-per-cpu=256<br />
#<br />
# Set your email address and request notification when you job is complete or if it fails<br />
#<br />
#SBATCH --mail-type=FAIL<br />
#SBATCH --mail-user=YOUR_EMAIL_ADDRESS<br />
<br />
module load R/3.2.0-goolf-1.7.20<br />
<br />
echo "TMPDIR: $LOCAL_SCRATCH"<br />
<br />
cd $LOCAL_SCRATCH<br />
# Create a working directory under the special scheduler local scratch directory<br />
# using the array job's taskID<br />
mdkir $SLURM_ARRAY_TASK_ID<br />
cd $SLURM_ARRAY_TASK_ID<br />
<br />
# Next copy the input data to the local scratch<br />
echo "Copying input data from network scratch to $LOCAL_SCRATCH/$SLURM_ARRAY_TASK_ID - $(date)<br />
# The input data in this case has a numerical file extension that<br />
# matches $SLURM_ARRAY_TASK_ID<br />
cp -a $USER_SCRATCH/GeneData/INP*.$SLURM_ARRAY_TASK_ID ./<br />
echo "copied input data from network scratch to $LOCAL_SCRATCH/$SLURM_ARRAY_TASK_ID - $(date)<br />
<br />
someapp -S 1 -D 10 -i INP*.$SLURM_ARRAY_TASK_ID -o geneapp.out.$SLURM_ARRAY_TASK_ID<br />
<br />
# Lastly copy the results back to network scratch<br />
echo "Copying results from local $LOCAL_SCRATCH/$SLURM_ARRAY_TASK_ID to network - $(date)<br />
cp -a geneapp.out.$SLURM_ARRAY_TASK_ID $USER_SCRATCH/GeneData/<br />
echo "Copied results from local $LOCAL_SCRATCH/$SLURM_ARRAY_TASK_ID to network - $(date)<br />
<br />
</pre><br />
<br />
=== Project Storage ===<br />
Cheaha has a location where shared data can be stored called $SHARE_PROJECT. As with user scratch, this area '''is not backed up'''!<br />
<br />
This is helpful if a team of researchers must access the same data. Please open a help desk ticket to request a project directory under $SHARE_PROJECT.<br />
<br />
=== Uploading Data ===<br />
{{SensitiveInformation}}<br />
Data can be moved onto the cluster (pushed) from a remote client (ie. you desktop) via SCP or SFTP. Data can also be downloaded to the cluster (pulled) by issuing transfer commands once you are logged into the cluster. Common transfer methods are `wget <URL>`, FTP, or SCP, and depend on how the data is made available from the data provider.<br />
<br />
Large data sets should be staged directly to your $USER_SCRATCH directory so as not to fill up $HOME. If you are working on a data set shared with multiple users, it's preferable to request space in $SHARE_PROJECT rather than duplicating the data for each user.<br />
<br />
== Environment Modules ==<br />
[http://modules.sourceforge.net/ Environment Modules] is installed on Cheaha and should be used when constructing your job scripts if an applicable module file exists. Using the module command you can easily configure your environment for specific software packages without having to know the specific environment variables and values to set. Modules allows you to dynamically configure your environment without having to logout / login for the changes to take affect.<br />
<br />
If you find that specific software does not have a module, please submit a [http://etlab.eng.uab.edu/ helpdesk ticket] to request the module.<br />
<br />
* Cheaha supports bash completion for the module command. For example, type 'module' and press the TAB key twice to see a list of options:<br />
<pre><br />
module TAB TAB<br />
<br />
add display initlist keyword refresh switch use <br />
apropos help initprepend list rm unload whatis <br />
avail initadd initrm load show unuse <br />
clear initclear initswitch purge swap update<br />
</pre><br />
<br />
* To see the list of available modulefiles on the cluster, run the '''module avail''' command (note the example list below may not be complete!) or '''module load ''' followed by two tab key presses:<br />
<pre><br />
module avail<br />
<br />
----------------------------------------------------------------------------------------- /cm/shared/modulefiles -----------------------------------------------------------------------------------------<br />
acml/gcc/64/5.3.1 acml/open64-int64/mp/fma4/5.3.1 fftw2/openmpi/gcc/64/float/2.1.5 intel-cluster-runtime/ia32/3.8 netcdf/gcc/64/4.3.3.1<br />
acml/gcc/fma4/5.3.1 blacs/openmpi/gcc/64/1.1patch03 fftw2/openmpi/open64/64/double/2.1.5 intel-cluster-runtime/intel64/3.8 netcdf/open64/64/4.3.3.1<br />
acml/gcc/mp/64/5.3.1 blacs/openmpi/open64/64/1.1patch03 fftw2/openmpi/open64/64/float/2.1.5 intel-cluster-runtime/mic/3.8 netperf/2.7.0<br />
acml/gcc/mp/fma4/5.3.1 blas/gcc/64/3.6.0 fftw3/openmpi/gcc/64/3.3.4 intel-tbb-oss/ia32/44_20160526oss open64/4.5.2.1<br />
acml/gcc-int64/64/5.3.1 blas/open64/64/3.6.0 fftw3/openmpi/open64/64/3.3.4 intel-tbb-oss/intel64/44_20160526oss openblas/dynamic/0.2.15<br />
acml/gcc-int64/fma4/5.3.1 bonnie++/1.97.1 gdb/7.9 iozone/3_434 openmpi/gcc/64/1.10.1<br />
acml/gcc-int64/mp/64/5.3.1 cmgui/7.2 globalarrays/openmpi/gcc/64/5.4 lapack/gcc/64/3.6.0 openmpi/open64/64/1.10.1<br />
acml/gcc-int64/mp/fma4/5.3.1 cuda75/blas/7.5.18 globalarrays/openmpi/open64/64/5.4 lapack/open64/64/3.6.0 pbspro/13.0.2.153173<br />
acml/open64/64/5.3.1 cuda75/fft/7.5.18 hdf5/1.6.10 mpich/ge/gcc/64/3.2 puppet/3.8.4<br />
acml/open64/fma4/5.3.1 cuda75/gdk/352.79 hdf5_18/1.8.16 mpich/ge/open64/64/3.2 rc-base<br />
acml/open64/mp/64/5.3.1 cuda75/nsight/7.5.18 hpl/2.1 mpiexec/0.84_432 scalapack/mvapich2/gcc/64/2.0.2<br />
acml/open64/mp/fma4/5.3.1 cuda75/profiler/7.5.18 hwloc/1.10.1 mvapich/gcc/64/1.2rc1 scalapack/openmpi/gcc/64/2.0.2<br />
acml/open64-int64/64/5.3.1 cuda75/toolkit/7.5.18 intel/compiler/32/15.0/2015.5.223 mvapich/open64/64/1.2rc1 sge/2011.11p1<br />
acml/open64-int64/fma4/5.3.1 default-environment intel/compiler/64/15.0/2015.5.223 mvapich2/gcc/64/2.2b slurm/15.08.6<br />
acml/open64-int64/mp/64/5.3.1 fftw2/openmpi/gcc/64/double/2.1.5 intel-cluster-checker/2.2.2 mvapich2/open64/64/2.2b torque/6.0.0.1<br />
<br />
---------------------------------------------------------------------------------------- /share/apps/modulefiles -----------------------------------------------------------------------------------------<br />
rc/BrainSuite/15b rc/freesurfer/freesurfer-5.3.0 rc/intel/compiler/64/ps_2016/2016.0.047 rc/matlab/R2015a rc/SAS/v9.4<br />
rc/cmg/2012.116.G rc/gromacs-intel/5.1.1 rc/Mathematica/10.3 rc/matlab/R2015b<br />
rc/dsistudio/dsistudio-20151020 rc/gtool/0.7.5 rc/matlab/R2012a rc/MRIConvert/2.0.8<br />
<br />
--------------------------------------------------------------------------------------- /share/apps/rc/modules/all ---------------------------------------------------------------------------------------<br />
AFNI/linux_openmp_64-goolf-1.7.20-20160616 gperf/3.0.4-intel-2016a MVAPICH2/2.2b-GCC-4.9.3-2.25<br />
Amber/14-intel-2016a-AmberTools-15-patchlevel-13-13 grep/2.15-goolf-1.4.10 NASM/2.11.06-goolf-1.7.20<br />
annovar/2016Feb01-foss-2015b-Perl-5.22.1 GROMACS/5.0.5-intel-2015b-hybrid NASM/2.11.08-foss-2015b<br />
ant/1.9.6-Java-1.7.0_80 GSL/1.16-goolf-1.7.20 NASM/2.11.08-intel-2016a<br />
APBS/1.4-linux-static-x86_64 GSL/1.16-intel-2015b NASM/2.12.02-foss-2016a<br />
ASHS/rev103_20140612 GSL/2.1-foss-2015b NASM/2.12.02-intel-2015b<br />
Aspera-Connect/3.6.1 gtool/0.7.5_linux_x86_64 NASM/2.12.02-intel-2016a<br />
ATLAS/3.10.1-gompi-1.5.12-LAPACK-3.4.2 guile/1.8.8-GNU-4.9.3-2.25 ncurses/5.9-foss-2015b<br />
Autoconf/2.69-foss-2016a HAPGEN2/2.2.0 ncurses/5.9-GCC-4.8.4<br />
Autoconf/2.69-GCC-4.8.4 HarfBuzz/1.2.7-intel-2016a ncurses/5.9-GNU-4.9.3-2.25<br />
Autoconf/2.69-GNU-4.9.3-2.25 HDF5/1.8.15-patch1-intel-2015b ncurses/5.9-goolf-1.4.10<br />
. <br />
.<br />
.<br />
.<br />
</pre><br />
<br />
Some software packages have multiple module files, for example:<br />
* GCC/4.7.2 <br />
* GCC/4.8.1 <br />
* GCC/4.8.2 <br />
* GCC/4.8.4 <br />
* GCC/4.9.2 <br />
* GCC/4.9.3 <br />
* GCC/4.9.3-2.25 <br />
<br />
In this case, the GCC module will always load the latest version, so loading this module is equivalent to loading GCC/4.9.3-2.25. If you always want to use the latest version, use this approach. If you want use a specific version, use the module file containing the appropriate version number.<br />
<br />
Some modules, when loaded, will actually load other modules. For example, the ''GROMACS/5.0.5-intel-2015b-hybrid '' module will also load ''intel/2015b'' and other related tools.<br />
<br />
* To load a module, ex: for a GROMACS job, use the following '''module load''' command in your job script:<br />
<pre><br />
module load GROMACS/5.0.5-intel-2015b-hybrid <br />
</pre><br />
<br />
* To see a list of the modules that you currently have loaded use the '''module list''' command<br />
<pre><br />
module list<br />
<br />
Currently Loaded Modulefiles:<br />
1) slurm/15.08.6 9) impi/5.0.3.048-iccifort-2015.3.187-GNU-4.9.3-2.25 17) Tcl/8.6.3-intel-2015b<br />
2) rc-base 10) iimpi/7.3.5-GNU-4.9.3-2.25 18) SQLite/3.8.8.1-intel-2015b<br />
3) GCC/4.9.3-binutils-2.25 11) imkl/11.2.3.187-iimpi-7.3.5-GNU-4.9.3-2.25 19) Tk/8.6.3-intel-2015b-no-X11<br />
4) binutils/2.25-GCC-4.9.3-binutils-2.25 12) intel/2015b 20) Python/2.7.9-intel-2015b<br />
5) GNU/4.9.3-2.25 13) bzip2/1.0.6-intel-2015b 21) Boost/1.58.0-intel-2015b-Python-2.7.9<br />
6) icc/2015.3.187-GNU-4.9.3-2.25 14) zlib/1.2.8-intel-2015b 22) GROMACS/5.0.5-intel-2015b-hybrid<br />
7) ifort/2015.3.187-GNU-4.9.3-2.25 15) ncurses/5.9-intel-2015b<br />
8) iccifort/2015.3.187-GNU-4.9.3-2.25 16) libreadline/6.3-intel-2015b<br />
</pre><br />
<br />
* A module can be removed from your environment by using the '''module unload''' command:<br />
<pre><br />
module unload GROMACS/5.0.5-intel-2015b-hybrid<br />
</pre><br />
<br />
* The definition of a module can also be viewed using the '''module show''' command, revealing what a specific module will do to your environment:<br />
<pre><br />
module show GROMACS/5.0.5-intel-2015b-hybrid <br />
-------------------------------------------------------------------<br />
/share/apps/rc/modules/all/GROMACS/5.0.5-intel-2015b-hybrid:<br />
<br />
module-whatis GROMACS is a versatile package to perform molecular dynamics,<br />
i.e. simulate the Newtonian equations of motion for systems with hundreds to millions of particles. - Homepage: http://www.gromacs.org <br />
conflict GROMACS <br />
prepend-path CPATH /share/apps/rc/software/GROMACS/5.0.5-intel-2015b-hybrid/include <br />
prepend-path LD_LIBRARY_PATH /share/apps/rc/software/GROMACS/5.0.5-intel-2015b-hybrid/lib64 <br />
prepend-path LIBRARY_PATH /share/apps/rc/software/GROMACS/5.0.5-intel-2015b-hybrid/lib64 <br />
prepend-path MANPATH /share/apps/rc/software/GROMACS/5.0.5-intel-2015b-hybrid/share/man <br />
prepend-path PATH /share/apps/rc/software/GROMACS/5.0.5-intel-2015b-hybrid/bin <br />
prepend-path PKG_CONFIG_PATH /share/apps/rc/software/GROMACS/5.0.5-intel-2015b-hybrid/lib64/pkgconfig <br />
setenv EBROOTGROMACS /share/apps/rc/software/GROMACS/5.0.5-intel-2015b-hybrid <br />
setenv EBVERSIONGROMACS 5.0.5 <br />
setenv EBDEVELGROMACS /share/apps/rc/software/GROMACS/5.0.5-intel-2015b-hybrid/easybuild/GROMACS-5.0.5-intel-2015b-hybrid-easybuild-devel <br />
-------------------------------------------------------------------<br />
</pre><br />
<br />
=== Error Using Modules from a Job Script ===<br />
<br />
If you are using modules and the command your job executes runs fine from the command line but fails when you run it from the job, you may be having an issue with the script initialization. If you see this error in your job error output file<br />
<pre><br />
-bash: module: line 1: syntax error: unexpected end of file<br />
-bash: error importing function definition for `BASH_FUNC_module'<br />
</pre><br />
Add the command `unset module` before calling your module files. The -V job argument will cause a conflict with the module function used in your script.<br />
<br />
== Sample Job Scripts ==<br />
The following are sample job scripts, please be careful to edit these for your environment (i.e. replace <font color="red">YOUR_EMAIL_ADDRESS</font> with your real email address), set the h_rt to an appropriate runtime limit and modify the job name and any other parameters.<br />
<br />
'''Hello World''' is the classic example used throughout programming. We don't want to buck the system, so we'll use it as well to demonstrate jobs submission with one minor variation: our hello world will send us a greeting using the name of whatever machine it runs on. For example, when run on the Cheaha login node, it would print "Hello from login001".<br />
<br />
=== Hello World (serial) ===<br />
<br />
A serial job is one that can run independently of other commands, ie. it doesn't depend on the data from other jobs running simultaneously. You can run many serial jobs in any order. This is a common solution to processing lots of data when each command works on a single piece of data. For example, running the same conversion on 100s of images.<br />
<br />
Here we show how to create job script for one simple command. Running more than one command just requires submitting more jobs.<br />
<br />
* Create your hello world application. Run this command to create a script, turn it into to a command, and run the command (just copy and past the following on to the command line).<br />
1. Create the file:<br />
<pre><br />
$ vim helloworld.sh<br />
</pre><br />
<br />
2. Write into "helloworld.sh" file (To write in vim editor: press '''shift + I''' )<br />
<pre><br />
#!/bin/bash<br />
echo Hello from `hostname`<br />
</pre><br />
<br />
3. Save the file by pressing the '''esc''' key, type the following<br />
<pre><br />
:wq<br />
</pre><br />
<br />
4. Need to give permission the "helloworld.sh" file<br />
<pre><br />
$ chmod +x helloworld.sh<br />
</pre><br />
<br />
* Create the Slurm job script that will request 256 MB RAM and a maximum runtime of 10 minutes.<br />
1. Create the JOB file:<br />
<pre><br />
$ vim helloworld.job<br />
</pre><br />
<br />
2. Write into "helloworld.job" file (To write in vim editor: press '''shift + I''' )<br />
<pre><br />
#!/bin/bash<br />
#SBATCH --share<br />
#SBATCH --partition=express<br />
#<br />
# Name your job to make it easier for you to track<br />
#<br />
#SBATCH --job-name=helloworld<br />
#<br />
# Set your error and output files<br />
#<br />
#SBATCH --error=helloworld.err<br />
#SBATCH --output=helloworld.out<br />
#SBATCH --ntasks=1<br />
#<br />
# Tell the scheduler only need 10 minutes<br />
#<br />
#SBATCH --time=00:10:00<br />
#SBATCH --mem-per-cpu=256<br />
#<br />
# Set your email address and request notification when you job is complete or if it fails<br />
#<br />
#SBATCH --mail-type=FAIL<br />
#SBATCH --mail-user=$USER@uab.edu<br />
<br />
./helloworld.sh<br />
</pre><br />
<br />
3. Save the file by pressing the '''esc''' key, type the following<br />
<pre><br />
:wq<br />
</pre><br />
<br />
* Submit the job to Slurm scheduler and check the status using squeue<br />
<pre><br />
$ sbatch helloworld.job<br />
Submitted batch job 52888<br />
</pre><br />
* When the job completes, you should have output files named helloworld.out and helloworld.err <br />
<pre><br />
$ cat helloworld.out <br />
Hello from c0003<br />
</pre><br />
<br />
=== Hello World (parallel with MPI) ===<br />
<br />
MPI is used to coordinate the activity of many computations occurring in parallel. It is commonly used in simulation software for molecular dynamics, fluid dynamics, and similar domains where there is significant communication (data) exchanged between cooperating process.<br />
<br />
Here is a simple parallel Slurm job script for running commands the rely on MPI. This example also includes the example of compiling the code and submitting the job script to the Slurm scheduler.<br />
<br />
* First, create a directory for the Hello World jobs<br />
<pre><br />
$ mkdir -p ~/jobs/helloworld<br />
$ cd ~/jobs/helloworld<br />
</pre><br />
* Create the Hello World code written in C (this example of MPI enabled Hello World includes a 3 minute sleep to ensure the job runs for several minutes, a normal hello world example would run in a matter of seconds).<br />
<pre><br />
$ vi helloworld-mpi.c<br />
</pre><br />
<pre><br />
#include <stdio.h><br />
#include <mpi.h><br />
<br />
main(int argc, char **argv)<br />
{<br />
int rank, size;<br />
<br />
int i, j;<br />
float f;<br />
<br />
MPI_Init(&argc,&argv);<br />
MPI_Comm_rank(MPI_COMM_WORLD, &rank);<br />
MPI_Comm_size(MPI_COMM_WORLD, &size);<br />
<br />
printf("Hello World from process %d of %d.\n", rank, size);<br />
sleep(180);<br />
for (j=0; j<=100000; j++)<br />
for(i=0; i<=100000; i++)<br />
f=i*2.718281828*i+i+i*3.141592654;<br />
<br />
MPI_Finalize();<br />
}<br />
</pre><br />
* Compile the code, first purging any modules you may have loaded followed by loading the module for OpenMPI GNU. The mpicc command will compile the code and produce a binary named helloworld_gnu_openmpi<br />
<pre><br />
$ module purge<br />
$ module load OpenMPI/1.8.8-GNU-4.9.3-2.25<br />
<br />
$ mpicc helloworld-mpi.c -o helloworld_gnu_openmpi<br />
</pre><br />
* Create the Slurm job script that will request 8 cpu slots and a maximum runtime of 10 minutes<br />
<pre><br />
$ vi helloworld.job<br />
</pre><br />
<pre><br />
#!/bin/bash<br />
#SBATCH --share<br />
#SBATCH --partition=express<br />
#<br />
# Name your job to make it easier for you to track<br />
#<br />
#SBATCH --job-name=helloworld_mpi<br />
#<br />
# Set your error and output files<br />
#<br />
#SBATCH --error=helloworld_mpi.err<br />
#SBATCH --output=helloworld_mpi.out<br />
#SBATCH --ntasks=8<br />
#<br />
# Tell the scheduler only need 10 minutes<br />
#<br />
#SBATCH --time=00:01:00<br />
#SBATCH --mem-per-cpu=256<br />
#<br />
# Set your email address and request notification when you job is complete or if it fails<br />
#<br />
#SBATCH --mail-type=FAIL<br />
#SBATCH --mail-user=YOUR_EMAIL_ADDRESS<br />
<br />
module load OpenMPI/1.8.8-GNU-4.9.3-2.25<br />
mpirun -np $SLURM_NTASKS helloworld_gnu_openmpi<br />
</pre><br />
* Submit the job to Slurm scheduler and check the status using squeue -u $USER<br />
<pre><br />
$ sbatch helloworld.job<br />
<br />
Submitted batch job 52893<br />
<br />
$ squeue -u BLAZERID<br />
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)<br />
52893 express hellowor BLAZERID R 2:07 2 c[0005-0006]<br />
<br />
</pre><br />
* When the job completes, you should have output files named helloworld_mpi.out and helloworld_mpi.err<br />
<pre><br />
$ cat helloworld_mpi.out<br />
<br />
Hello World from process 1 of 8.<br />
Hello World from process 3 of 8.<br />
Hello World from process 4 of 8.<br />
Hello World from process 7 of 8.<br />
Hello World from process 5 of 8.<br />
Hello World from process 6 of 8.<br />
Hello World from process 0 of 8.<br />
Hello World from process 2 of 8.<br />
</pre><br />
<br />
=== Hello World (serial) -- revisited ===<br />
<br />
The job submit scripts (sbatch scripts) are actually bash shell scripts in their own right. The reason for using the funky #SBATCH prefix in the scripts is so that bash interprets any such line as a comment and won't execute it. Because the # character starts a comment in bash, we can weave the Slurm scheduler directives (the #SBATCH lines) into standard bash scripts. This lets us build scripts that we can execute locally and then easily run the same script to on a cluster node by calling it with sbatch. This can be used to our advantage to create a more fluid experience in moving between development and production job runs. <br />
<br />
The following example is a simple variation on the serial job above. All we will do is convert our Slurm job script into a command called helloworld that calls the helloworld.sh command.<br />
<br />
If the first line of a file is #!/bin/bash and that file is executable, the shell will automatically run the command as if were any other system command, eg. ls. That is, the ".sh" extension on our HelloWorld.sh script is completely optional and is only meaningful to the user.<br />
<br />
Copy the serial helloworld.job script to a new file, add a the special #!/bin/bash as the first line, and make it executable with the following command (note: those are single quotes in the echo command): <br />
<pre><br />
echo '#!/bin/bash' | cat helloworld.job > helloworld ; chmod +x helloworld<br />
</pre><br />
<br />
Our sbatch script has now become a regular command. We can now execute the command with the simple prefix "./helloworld", which means "execute this file in the current directory":<br />
<pre><br />
./helloworld<br />
Hello from login001<br />
</pre><br />
Or if we want to run the command on a compute node, replace the "./" prefix with "sbatch ":<br />
<pre><br />
$ sbatch helloworld<br />
Submitted batch job 53001<br />
</pre><br />
And when the cluster run is complete you can look at the content of the output:<br />
<pre><br />
$ $ cat helloworld.out <br />
Hello from c0003<br />
</pre><br />
<br />
You can use this approach of treating you sbatch files as command wrappers to build a collection of commands that can be executed locally or via sbatch. The other examples can be restructured similarly.<br />
<br />
To avoid having to use the "./" prefix, just add the current directory to your PATH. Also, if you plan to do heavy development using this feature on the cluster, please be sure to run [https://docs.uabgrid.uab.edu/wiki/Slurm#Interactive_Session sinteractive] first so you don't load the login node with your development work.<br />
<br />
=== Gromacs ===<br />
<pre><br />
#!/bin/bash<br />
#SBATCH --partition=short<br />
#<br />
# Name your job to make it easier for you to track<br />
#<br />
#SBATCH --job-name=test_gromacs<br />
#<br />
# Set your error and output files<br />
#<br />
#SBATCH --error=test_gromacs.err<br />
#SBATCH --output=test_gromacs.out<br />
#SBATCH --ntasks=8<br />
#<br />
# Tell the scheduler only need 10 minutes<br />
#<br />
#SBATCH --time=10:00:00<br />
#SBATCH --mem-per-cpu=2048<br />
#<br />
# Set your email address and request notification when you job is complete or if it fails<br />
#<br />
#SBATCH --mail-type=FAIL<br />
#SBATCH --mail-user=YOUR_EMAIL_ADDRESS<br />
<br />
module load OpenMPI/1.8.8-GNU-4.9.3-2.25<br />
<br />
module load GROMACS/5.0.5-intel-2015b-hybrid <br />
<br />
# Change directory to the job working directory if not already there<br />
cd ${USER_SCRATCH}/jobs/gromacs<br />
<br />
# Single precision<br />
MDRUN=mdrun_mpi<br />
<br />
# Enter your tpr file over here<br />
export MYFILE=example.tpr<br />
<br />
mpirun -np SLURM_NTASKS $MDRUN -v -s $MYFILE -o $MYFILE -c $MYFILE -x $MYFILE -e $MYFILE -g ${MYFILE}.log<br />
<br />
</pre><br />
<br />
=== R ===<br />
<br />
The following is an example job script that will use an array of 10 tasks (--array=1-10), each task has a max runtime of 2 hours and will use no more than 256 MB of RAM per task.<br />
<br />
Create a working directory and the job submission script<br />
<pre><br />
$ mkdir -p ~/jobs/ArrayExample<br />
$ cd ~/jobs/ArrayExample<br />
$ vi R-example-array.job<br />
</pre><br />
<br />
<pre><br />
#!/bin/bash<br />
#SBATCH --array=1-10<br />
#SBATCH --share<br />
#SBATCH --partition=express<br />
#<br />
# Name your job to make it easier for you to track<br />
#<br />
#SBATCH --job-name=R_array_job<br />
#<br />
# Set your error and output files<br />
#<br />
#SBATCH --error=R_array_job.err<br />
#SBATCH --output=R_array_job.out<br />
#SBATCH --ntasks=1<br />
#<br />
# Tell the scheduler only need 10 minutes<br />
#<br />
#SBATCH --time=00:10:00<br />
#SBATCH --mem-per-cpu=256<br />
#<br />
# Set your email address and request notification when you job is complete or if it fails<br />
#<br />
#SBATCH --mail-type=FAIL<br />
#SBATCH --mail-user=YOUR_EMAIL_ADDRESS<br />
<br />
module load R/3.2.0-goolf-1.7.20 <br />
cd ~/jobs/ArrayExample/rep$SLURM_ARRAY_TASK_ID<br />
srun R CMD BATCH rscript.R<br />
</pre><br />
<br />
Submit the job to the Slurm scheduler and check the status of the job using the squeue command<br />
<pre><br />
$ sbatch R-example-array.job<br />
$ squeue -u $USER<br />
</pre><br />
<br />
== Installed Software ==<br />
<br />
A partial list of installed software with additional instructions for their use is available on the [[Cheaha Software]] page.</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Collaborator_Account&diff=5900Collaborator Account2019-04-10T21:16:06Z<p>Ravi89@uab.edu: Initial run with creating an external collaborator account.</p>
<hr />
<div>This Page lays down the step for you as a UAB employee to create a temporary account for your collaborator.<br />
<br />
==XIAS Account==<br />
XIAS Accounts or external access account allows UAB employees to sponsor external collaborators to utilize some of the UAB resources for which the user has been granted access. Creating XIAS account is a self-service interface which allows you to sponsor and create an account for your collaborator at [https://idm.uab.edu/cgi-cas/xrmi/sites XIAS website].<br />
<br />
'''When you go through the sponsorship process you are stating that you know the individual(s) and are responsible for their actions while they are using the XIAS accounts.'''<br />
<br />
===Create a site===<br />
When you go to the [https://idm.uab.edu/cgi-cas/xrmi/sites XIAS website], you'll notice two options on the left-hand panel: [https://idm.uab.edu/cgi-cas/xrmi/sites Manage Projects/Sites] and [https://idm.uab.edu/cgi-cas/xrmi/users Manage Users.]<br />
<br />
* Choose Manage Projects/sites.<br />
* Over there click on '''New''' to create a new site.<br />
* Fill in all the information i.e. Short Description, Long Description, Start date and End date. <br />
** Remember that you users cannot have '''End date''' beyond your sites '''End date'''.<br />
** Note that the start and end dates should be in the format YYYY-MM-DD<br />
** URIs are the resources that the sponsored users should have access to. If the resources are applications or servers then the manager of that resource must do what is necessary within that resource to authorize the external users to gain access.<br />
* In the URIs section: fill out '''VPN.DPO.UAB.EDU''' and '''cheaha.rc.uab.edu''' <br />
* Click on '''Add''' button to create the site.<br />
<br />
=== Create a user===<br />
<br />
* Now choose [https://idm.uab.edu/cgi-cas/xrmi/users Manage Users.] from the left hand panel.<br />
* In the drop-down select your XIAS site.<br />
* To add new users click the '''Register''' button. To review the users already there and change their end date click the '''List''' button.<br />
* To register new user(s) enter an end date for that user’s access. <br />
** The date must be on or before the end date for the site and in the format YYYY-MM-DD<br />
* Enter the email addresses of the user(s) (your collaborator's email) in the box under the end date. You can add multiple users by putting each on a separate line.<br />
<br />
=== Collaborator===<br />
Once you have gone through the above steps, your collaborator should receive an automated email from XIAS with a code, that he can use to complete their registration.<br />
<br />
== Inform UAB Research Computing==<br />
Once you have completed the steps of adding/sponsoring XIAS account for your collaborator, send us an email on support@listserv.uab.edu with information about the collaborator. Please don't forget to include their email address which you used to create their XIAS account, as it would become their Username on [[Cheaha]].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Jupyter&diff=5873Jupyter2019-01-24T17:23:17Z<p>Ravi89@uab.edu: /* 2. Proxy Connection Locally */</p>
<hr />
<div>[http://jupyter.org/ Jupyter Notebook] is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. For more information on jupyter notebook, click [http://jupyter.org/documentation here].<br />
<br />
= Jupyter on Cheaha =<br />
<br />
The cheaha cluster supports Jupyter notebooks for data analysis, but such jobs should be running using the SLURM job submission system to avoid overloading the head node. To run a Jupyter Notebook on cheaha, login to cheaha from your client machine and start an [https://docs.uabgrid.uab.edu/wiki/Slurm#Interactive_Job interactive job]. <br />
<br />
One important note is that cheaha only supports openssh, you should be able to use native ssh from Mac or Linux machines. Windows 10 supports openssh as well, but it is not enabled by default. On updated Windows 10 machines, '''a Developers Command Prompt''' (available via searching from the Start Menu) is able to run openssh via the ssh command similar to Mac and Linux users. Another option for Windows machines is the installation of Cygwin. Putty has been [[Setting_Up_VNC_Session#Port-forwarding_from_Windows_Systems|tested]], but does not work reliably on cheaha for proxying connections.<br />
<br />
The Jupyter notebooks is built with [[Anaconda]],a free and open source distribution of python and R for scientific computing. If you need additional packages, you can create your own [[Python_Virtual_Environment]] just for that purpose.<br />
<br />
== 1. Start the Jupyter Notebook ==<br />
<pre><br />
srun --ntasks=1 --cpus-per-task=4 --mem-per-cpu=4096 --time=08:00:00 --partition=medium --job-name=JOB_NAME --pty /bin/bash<br />
module load Anaconda3/5.2.0<br />
unset XDG_RUNTIME_DIR<br />
jupyter notebook --no-browser --ip=$host<br />
</pre><br />
A headless Jupyter notebook should now be running on a compute node. The next step is to proxy this connection to your local machine.<br />
<br />
== 2. Proxy Connection Locally ==<br />
Now, start up a '''new''' tab/terminal/window on your client machine and relogin to cheaha, using<br />
<pre><br />
ssh -L 88XX:c00XX:88XX BLAZERID@cheaha.rc.uab.edu<br />
</pre><br />
'''Note:'''<br />
* '''c00XX''' is the compute node where you started the jupyter notebook, for example c0047<br />
* '''88XX''' is the port that the notebook is running, for example 8888<br />
* For windows users, you can find instructions for port forwarding, [https://docs.uabgrid.uab.edu/wiki/Setting_Up_VNC_Session#Port-forwarding_from_Windows_Systems here]<br />
<br />
== 3. Copy notebook URL ==<br />
After running the jupyter notebook command the server should start running in headless mode and provide you with a URL including a port # (typically but not always 8888) and a compute node on cheaha (for example C0047) that looks something like this:<br />
<pre><br />
Copy/paste this URL into your browser when you connect for the first time,<br />
to login with a token:<br />
http://c0047:8888/?token=73da89e0eabdeb9d6dc1241a55754634d4e169357f60626c&token=73da89e0eabdeb7d6dc1241a55754634d4e169357f60626c<br />
</pre><br />
Copy the URL shown below into you clipboard/buffer for pasting into the browser as shown in step 4).<br />
<br />
== 4. Access Notebook through Local Browser via Proxy Connection ==<br />
Now access the link on your client machine browser locally using the link generated by jupyter notebook by '''substituting in localhost instead of c00XX'''. Make sure you have the correct port as well.<br />
<pre><br />
http://localhost:88XX/?token=73da89e0eabdeb9d6dc1241a55754634d4e169357f60626c&token=73da89e0eabdeb7d6dc1241a55754634d4e169357f60626c<br />
</pre><br />
A Jupyter notebook should then open in your browser connected to the compute node.<br />
<br />
== Jupyter Options ==<br />
<br />
=== DeepNLP option (development in progress) ===<br />
For the use of additional libraries (pytorch, spacy) related to Deep Learning and/or NLP after loading Anaconda3/5.2.0 run:<br />
<pre><br />
conda activate /share/apps/rc/software/Anaconda3/5.2.0/envs/DeepNLP<br />
</pre><br />
<br />
=== Heavy Data IO option ===<br />
Additionally, if anticipating large IO data transfer adjust the run command to set a higher data rate limit as shown below:<br />
<pre><br />
jupyter notebook --no-browser --ip=$host --NotebookApp.iopub_data_rate_limit=1.0e10 <br />
</pre><br />
<br />
=== Memory Heavy option ===<br />
<pre><br />
srun --ntasks=1 --cpus-per-task=4 --mem-per-cpu=16384 --time=08:00:00 --partition=medium --job-name=POSTag --pty /bin/bash<br />
</pre><br />
<br />
=== GPU Option ===<br />
Finally, if your job requires a GPU then add the [https://docs.uabgrid.uab.edu/wiki/Slurm#Requesting_for_GPUs gres and partition arguments] as shown below:<br />
<pre><br />
srun --ntasks=1 --cpus-per-task=1 --mem-per-cpu=4096 --time=08:00:00 --partition=pascalnodes --job-name=JOB_NAME --gres=gpu:1 --pty /bin/bash<br />
</pre></div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Jupyter&diff=5872Jupyter2019-01-24T17:22:29Z<p>Ravi89@uab.edu: /* 2. Proxy Connection Locally */</p>
<hr />
<div>[http://jupyter.org/ Jupyter Notebook] is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. For more information on jupyter notebook, click [http://jupyter.org/documentation here].<br />
<br />
= Jupyter on Cheaha =<br />
<br />
The cheaha cluster supports Jupyter notebooks for data analysis, but such jobs should be running using the SLURM job submission system to avoid overloading the head node. To run a Jupyter Notebook on cheaha, login to cheaha from your client machine and start an [https://docs.uabgrid.uab.edu/wiki/Slurm#Interactive_Job interactive job]. <br />
<br />
One important note is that cheaha only supports openssh, you should be able to use native ssh from Mac or Linux machines. Windows 10 supports openssh as well, but it is not enabled by default. On updated Windows 10 machines, '''a Developers Command Prompt''' (available via searching from the Start Menu) is able to run openssh via the ssh command similar to Mac and Linux users. Another option for Windows machines is the installation of Cygwin. Putty has been [[Setting_Up_VNC_Session#Port-forwarding_from_Windows_Systems|tested]], but does not work reliably on cheaha for proxying connections.<br />
<br />
The Jupyter notebooks is built with [[Anaconda]],a free and open source distribution of python and R for scientific computing. If you need additional packages, you can create your own [[Python_Virtual_Environment]] just for that purpose.<br />
<br />
== 1. Start the Jupyter Notebook ==<br />
<pre><br />
srun --ntasks=1 --cpus-per-task=4 --mem-per-cpu=4096 --time=08:00:00 --partition=medium --job-name=JOB_NAME --pty /bin/bash<br />
module load Anaconda3/5.2.0<br />
unset XDG_RUNTIME_DIR<br />
jupyter notebook --no-browser --ip=$host<br />
</pre><br />
A headless Jupyter notebook should now be running on a compute node. The next step is to proxy this connection to your local machine.<br />
<br />
== 2. Proxy Connection Locally ==<br />
Now, start up a '''new''' tab/terminal/window on your client machine and relogin to cheaha, using<br />
<pre><br />
ssh -L 88XX:c00XX:88XX BLAZERID@cheaha.rc.uab.edu<br />
</pre><br />
'''Note:'''<br />
* '''c00XX''' is the compute node where you started the jupyter notebook, for example c0047<br />
* '''88XX''' is the port that the notebook is running, for example 8888<br />
* For windows users, you can find instructions for port forwarding, [here]<br />
<br />
== 3. Copy notebook URL ==<br />
After running the jupyter notebook command the server should start running in headless mode and provide you with a URL including a port # (typically but not always 8888) and a compute node on cheaha (for example C0047) that looks something like this:<br />
<pre><br />
Copy/paste this URL into your browser when you connect for the first time,<br />
to login with a token:<br />
http://c0047:8888/?token=73da89e0eabdeb9d6dc1241a55754634d4e169357f60626c&token=73da89e0eabdeb7d6dc1241a55754634d4e169357f60626c<br />
</pre><br />
Copy the URL shown below into you clipboard/buffer for pasting into the browser as shown in step 4).<br />
<br />
== 4. Access Notebook through Local Browser via Proxy Connection ==<br />
Now access the link on your client machine browser locally using the link generated by jupyter notebook by '''substituting in localhost instead of c00XX'''. Make sure you have the correct port as well.<br />
<pre><br />
http://localhost:88XX/?token=73da89e0eabdeb9d6dc1241a55754634d4e169357f60626c&token=73da89e0eabdeb7d6dc1241a55754634d4e169357f60626c<br />
</pre><br />
A Jupyter notebook should then open in your browser connected to the compute node.<br />
<br />
== Jupyter Options ==<br />
<br />
=== DeepNLP option (development in progress) ===<br />
For the use of additional libraries (pytorch, spacy) related to Deep Learning and/or NLP after loading Anaconda3/5.2.0 run:<br />
<pre><br />
conda activate /share/apps/rc/software/Anaconda3/5.2.0/envs/DeepNLP<br />
</pre><br />
<br />
=== Heavy Data IO option ===<br />
Additionally, if anticipating large IO data transfer adjust the run command to set a higher data rate limit as shown below:<br />
<pre><br />
jupyter notebook --no-browser --ip=$host --NotebookApp.iopub_data_rate_limit=1.0e10 <br />
</pre><br />
<br />
=== Memory Heavy option ===<br />
<pre><br />
srun --ntasks=1 --cpus-per-task=4 --mem-per-cpu=16384 --time=08:00:00 --partition=medium --job-name=POSTag --pty /bin/bash<br />
</pre><br />
<br />
=== GPU Option ===<br />
Finally, if your job requires a GPU then add the [https://docs.uabgrid.uab.edu/wiki/Slurm#Requesting_for_GPUs gres and partition arguments] as shown below:<br />
<pre><br />
srun --ntasks=1 --cpus-per-task=1 --mem-per-cpu=4096 --time=08:00:00 --partition=pascalnodes --job-name=JOB_NAME --gres=gpu:1 --pty /bin/bash<br />
</pre></div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Brain_Core&diff=5845Brain Core2018-11-08T21:21:21Z<p>Ravi89@uab.edu: </p>
<hr />
<div>{{BrainCore}}<br />
<br />
[[File:Core.png|thumb|500px]]<br />
CINL Brain Core is an arm of the [https://www.uab.edu/medicine/cinl Civitan International Neuroimaging Laboratory]. The original "Visual Brain Core" was made possible by a generous grant from UAB's HSF/GEF grant program. Given that our resources ended up being used by a broader base of users than just vision researchers, we've dropped the "visual" from our name. Also, we're continuing our work in collaboration with UAB's Civitan International Neuroimaging Lab, and so we're officially the CINL Brain Core now.<br />
<br />
==CINL Brain Core Mission==<br />
Our mission is to help produce high quality, cutting edge research examining the visual brain. To achieve this, we will help investigators overcome some common barriers to performing high quality vision research, and provide forums to discuss new ideas and research techniques.<br />
<br />
[https://docs.uabgrid.uab.edu/wiki/The_5_aims_of_the_Visual_Brain_Core The 5 aims of the Brain Core]<br />
<br />
[[Media:Visual_Brain_Core_Poster.pdf | Visual Brain Core Poster]]<br />
<br />
==Information For CINL Brain Core==<br />
<br />
===CINL Brain Core Personnel and Office Hours===<br />
<br />
<br />
**'''Office Hours: <br />
**'''Monday, 10:00 am - noon, Civitan International Research Center, Second floor outside room 210.'''<br />
*Ravi Tripathi, MS: Computer Systems Specialist. Consultation on high performance computing and algorithm issues. <br />
** '''Thursday, 10:00 am - noon, Edge of Chaos in Lister Hill Library.'''<br />
*Mark Bolding, Ph.D. will discuss MR physics related questions. Ravi Tripathi, MS: Computer Systems Specialist. Consultation on high performance computing and algorithm issues.<br />
<br />
===CINL Brain Core Seminar Series and Neuroimaging Journal Club===<br />
Brain Core seminar series includes high level speakers usually from outside UAB. Every second Friday at noon in CIRC 120. <br />
We will discuss new ideas and techniques in brain imaging. During other fridays at noon in CIRC 120, we have Neuroimaging Journal Club.<br />
The Neuroimaging journal club is for UAB and Auburn researchers to share their work, or journal articles of their interest with our neuroimaging community. <br />
Information about this colloquium is here: [https://www.uab.edu/medicine/cinl/seminars CINL page ].<br />
<br />
<br />
[[https://docs.uabgrid.uab.edu/wiki/List_of_speakers_in_Visual_Brain_Core_Seminar_Series Older website for speakers]]<br />
<br />
===For Use in Grant Proposals:===<br />
The CINL Brain Core is supported by users. For this reason, we ask that you include use of the Brain Core resources in the budget of your upcoming grants. Quotations from previous proposals are provided here: [[Grant Proposal Language]].<br />
<br />
===Mailing List:===<br />
Please follow these instructions to subscribe to the ‘CINL-NOTICE’ listserv:<br />
<br />
Click here, or alternatively, send an email to listserv@listserv.uab.edu with the email body as sub cinl-notice.<br />
After which you’ll receive an email to confirm your email address.<br />
<br />
After confirming your email address, you would start receiving cancellation emails from others on the list as well as be able to send your own notifications .<br />
<br />
===[[BrainhackUAB]]===<br />
<!-- this link does not have much in it<br />
===[[Other information]]===<br />
--><br />
<br />
==Neuroimaging at UAB==<br />
<br />
===UAB Neuroimaging Facilities===<br />
<!-- need to add good links to here --><br />
[http://www.alabamaadvancedimaging.org/ Alabama Advanced Imaging Consortium<br />
[https://www.uab.edu/medicine/cinl Civitan International Neuroimaging Laboratory ] <br />
<br />
[[UAB-HSF MEG Laboratory]]<br />
<br />
[[Small Animal Imaging Shared Facility]]<br />
<!-- the following is outdated and could be improved <br />
Equipment for collecting behavioral data during Neuroimaging<br />
<br />
*[http://www.sr-research.com/EL_1000.html Eye Tracker] --><br />
<br />
===Neuroimaging and Systems Neuroscience Labs at UAB===<br />
<br />
*[https://www.uab.edu/medicine/cinl/about/researchers a partial list of researchers who use the CINL]<br />
<br />
(UAB folks, please let us know if your lab should be included on this list, or add more information about it!)<br />
<br />
Here is a [[partial list of manuscripts]] that have resulted from CINL and Visual Brain Core resources.<br />
<br />
===Cluster Computing Environment at UAB: Cheaha===<br />
* [[Cheaha_GettingStarted]] - information on getting an account and learning about how to use the cluster<br />
* [[Cheaha]] - background information on the cluster useful for grants and publications<br />
<br />
===UAB-Auburn University Collaboration for Neuroimaging===<br />
<br />
'''[http://www.eng.auburn.edu/research/centers/mri/ Auburn University MRI Research Center]'''<br />
'''[http://www.eng.auburn.edu/research/centers/mri/equipment/siemens-magnetom-7t.html Siemens Magnetom 7T]'''<br />
<br />
'''UAB & Auburn Neuroimaging Colloquium'''<br />
<br />
*Neuroimaging journal Club. Shared across campuses via GoToMeeting. <br />
To get on our mailing list, [https://docs.google.com/forms/d/e/1FAIpQLSdNi8bGzhQleGUg5h3hLZtXTDL-vAJMyf-n5W6i_ohdedISbw/viewform click here]<br />
<br />
'''[[UAB & Auburn Neuroimaging Retreat]]'''<br />
<br />
==How To...==<br />
<br />
===Computer and coding related how-to's===<br />
<br />
[[Using Linux]]<br />
<br />
[[Matlab]]<br />
<br />
[[Psychtoolbox]]<br />
<br />
[[https://docs.uabgrid.uab.edu/wiki/Box.com_bulk_transfer Saving Data in Box]]<br />
<br />
*[[Unix shortcuts]]<br />
<br />
===fMRI related how-to's and important links===<br />
<br />
[[Tools]]<br />
<br />
[[Brain atlases]]<br />
<br />
[[Cool Websites for Beginners]]<br />
<br />
<br />
===UAB Neuroimaging Tools and How-To's (some require blazer id)===<br />
<br />
[[Imaging Protocols]]<br />
<br />
[[Analysis Scripts]]<br />
<br />
[[Behavioral data analysis techniques]]<br />
<br />
[[Institutional Review Board]]</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Template:BrainCore&diff=5844Template:BrainCore2018-11-08T21:19:50Z<p>Ravi89@uab.edu: </p>
<hr />
<div><!-- MAIN PAGE BANNER --><br />
<table id="mp-banner" style="width: 100%; margin:4px 0 0 0; background:none; border-spacing: 0px;"><br />
<tr><td class="MainPageBG" style="text-align:center; padding:0.2em; background-color:#cef2e0; border:2px solid #f2e0ce; color:#000; font-size:100%;"><br />
<br />
<span style="color:#009000"> '''<big></big>''' </span><br />
<br />
<span><big>'''NOTE'''</big> <br />
<br />
There would be no VBC session on Monday, Nov 12th 2018. If you have any questions, please send an email to Research Computing at support@listserv.uab.edu <br />
<br />
</span><br />
</td><br />
</tr><br />
</table></div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Template:BrainCore&diff=5843Template:BrainCore2018-11-08T21:19:28Z<p>Ravi89@uab.edu: Created page with "<!-- MAIN PAGE BANNER --> <table id="mp-banner" style="width: 100%; margin:4px 0 0 0; background:none; border-spacing: 0px;"> <tr><td class="MainPageBG" style="t..."</p>
<hr />
<div><!-- MAIN PAGE BANNER --><br />
<table id="mp-banner" style="width: 100%; margin:4px 0 0 0; background:none; border-spacing: 0px;"><br />
<tr><td class="MainPageBG" style="text-align:center; padding:0.2em; background-color:#cef2e0; border:2px solid #f2e0ce; color:#000; font-size:100%;"><br />
<br />
<span style="color:#009000"> '''<big></big>''' </span><br />
<br />
<span><big>'''NOTE'''</big> <br />
<br />
There would be no VBC session on Monday, Nov 12th 2018. If you have any questions, please send an email to . Research Computing at support@listserv.uab.edu <br />
<br />
</span><br />
</td><br />
</tr><br />
</table></div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Python_Virtual_Environment&diff=5830Python Virtual Environment2018-10-10T15:44:32Z<p>Ravi89@uab.edu: </p>
<hr />
<div>Python virtual environment is a method of creating an isolated environment for Python projects. It enables each project to have its own dependencies, regardless of what dependencies every other project has. To read more about Python virtual environments, click [https://docs.python.org/3/tutorial/venv.html here].<br />
<br />
===Creating a Python Virtual Environment===<br />
Load one of the Python modules available on Cheaha in your environment.<br />
<pre><br />
[ravi89@login001 ~]$ module avail Python<br />
<br />
-------------------------- /share/apps/rc/modules/all --------------------------<br />
Python/2.7.10-goolf-1.7.20 Python/2.7.13-intel-2017a<br />
Python/2.7.10-intel-2015b Python/2.7.3-foss-2016a<br />
Python/2.7.11-foss-2016a Python/2.7.3-goolf-1.7.20<br />
Python/2.7.11-foss-2016b Python/2.7.5-goolf-1.7.20<br />
Python/2.7.11-goolf-1.7.20 Python/2.7.8-intel-2015b<br />
Python/2.7.11-intel-2015b Python/2.7.9-goolf-1.7.20<br />
Python/2.7.11-intel-2016a Python/2.7.9-intel-2015b<br />
Python/2.7.12-foss-2016a Python/3.2.3-goolf-1.7.20<br />
Python/2.7.12-foss-2016b Python/3.5.1-foss-2016a<br />
Python/2.7.12-intel-2015b Python/3.5.1-intel-2016a<br />
Python/2.7.12-intel-2016a Python/3.6.1-intel-2017a<br />
Python/2.7.13-GCCcore-6.3.0-bare Python/3.6.3-intel-2017a<br />
</pre><br />
<br />
Once you have loaded Python, we would use '''virtualenv''' to create and manage virtual environments.<br />
<pre><br />
[ravi89@login001 Python_Environments]$ module load Python/3.6.3-intel-2017a <br />
[ravi89@login001 Python_Environments]$ virtualenv test_environment<br />
Using base prefix '/share/apps/rc/software/Python/3.6.3-intel-2017a'<br />
New python executable in /data/user/ravi89/Python_Environments/test_environment/bin/python<br />
Installing setuptools, pip, wheel...done.<br />
[ravi89@login001 Python_Environments]$<br />
</pre><br />
<br />
===Activating a Virtual Environment===<br />
Once a virtual environment has been created, you need to activate it to be in the virtual environment.<br />
<pre><br />
[ravi89@login001 Python_Environments]$ source test_environment/bin/activate<br />
(test_environment) [ravi89@login001 Python_Environments]$<br />
</pre><br />
Activating the virtual environment will change your shell’s prompt to show what virtual environment you’re using, test_environment in the above case, and modify the environment so that you can install Python packages for that particular environment.<br />
<br />
===Maintaining a Virtual Environment===<br />
After this you can install the packages that you would like for this environment, using '''pip'''. [https://pip.pypa.io/en/stable/ pip] is a package management system used to install and manage software packages written in Python.<br />
<pre><br />
(test_environment) [ravi89@login001 Python_Environments]$ pip install numpy<br />
Collecting numpy<br />
Downloading numpy-1.14.0-cp36-cp36m-manylinux1_x86_64.whl (17.2MB)<br />
100% |████████████████████████████████| 17.2MB 77kB/s <br />
Installing collected packages: numpy<br />
Successfully installed numpy-1.14.0<br />
(test_environment) [ravi89@login001 Python_Environments]$ ls test_environment/lib/python3.6/site-packages/<br />
easy_install.py pip-9.0.1.dist-info setuptools-38.4.0.dist-info<br />
numpy pkg_resources wheel<br />
numpy-1.14.0.dist-info __pycache__ wheel-0.30.0.dist-info<br />
pip setuptools<br />
(test_environment) [ravi89@login001 Python_Environments]$<br />
</pre><br />
<br />
You can use this method to install a Python application alongside all the dependencies that it requires. <br />
<br />
===Deactivating a Virtual Environment===<br />
After you are done using the virtual environment, you can use '''deactivate''' command to go back to your bash shell environemnt.<br />
<pre><br />
(test_environment) [ravi89@login001 Python_Environments]$ deactivate <br />
[ravi89@login001 Python_Environments]$<br />
</pre><br />
It would change your shell's prompt and remove the name of the virtual environment that you were in.<br />
<br />
===Sharing a virtual environment===<br />
You can use '''pip freeze''' to list all the packages in a virtual environment and copy it to a '''requirement.txt.file'''<br />
<pre><br />
pip freeze > requirements.txt<br />
</pre><br />
<br />
Now you can create new virtualenv and after activating that virtual environment, install all the packages using the following command.<br />
<pre><br />
pip install -r requirements.txt<br />
</pre></div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Anaconda&diff=5829Anaconda2018-10-09T23:48:45Z<p>Ravi89@uab.edu: Created page with "[https://conda.io/docs/user-guide/overview.html Conda] is a powerful package manager and environment manager. Conda allows you to maintain distinct environments for your diffe..."</p>
<hr />
<div>[https://conda.io/docs/user-guide/overview.html Conda] is a powerful package manager and environment manager. Conda allows you to maintain distinct environments for your different projects, with dependency packages defined and installed for each project.<br />
<br />
===Creating a Conda virtual environment===<br />
Load one of the conda environments available on cheaha:<br />
<pre><br />
ravi89 @ c0066 ➜ ~ module avail Anaconda<br />
<br />
--------------------------------------------- /share/apps/rc/modules/all ---------------------------------------------<br />
Anaconda2/4.0.0 Anaconda2/4.2.0 Anaconda3/4.4.0 Anaconda3/5.0.1 Anaconda3/5.1.0 Anaconda3/5.2.0<br />
</pre><br />
Once you have loaded Anaconda, you can create an environment using the following command:<br />
<pre><br />
ravi89 @ c0066 ➜ ~ conda create --name test_env<br />
Solving environment: done<br />
<br />
## Package Plan ##<br />
<br />
environment location: /home/ravi89/.conda/envs/test_env<br />
<br />
added / updated specs:<br />
- setuptools<br />
<br />
<br />
The following packages will be downloaded:<br />
<br />
package | build<br />
---------------------------|-----------------<br />
python-3.7.0 | h6e4f718_3 30.6 MB<br />
wheel-0.32.1 | py37_0 35 KB<br />
setuptools-40.4.3 | py37_0 556 KB<br />
------------------------------------------------------------<br />
Total: 31.1 MB<br />
<br />
The following NEW packages will be INSTALLED:<br />
<br />
ca-certificates: 2018.03.07-0<br />
certifi: 2018.8.24-py37_1<br />
libedit: 3.1.20170329-h6b74fdf_2<br />
libffi: 3.2.1-hd88cf55_4<br />
libgcc-ng: 8.2.0-hdf63c60_1<br />
libstdcxx-ng: 8.2.0-hdf63c60_1<br />
ncurses: 6.1-hf484d3e_0<br />
openssl: 1.0.2p-h14c3975_0<br />
pip: 10.0.1-py37_0<br />
python: 3.7.0-h6e4f718_3<br />
readline: 7.0-h7b6447c_5<br />
setuptools: 40.4.3-py37_0<br />
sqlite: 3.25.2-h7b6447c_0<br />
tk: 8.6.8-hbc83047_0<br />
wheel: 0.32.1-py37_0<br />
xz: 5.2.4-h14c3975_4<br />
zlib: 1.2.11-ha838bed_2<br />
<br />
Proceed ([y]/n)? y<br />
<br />
<br />
Downloading and Extracting Packages<br />
python-3.7.0 | 30.6 MB | ########################################################################### | 100%<br />
wheel-0.32.1 | 35 KB | ########################################################################### | 100%<br />
setuptools-40.4.3 | 556 KB | ########################################################################### | 100%<br />
Preparing transaction: done<br />
Verifying transaction: done<br />
Executing transaction: done<br />
#<br />
# To activate this environment, use:<br />
# > source activate test_env<br />
#<br />
# To deactivate an active environment, use:<br />
# > source deactivate<br />
#<br />
</pre><br />
<br />
You can also specify the packages that you want to install in the conda virtual environment:<br />
<pre><br />
ravi89 @ c0066 ➜ ~ conda create --name test_env PACKAGE_NAME<br />
</pre><br />
<br />
===Listing all your conda virtual environments===<br />
In case you forget the name of your virtual environments, you can list all your virtual environments by running '''conda env list'''<br />
<pre><br />
ravi89 @ c0066 ➜ ~ conda env list<br />
# conda environments:<br />
#<br />
jupyter_test /home/ravi89/.conda/envs/jupyter_test<br />
modeller /home/ravi89/.conda/envs/modeller<br />
psypy3 /home/ravi89/.conda/envs/psypy3<br />
test /home/ravi89/.conda/envs/test<br />
test_env /home/ravi89/.conda/envs/test_env<br />
test_pytorch /home/ravi89/.conda/envs/test_pytorch<br />
tomopy /home/ravi89/.conda/envs/tomopy<br />
base * /share/apps/rc/software/Anaconda3/5.2.0<br />
DeepNLP /share/apps/rc/software/Anaconda3/5.2.0/envs/DeepNLP<br />
ubrite-jupyter-base-1.0 /share/apps/rc/software/Anaconda3/5.2.0/envs/ubrite-jupyter-base-1.0<br />
<br />
ravi89 @ c0066 ➜ ~<br />
</pre><br />
NOTE: Virtual environment with the asterisk(*) next to it is the one that's currently active.<br />
<br />
===Activating a conda virtual environment===<br />
You can activate your virtual environment for use by running '''source activate ENV_NAME'''<br />
<pre><br />
ravi89 @ c0066 ➜ ~ source activate test_env<br />
(test_env) ravi89 @ c0066 ➜ ~<br />
</pre><br />
NOTE: Your shell prompt would also include the name of the virtual environment that you activated.<br />
<br />
===Locate and install packages===<br />
Conda allows you to search for packages that you want to install:<br />
<pre><br />
(test_env) ravi89 @ c0066 ➜ ~ conda search BeautifulSoup4<br />
Loading channels: done<br />
# Name Version Build Channel<br />
beautifulsoup4 4.4.0 py27_0 pkgs/free<br />
beautifulsoup4 4.4.0 py34_0 pkgs/free<br />
beautifulsoup4 4.4.0 py35_0 pkgs/free<br />
beautifulsoup4 4.4.1 py27_0 pkgs/free<br />
beautifulsoup4 4.4.1 py34_0 pkgs/free<br />
beautifulsoup4 4.4.1 py35_0 pkgs/free<br />
beautifulsoup4 4.5.1 py27_0 pkgs/free<br />
beautifulsoup4 4.5.1 py34_0 pkgs/free<br />
beautifulsoup4 4.5.1 py35_0 pkgs/free<br />
beautifulsoup4 4.5.1 py36_0 pkgs/free<br />
beautifulsoup4 4.5.3 py27_0 pkgs/free<br />
beautifulsoup4 4.5.3 py34_0 pkgs/free<br />
beautifulsoup4 4.5.3 py35_0 pkgs/free<br />
beautifulsoup4 4.5.3 py36_0 pkgs/free<br />
beautifulsoup4 4.6.0 py27_0 pkgs/free<br />
beautifulsoup4 4.6.0 py27_1 pkgs/main<br />
beautifulsoup4 4.6.0 py27h3f86ba9_1 pkgs/main<br />
beautifulsoup4 4.6.0 py34_0 pkgs/free<br />
beautifulsoup4 4.6.0 py35_0 pkgs/free<br />
beautifulsoup4 4.6.0 py35h442a8c9_1 pkgs/main<br />
beautifulsoup4 4.6.0 py36_0 pkgs/free<br />
beautifulsoup4 4.6.0 py36_1 pkgs/main<br />
beautifulsoup4 4.6.0 py36h49b8c8c_1 pkgs/main<br />
beautifulsoup4 4.6.0 py37_1 pkgs/main<br />
beautifulsoup4 4.6.1 py27_0 pkgs/main<br />
beautifulsoup4 4.6.1 py35_0 pkgs/main<br />
beautifulsoup4 4.6.1 py36_0 pkgs/main<br />
beautifulsoup4 4.6.1 py37_0 pkgs/main<br />
beautifulsoup4 4.6.3 py27_0 pkgs/main<br />
beautifulsoup4 4.6.3 py35_0 pkgs/main<br />
beautifulsoup4 4.6.3 py36_0 pkgs/main<br />
beautifulsoup4 4.6.3 py37_0 pkgs/main<br />
(test_env) ravi89 @ c0066 ➜ ~<br />
</pre><br />
NOTE: Search is case-insensitive<br />
<br />
You can install the packages in conda environment using<br />
<pre><br />
(test_env) ravi89 @ c0066 ➜ ~ conda install beautifulsoup4<br />
Solving environment: done<br />
<br />
## Package Plan ##<br />
<br />
environment location: /home/ravi89/.conda/envs/test_env<br />
<br />
added / updated specs:<br />
- beautifulsoup4<br />
<br />
<br />
The following packages will be downloaded:<br />
<br />
package | build<br />
---------------------------|-----------------<br />
beautifulsoup4-4.6.3 | py37_0 138 KB<br />
<br />
The following NEW packages will be INSTALLED:<br />
<br />
beautifulsoup4: 4.6.3-py37_0<br />
<br />
Proceed ([y]/n)? y<br />
<br />
<br />
Downloading and Extracting Packages<br />
beautifulsoup4-4.6.3 | 138 KB | ########################################################################### | 100%<br />
Preparing transaction: done<br />
Verifying transaction: done<br />
Executing transaction: done<br />
(test_env) ravi89 @ c0066 ➜ ~<br />
</pre><br />
<br />
===Deactivating your virtual environment===<br />
You can deactivate your virtual environment using '''source deactivate'''<br />
<pre><br />
(test_env) ravi89 @ c0066 ➜ ~ source deactivate<br />
ravi89 @ c0066 ➜ ~<br />
</pre><br />
<br />
===Sharing an environment===<br />
You may want to share your environment with someone for testing or other purposes. Sharing the environemnt file for your virtual environment is the most starightforward metohd which allows other person to quickly create an environment identical to you.<br />
====Export environment====<br />
* Activate the virtual environment that you want to export.<br />
* Export an environment.yml file<br />
<pre><br />
conda env export > environment.yml<br />
</pre><br />
* Now you can send the recently created environment.yml file to the other person.<br />
<br />
====Create a virtual environment using environment.yml====<br />
<pre><br />
conda env create -f environment.yml<br />
</pre><br />
<br />
===Delete a conda virtual environment===<br />
You can use remove parameter of conda to delete a conda virtual environment that you don't need:<br />
<pre><br />
ravi89 @ c0066 ➜ ~ conda remove --name test_env --all<br />
<br />
Remove all packages in environment /home/ravi89/.conda/envs/test_env:<br />
<br />
<br />
## Package Plan ##<br />
<br />
environment location: /home/ravi89/.conda/envs/test_env<br />
<br />
<br />
The following packages will be REMOVED:<br />
<br />
beautifulsoup4: 4.6.3-py37_0<br />
ca-certificates: 2018.03.07-0<br />
certifi: 2018.8.24-py37_1<br />
libedit: 3.1.20170329-h6b74fdf_2<br />
libffi: 3.2.1-hd88cf55_4<br />
libgcc-ng: 8.2.0-hdf63c60_1<br />
libstdcxx-ng: 8.2.0-hdf63c60_1<br />
ncurses: 6.1-hf484d3e_0<br />
openssl: 1.0.2p-h14c3975_0<br />
pip: 10.0.1-py37_0<br />
python: 3.7.0-h6e4f718_3<br />
readline: 7.0-h7b6447c_5<br />
setuptools: 40.4.3-py37_0<br />
sqlite: 3.25.2-h7b6447c_0<br />
tk: 8.6.8-hbc83047_0<br />
wheel: 0.32.1-py37_0<br />
xz: 5.2.4-h14c3975_4<br />
zlib: 1.2.11-ha838bed_2<br />
<br />
Proceed ([y]/n)? y<br />
<br />
ravi89 @ c0066 ➜ ~<br />
</pre></div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Jupyter&diff=5815Jupyter2018-08-21T20:07:30Z<p>Ravi89@uab.edu: /* Jupyter on Cheaha */</p>
<hr />
<div>[http://jupyter.org/ Jupyter Notebook] is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. For more information on jupyter notebook, click [http://jupyter.org/documentation here].<br />
<br />
== Jupyter on Cheaha ==<br />
<br />
The cheaha cluster supports Jupyter notebooks for data analysis, but such jobs should be running using the SLURM job submission system to avoid overloading the head node. To run a Jupyter Notebook on cheaha, login to cheaha from your client machine and start an [https://docs.uabgrid.uab.edu/wiki/Slurm#Interactive_Job interactive job]<br />
<pre><br />
srun --ntasks=1 --cpus-per-task=4 --mem-per-cpu=4096 --time=08:00:00 --partition=medium --job-name=JOB_NAME --pty /bin/bash<br />
module load Anaconda3/5.2.0<br />
unset XDG_RUNTIME_DIR<br />
jupyter notebook --no-browser --ip=$host<br />
</pre><br />
The server should start running and provide you with a URL.<br />
<br />
Now, start up a new tab/terminal/window on your client machine, and relogin to cheaha, using<br />
<pre><br />
ssh -L 8888:c00XX:8888 BLAZERID@cheaha.rc.uab.edu<br />
</pre><br />
'''Note:'''<br />
* c00XX is the compute node where you started the jupiter notebook.<br />
* If your jupyter notebook starts on a different port number, then 8888 , then use that in the above command, in place of 8888.<br />
<br />
Now access the link generated by jupyter notebook (change c00XX to localhost) on your client machine by opening your browser. It should be running.</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Jupyter&diff=5813Jupyter2018-08-21T19:22:03Z<p>Ravi89@uab.edu: Starting up a new page for jupyter notebook.</p>
<hr />
<div>[http://jupyter.org/ Jupyter Notebook] is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. For more information on jupyter notebook, click [http://jupyter.org/documentation here].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Slurm&diff=5807Slurm2018-08-15T16:46:29Z<p>Ravi89@uab.edu: /* Example Batch Job Script */</p>
<hr />
<div>[http://slurm.schedmd.com/ Slurm] is a queue management system and stands for Simple Linux Utility for Resource Management. Slurm was developed at the Lawrence Livermore National Lab and currently runs some of the largest compute clusters in the world. Slurm is now the primary job manager on Cheaha, it replaces SUN Grid Engine (SGE) the job manager used earlier.<br />
<br />
Slurm is similar in many ways to GridEngine or most other queue systems. You write a batch script then submit it to the queue manager (scheduler). The queue manager then schedules your job to run on the queue (or '''partition''' in Slurm parlance) that you designate. Below we will provide an outline of how to submit jobs to Slurm, how Slurm decides when to schedule your job, and how to monitor progress.<br />
<br />
<br />
== General Slurm Documentation ==<br />
The primary source for documentation on Slurm usage and commands can be found at the [http://slurm.schedmd.com/ Slurm] site. If you Google for Slurm questions, you'll often see the Lawrence Livermore pages as the top hits, but these tend to be outdated.<br />
<br />
The [https://slurm.schedmd.com/quickstart.html SLURM QuickStart Guide] provides a very useful overview of how SLURM treats a cluster as pool of resources which you can allocate to get your work done. The Example section on that page is a very useful orientation to SLURM environments.<br />
<br />
The [http://www.ceci-hpc.be/slurm_tutorial.html SLURM Tutorial at CECI], a European Consortium of HPC sites, provides a very good introduction on submitting single threaded, multi-threaded, and MPI jobs. <br />
<br />
A great way to get details on the Slurm commands is the man pages available from the Cheaha cluster. For example, if you type the following command:<br />
<br />
<pre><br />
man sbatch<br />
</pre><br />
you'll get the manual page for the sbatch command.<br />
<br />
== Slurm Partitions ==<br />
Cheaha has the following Slurm partitions (can also be thought of in terms of SGE queues) defined (the lower the number the higher the priority).<br />
<br />
'''Note:'''Jobs '''must request''' the appropriate partition (ex: ''--partition=short'') to satisfy the jobs resource request (maximum runtime, number of compute nodes, etc...)<br />
{{Slurm_Partitions}}<br />
<br />
== Logging on and Running Jobs from the command line ==<br />
Once you've gone through the [https://docs.uabgrid.uab.edu/wiki/Cheaha_GettingStarted#Access_.28Cluster_Account_Request.29 account setup procedure] and obtained a suitable [https://docs.uabgrid.uab.edu/wiki/Cheaha_GettingStarted#Client_Configuration terminal application], you can login to the Cheaha system via ssh<br />
<br />
ssh '''BLAZERID'''@cheaha.rc.uab.edu<br />
<br />
Alternatively, '''existing users''' could follow these [https://docs.uabgrid.uab.edu/wiki/SSH_Key_Authentication instructions to add SSH keys] and access the new system.<br />
<br />
Cheaha (new hardware) run the CentOS 7 version of the Linux operating system and commands are run under the "bash" shell (the default shell). There are a number of Linux and [http://www.gnu.org/software/bash/manual/bashref.html bash references], [http://cli.learncodethehardway.org/bash_cheat_sheet.pdf cheat sheets] and [http://www.tldp.org/LDP/Bash-Beginners-Guide/html/ tutorials] available on the web.<br />
<br />
== Typical Workflow ==<br />
* Stage data to $USER_SCRATCH (your scratch directory)<br />
* Determine how to run your code in "batch" mode. Batch mode typically means the ability to run it from the command line without requiring any interaction from the user.<br />
* Identify the appropriate resources needed to run the job. The following are mandatory resource requests for all jobs on Cheaha:<br />
** Number of processor cores required by the job<br />
** Maximum memory (RAM) required per core<br />
** Maximum runtime<br />
* Write a job script specifying queuing system parameters, resource requests, and commands to run program<br />
* Submit script to queuing system (sbatch script.job)<br />
* Monitor job (squeue)<br />
* Review the results and resubmit as necessary<br />
* Clean up the scratch directory by moving or deleting the data off of the cluster<br />
<br />
== Slurm Job Types ==<br />
=== Batch Job ===<br />
'''TODO: ''' provide an explanation of what makes a batch job and why use that vs an interactive job<br />
<br />
For additional information on the '''sbatch''' command execute '''man sbatch''' at the command line to view the manual.<br />
<br />
==== Example Batch Job Script ====<br />
A job consists of '''resource requests''' and '''tasks'''. The Slurm job scheduler interprets lines beginning with '''#SBATCH''' as Slurm arguments. In this example, the job is requesting to run 1 task<br />
<br />
'''Note:'''Jobs '''must request''' the appropriate partition (ex: ''--partition=short'') to satisfy the jobs resource request (maximum runtime, number of compute nodes, etc...)<br />
<pre>#!/bin/bash<br />
#<br />
#SBATCH --job-name=test<br />
#SBATCH --output=res.out<br />
#SBATCH --error=res.err<br />
#<br />
# Number of tasks needed for this job. Generally, used with MPI jobs<br />
#SBATCH --ntasks=1<br />
#SBATCH --partition=express<br />
#<br />
# Time format = HH:MM:SS, DD-HH:MM:SS<br />
#SBATCH --time=10:00<br />
#<br />
# Number of CPUs allocated to each task. <br />
#SBATCH --cpus-per-task=1<br />
#<br />
# Mimimum memory required per allocated CPU in MegaBytes. <br />
#SBATCH --mem-per-cpu=100<br />
#<br />
# Send mail to the email address when the job fails<br />
#SBATCH --mail-type=FAIL<br />
#SBATCH --mail-user=YOUR_EMAIL_ADDRESS<br />
<br />
#Set your environment here<br />
<br />
#Run your commands here<br />
srun hostname<br />
srun sleep 60<br />
</pre><br />
[https://docs.uabgrid.uab.edu/wiki/Cheaha_GettingStarted#Sample_Job_Scripts Click here] for more example SLURM job scripts.<br />
<br />
=== Interactive Job ===<br />
Login Node (the host that you connected to when you setup the SSH connection to Cheaha) is supposed to be used for submitting jobs and/or lighter prep work required for the job scripts. '''Do not run heavy computations on the login node'''. If you have a heavier workload to prepare for a batch job (eg. compiling code or other manipulations of data) or your compute application requires interactive control, you should request a dedicated interactive node for this work.<br />
<br />
Interactive resources are requested by submitting an "interactive" job to the scheduler. Interactive jobs will provide you a command line on a compute resource that you can use just like you would the command line on the login node. The difference is that the scheduler has dedicated the requested resources to your job and you can run your interactive commands without having to worry about impacting other users on the login node.<br />
<br />
Interactive jobs, that can be run on command line, are requested with the '''srun''' command. <br />
<br />
<pre><br />
srun --ntasks=1 --cpus-per-task=4 --mem-per-cpu=4096 --time=08:00:00 --partition=medium --job-name=JOB_NAME --pty /bin/bash<br />
</pre><br />
<br />
This command requests for 4 cores (--cpus-per-task) for a single task (--ntasks) with each cpu requesting size 4GB of RAM (--mem-per-cpu) for 8 hrs (--time).<br />
<br />
More advanced interactive scenarios to support graphical applications are available using [https://docs.uabgrid.uab.edu/wiki/Setting_Up_VNC_Session VNC] or X11 tunneling [http://www.uab.edu/it/software X-Win32 2014 for Windows]<br />
<br />
Interactive jobs that requires running a graphical application, are requested with the '''sinteractive''' command, via '''Terminal''' on your VNC window.<br />
<br />
<pre><br />
sinteractive --ntasks=1 --cpus-per-task=4 --mem-per-cpu=4096 --time=08:00:00 --partition=medium --job-name=JOB_NAME <br />
</pre><br />
<br />
====Requesting for GPUs====<br />
<br />
To request for an interactive session on one of the GPU nodes (c0089-c0092 K80's and c0097-c0114 P100's), add --gres parameter to the 'srun' or 'sinteractive' command. <br />
<br />
<pre style="white-space: pre-wrap;" ><br />
srun --ntasks=1 --cpus-per-task=1 --mem-per-cpu=4096 --time=08:00:00 --partition=pascalnodes --job-name=JOB_NAME --gres=gpu:1 --pty /bin/bash<br />
</pre><br />
<br />
<pre style="white-space: pre-wrap;" ><br />
sinteractive --ntasks=1 --cpus-per-task=1 --mem-per-cpu=4096 --time=08:00:00 --partition=pascalnodes --job-name=JOB_NAME --gres=gpu:1<br />
</pre><br />
<br />
'''NOTE:''' <br />
* If you want to use more then one GPU on the node, please increase the value in --gres=gpu:[1-4]<br />
* If you want to use the P100s please use the partition as 'pascalnodes', wheres for K80s please use either of the express, short, medium or long as partitions.<br />
* To request an interactive session using a single GPU, say for code development, you can use the following syntax<br />
<pre><br />
sinteracive --partition=pascalnodes --gres=gpu<br />
</pre><br />
<br />
=== MPI Job ===<br />
'''TODO add MPI information and a job example'''<br />
<br />
=== OpenMP / SMP Job ===<br />
[https://en.wikipedia.org/wiki/OpenMP OpenMP / SMP] jobs are those that use multiple CPU cores on a single compute node.<br />
<br />
It is very important to properly structure an SMP job to ensure that the requested CPU cores are assigned to the same compute node. The following example requests 4 CPU cores by setting the number of '''ntasks''' to '''1''' and '''cpus-per-tasks''' to '''4'''<br />
<br />
<pre><br />
srun --partition=short \<br />
--ntasks=1 \<br />
--cpus-per-task=4 \<br />
--mem-per-cpu=1024 \<br />
--time=5:00:00 \<br />
--job-name=rsync \<br />
--pty /bin/bash<br />
</pre><br />
<br />
== Job Status ==<br />
<br />
=== SQUEUE ===<br />
To check your job status, you can use the following command<br />
<pre><br />
squeue -u $USER<br />
</pre><br />
<br />
Following fields are displayed when you run '''squeue'''<br />
<pre style="white-space: pre-wrap;"><br />
JOBID - ID assigned to your job by Slurm scheduler<br />
PARTITION - Partition your job gets, depends upon time requested (express(max 2 hrs), short(max 12 hrs), medium(max 50 hrs), long(max 150 hrs), sinteractive(0-2 hrs))<br />
NAME - JOB name given by user<br />
USER - User who started the job<br />
ST - State your job is in. The typical states are PENDING (PD), RUNNING(R), SUSPENDED(S), COMPLETING(CG), and COMPLETED(CD)<br />
TIME - Time for which your job has been running<br />
NODES - Number of nodes your job is running on<br />
NODELIST - Node on which the job is running<br />
</pre><br />
<br />
For more details on '''squeue''', go [http://slurm.schedmd.com/squeue.html here].<br />
<br />
=== SSTAT ===<br />
The '''sstat''' command shows status and metric information for a running job.<br />
<br />
'''NOTE: the job parts must be executed using ''srun'' otherwise ''sstat'' will not display useful output'''<br />
<pre style="white-space: pre-wrap;"><br />
[rcs@login001 ~]$ sstat 256483<br />
JobID MaxVMSize MaxVMSizeNode MaxVMSizeTask AveVMSize MaxRSS MaxRSSNode MaxRSSTask AveRSS MaxPages MaxPagesNode MaxPagesTask AvePages MinCPU MinCPUNode MinCPUTask AveCPU NTasks AveCPUFreq ReqCPUFreqMin ReqCPUFreqMax ReqCPUFreqGov ConsumedEnergy MaxDiskRead MaxDiskReadNode MaxDiskReadTask AveDiskRead MaxDiskWrite MaxDiskWriteNode MaxDiskWriteTask AveDiskWrite <br />
------------ ---------- -------------- -------------- ---------- ---------- ---------- ---------- ---------- -------- ------------ -------------- ---------- ---------- ---------- ---------- ---------- -------- ---------- ------------- ------------- ------------- -------------- ------------ --------------- --------------- ------------ ------------ ---------------- ---------------- ------------ <br />
256483.0 1962728K c0043 1 1960633K 91920K c0043 3 91867K 67K c0043 3 50K 00:00.000 c0043 0 00:00.000 8 1.20G Unknown Unknown Unknown 0 1M c0043 5 1M 0.34M c0043 5 0.34M <br />
<br />
</pre><br />
<br />
For more details on '''sstat''', go [http://slurm.schedmd.com/sstat.html here].<br />
<br />
=== SCONTROL ===<br />
<br />
<pre><br />
$ scontrol show jobid -dd 123<br />
<br />
JobId=123 JobName=SLI<br />
UserId=rcuser(1000) GroupId=rcuser(1000)<br />
Priority=4294898073 Nice=0 Account=(null) QOS=normal<br />
JobState=RUNNING Reason=None Dependency=(null)<br />
Requeue=1 Restarts=0 BatchFlag=1 Reboot=0 ExitCode=0:0<br />
DerivedExitCode=0:0<br />
RunTime=06:27:02 TimeLimit=08:00:00 TimeMin=N/A<br />
SubmitTime=2016-09-12T14:40:20 EligibleTime=2016-09-12T14:40:20<br />
StartTime=2016-09-12T14:40:20 EndTime=2016-09-12T22:40:21<br />
PreemptTime=None SuspendTime=None SecsPreSuspend=0<br />
Partition=medium AllocNode:Sid=login001:123<br />
ReqNodeList=(null) ExcNodeList=(null)<br />
NodeList=c0003<br />
BatchHost=c0003<br />
NumNodes=1 NumCPUs=24 CPUs/Task=1 ReqB:S:C:T=0:0:*:*<br />
TRES=cpu=24,mem=10000,node=1<br />
Socks/Node=* NtasksPerN:B:S:C=0:0:*:* CoreSpec=*<br />
Nodes=c0003 CPU_IDs=0-23 Mem=10000<br />
MinCPUsNode=1 MinMemoryNode=10000M MinTmpDiskNode=0<br />
Features=(null) Gres=(null) Reservation=(null)<br />
Shared=OK Contiguous=0 Licenses=(null) Network=(null)<br />
Command=/share/apps/rc/git/rc-sched-scripts/bin/_interactive<br />
WorkDir=/scratch/user/rcuser/work/other/rhea/Gray/MERGED<br />
StdErr=/dev/null<br />
StdIn=/dev/null<br />
StdOut=/dev/null<br />
Power= SICP=0<br />
</pre><br />
<br />
== Job History ==<br />
TODO: Provide some examples of using the '''sacct''' or our wrapper '''rc-sacct''' to view historical information.<br />
<br />
This example uses the rc-sacct wrapper script, for comparison here is the equivalent sacct command:<br />
<pre><br />
$ sacct --starttime 2016-08-30 \<br />
--allusers \<br />
--format=User,JobID,Jobname,partition,state,time,start,end,elapsed,MaxRss,MaxVMSize,nnodes,ncpus,nodelist<br />
</pre><br />
<pre style="white-space: pre-wrap;"><br />
$ rc-sacct --allusers --starttime 2016-08-30<br />
<br />
User JobID JobName Partition State Timelimit Start End Elapsed MaxRSS MaxVMSize NNodes NCPUS NodeList<br />
--------- ------------ ---------- ---------- ---------- ---------- ------------------- ------------------- ---------- ---------- ---------- -------- ---------- ---------------<br />
kxxxxxxx 34308 Connectom+ interacti+ PENDING 08:00:00 Unknown Unknown 00:00:00 1 4 None assigned<br />
kxxxxxxx 34310 Connectom+ interacti+ PENDING 08:00:00 Unknown Unknown 00:00:00 1 4 None assigned<br />
dxxxxxxx 35927 PK_htseq1 medium COMPLETED 2-00:00:00 2016-08-30T09:21:33 2016-08-30T10:06:25 00:44:52 1 4 c0005<br />
35927.batch batch COMPLETED 2016-08-30T09:21:33 2016-08-30T10:06:25 00:44:52 307704K 718152K 1 4 c0005<br />
bxxxxxxx 35928 SI medium TIMEOUT 12:00:00 2016-08-30T09:36:04 2016-08-30T21:36:42 12:00:38 1 1 c0006<br />
35928.batch batch FAILED 2016-08-30T09:36:04 2016-08-30T21:36:43 12:00:39 31400K 286532K 1 1 c0006<br />
35928.0 hostname COMPLETED 2016-08-30T09:36:16 2016-08-30T09:36:17 00:00:01 1112K 207252K 1 1 c0006<br />
<br />
</pre><br />
<br />
Additional information about the sacct command can be found by running '''man sacct''' or [http://slurm.schedmd.com/sacct.html found here]<br />
<br />
The rc-sacct wrapper script supports the following arguments:<br />
<pre><br />
$ rc-sacct --help<br />
<br />
Copyright (c) 2016 Mike Hanby, University of Alabama at Birmingham IT Research Computing.<br />
<br />
rc-sacct - version 1.0.0<br />
<br />
Run sacct to display history in a nicely formatted output.<br />
<br />
-r, --starttime HH:MM[:SS] [AM|PM]<br />
MMDD[YY] or MM/DD[/YY] or MM.DD[.YY]<br />
MM/DD[/YY]-HH:MM[:SS]<br />
YYYY-MM-DD[THH:MM[:SS]]<br />
-a, --allusers Dispay hsitory for all users)<br />
-u, --user user_list Display hsitory for all users in the comma seperated user list<br />
-f, --format a,b,c Comma separated list of columns: i.e. --format jobid,elapsed,ncpus,ntasks,state<br />
--debug Display additional output like internal structures<br />
-?, -h, --help Display this help message<br />
<br />
</pre><br />
<br />
== Slurm Variables ==<br />
The following is a list of useful Slurm environment variables (click here for the [http://slurm.schedmd.com/srun.html full list]):<br />
{{Slurm_Variables}}<br />
<br />
== SGE - Slurm ==<br />
<br />
This section shows Slurm and SGE equivalent commands<br />
<br />
<pre><br />
SGE Slurm <br />
--------- ------------<br />
qsub sbatch <br />
qlogin sinteractive<br />
qdel scancel<br />
qstat squeue<br />
<br />
</pre><br />
<br />
To get more info about individual commands, run : '''man SLURM_COMMAND''' . For an extensive list of Slurm-SGE equivalent commands, go [https://docs.uabgrid.uab.edu/wiki/SGE-SLURM here] or Slurm's official [http://slurm.schedmd.com/rosetta.pdf documentation]</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Slurm&diff=5806Slurm2018-08-15T16:45:12Z<p>Ravi89@uab.edu: /* Example Batch Job Script */</p>
<hr />
<div>[http://slurm.schedmd.com/ Slurm] is a queue management system and stands for Simple Linux Utility for Resource Management. Slurm was developed at the Lawrence Livermore National Lab and currently runs some of the largest compute clusters in the world. Slurm is now the primary job manager on Cheaha, it replaces SUN Grid Engine (SGE) the job manager used earlier.<br />
<br />
Slurm is similar in many ways to GridEngine or most other queue systems. You write a batch script then submit it to the queue manager (scheduler). The queue manager then schedules your job to run on the queue (or '''partition''' in Slurm parlance) that you designate. Below we will provide an outline of how to submit jobs to Slurm, how Slurm decides when to schedule your job, and how to monitor progress.<br />
<br />
<br />
== General Slurm Documentation ==<br />
The primary source for documentation on Slurm usage and commands can be found at the [http://slurm.schedmd.com/ Slurm] site. If you Google for Slurm questions, you'll often see the Lawrence Livermore pages as the top hits, but these tend to be outdated.<br />
<br />
The [https://slurm.schedmd.com/quickstart.html SLURM QuickStart Guide] provides a very useful overview of how SLURM treats a cluster as pool of resources which you can allocate to get your work done. The Example section on that page is a very useful orientation to SLURM environments.<br />
<br />
The [http://www.ceci-hpc.be/slurm_tutorial.html SLURM Tutorial at CECI], a European Consortium of HPC sites, provides a very good introduction on submitting single threaded, multi-threaded, and MPI jobs. <br />
<br />
A great way to get details on the Slurm commands is the man pages available from the Cheaha cluster. For example, if you type the following command:<br />
<br />
<pre><br />
man sbatch<br />
</pre><br />
you'll get the manual page for the sbatch command.<br />
<br />
== Slurm Partitions ==<br />
Cheaha has the following Slurm partitions (can also be thought of in terms of SGE queues) defined (the lower the number the higher the priority).<br />
<br />
'''Note:'''Jobs '''must request''' the appropriate partition (ex: ''--partition=short'') to satisfy the jobs resource request (maximum runtime, number of compute nodes, etc...)<br />
{{Slurm_Partitions}}<br />
<br />
== Logging on and Running Jobs from the command line ==<br />
Once you've gone through the [https://docs.uabgrid.uab.edu/wiki/Cheaha_GettingStarted#Access_.28Cluster_Account_Request.29 account setup procedure] and obtained a suitable [https://docs.uabgrid.uab.edu/wiki/Cheaha_GettingStarted#Client_Configuration terminal application], you can login to the Cheaha system via ssh<br />
<br />
ssh '''BLAZERID'''@cheaha.rc.uab.edu<br />
<br />
Alternatively, '''existing users''' could follow these [https://docs.uabgrid.uab.edu/wiki/SSH_Key_Authentication instructions to add SSH keys] and access the new system.<br />
<br />
Cheaha (new hardware) run the CentOS 7 version of the Linux operating system and commands are run under the "bash" shell (the default shell). There are a number of Linux and [http://www.gnu.org/software/bash/manual/bashref.html bash references], [http://cli.learncodethehardway.org/bash_cheat_sheet.pdf cheat sheets] and [http://www.tldp.org/LDP/Bash-Beginners-Guide/html/ tutorials] available on the web.<br />
<br />
== Typical Workflow ==<br />
* Stage data to $USER_SCRATCH (your scratch directory)<br />
* Determine how to run your code in "batch" mode. Batch mode typically means the ability to run it from the command line without requiring any interaction from the user.<br />
* Identify the appropriate resources needed to run the job. The following are mandatory resource requests for all jobs on Cheaha:<br />
** Number of processor cores required by the job<br />
** Maximum memory (RAM) required per core<br />
** Maximum runtime<br />
* Write a job script specifying queuing system parameters, resource requests, and commands to run program<br />
* Submit script to queuing system (sbatch script.job)<br />
* Monitor job (squeue)<br />
* Review the results and resubmit as necessary<br />
* Clean up the scratch directory by moving or deleting the data off of the cluster<br />
<br />
== Slurm Job Types ==<br />
=== Batch Job ===<br />
'''TODO: ''' provide an explanation of what makes a batch job and why use that vs an interactive job<br />
<br />
For additional information on the '''sbatch''' command execute '''man sbatch''' at the command line to view the manual.<br />
<br />
==== Example Batch Job Script ====<br />
A job consists of '''resource requests''' and '''tasks'''. The Slurm job scheduler interprets lines beginning with '''#SBATCH''' as Slurm arguments. In this example, the job is requesting to run 1 task<br />
<br />
'''Note:'''Jobs '''must request''' the appropriate partition (ex: ''--partition=short'') to satisfy the jobs resource request (maximum runtime, number of compute nodes, etc...)<br />
<pre>#!/bin/bash<br />
#<br />
#SBATCH --job-name=test<br />
#SBATCH --output=res.out<br />
#SBATCH --error=res.err<br />
#<br />
# Number of tasks needed for this job. Generally, used with MPI jobs<br />
#SBATCH --ntasks=1<br />
#SBATCH --partition=express<br />
#<br />
# Time format = HH:MM:SS, DD-HH:MM:SS<br />
#SBATCH --time=10:00<br />
#<br />
# Number of CPUs allocated to each task. <br />
#SBATCH --cpus-per-task=1<br />
#<br />
# Mimimum memory required per allocated CPU in MegaBytes. <br />
#SBATCH --mem-per-cpu=100<br />
#<br />
# Send mail to the email address when the job fails<br />
#SBATCH --mail-type=FAIL<br />
#SBATCH --mail-user=YOUR_EMAIL_ADDRESS<br />
<br />
srun hostname<br />
srun sleep 60<br />
</pre><br />
[https://docs.uabgrid.uab.edu/wiki/Cheaha_GettingStarted#Sample_Job_Scripts Click here] for more example SLURM job scripts.<br />
<br />
=== Interactive Job ===<br />
Login Node (the host that you connected to when you setup the SSH connection to Cheaha) is supposed to be used for submitting jobs and/or lighter prep work required for the job scripts. '''Do not run heavy computations on the login node'''. If you have a heavier workload to prepare for a batch job (eg. compiling code or other manipulations of data) or your compute application requires interactive control, you should request a dedicated interactive node for this work.<br />
<br />
Interactive resources are requested by submitting an "interactive" job to the scheduler. Interactive jobs will provide you a command line on a compute resource that you can use just like you would the command line on the login node. The difference is that the scheduler has dedicated the requested resources to your job and you can run your interactive commands without having to worry about impacting other users on the login node.<br />
<br />
Interactive jobs, that can be run on command line, are requested with the '''srun''' command. <br />
<br />
<pre><br />
srun --ntasks=1 --cpus-per-task=4 --mem-per-cpu=4096 --time=08:00:00 --partition=medium --job-name=JOB_NAME --pty /bin/bash<br />
</pre><br />
<br />
This command requests for 4 cores (--cpus-per-task) for a single task (--ntasks) with each cpu requesting size 4GB of RAM (--mem-per-cpu) for 8 hrs (--time).<br />
<br />
More advanced interactive scenarios to support graphical applications are available using [https://docs.uabgrid.uab.edu/wiki/Setting_Up_VNC_Session VNC] or X11 tunneling [http://www.uab.edu/it/software X-Win32 2014 for Windows]<br />
<br />
Interactive jobs that requires running a graphical application, are requested with the '''sinteractive''' command, via '''Terminal''' on your VNC window.<br />
<br />
<pre><br />
sinteractive --ntasks=1 --cpus-per-task=4 --mem-per-cpu=4096 --time=08:00:00 --partition=medium --job-name=JOB_NAME <br />
</pre><br />
<br />
====Requesting for GPUs====<br />
<br />
To request for an interactive session on one of the GPU nodes (c0089-c0092 K80's and c0097-c0114 P100's), add --gres parameter to the 'srun' or 'sinteractive' command. <br />
<br />
<pre style="white-space: pre-wrap;" ><br />
srun --ntasks=1 --cpus-per-task=1 --mem-per-cpu=4096 --time=08:00:00 --partition=pascalnodes --job-name=JOB_NAME --gres=gpu:1 --pty /bin/bash<br />
</pre><br />
<br />
<pre style="white-space: pre-wrap;" ><br />
sinteractive --ntasks=1 --cpus-per-task=1 --mem-per-cpu=4096 --time=08:00:00 --partition=pascalnodes --job-name=JOB_NAME --gres=gpu:1<br />
</pre><br />
<br />
'''NOTE:''' <br />
* If you want to use more then one GPU on the node, please increase the value in --gres=gpu:[1-4]<br />
* If you want to use the P100s please use the partition as 'pascalnodes', wheres for K80s please use either of the express, short, medium or long as partitions.<br />
* To request an interactive session using a single GPU, say for code development, you can use the following syntax<br />
<pre><br />
sinteracive --partition=pascalnodes --gres=gpu<br />
</pre><br />
<br />
=== MPI Job ===<br />
'''TODO add MPI information and a job example'''<br />
<br />
=== OpenMP / SMP Job ===<br />
[https://en.wikipedia.org/wiki/OpenMP OpenMP / SMP] jobs are those that use multiple CPU cores on a single compute node.<br />
<br />
It is very important to properly structure an SMP job to ensure that the requested CPU cores are assigned to the same compute node. The following example requests 4 CPU cores by setting the number of '''ntasks''' to '''1''' and '''cpus-per-tasks''' to '''4'''<br />
<br />
<pre><br />
srun --partition=short \<br />
--ntasks=1 \<br />
--cpus-per-task=4 \<br />
--mem-per-cpu=1024 \<br />
--time=5:00:00 \<br />
--job-name=rsync \<br />
--pty /bin/bash<br />
</pre><br />
<br />
== Job Status ==<br />
<br />
=== SQUEUE ===<br />
To check your job status, you can use the following command<br />
<pre><br />
squeue -u $USER<br />
</pre><br />
<br />
Following fields are displayed when you run '''squeue'''<br />
<pre style="white-space: pre-wrap;"><br />
JOBID - ID assigned to your job by Slurm scheduler<br />
PARTITION - Partition your job gets, depends upon time requested (express(max 2 hrs), short(max 12 hrs), medium(max 50 hrs), long(max 150 hrs), sinteractive(0-2 hrs))<br />
NAME - JOB name given by user<br />
USER - User who started the job<br />
ST - State your job is in. The typical states are PENDING (PD), RUNNING(R), SUSPENDED(S), COMPLETING(CG), and COMPLETED(CD)<br />
TIME - Time for which your job has been running<br />
NODES - Number of nodes your job is running on<br />
NODELIST - Node on which the job is running<br />
</pre><br />
<br />
For more details on '''squeue''', go [http://slurm.schedmd.com/squeue.html here].<br />
<br />
=== SSTAT ===<br />
The '''sstat''' command shows status and metric information for a running job.<br />
<br />
'''NOTE: the job parts must be executed using ''srun'' otherwise ''sstat'' will not display useful output'''<br />
<pre style="white-space: pre-wrap;"><br />
[rcs@login001 ~]$ sstat 256483<br />
JobID MaxVMSize MaxVMSizeNode MaxVMSizeTask AveVMSize MaxRSS MaxRSSNode MaxRSSTask AveRSS MaxPages MaxPagesNode MaxPagesTask AvePages MinCPU MinCPUNode MinCPUTask AveCPU NTasks AveCPUFreq ReqCPUFreqMin ReqCPUFreqMax ReqCPUFreqGov ConsumedEnergy MaxDiskRead MaxDiskReadNode MaxDiskReadTask AveDiskRead MaxDiskWrite MaxDiskWriteNode MaxDiskWriteTask AveDiskWrite <br />
------------ ---------- -------------- -------------- ---------- ---------- ---------- ---------- ---------- -------- ------------ -------------- ---------- ---------- ---------- ---------- ---------- -------- ---------- ------------- ------------- ------------- -------------- ------------ --------------- --------------- ------------ ------------ ---------------- ---------------- ------------ <br />
256483.0 1962728K c0043 1 1960633K 91920K c0043 3 91867K 67K c0043 3 50K 00:00.000 c0043 0 00:00.000 8 1.20G Unknown Unknown Unknown 0 1M c0043 5 1M 0.34M c0043 5 0.34M <br />
<br />
</pre><br />
<br />
For more details on '''sstat''', go [http://slurm.schedmd.com/sstat.html here].<br />
<br />
=== SCONTROL ===<br />
<br />
<pre><br />
$ scontrol show jobid -dd 123<br />
<br />
JobId=123 JobName=SLI<br />
UserId=rcuser(1000) GroupId=rcuser(1000)<br />
Priority=4294898073 Nice=0 Account=(null) QOS=normal<br />
JobState=RUNNING Reason=None Dependency=(null)<br />
Requeue=1 Restarts=0 BatchFlag=1 Reboot=0 ExitCode=0:0<br />
DerivedExitCode=0:0<br />
RunTime=06:27:02 TimeLimit=08:00:00 TimeMin=N/A<br />
SubmitTime=2016-09-12T14:40:20 EligibleTime=2016-09-12T14:40:20<br />
StartTime=2016-09-12T14:40:20 EndTime=2016-09-12T22:40:21<br />
PreemptTime=None SuspendTime=None SecsPreSuspend=0<br />
Partition=medium AllocNode:Sid=login001:123<br />
ReqNodeList=(null) ExcNodeList=(null)<br />
NodeList=c0003<br />
BatchHost=c0003<br />
NumNodes=1 NumCPUs=24 CPUs/Task=1 ReqB:S:C:T=0:0:*:*<br />
TRES=cpu=24,mem=10000,node=1<br />
Socks/Node=* NtasksPerN:B:S:C=0:0:*:* CoreSpec=*<br />
Nodes=c0003 CPU_IDs=0-23 Mem=10000<br />
MinCPUsNode=1 MinMemoryNode=10000M MinTmpDiskNode=0<br />
Features=(null) Gres=(null) Reservation=(null)<br />
Shared=OK Contiguous=0 Licenses=(null) Network=(null)<br />
Command=/share/apps/rc/git/rc-sched-scripts/bin/_interactive<br />
WorkDir=/scratch/user/rcuser/work/other/rhea/Gray/MERGED<br />
StdErr=/dev/null<br />
StdIn=/dev/null<br />
StdOut=/dev/null<br />
Power= SICP=0<br />
</pre><br />
<br />
== Job History ==<br />
TODO: Provide some examples of using the '''sacct''' or our wrapper '''rc-sacct''' to view historical information.<br />
<br />
This example uses the rc-sacct wrapper script, for comparison here is the equivalent sacct command:<br />
<pre><br />
$ sacct --starttime 2016-08-30 \<br />
--allusers \<br />
--format=User,JobID,Jobname,partition,state,time,start,end,elapsed,MaxRss,MaxVMSize,nnodes,ncpus,nodelist<br />
</pre><br />
<pre style="white-space: pre-wrap;"><br />
$ rc-sacct --allusers --starttime 2016-08-30<br />
<br />
User JobID JobName Partition State Timelimit Start End Elapsed MaxRSS MaxVMSize NNodes NCPUS NodeList<br />
--------- ------------ ---------- ---------- ---------- ---------- ------------------- ------------------- ---------- ---------- ---------- -------- ---------- ---------------<br />
kxxxxxxx 34308 Connectom+ interacti+ PENDING 08:00:00 Unknown Unknown 00:00:00 1 4 None assigned<br />
kxxxxxxx 34310 Connectom+ interacti+ PENDING 08:00:00 Unknown Unknown 00:00:00 1 4 None assigned<br />
dxxxxxxx 35927 PK_htseq1 medium COMPLETED 2-00:00:00 2016-08-30T09:21:33 2016-08-30T10:06:25 00:44:52 1 4 c0005<br />
35927.batch batch COMPLETED 2016-08-30T09:21:33 2016-08-30T10:06:25 00:44:52 307704K 718152K 1 4 c0005<br />
bxxxxxxx 35928 SI medium TIMEOUT 12:00:00 2016-08-30T09:36:04 2016-08-30T21:36:42 12:00:38 1 1 c0006<br />
35928.batch batch FAILED 2016-08-30T09:36:04 2016-08-30T21:36:43 12:00:39 31400K 286532K 1 1 c0006<br />
35928.0 hostname COMPLETED 2016-08-30T09:36:16 2016-08-30T09:36:17 00:00:01 1112K 207252K 1 1 c0006<br />
<br />
</pre><br />
<br />
Additional information about the sacct command can be found by running '''man sacct''' or [http://slurm.schedmd.com/sacct.html found here]<br />
<br />
The rc-sacct wrapper script supports the following arguments:<br />
<pre><br />
$ rc-sacct --help<br />
<br />
Copyright (c) 2016 Mike Hanby, University of Alabama at Birmingham IT Research Computing.<br />
<br />
rc-sacct - version 1.0.0<br />
<br />
Run sacct to display history in a nicely formatted output.<br />
<br />
-r, --starttime HH:MM[:SS] [AM|PM]<br />
MMDD[YY] or MM/DD[/YY] or MM.DD[.YY]<br />
MM/DD[/YY]-HH:MM[:SS]<br />
YYYY-MM-DD[THH:MM[:SS]]<br />
-a, --allusers Dispay hsitory for all users)<br />
-u, --user user_list Display hsitory for all users in the comma seperated user list<br />
-f, --format a,b,c Comma separated list of columns: i.e. --format jobid,elapsed,ncpus,ntasks,state<br />
--debug Display additional output like internal structures<br />
-?, -h, --help Display this help message<br />
<br />
</pre><br />
<br />
== Slurm Variables ==<br />
The following is a list of useful Slurm environment variables (click here for the [http://slurm.schedmd.com/srun.html full list]):<br />
{{Slurm_Variables}}<br />
<br />
== SGE - Slurm ==<br />
<br />
This section shows Slurm and SGE equivalent commands<br />
<br />
<pre><br />
SGE Slurm <br />
--------- ------------<br />
qsub sbatch <br />
qlogin sinteractive<br />
qdel scancel<br />
qstat squeue<br />
<br />
</pre><br />
<br />
To get more info about individual commands, run : '''man SLURM_COMMAND''' . For an extensive list of Slurm-SGE equivalent commands, go [https://docs.uabgrid.uab.edu/wiki/SGE-SLURM here] or Slurm's official [http://slurm.schedmd.com/rosetta.pdf documentation]</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5777Git For Beginners2018-06-20T17:58:59Z<p>Ravi89@uab.edu: /* Collaboration using Git */</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a [https://en.wikipedia.org/wiki/Distributed_version_control distributed version control system] for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
== Installation ==<br />
<br />
If you are using Linux or Mac , git should be installed by default. If fo any reason it hasn't been installed, you can install them using the given instructions.<br />
=== Linux ===<br />
If you’re on Fedora (or any closely-related RPM-based distribution, such as RHEL or CentOS), you can use dnf:<br />
<pre><br />
$ sudo dnf install git-all<br />
</pre><br />
If you’re on a Debian-based distribution, such as Ubuntu, try apt:<br />
<pre><br />
$ sudo apt install git-all<br />
</pre><br />
<br />
=== Mac ===<br />
On a Mac, [Homebrew] can be used to install git.<br />
<pre><br />
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"<br />
brew install git<br />
</pre><br />
<br />
=== Windows ===<br />
To install Git on Windows, you can download the executable [http://git-scm.com/download/win here] or Github Desktop from [https://desktop.github.com/ here].<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Creating a version for your project ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
'''Example:'''<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Suppress Tracking ==<br />
To remove a file from tracking in git, create a .gitignore file in the project directory. It suppress accidental versioning of files and paths matching the specified patterns.<br />
<br />
To list all ignored files in the project, run:<br />
<pre><br />
git ls-files --other --ignored --exclude-standard<br />
</pre><br />
<br />
== Collaboration using Git ==<br />
To collaborate on a project with your teammates, you can use any of the following Git repository managers:<br />
<br />
[https://gitlab.rc.uab.edu/ Gitlab hosted by Research Computing ]<br />
<br />
[https://github.com/ Github ]<br />
<br />
[https://about.gitlab.com/ Gitlab ]<br />
<br />
<br />
All of them provide issue tracking features. To get more information about using Gitlab, click [https://www.tutorialspoint.com/gitlab/index.htm here].<br />
<br />
== Useful Links ==<br />
* '''Cheat Sheet'''<br />
<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]<br />
<br />
* To access classes provided by Software Carpentry on Git, click [https://swcarpentry.github.io/git-novice/ here].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5776Git For Beginners2018-06-20T04:45:41Z<p>Ravi89@uab.edu: </p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a [https://en.wikipedia.org/wiki/Distributed_version_control distributed version control system] for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
== Installation ==<br />
<br />
If you are using Linux or Mac , git should be installed by default. If fo any reason it hasn't been installed, you can install them using the given instructions.<br />
=== Linux ===<br />
If you’re on Fedora (or any closely-related RPM-based distribution, such as RHEL or CentOS), you can use dnf:<br />
<pre><br />
$ sudo dnf install git-all<br />
</pre><br />
If you’re on a Debian-based distribution, such as Ubuntu, try apt:<br />
<pre><br />
$ sudo apt install git-all<br />
</pre><br />
<br />
=== Mac ===<br />
On a Mac, [Homebrew] can be used to install git.<br />
<pre><br />
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"<br />
brew install git<br />
</pre><br />
<br />
=== Windows ===<br />
To install Git on Windows, you can download the executable [http://git-scm.com/download/win here] or Github Desktop from [https://desktop.github.com/ here].<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Creating a version for your project ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
'''Example:'''<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Suppress Tracking ==<br />
To remove a file from tracking in git, create a .gitignore file in the project directory. It suppress accidental versioning of files and paths matching the specified patterns.<br />
<br />
To list all ignored files in the project, run:<br />
<pre><br />
git ls-files --other --ignored --exclude-standard<br />
</pre><br />
<br />
== Collaboration using Git ==<br />
To collaborate on a project with your teammates, you can use any of the following Git repository managers:<br />
<br />
[http://gitlab.rc.uab.edu/ Gitlab hosted by Research Computing ]<br />
<br />
[https://github.com/ Github ]<br />
<br />
[https://about.gitlab.com/ Gitlab ]<br />
<br />
<br />
All of them provide issue tracking features. To get more information about using Gitlab, click [https://www.tutorialspoint.com/gitlab/index.htm here].<br />
<br />
== Useful Links ==<br />
* '''Cheat Sheet'''<br />
<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]<br />
<br />
* To access classes provided by Software Carpentry on Git, click [https://swcarpentry.github.io/git-novice/ here].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5775Git For Beginners2018-06-20T04:43:39Z<p>Ravi89@uab.edu: /* Collaboration using Git */</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
== Installation ==<br />
<br />
If you are using Linux or Mac , git should be installed by default. If fo any reason it hasn't been installed, you can install them using the given instructions.<br />
=== Linux ===<br />
If you’re on Fedora (or any closely-related RPM-based distribution, such as RHEL or CentOS), you can use dnf:<br />
<pre><br />
$ sudo dnf install git-all<br />
</pre><br />
If you’re on a Debian-based distribution, such as Ubuntu, try apt:<br />
<pre><br />
$ sudo apt install git-all<br />
</pre><br />
<br />
=== Mac ===<br />
On a Mac, [Homebrew] can be used to install git.<br />
<pre><br />
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"<br />
brew install git<br />
</pre><br />
<br />
=== Windows ===<br />
To install Git on Windows, you can download the executable [http://git-scm.com/download/win here] or Github Desktop from [https://desktop.github.com/ here].<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Creating a version for your project ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
'''Example:'''<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Suppress Tracking ==<br />
To remove a file from tracking in git, create a .gitignore file in the project directory. It suppress accidental versioning of files and paths matching the specified patterns.<br />
<br />
To list all ignored files in the project, run:<br />
<pre><br />
git ls-files --other --ignored --exclude-standard<br />
</pre><br />
<br />
== Collaboration using Git ==<br />
To collaborate on a project with your teammates, you can use any of the following Git repository managers:<br />
<br />
[http://gitlab.rc.uab.edu/ Gitlab hosted by Research Computing ]<br />
<br />
[https://github.com/ Github ]<br />
<br />
[https://about.gitlab.com/ Gitlab ]<br />
<br />
<br />
All of them provide issue tracking features. To get more information about using Gitlab, click [https://www.tutorialspoint.com/gitlab/index.htm here].<br />
<br />
== Useful Links ==<br />
* '''Cheat Sheet'''<br />
<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]<br />
<br />
* To access classes provided by Software Carpentry on Git, click [https://swcarpentry.github.io/git-novice/ here].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5774Git For Beginners2018-06-20T04:11:06Z<p>Ravi89@uab.edu: /* Collaboration using Git */</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
== Installation ==<br />
<br />
If you are using Linux or Mac , git should be installed by default. If fo any reason it hasn't been installed, you can install them using the given instructions.<br />
=== Linux ===<br />
If you’re on Fedora (or any closely-related RPM-based distribution, such as RHEL or CentOS), you can use dnf:<br />
<pre><br />
$ sudo dnf install git-all<br />
</pre><br />
If you’re on a Debian-based distribution, such as Ubuntu, try apt:<br />
<pre><br />
$ sudo apt install git-all<br />
</pre><br />
<br />
=== Mac ===<br />
On a Mac, [Homebrew] can be used to install git.<br />
<pre><br />
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"<br />
brew install git<br />
</pre><br />
<br />
=== Windows ===<br />
To install Git on Windows, you can download the executable [http://git-scm.com/download/win here] or Github Desktop from [https://desktop.github.com/ here].<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Creating a version for your project ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
'''Example:'''<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Collaboration using Git ==<br />
To collaborate on a project with your teammates, you can use any of the following Git repository managers:<br />
<br />
[http://gitlab.rc.uab.edu/ Gitlab hosted by Research Computing ]<br />
<br />
[https://github.com/ Github ]<br />
<br />
[https://about.gitlab.com/ Gitlab ]<br />
<br />
<br />
All of them provide issue tracking features. To get more information about using Gitlab, click [https://www.tutorialspoint.com/gitlab/index.htm here].<br />
<br />
== Useful Links ==<br />
* '''Cheat Sheet'''<br />
<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]<br />
<br />
* To access classes provided by Software Carpentry on Git, click [https://swcarpentry.github.io/git-novice/ here].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5773Git For Beginners2018-06-19T23:15:05Z<p>Ravi89@uab.edu: Adding git installation instructions.</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
== Installation ==<br />
<br />
If you are using Linux or Mac , git should be installed by default. If fo any reason it hasn't been installed, you can install them using the given instructions.<br />
=== Linux ===<br />
If you’re on Fedora (or any closely-related RPM-based distribution, such as RHEL or CentOS), you can use dnf:<br />
<pre><br />
$ sudo dnf install git-all<br />
</pre><br />
If you’re on a Debian-based distribution, such as Ubuntu, try apt:<br />
<pre><br />
$ sudo apt install git-all<br />
</pre><br />
<br />
=== Mac ===<br />
On a Mac, [Homebrew] can be used to install git.<br />
<pre><br />
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"<br />
brew install git<br />
</pre><br />
<br />
=== Windows ===<br />
To install Git on Windows, you can download the executable [http://git-scm.com/download/win here] or Github Desktop from [https://desktop.github.com/ here].<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Creating a version for your project ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
'''Example:'''<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Collaboration using Git ==<br />
To collaborate on a project with you teammates, you can use any of the following Git repository managers:<br />
<br />
[http://gitlab.rc.uab.edu/ Gitlab hosted by Research Computing ]<br />
<br />
[https://github.com/ Github ]<br />
<br />
[https://about.gitlab.com/ Gitlab ]<br />
<br />
<br />
All of them provide issue tracking features. To get more information about using Gitlab, click [https://www.tutorialspoint.com/gitlab/index.htm here].<br />
<br />
== Useful Links ==<br />
* '''Cheat Sheet'''<br />
<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]<br />
<br />
* To access classes provided by Software Carpentry on Git, click [https://swcarpentry.github.io/git-novice/ here].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5772Git For Beginners2018-06-19T23:01:14Z<p>Ravi89@uab.edu: /* Commit a file */</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Creating a version for your project ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
'''Example:'''<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Collaboration using Git ==<br />
To collaborate on a project with you teammates, you can use any of the following Git repository managers:<br />
<br />
[http://gitlab.rc.uab.edu/ Gitlab hosted by Research Computing ]<br />
<br />
[https://github.com/ Github ]<br />
<br />
[https://about.gitlab.com/ Gitlab ]<br />
<br />
<br />
All of them provide issue tracking features. To get more information about using Gitlab, click [https://www.tutorialspoint.com/gitlab/index.htm here].<br />
<br />
== Useful Links ==<br />
* '''Cheat Sheet'''<br />
<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]<br />
<br />
* To access classes provided by Software Carpentry on Git, click [https://swcarpentry.github.io/git-novice/ here].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5771Git For Beginners2018-06-19T22:59:30Z<p>Ravi89@uab.edu: /* Useful Links */</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
'''Example:'''<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Collaboration using Git ==<br />
To collaborate on a project with you teammates, you can use any of the following Git repository managers:<br />
<br />
[http://gitlab.rc.uab.edu/ Gitlab hosted by Research Computing ]<br />
<br />
[https://github.com/ Github ]<br />
<br />
[https://about.gitlab.com/ Gitlab ]<br />
<br />
<br />
All of them provide issue tracking features. To get more information about using Gitlab, click [https://www.tutorialspoint.com/gitlab/index.htm here].<br />
<br />
== Useful Links ==<br />
* '''Cheat Sheet'''<br />
<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]<br />
<br />
* To access classes provided by Software Carpentry on Git, click [https://swcarpentry.github.io/git-novice/ here].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5770Git For Beginners2018-06-19T22:59:04Z<p>Ravi89@uab.edu: /* Collaboration using Git */</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
'''Example:'''<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Collaboration using Git ==<br />
To collaborate on a project with you teammates, you can use any of the following Git repository managers:<br />
<br />
[http://gitlab.rc.uab.edu/ Gitlab hosted by Research Computing ]<br />
<br />
[https://github.com/ Github ]<br />
<br />
[https://about.gitlab.com/ Gitlab ]<br />
<br />
<br />
All of them provide issue tracking features. To get more information about using Gitlab, click [https://www.tutorialspoint.com/gitlab/index.htm here].<br />
<br />
== Useful Links ==<br />
* '''Cheat Sheet'''<br />
<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]<br />
<br />
* Classes provided by Software Carpentry on Git, [https://swcarpentry.github.io/git-novice/ here].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5769Git For Beginners2018-06-19T21:32:09Z<p>Ravi89@uab.edu: /* Git branches */</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
'''Example:'''<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Collaboration using Git ==<br />
To collaborate on a project with you teammates, you can use any of the following Git repository managers:<br />
<br />
[http://gitlab.rc.uab.edu/ Gitlab hosted by Research Computing ]<br />
<br />
[https://github.com/ Github ]<br />
<br />
[https://about.gitlab.com/ Gitlab ]<br />
<br />
<br />
All of them provide issue tracking features.<br />
<br />
== Useful Links ==<br />
* '''Cheat Sheet'''<br />
<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]<br />
<br />
* Classes provided by Software Carpentry on Git, [https://swcarpentry.github.io/git-novice/ here].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5768Git For Beginners2018-06-19T21:26:33Z<p>Ravi89@uab.edu: /* Collaboration using Git */</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
** Example<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Collaboration using Git ==<br />
To collaborate on a project with you teammates, you can use any of the following Git repository managers:<br />
<br />
[http://gitlab.rc.uab.edu/ Gitlab hosted by Research Computing ]<br />
<br />
[https://github.com/ Github ]<br />
<br />
[https://about.gitlab.com/ Gitlab ]<br />
<br />
<br />
All of them provide issue tracking features.<br />
<br />
== Useful Links ==<br />
* '''Cheat Sheet'''<br />
<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]<br />
<br />
* Classes provided by Software Carpentry on Git, [https://swcarpentry.github.io/git-novice/ here].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5767Git For Beginners2018-06-19T21:25:04Z<p>Ravi89@uab.edu: /* Git Cheat Sheet */</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
** Example<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Collaboration using Git ==<br />
To collaborate on a project with you teammates, you can use any of the following Git repo managers:<br />
<br />
[http://gitlab.rc.uab.edu/ Gitlab hosted by Research Computing ]<br />
<br />
[https://github.com/ Github ]<br />
<br />
[https://about.gitlab.com/ Gitlab ]<br />
<br />
== Useful Links ==<br />
* '''Cheat Sheet'''<br />
<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]<br />
<br />
* Classes provided by Software Carpentry on Git, [https://swcarpentry.github.io/git-novice/ here].</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5766Git For Beginners2018-06-19T21:20:28Z<p>Ravi89@uab.edu: /* Collaboration using Git */</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
** Example<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Collaboration using Git ==<br />
To collaborate on a project with you teammates, you can use any of the following Git repo managers:<br />
<br />
[http://gitlab.rc.uab.edu/ Gitlab hosted by Research Computing ]<br />
<br />
[https://github.com/ Github ]<br />
<br />
[https://about.gitlab.com/ Gitlab ]<br />
<br />
== Git Cheat Sheet ==<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5765Git For Beginners2018-06-19T21:20:10Z<p>Ravi89@uab.edu: /* Collaboration using Git */</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
** Example<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Collaboration using Git ==<br />
To collaborate on a project with you teammates, you can use any of the following Git repo managers:<br />
<br />
[https://github.com/ Github ]<br />
<br />
[https://about.gitlab.com/ Gitlab ]<br />
<br />
[http://gitlab.rc.uab.edu/ Gitlab hosted by Research Computing ]<br />
<br />
== Git Cheat Sheet ==<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5764Git For Beginners2018-06-19T21:19:06Z<p>Ravi89@uab.edu: </p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
** Example<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Collaboration using Git ==<br />
To collaborate on a project with you teammates, you can use any of the following Git repo managers:<br />
<br />
[Github https://github.com/]<br />
[Gitlab https://about.gitlab.com/]<br />
[Gitlab hosted by Research Computing http://gitlab.rc.uab.edu/]<br />
<br />
== Git Cheat Sheet ==<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5763Git For Beginners2018-06-19T20:50:47Z<p>Ravi89@uab.edu: /* Commit a file */</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
* To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
** Example<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Git Cheat Sheet ==<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5762Git For Beginners2018-06-19T20:50:22Z<p>Ravi89@uab.edu: </p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
* To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
* To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
* To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
* Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
* To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
* To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
* To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
** Example<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
* Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Git Cheat Sheet ==<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5761Git For Beginners2018-06-19T18:35:01Z<p>Ravi89@uab.edu: /* Git branches */</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
*Example<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git log<br />
commit e6a159184073ed1915fec03f87c6c5866fb099df<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 13:27:40 2018 -0500<br />
<br />
Commit to new_branch<br />
<br />
commit 65d20658d2972e2b64b5f8eb192c59d63c90d398<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 11:43:34 2018 -0500<br />
<br />
Adding feature1<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
== Git Cheat Sheet ==<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5760Git For Beginners2018-06-19T18:33:10Z<p>Ravi89@uab.edu: Git branch</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
== Git branches ==<br />
To list all local branches in the current repository<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
Create a new branch<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
Switch to the specified branch and updates the working directory<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout new_branch<br />
Switched to branch 'new_branch'<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
master<br />
* new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
Combine the specified branch’s history into the current branch<br />
<pre><br />
git merge [branch]<br />
</pre><br />
*Example<br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git status<br />
# On branch new_branch<br />
# Changes not staged for commit:<br />
# (use "git add <file>..." to update what will be committed)<br />
# (use "git checkout -- <file>..." to discard changes in working directory)<br />
#<br />
# modified: test<br />
#<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
[ravi89@c0021 Tutorial_June_2018]$ git add test<br />
[ravi89@c0021 Tutorial_June_2018]$ git commit -m "Commit to new_branch"<br />
[new_branch e6a1591] Commit to new_branch<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout merge<br />
error: pathspec 'merge' did not match any file(s) known to git.<br />
[ravi89@c0021 Tutorial_June_2018]$ git checkout master<br />
Switched to branch 'master'<br />
[ravi89@c0021 Tutorial_June_2018]$ git merge new_branch<br />
Updating 65d2065..e6a1591<br />
Fast-forward<br />
test | 2 +-<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
[ravi89@c0021 Tutorial_June_2018]$ git log<br />
commit e6a159184073ed1915fec03f87c6c5866fb099df<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 13:27:40 2018 -0500<br />
<br />
Commit to new_branch<br />
<br />
commit 65d20658d2972e2b64b5f8eb192c59d63c90d398<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 11:43:34 2018 -0500<br />
<br />
Adding feature1<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
Delete the specified branch.<br />
<pre><br />
git branch -d [branch-name]<br />
</pre><br />
<pre><br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
new_branch<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch -d new_branch<br />
Deleted branch new_branch (was e6a1591).<br />
[ravi89@c0021 Tutorial_June_2018]$ git branch<br />
* master<br />
[ravi89@c0021 Tutorial_June_2018]$<br />
</pre><br />
<br />
<br />
== Git Cheat Sheet ==<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5759Git For Beginners2018-06-19T15:53:17Z<p>Ravi89@uab.edu: Adding link for the cheatsheet</p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.<br />
<br />
<br />
<br />
== Git Cheat Sheet ==<br />
A lot of the content on this page has been taken from this [https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf cheatsheet]</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5758Git For Beginners2018-06-19T15:48:38Z<p>Ravi89@uab.edu: </p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==<br />
Browse and inspect the evolution of project files<br />
<br />
To list version history for the current branch<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log<br />
commit 69314c321f5e56eb3f39d7c6588db3994493cbd9<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:48:18 2018 -0500<br />
<br />
Testing branch and graph<br />
<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
commit 39313b92a2cb796dae1d53bc44d0ab4b07a9a13f<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:29:32 2018 -0500<br />
<br />
First commit<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
To list version history for a particular file in your project:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git log --follow test1<br />
commit 4b679447ceeae3c5c95575eab301c20b2d893b06<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Tue Jun 19 10:25:48 2018 -0500<br />
<br />
Adding a new file<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
To output metadata and content changes of the specified commit:<br />
<pre><br />
[ravi89@c0027 Tutorial_June_2018]$ git show 5d71077<br />
commit 5d710775910a9fbea8d06a50ced9f5d59e893589<br />
Author: ravi89 <ravi89@uab.edu><br />
Date: Mon Jun 18 16:32:42 2018 -0500<br />
<br />
Second commit<br />
<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@c0027 Tutorial_June_2018]$<br />
</pre><br />
<br />
'''NOTE:''' In the above example, we have used first 7 characters of the commit hash, instead of the entire commit hash. Minimum number of characters required for it to be useful is 4, but it is recommended to use 6-8 characters for higher likelihood of uniqueness.</div>Ravi89@uab.eduhttps://docs.uabgrid.uab.edu/w/index.php?title=Git_For_Beginners&diff=5757Git For Beginners2018-06-18T21:42:51Z<p>Ravi89@uab.edu: </p>
<hr />
<div>[https://en.wikipedia.org/wiki/Git Git] is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.<br />
<br />
<br />
== Configuration ==<br />
To configure user information for all local repositories use the following commands:<br />
<br />
* Set the name you want attached to your commit transactions.<br />
<pre><br />
git config --global user.name "[name]"<br />
</pre><br />
* Set the email you want atached to your commit transactions<br />
<pre><br />
git config --global user.email "[email address]"<br />
</pre><br />
<br />
== Initializing a git repository ==<br />
<br />
To initialize a new git repository, run:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git init test<br />
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
To make an already existing directory, a git repo, run:<br />
<pre><br />
cd EXISTING_DIRECTORY<br />
git init<br />
</pre><br />
<br />
== Review changes ==<br />
Once you have made changes to the files in a git repository, you can review your edits using following commands.<br />
<br />
To list all new or modified files to be commited:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
# On branch master<br />
#<br />
# Initial commit<br />
#<br />
# Untracked files:<br />
# (use "git add <file>..." to include in what will be committed)<br />
#<br />
# test<br />
nothing added to commit but untracked files present (use "git add" to track)<br />
[ravi89@login001 Tutorial_June_2018]$<br />
</pre><br />
<br />
To show file differences that have not yet been staged for a commit:<br />
<pre><br />
[ravi89@login001 Tutorial_June_2018]$ git diff<br />
diff --git a/test b/test<br />
index 19e2dd9..d04e379 100644<br />
--- a/test<br />
+++ b/test<br />
@@ -1 +1,3 @@<br />
Show git status<br />
+<br />
+Demo git diff<br />
[ravi89@login001 Tutorial_June_2018]$ git status<br />
</pre><br />
<br />
To see the file differences for file that have been staged, use: '''git diff --staged'''<br />
<br />
== Commit a file ==<br />
To commit a file you first need to add the file where you have made changes, i.e. stage the file:<br />
<pre><br />
git add CHANGED_FILE<br />
</pre><br />
This snapshots/stages the file in preparation for versioning.<br />
<br />
Next commit these changes to record file snapshots permanently in version history<br />
<pre><br />
git commit -m "YOUR_COMMIT_MESSAGE"<br />
</pre><br />
<br />
== Git History ==</div>Ravi89@uab.edu