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 2019/05/08 20:30:35 UTC
[airavata-django-portal] branch master updated (78a2bea -> 6e2b258)
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git.
from 78a2bea AIRAVATA-2975 Remove unused function, css class
new 4d2fb01 Allow passing experimentDataDir to create experiment
new 6e2b258 Fix order of imports
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
django_airavata/apps/api/views.py | 13 +++++++------
.../js/containers/CreateExperimentContainer.vue | 5 ++++-
.../django_airavata_workspace/js/entry-create-experiment.js | 6 +++++-
.../django_airavata_workspace/create_experiment.html | 5 ++++-
django_airavata/apps/workspace/views.py | 11 ++++++++---
5 files changed, 28 insertions(+), 12 deletions(-)
[airavata-django-portal] 02/02: Fix order of imports
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
commit 6e2b258f8ce207ea53a46c32d9231683cbb4b076
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed May 8 16:30:17 2019 -0400
Fix order of imports
---
django_airavata/apps/api/views.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/django_airavata/apps/api/views.py b/django_airavata/apps/api/views.py
index d5a03af..1e29da2 100644
--- a/django_airavata/apps/api/views.py
+++ b/django_airavata/apps/api/views.py
@@ -6,7 +6,6 @@ from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
from django.http import FileResponse, Http404, HttpResponse, JsonResponse
from django.urls import reverse
-from django_airavata.apps.workspace.models import User_Files
from rest_framework import mixins
from rest_framework.decorators import action, detail_route, list_route
from rest_framework.exceptions import ParseError
@@ -38,6 +37,7 @@ from django_airavata.apps.api.view_utils import (
APIResultPagination,
GenericAPIBackedViewSet
)
+from django_airavata.apps.workspace.models import User_Files
from . import datastore, helpers, models, serializers, thrift_utils
[airavata-django-portal] 01/02: Allow passing experimentDataDir to
create experiment
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
commit 4d2fb01a8670ecca8a290cb093a33dd6e746fac2
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed May 8 14:52:09 2019 -0400
Allow passing experimentDataDir to create experiment
---
django_airavata/apps/api/views.py | 11 ++++++-----
.../js/containers/CreateExperimentContainer.vue | 5 ++++-
.../django_airavata_workspace/js/entry-create-experiment.js | 6 +++++-
.../django_airavata_workspace/create_experiment.html | 5 ++++-
django_airavata/apps/workspace/views.py | 11 ++++++++---
5 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/django_airavata/apps/api/views.py b/django_airavata/apps/api/views.py
index dffba15..d5a03af 100644
--- a/django_airavata/apps/api/views.py
+++ b/django_airavata/apps/api/views.py
@@ -181,7 +181,7 @@ class ExperimentViewSet(APIBackedViewSet):
gatewayId=self.gateway_id,
userName=self.username)
# The project or exp name may have changed, so update the exp data dir
- self._set_storage_id_and_data_dir(experiment)
+ # self._set_storage_id_and_data_dir(experiment)
self.request.airavata_client.updateExperiment(
self.authz_token, experiment.experimentId, experiment)
self._update_most_recent_project(experiment.projectId)
@@ -193,10 +193,11 @@ class ExperimentViewSet(APIBackedViewSet):
# Create experiment dir and set it on model
project = self.request.airavata_client.getProject(
self.authz_token, experiment.projectId)
- exp_dir = datastore.get_experiment_dir(self.username,
- project.name,
- experiment.experimentName)
- experiment.userConfigurationData.experimentDataDir = exp_dir
+ if not experiment.userConfigurationData.experimentDataDir:
+ exp_dir = datastore.get_experiment_dir(self.username,
+ project.name,
+ experiment.experimentName)
+ experiment.userConfigurationData.experimentDataDir = exp_dir
@detail_route(methods=['post'])
def launch(self, request, experiment_id=None):
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/CreateExperimentContainer.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/CreateExperimentContainer.vue
index c7f7d0b..d820834 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/CreateExperimentContainer.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/containers/CreateExperimentContainer.vue
@@ -20,7 +20,7 @@ import moment from "moment";
export default {
name: "create-experiment-container",
- props: ["app-module-id", "user-input-files"],
+ props: ["app-module-id", "user-input-files", "experiment-data-dir"],
data() {
return {
experiment: null,
@@ -66,6 +66,9 @@ export default {
}
experiment.executionId = appInterface.applicationInterfaceId;
});
+ if (this.experimentDataDir) {
+ experiment.userConfigurationData.experimentDataDir = this.experimentDataDir;
+ }
Promise.all([loadAppModule, loadAppInterface])
.then(() => (this.experiment = experiment))
.catch(error => {
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/entry-create-experiment.js b/django_airavata/apps/workspace/static/django_airavata_workspace/js/entry-create-experiment.js
index 386d665..4f2e983 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/entry-create-experiment.js
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/entry-create-experiment.js
@@ -8,7 +8,8 @@ entry(Vue => {
h(CreateExperimentContainer, {
props: {
appModuleId: this.appModuleId,
- userInputFiles: this.userInputFiles
+ userInputFiles: this.userInputFiles,
+ experimentDataDir: this.experimentDataDir
}
})
]);
@@ -26,6 +27,9 @@ entry(Vue => {
if (this.$el.dataset.userInputFiles) {
this.userInputFiles = JSON.parse(this.$el.dataset.userInputFiles);
}
+ if (this.$el.dataset.experimentDataDir) {
+ this.experimentDataDir = this.$el.dataset.experimentDataDir;
+ }
}
}).$mount("#create-experiment");
});
diff --git a/django_airavata/apps/workspace/templates/django_airavata_workspace/create_experiment.html b/django_airavata/apps/workspace/templates/django_airavata_workspace/create_experiment.html
index 327d5a3..08939a2 100644
--- a/django_airavata/apps/workspace/templates/django_airavata_workspace/create_experiment.html
+++ b/django_airavata/apps/workspace/templates/django_airavata_workspace/create_experiment.html
@@ -2,6 +2,9 @@
{% block content %}
-<div id="{{ bundle_name }}" data-app-module-id="{{ app_module_id }}" data-user-input-files="{{ user_input_files }}"></div>
+<div id="{{ bundle_name }}" data-app-module-id="{{ app_module_id }}" data-user-input-files="{{ user_input_files }}"
+ {% if experiment_data_dir %}data-experiment-data-dir="{{ experiment_data_dir }}"{% endif %}
+>
+</div>
{% endblock content %}
diff --git a/django_airavata/apps/workspace/views.py b/django_airavata/apps/workspace/views.py
index 402bceb..45675cf 100644
--- a/django_airavata/apps/workspace/views.py
+++ b/django_airavata/apps/workspace/views.py
@@ -94,12 +94,17 @@ def create_experiment(request, app_module_id):
data_product_uri = request.airavata_client.registerDataProduct(
request.authz_token, data_product)
user_input_files[app_input['name']] = data_product_uri
+ context = {
+ 'bundle_name': 'create-experiment',
+ 'app_module_id': app_module_id,
+ 'user_input_files': json.dumps(user_input_files)
+ }
+ if 'experiment-data-dir' in request.GET:
+ context['experiment_data_dir'] = request.GET['experiment-data-dir']
return render(request,
'django_airavata_workspace/create_experiment.html',
- {'bundle_name': 'create-experiment',
- 'app_module_id': app_module_id,
- 'user_input_files': json.dumps(user_input_files)})
+ context)
@login_required