Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: set up FOCA #13

Merged
merged 44 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f56882a
basic structure using foca
psankhe28 Aug 6, 2024
d04f70c
Update tus_storagehandler/config.yaml
psankhe28 Aug 6, 2024
fb391ea
Update tus_storagehandler/storage_handler.yaml
psankhe28 Aug 6, 2024
fdf2431
updated license
psankhe28 Aug 6, 2024
e59a83d
added foca
psankhe28 Aug 9, 2024
cf06b09
fixing lint
psankhe28 Aug 9, 2024
ab0c2c7
formatted file
psankhe28 Aug 9, 2024
4fdab89
added init file
psankhe28 Aug 9, 2024
4c886ed
fixed lint
psankhe28 Aug 9, 2024
588295d
formatting
psankhe28 Aug 9, 2024
c6f8b03
made changes
psankhe28 Aug 10, 2024
b51b695
fixed ruff checks
psankhe28 Aug 10, 2024
439bfff
fixing failed workflows
psankhe28 Aug 10, 2024
ae19407
formatted
psankhe28 Aug 10, 2024
d8ff3a4
changed test
psankhe28 Aug 10, 2024
c9a50d7
formatted test
psankhe28 Aug 10, 2024
e592571
added env desc to readme
psankhe28 Aug 10, 2024
1b7a1d4
removed dotenv
psankhe28 Aug 12, 2024
653cc32
made changes
psankhe28 Aug 13, 2024
e0a3f45
added override for mypy
psankhe28 Aug 13, 2024
e3e04dc
setting up dev and prod env
psankhe28 Aug 13, 2024
f6a1a40
fixed type check
psankhe28 Aug 13, 2024
f6fc7a5
made some changes
psankhe28 Aug 15, 2024
1fca403
fixed lint
psankhe28 Aug 15, 2024
6fe1d25
changed slug
psankhe28 Aug 15, 2024
1f4609c
changed repo url
psankhe28 Aug 15, 2024
3302ff9
changed repo url for license
psankhe28 Aug 15, 2024
94d8b86
changed link
psankhe28 Aug 15, 2024
c8a44d0
changed slug
psankhe28 Aug 16, 2024
02139bf
reverting all changes in project name, slug and repository
psankhe28 Aug 16, 2024
115157f
change
psankhe28 Aug 16, 2024
920cdd3
fixed format
psankhe28 Aug 16, 2024
069a6b5
test changes
psankhe28 Aug 17, 2024
3e080b7
change in workflow
psankhe28 Aug 17, 2024
afaf56c
updated test_operations.py
psankhe28 Aug 18, 2024
faabcaa
fixed the pre commit checks
psankhe28 Aug 19, 2024
6a87cfb
made some readme changes
psankhe28 Aug 19, 2024
225425b
Updated README.md
psankhe28 Aug 19, 2024
a2f7740
Update __init__.py
uniqueg Aug 19, 2024
9068a22
Update README.md
uniqueg Aug 19, 2024
a66c33f
remove environment env
psankhe28 Aug 19, 2024
704ebce
removed enum
psankhe28 Aug 19, 2024
0467881
change in readme
psankhe28 Aug 19, 2024
83cddfc
fixed the table
psankhe28 Aug 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author_email": "[email protected]",
"development_status": "1 - Planning",
"short_description": "File handler utilizing TUS and MinIO with DRS-Filer integration.",
"project_name": "tus-storagehandler",
"project_name": "tus_storagehandler",
"project_slug": "tus_storagehandler",
"github_username": "elixir-cloud-aai",
"python_version": "3.11",
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/general-purpose.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ bug in -->
- Operating System and version (desktop or mobile):
- Link to your project:

[issue-tracker]: https://github.com/elixir-cloud-aai/tus-storagehandler/issues
[issue-tracker]: https://github.com/elixir-cloud-aai/tus_storagehandler/issues
48 changes: 48 additions & 0 deletions .github/workflows/run-application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Run Application

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Activate environment and install dependencies
run: |
make v
source .venv/bin/activate
make i

- name: Start server in the background
run: |
tus_storagehandler &
echo $! > server.pid

- name: Run tests
run: |
poetry run pytest tests/test_integration

- name: Stop server
run: |
kill $(cat server.pid) || true
...
2 changes: 1 addition & 1 deletion .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ MD037: true # Spaces inside emphasis markers
MD038: true # Spaces inside code span elements
MD039: true # Spaces inside link elements
MD040: true # Fenced code blocks should have a language specified
MD041: false # First line need not be h1
MD041: false # First line need not be h1
MD046: true # Code block style
MD047: true # Files should end with a single newline character
MD048: true # Code fence style
Expand Down
60 changes: 48 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,53 +18,76 @@ File handler utilizing TUS and MinIO with DRS-Filer integration.
- [Basic Usage](#basic-usage)
- [Installation](#installation)
- [Development](#development)
- [Environment Variables](#environment-variables)
- [Contributing](#contributing)
- [Code of Conduct](#code-of-conduct)
- [Versioning](#versioning)
- [License](#license)
- [Contact](#contact)

## 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.

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](https://min.io/download)
This flask application requires a running instance of
psankhe28 marked this conversation as resolved.
Show resolved Hide resolved
[MinIO](https://min.io/download).

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

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

### Install Dependencies using Poetry

1. **Download the required dependencies**
1. **Clone the Repository**

psankhe28 marked this conversation as resolved.
Show resolved Hide resolved
To get started, first, clone the repository using the following command:

```sh
git clone https://github.com/elixir-cloud-aai/tus-storagehandler.git
```

1. **Navigate to the package folder**

Navigate to the folder `tus_storagehandler`:

```sh
cd tus_storagehandler
```

Navigate to the folder `tus_storagehandler`.
1. **Install Poetry**

2. **Install Poetry**
If you haven't already, install Poetry by following the instructions on the
[Poetry website](https://python-poetry.org/docs/#installation).

If you haven't already, install Poetry by following the instructions on the [Poetry website](https://python-poetry.org/docs/#installation).
1. **Create and Activate a Virtual Environment (optional)**

3. **Create and Activate a Virtual Environment (optional)**
Poetry automatically creates and manages a virtual environment for your
project. You can activate it using:

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

4. **Install Dependencies**
1. **Install Dependencies**

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

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

## Development

For ease of use, certain scripts have been abbreviated in `Makefile`, make sure
Expand Down Expand Up @@ -157,6 +180,19 @@ make u
> **Note**: This is not the complete list of commands, run `make` to find out if
> more have been added.

## Environment Variables

<!-- markdownlint-disable line-length -->

| **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. |

<!-- markdownlint-enable line-length -->

## Contributing

This project is a community effort and lives off _your_ contributions, be it in
Expand Down
42 changes: 42 additions & 0 deletions deployment/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
server:
host: '0.0.0.0'
port: 8080
debug: false
environment: development
testing: false
use_reloader: true

security:
auth:
required: true
add_key_to_claims: true
allow_expired: false
audience: null
claim_identity: sub
claim_issuer: iss
algorithms:
- RS256
validation_methods:
- userinfo
- public_key
validation_checks: all

api:
specs:
- path: tus_storagehandler/api/specs/specs.yaml
append: null
add_operation_fields:
x-openapi-router-controller: tus_storagehandler.api.elixircloud.csh.controllers
connexion:
strict_validation: true
validate_responses: false
options:
swagger_ui: true
serve_spec: true

exceptions:
required_members: [['message'], ['code']]
status_member: ['code']
exceptions: tus_storagehandler.exceptions.exceptions
...
21 changes: 21 additions & 0 deletions docs/source/pages/tus_storagehandler.api.elixircloud.csh.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
tus\_storagehandler.api.elixircloud.csh package
===============================================

Submodules
----------

tus\_storagehandler.api.elixircloud.csh.controllers module
----------------------------------------------------------

.. automodule:: tus_storagehandler.api.elixircloud.csh.controllers
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: tus_storagehandler.api.elixircloud.csh
:members:
:undoc-members:
:show-inheritance:
18 changes: 18 additions & 0 deletions docs/source/pages/tus_storagehandler.api.elixircloud.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
tus\_storagehandler.api.elixircloud package
===========================================

Subpackages
-----------

.. toctree::
:maxdepth: 4

tus_storagehandler.api.elixircloud.csh

Module contents
---------------

.. automodule:: tus_storagehandler.api.elixircloud
:members:
:undoc-members:
:show-inheritance:
18 changes: 18 additions & 0 deletions docs/source/pages/tus_storagehandler.api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
tus\_storagehandler.api package
===============================

Subpackages
-----------

.. toctree::
:maxdepth: 4

tus_storagehandler.api.elixircloud

Module contents
---------------

.. automodule:: tus_storagehandler.api
:members:
:undoc-members:
:show-inheritance:
22 changes: 19 additions & 3 deletions docs/source/pages/tus_storagehandler.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
tus\_storagehandler package
===========================

Subpackages
-----------

.. toctree::
:maxdepth: 4

tus_storagehandler.api

Submodules
----------

tus\_storagehandler.main module
-------------------------------
tus\_storagehandler.app module
------------------------------

.. automodule:: tus_storagehandler.app
:members:
:undoc-members:
:show-inheritance:

tus\_storagehandler.exceptions module
-------------------------------------

.. automodule:: tus_storagehandler.main
.. automodule:: tus_storagehandler.exceptions
:members:
:undoc-members:
:show-inheritance:
Expand Down
Loading
Loading