Low-level API¶
This API is built on top of Git and Git-LFS.
Renku repository management.
-
class
renku.core.management.
LocalClient
(path=<function default_path>, renku_home='.renku', parent=None, use_external_storage=True, datadir='data', config_dir='/home/docs/.renku', config_name='renku.ini', lock=None)[source]¶ A low-level client for communicating with a local Renku repository.
Datasets¶
Client for handling datasets.
-
class
renku.core.management.datasets.
DatasetsApiMixin
(datadir='data')[source]¶ Client for handling datasets.
-
DATASETS
= 'datasets'¶ Directory for storing dataset metadata in Renku.
-
add_data_to_dataset
(dataset, urls, git=False, force=False, sources=(), destination='', link=False)[source]¶ Import the data into the data directory.
-
add_dataset_tag
(dataset, tag, description='', force=False)[source]¶ Adds a new tag to a dataset.
Validates if the tag already exists and that the tag follows the same rules as docker tags. See https://docs.docker.com/engine/reference/commandline/tag/ for a documentation of docker tag syntax.
Raises: ValueError
-
datadir
= None¶ Define a name of the folder for storing datasets.
-
dataset_commits
(dataset, max_results=None)[source]¶ Gets the newest commit for a dataset or its files.
Commits are returned sorted from newest to oldest.
-
datasets
¶ Return mapping from path to dataset.
Removes tags from a dataset.
-
renku_datasets_path
¶ Return a
Path
instance of Renku dataset metadata folder.
-
Repository¶
Client for handling a local repository.
-
class
renku.core.management.repository.
PathMixin
(path=<function default_path>)[source]¶ Define a default path attribute.
-
class
renku.core.management.repository.
RepositoryApiMixin
(renku_home='.renku', parent=None)[source]¶ Client for handling a local repository.
-
LOCK_SUFFIX
= '.lock'¶ Default suffix for Renku lock file.
-
METADATA
= 'metadata.yml'¶ Default name of Renku config file.
-
WORKFLOW
= 'workflow'¶ Directory for storing workflow in Renku.
-
find_previous_commit
(paths, revision='HEAD', return_first=False)[source]¶ Return a previous commit for a given path starting from
revision
.Parameters: - revision – revision to start from, defaults to
HEAD
- return_first – show the first commit in the history
Raises: KeyError – if path is not present in the given commit
- revision – revision to start from, defaults to
-
lock
¶ Create a Renku config lock.
-
parent
= None¶ Store a pointer to the parent repository.
-
process_commit
(commit=None, path=None)[source]¶ Build an
Activity
.Parameters: - commit – Commit to process. (default:
HEAD
) - path – Process a specific CWL file.
- commit – Commit to process. (default:
-
project_id
¶ Return the id for the project based on the repo origin remote.
-
remote
¶ Return host, owner and name of the remote if it exists.
-
renku_home
= None¶ Define a name of the Renku folder (default:
.renku
).
-
renku_metadata_path
¶ Return a
Path
instance of Renku metadata file.
-
renku_path
= None¶ Store a
Path
instance of the Renku folder.
-
workflow_path
¶ Return a
Path
instance of the workflow folder.
-
Git Internals¶
Wrap Git client.
-
class
renku.core.management.git.
GitCore
[source]¶ Wrap Git client.
-
candidate_paths
¶ Return all paths in the index and untracked files.
-
dirty_paths
¶ Get paths of dirty files in the repository.
-
modified_paths
¶ Return paths of modified files.
-
repo
= None¶ Store an instance of the Git repository.
-
Git utilities.
-
class
renku.core.models.git.
GitURL
(href, pathname=None, protocol='ssh', hostname='localhost', username=None, password=None, port=None, owner=None, name=None, regex=None)[source]¶ Parser for common Git URLs.
-
image
¶ Return image name.
-