Skip to content

elixir-cloud-aai/cloud-storage-handler

 
 

Repository files navigation

Bandit codecov Contributor Covenant Documentation Status License Python 3.11 GitHub contributors Ruff Safety

Cloud Storage Handler

File handler utilizing TUS and MinIO with DRS-Filer integration.

Table of Contents

Synopsis

This application provides endpoints for uploading, downloading, and listing files in a MinIO bucket, with TUS protocol support for uploads, and CORS enabled for cross-origin requests.

Basic Usage

Installation

Prerequisites

This Flask application requires a running instance of MinIO.

Run the MinIO instance by executing the following command in the location where MinIO is installed:

minio server /data --console-address ":9001"

Install Dependencies using Poetry

  1. Clone the Repository

    To get started, first, clone the repository using the following command:

    git clone https://github.com/elixir-cloud-aai/cloud-storage-handler.git
  2. Navigate to the package folder

    Navigate to the folder cloud-storage-handler:

    cd cloud-storage-handler
  3. Install Poetry

    If you haven't already, install Poetry by following the instructions on the Poetry website.

  4. Create and Activate a Virtual Environment (optional)

    Poetry automatically creates and manages a virtual environment for your project. You can activate it using:

    poetry shell
  5. Install Dependencies

    Run the following command to install the dependencies defined in the pyproject.toml file:

    poetry install

Development

For ease of use, certain scripts have been abbreviated in Makefile, make sure that you have installed the dependencies before running the commands.

Note: make commands are only available for Unix-based systems.

To view the commands available, run:

make

Here are certain commands that you might find useful:

  • Make a virtual environment
make v
  • Install all dependencies including optional dependencies
make i

Note: This project uses optional dependency groups such as types, code_quality, docs, vulnerability, test, and misc. To install stubs or types for the dependencies, you must use the following command:

poetry add types-foo --group types

Replace types-foo with the name of the package for the types. All runtime dependencies should be added to the default group. For example, to install requests and its type stubs, run:

poetry add requests
poetry add types-requests --group types

This ensures that the type checker functions correctly.

Note: Since the dependencies are segregated into groups, if you add a new group make sure to add it in make install command in Makefile.

  • Run tests
make t
  • Run linter, formatter and spell checker
make fl
  • Build the documentation
make d

Note: If you make changes to the code, make sure to generate and push the documentation using above command, else the documentation check CI will fail. Do NOT edit auto-generated documentation manually.

  • Run type checker
make tc
  • Run all pre-commit checks
make pc
  • Update the cookiecutter template
make u

Note: This is not the complete list of commands, run make to find out if more have been added.

Environment Variables

| Environment Variable | Description | Usage | Error Handling | |--|--|--|--| | CSH_FOCA_CONFIG_PATH | Specifies the path to the configuration file for the FOCA app. | The FOCA app uses this environment variable to locate the configuration file. If not set, it defaults to dev. | If the configuration file is not found at the specified or default path, a FileNotFoundError will be raised. |

Contributing

This project is a community effort and lives off your contributions, be it in the form of bug reports, feature requests, discussions, fixes or any other form of contribution!

Please refer to the guidelines available at CONTRIBUTING.md if you are interested in contributing.

Code of Conduct

We kindly request all contributors to abide by our organization's Code of Conduct. Please also refer to this document if you want to report an incident with respect to conduct in our community. Thank you for your cooperation.

Versioning

The project adopts the semantic versioning scheme for versioning. Currently the software is in a pre-release stage, so changes to the API, including breaking changes, may occur at any time without further notice.

License

This project is distributed under the Apache License 2.0, a copy of which is also available in LICENSE.

Contact

The project is maintained by ELIXIR Cloud & AAI, a Driver Project of the Global Alliance for Genomics and Health (GA4GH), under the umbrella of the ELIXIR Compute Platform.

To get in touch with us, please use one of the following routes:

  • For filing bug reports, feature requests or other code-related issues, please make use of the project's issue tracker.
  • For private/personal issues, more involved communication, or if you would like to join our team as a regular contributor, you can either join our chat board or email the community leaders.

logo-elixir logo-elixir-cloud-aai