You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/08/04 17:56:31 UTC
[airavata-django-portal] branch develop updated: AIRAVATA-3420
Updates for the refactored USER_STORAGES setting
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
The following commit(s) were added to refs/heads/develop by this push:
new d81e04b AIRAVATA-3420 Updates for the refactored USER_STORAGES setting
d81e04b is described below
commit d81e04bd29387b6b240b2982c004de1a3e8d9a00
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Aug 4 13:55:32 2021 -0400
AIRAVATA-3420 Updates for the refactored USER_STORAGES setting
---
django_airavata/apps/api/views.py | 3 +--
.../settings_local.py.template | 2 --
django_airavata/apps/auth/views.py | 3 +--
django_airavata/settings_local.py.ide | 13 +++++++++---
django_airavata/settings_local.py.sample | 24 +++++++++++++++++++---
requirements.txt | 2 +-
6 files changed, 34 insertions(+), 13 deletions(-)
diff --git a/django_airavata/apps/api/views.py b/django_airavata/apps/api/views.py
index 134b2fc..629b9b3 100644
--- a/django_airavata/apps/api/views.py
+++ b/django_airavata/apps/api/views.py
@@ -224,8 +224,7 @@ class ExperimentViewSet(mixins.CreateModelMixin,
def _set_storage_id_and_data_dir(self, experiment):
# Storage ID
- experiment.userConfigurationData.storageId = \
- settings.GATEWAY_DATA_STORE_RESOURCE_ID
+ experiment.userConfigurationData.storageId = user_storage.get_default_storage_resource_id()
# Create experiment dir and set it on model
if not experiment.userConfigurationData.experimentDataDir:
project = self.request.airavata_client.getProject(
diff --git a/django_airavata/apps/auth/templates/django_airavata_auth/settings_local.py.template b/django_airavata/apps/auth/templates/django_airavata_auth/settings_local.py.template
index cdda4ce..5412476 100644
--- a/django_airavata/apps/auth/templates/django_airavata_auth/settings_local.py.template
+++ b/django_airavata/apps/auth/templates/django_airavata_auth/settings_local.py.template
@@ -67,8 +67,6 @@ GATEWAY_ID = '{{ GATEWAY_ID }}'
AIRAVATA_API_HOST = '{{ AIRAVATA_API_HOST }}'
AIRAVATA_API_PORT = {{ AIRAVATA_API_PORT }}
AIRAVATA_API_SECURE = {{ AIRAVATA_API_SECURE }}
-GATEWAY_DATA_STORE_RESOURCE_ID = '{{ GATEWAY_DATA_STORE_RESOURCE_ID }}'
-GATEWAY_DATA_STORE_DIR = '/tmp'
GATEWAY_DATA_STORE_REMOTE_API = '{{ GATEWAY_DATA_STORE_REMOTE_API }}'
# FILE_UPLOAD_TEMP_DIR = '/tmp'
diff --git a/django_airavata/apps/auth/views.py b/django_airavata/apps/auth/views.py
index fb0d295..d2d843d 100644
--- a/django_airavata/apps/auth/views.py
+++ b/django_airavata/apps/auth/views.py
@@ -632,11 +632,10 @@ def download_settings_local(request):
context['AIRAVATA_API_HOST'] = settings.AIRAVATA_API_HOST
context['AIRAVATA_API_PORT'] = settings.AIRAVATA_API_PORT
context['AIRAVATA_API_SECURE'] = settings.AIRAVATA_API_SECURE
- context['GATEWAY_DATA_STORE_RESOURCE_ID'] = settings.GATEWAY_DATA_STORE_RESOURCE_ID
if hasattr(settings, 'GATEWAY_DATA_STORE_REMOTE_API'):
context['GATEWAY_DATA_STORE_REMOTE_API'] = settings.GATEWAY_DATA_STORE_REMOTE_API
else:
- context['GATEWAY_DATA_STORE_REMOTE_API'] = request.build_absolute_uri("/api")
+ context['GATEWAY_DATA_STORE_REMOTE_API'] = request.build_absolute_uri()
context['PROFILE_SERVICE_HOST'] = settings.PROFILE_SERVICE_HOST
context['PROFILE_SERVICE_PORT'] = settings.PROFILE_SERVICE_PORT
context['PROFILE_SERVICE_SECURE'] = settings.PROFILE_SERVICE_SECURE
diff --git a/django_airavata/settings_local.py.ide b/django_airavata/settings_local.py.ide
index cb6af76..2e42321 100644
--- a/django_airavata/settings_local.py.ide
+++ b/django_airavata/settings_local.py.ide
@@ -63,11 +63,18 @@ GATEWAY_ID = 'default'
AIRAVATA_API_HOST = 'localhost'
AIRAVATA_API_PORT = 9930
AIRAVATA_API_SECURE = True
-GATEWAY_DATA_STORE_RESOURCE_ID = 'airavata.host_77116e91-f042-4d3a-ab9c-3e7b4ebcd5bd'
-GATEWAY_DATA_STORE_DIR = '/tmp'
-GATEWAY_DATA_STORE_HOSTNAME = 'localhost'
FILE_UPLOAD_TEMP_DIR = '/tmp'
+USER_STORAGES = {
+ 'default': {
+ 'BACKEND': 'airavata_django_portal_sdk.user_storage.backends.DjangoFileSystemProvider',
+ 'STORAGE_RESOURCE_ID': 'airavata.host_77116e91-f042-4d3a-ab9c-3e7b4ebcd5bd',
+ 'OPTIONS': {
+ 'directory': '/tmp',
+ }
+ }
+}
+
# Profile Service Configuration
PROFILE_SERVICE_HOST = AIRAVATA_API_HOST
PROFILE_SERVICE_PORT = 8962
diff --git a/django_airavata/settings_local.py.sample b/django_airavata/settings_local.py.sample
index 6e3bff7..b6b55d4 100644
--- a/django_airavata/settings_local.py.sample
+++ b/django_airavata/settings_local.py.sample
@@ -81,11 +81,29 @@ GATEWAY_ID = 'default'
AIRAVATA_API_HOST = 'localhost'
AIRAVATA_API_PORT = 8930
AIRAVATA_API_SECURE = False
-GATEWAY_DATA_STORE_RESOURCE_ID = '...'
-GATEWAY_DATA_STORE_DIR = '/tmp'
-GATEWAY_DATA_STORE_HOSTNAME = 'localhost'
FILE_UPLOAD_TEMP_DIR = '/tmp'
+USER_STORAGES = {
+ 'default': {
+ 'BACKEND': 'airavata_django_portal_sdk.user_storage.backends.DjangoFileSystemProvider',
+ 'STORAGE_RESOURCE_ID': '...',
+ 'OPTIONS': {
+ 'directory': '/tmp/experiment-data-dir',
+ }
+ },
+ # Or for MFT integration
+ # 'default': {
+ # 'BACKEND': 'airavata_django_portal_sdk.user_storage.backends.MFTUserStorageProvider',
+ # 'STORAGE_RESOURCE_ID': '...',
+ # 'OPTIONS': {
+ # 'resource_token': 'local-ssh-cred',
+ # 'mft_api_endpoint': 'localhost:7004',
+ # 'resource_per_gateway': True,
+ # 'base_resource_path': '...'
+ # }
+ # }
+}
+
# Define shared directories. Each entry is symlinked into the user's storage.
# GATEWAY_DATA_SHARED_DIRECTORIES = {
# 'Display Name': {
diff --git a/requirements.txt b/requirements.txt
index 93ca1b9..46808fe 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -19,7 +19,7 @@ google-api-python-client==1.12.8
grpcio-tools==1.34.1
grpcio==1.34.1
-airavata-django-portal-sdk==1.2.dev1
+airavata-django-portal-sdk==1.2.dev2
airavata-python-sdk==1.0.1
-e "."