Client-side functions¶
-
workflow_client.workflow_registry_client.
add_script_to_existing_docker
(hostname, token, docker_name, docker_tag, script_name, path_to_script)[source]¶ Function to register a script (bash or python) to an existing registered docker environment
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functiondocker_name (str): the name of your docker environmentdocker_tag (str): the tag of your docker environmentscript_name (str): the name of the scriptpath_to_script (str): path to the folder that the script is stored (e.g. /home/user/docker/)
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
add_workflow_part
(hostname, token, workflow_name, workflow_version, workflow_part_name, workflow_part_version, path_to_scripts, spec_name=None)[source]¶ Registers a CWL workflow part (class CommandLineTool) to the registry. Relevant yaml file can also be stored, if different yaml files are used.
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functionworkflow_name (str): the name of the CWL with class Workflowworkflow_version (str): the version of the CWL with class Workflowworkflow_part_name (str): the name of the CWL of class CommandLineTool to be registeredworkflow_part_version (str): the version of the CWL of class CommandLineTool to be registeredpath_to_scripts (str): the path to the folder containing the CWL filesspec_name (str): optional, use it only if you have different yaml file for each CWL
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
create_docker_env
(hostname, token, docker_name, docker_tag, docker_path)[source]¶ Create a docker environment with a Dockerfile (without any other scripts)
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functiondocker_name (str): the name of your docker environmentdocker_tag (str): the tag of your docker environmentdocker_path (str): the path to the Dockerfile (e.g. /home/user/docker/Dockerfile)
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
create_docker_env_with_scripts
(hostname, token, docker_name, docker_tag, script_names, path_to_files)[source]¶ Register an entire docker environment to the DARE platform. Under the path_to_files directory you should already have stored a Dockerfile and the relevant bash or python scripts
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functiondocker_name (str): the name of your docker environmentdocker_tag (str): the tag of your docker environmentscript_names (list): a list of names for your docker scriptspath_to_files (str): the path to the Dockerfile and scripts
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
create_workflow
(hostname, token, workflow_name, workflow_version, spec_name, path_to_cwls, docker_name, docker_tag, workflow_part_data=None)[source]¶ Registers a CWL workflow and its parts (if provided) to the registry.
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functionworkflow_name (str): the name of the CWL with class Workflowworkflow_version (str): the version of the CWL with class Workflowspec_name (str): the name of the spec yaml filepath_to_cwls (str): path to the folder where the CWL files are stored (locally)docker_name (str): the name of the associated docker envdocker_tag (str): the tag of the associated docker envworkflow_part_data (dict): name,version and yaml file name of each of the CWL of class CommandLineTool
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
delete_docker
(hostname, token, docker_name, docker_tag)[source]¶ Function to delete a docker environment (Dockerfile and associated scripts)
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functiondocker_name (str): the name of your docker environmentdocker_tag (str): the tag of your docker environment
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
delete_script_in_docker
(hostname, token, docker_name, docker_tag, script_name)[source]¶ Function to delete a script of a docker env
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functiondocker_name (str): the name of your docker environmentdocker_tag (str): the tag of your docker environmentscript_name (str): the name of the script
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
delete_workflow
(hostname, token, workflow_name, workflow_version)[source]¶ Deletes a CWL workflow and its parts (if provided) from the registry.
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functionworkflow_name (str): the name of the CWL with class Workflowworkflow_version (str): the version of the CWL with class Workflow
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
delete_workflow_part
(hostname, token, workflow_name, workflow_version, workflow_part_name, workflow_part_version)[source]¶ Deletes a CWL workflow (class CommandLineTool) from the registry.
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functionworkflow_name (str): the name of the CWL with class Workflowworkflow_version (str): the version of the CWL with class Workflowworkflow_part_name (str): the name of the CWL of class CommandLineTool to be deletedworkflow_part_version (str): the version of the CWL of class CommandLineTool to be deleted
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
download_docker
(hostname, token, docker_name, docker_tag, local_path)[source]¶ Function to download a zip file containing the Dockerfile and the relevant scripts
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functiondocker_name (str): the name of your docker environmentdocker_tag (str): the tag of your docker environment
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
download_script
(hostname, token, docker_name, docker_tag, script_name, local_path)[source]¶ Function to download a script of a docker env by name
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functiondocker_name (str): the name of your docker environmentdocker_tag (str): the tag of your docker environmentscript_name (str): the name of the script
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
download_workflow
(hostname, token, workflow_name, workflow_version, local_path, dockerized=None)[source]¶ Function to download a CWL workflow (class Workflow) and its CWL parts (class CommandLineTool), the relevant yaml files (spec files) and, if dockerized is set to True, it also downloads the Dockerfile and scripts (bash or python) of the associated docker container
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functionworkflow_name (str): the name of the CWL with class Workflowworkflow_version (str): the version of the CWL with class Workflowlocal_path (str): the path where the zip file will be storeddockerized (bool): true to download the Dockerfile and scripts along with the workflow files. Leave it
empty if you want only the CWL and yaml files
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
download_workflow_part
(hostname, token, workflow_name, workflow_version, workflow_part_name, workflow_part_version, local_path)[source]¶ Downloads a CWL of class CommandLineTool and its associated yaml file if exists.
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functionworkflow_name (str): the name of the CWL with class Workflowworkflow_version (str): the version of the CWL with class Workflowworkflow_part_name (str): the name of the CWL of class CommandLineTool to be retrievedworkflow_part_version (str): the version of the CWL of class CommandLineTool to be retrievedlocal_path (str): the path to store the zip file / should contain the zip filename as well
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
edit_script_in_existing_docker
(hostname, token, docker_name, docker_tag, script_name, path_to_script)[source]¶ Function to update a script (bash or python) to an existing registered docker environment
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functiondocker_name (str): the name of your docker environmentdocker_tag (str): the tag of your docker environmentscript_name (str): the name of the scriptpath_to_script (str): path to the folder that the script is stored (e.g. /home/user/docker/)
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
edit_workflow_part
(hostname, token, workflow_name, workflow_version, workflow_part_name, workflow_part_version, update, spec_name=None, path_to_files=None)[source]¶ Updates a CWL workflow (class CommandLineTool) to the registry.
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functionworkflow_name (str): the name of the CWL with class Workflowworkflow_version (str): the version of the CWL with class Workflowworkflow_part_name (str): the name of the CWL of class CommandLineTool to be updatedworkflow_part_version (str): the version of the CWL of class CommandLineTool to be updatedupdate (dict): the workflow’s fields to be updated. Valid fields are: name, version, spec_namespec_name (str): optional, use it only if you have different yaml file for each CWLpath_to_files (str): optional, use it only when you want to update the actual files and not only the
workflow object’s fields
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
get_docker_by_name_and_tag
(hostname, token, docker_name, docker_tag)[source]¶ Retrieve a docker environment by name and tag
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functiondocker_name (str): the name of your docker environmentdocker_tag (str): the tag of your docker environment
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
get_docker_by_user
(hostname, token, username=None)[source]¶ Retrieve a docker env by user. You can specify a user (if it’s not you) otherwise the system will identify you from the provided token.
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functionusername (str): optional, the username associated with the docker
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
get_script_by_name
(hostname, token, docker_name, docker_tag, script_name)[source]¶ Function to get a script of a docker env by name
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functiondocker_name (str): the name of your docker environmentdocker_tag (str): the tag of your docker environmentscript_name (str): the name of the script
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
get_workflow_by_name_and_version
(hostname, token, workflow_name, workflow_version)[source]¶ Function to retrieve a CWL workflow by name and version
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functionworkflow_name (str): the name of the CWL with class Workflowworkflow_version (str): the version of the CWL with class Workflow
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
get_workflow_part_by_name_and_version
(hostname, token, workflow_name, workflow_version, workflow_part_name, workflow_part_version)[source]¶ Function to retrieve a CWL of class CommandLineTool by name, tag and CWL name & version of the CWL of class Workflow
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functionworkflow_name (str): the name of the CWL with class Workflowworkflow_version (str): the version of the CWL with class Workflowworkflow_part_name (str): the name of the CWL of class CommandLineTool to be retrievedworkflow_part_version (str): the version of the CWL of class CommandLineTool to be retrieved
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
login
(hostname, username, password, requested_issuer)[source]¶ User can sign in the DARE platform using this function. You should provide your credentials from the yaml file
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)username (str): your username from the credentials filepassword (str): your password from the credentials filerequested_issuer (str): the Identity Provider (e.g. dare, google etc)
- Returns
dict: the access and refresh token. If the call failed, it returns an error message
-
workflow_client.workflow_registry_client.
provide_url
(hostname, token, docker_name, docker_tag, docker_url)[source]¶ Function to update the URL to a public docker image for a specific docker environment. The docker env should already be available in the registry.
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functiondocker_name (str): the name of your docker environmentdocker_tag (str): the tag of your docker environmentdocker_url (str): the URL to the public docker image
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
read_credentials
()[source]¶ Reads the user’s credentials from a yaml file. You should create a file named credentials.yaml in the same directory as the workflow_registry_client.py script and your main function or jupyter notebook.
The yaml file should contain your username, password and the issuer of the token (e.g. Google). If you leave the latter field empty, you should be registered in the DARE platform Keycloak module.
- Returns
- dict: the user’s credentials
-
workflow_client.workflow_registry_client.
update_associated_docker
(hostname, token, workflow_name, workflow_version, docker_name, docker_tag)[source]¶ Function to update the associated docker environment for a specific workflow
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functionworkflow_name (str): the name of the CWL with class Workflowworkflow_version (str): the version of the CWL with class Workflowdocker_name (str): the name of the associated docker envdocker_tag (str): the tag of the associated docker env
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
update_docker
(hostname, token, update, docker_name, docker_tag, path_to_docker=None)[source]¶ Function to update an existing docker environment. You should provide a dict (parameter update) with the fields to be updated. Valid keys to the dict are: name, tag, url, dockerfile
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functionupdate (dict): docker fileds to be updated in the registrydocker_name (str): the name of your docker environmentdocker_tag (str): the tag of your docker environmentpath_to_docker (str): the path to the Dockerfile (e.g. /home/user/docker/Dockerfile) - optional, should beused only if you need to update the Dockerfile
- Returns
tuple: the response status code and the response content
-
workflow_client.workflow_registry_client.
update_workflow
(hostname, token, workflow_name, workflow_version, update, workflow_path=None, specpath=None)[source]¶ Updates a CWL workflow to the registry.
- Args
- hostname (str): the base url to the DARE platform (e.g. https://testbed.project-dare.eu)token (str): your authentication token which is returned from the login functionworkflow_name (str): the name of the CWL with class Workflowworkflow_version (str): the version of the CWL with class Workflowupdate (dict): the workflow’s fields to be updated. Valid fields are: name, version, spec_nameworkflow_path (str): optional, the path to the CWL of class Workflow (only for file update)specpath (str): the path to the yaml file, optional (only if you need to update the file)
- Returns
tuple: the response status code and the response content