X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/908261de15c98553a4200f01aff1f26ef57c8fb8..bffc439a72f03126359d468329b8d25febc7bc9e:/doc/user/tutorials/git-arvados-guide.html.textile.liquid diff --git a/doc/user/tutorials/git-arvados-guide.html.textile.liquid b/doc/user/tutorials/git-arvados-guide.html.textile.liquid index f9f0af521f..a4ac2a5795 100644 --- a/doc/user/tutorials/git-arvados-guide.html.textile.liquid +++ b/doc/user/tutorials/git-arvados-guide.html.textile.liquid @@ -3,21 +3,19 @@ layout: default navsection: userguide title: Working with an Arvados git repository ... +{% comment %} +Copyright (C) The Arvados Authors. All rights reserved. -This tutorial describes how to work with a new Arvados git repository. Working with an Arvados git repository is analogous to working with other public git repositories. It will show you how to upload custom scripts to a remote Arvados repository, so you can use it in Arvados pipelines. +SPDX-License-Identifier: CC-BY-SA-3.0 +{% endcomment %} + +This tutorial describes how to work with an Arvados-managed git repository. Working with an Arvados git repository is very similar to working with other public git repositories. {% include 'tutorial_expectations' %} {% include 'tutorial_git_repo_expectations' %} -{% include 'notebox_begin' %} -For more information about using Git, try - -
$ man gittutorial
-
or *"search Google for Git tutorials":http://google.com/#q=git+tutorial*. -{% include 'notebox_end' %} - -h2. Cloning an Arvados repository +h2. Cloning a git repository Before you start using Git, you should do some basic configuration (you only need to do this the first time): @@ -26,7 +24,7 @@ Before you start using Git, you should do some basic configuration (you only nee ~$ git config --global user.email $USER@example.com -On the Arvados Workbench, click on the dropdown menu icon in the upper right corner of the top navigation menu to access the user settings menu, and click on the menu item *Repositories*. In the *Repositories* page, you should see the @$USER/tutorial@ repository listed in the *name* column. Next to *name* is the column *URL*. Copy the *URL* value associated with your repository. This should look like https://git.{{ site.arvados_api_host }}/$USER/tutorial.git. Alternatively, you can use git@git.{{ site.arvados_api_host }}:$USER/tutorial.git +On the Arvados Workbench, click on the dropdown menu icon in the upper right corner of the top navigation menu to access the Account Management menu, and click on the menu item *Repositories*. In the *Repositories* page, you should see the @$USER/tutorial@ repository listed in the *name* column. Next to *name* is the column *URL*. Copy the *URL* value associated with your repository. This should look like https://git.{{ site.arvados_api_host }}/$USER/tutorial.git. Alternatively, you can use git@git.{{ site.arvados_api_host }}:$USER/tutorial.git Next, on the Arvados virtual machine, clone your Git repository: @@ -60,33 +58,22 @@ Create a git branch named *tutorial_branch* in the *tutorial* Arvados git reposi h2. Adding scripts to an Arvados repository -Arvados crunch scripts need to be added in a *crunch_scripts* subdirectory in the repository. If this subdirectory does not exist, first create it in the local repository and change to that directory: - - -
~/tutorial$ mkdir crunch_scripts
-~/tutorial$ cd crunch_scripts
-
- -Next, using @nano@ or your favorite Unix text editor, create a new file called @hash.py@ in the @crunch_scripts@ directory. - -notextile.
~/tutorial/crunch_scripts$ nano hash.py
- -Add the following code to compute the MD5 hash of each file in a collection +A git repository is a good place to store the CWL workflows that you run on Arvados. - {% code 'tutorial_hash_script_py' as python %} +First, create a simple CWL CommandLineTool: -Make the file executable: +notextile.
~/tutorials$ nano hello.cwl
-notextile.
~/tutorial/crunch_scripts$ chmod +x hash.py
+ {% code tutorial_hello_cwl as yaml %} Next, add the file to the git repository. This tells @git@ that the file should be included on the next commit. -notextile.
~/tutorial/crunch_scripts$ git add hash.py
+notextile.
~/tutorial$ git add hello.cwl
Next, commit your changes. All staged changes are recorded into the local git repository: -
~/tutorial/crunch_scripts$ git commit -m "my first script"
+
~/tutorial$ git commit -m "my first script"
 
@@ -97,4 +84,4 @@ Finally, upload your changes to the remote repository:
-Although this tutorial shows how to add a python script to Arvados, the same steps can be used to add any of your custom bash, R, or python scripts to an Arvados repository. +The same steps can be used to add any of your custom bash, R, or python scripts to an Arvados repository.