From b400485ed0327f89c657c78485589bebdb72da93 Mon Sep 17 00:00:00 2001 From: Ethan Gafford Date: Wed, 5 Aug 2015 17:54:37 -0400 Subject: [PATCH] [Sahara] Unified job interface map UI A UI to serve the "Unified Job Interface Map" feature in Sahara. This feature adds an "interface" map to the API for job creation, such that the operator registering a job can define a unified, human-readable way to pass in all arguments, parameters, and configurations that the execution of that job may require or accept. This will allow platform- agnostic wizarding at the job execution phase and allows users to document use of their own jobs once in a persistent, standardized format. Change-Id: I81527405aa8038b13ff6e55ac5d972775ae810a6 Implements: blueprint unified-job-interface-map-ui --- .../contrib/sahara/api/sahara.py | 11 +- .../job_interface_arguments_template.html | 43 +++++ .../templates/data_processing.jobs/jobs.html | 3 - .../library_template.html | 12 +- .../content/data_processing/jobs/tests.py | 68 ++++++- .../data_processing/jobs/workflows/create.py | 79 +++++++- .../data_processing/jobs/workflows/launch.py | 106 ++++++++++- ...data_processing.job_interface_arguments.js | 175 ++++++++++++++++++ .../data_processing/utils/workflow_helpers.py | 40 ++++ .../_1840_data_processing_jobs_panel.py | 11 +- .../test/test_data/sahara_data.py | 2 + 11 files changed, 522 insertions(+), 28 deletions(-) create mode 100644 openstack_dashboard/contrib/sahara/content/data_processing/jobs/templates/data_processing.jobs/job_interface_arguments_template.html create mode 100644 openstack_dashboard/contrib/sahara/content/data_processing/static/dashboard/project/data_processing/data_processing.job_interface_arguments.js diff --git a/openstack_dashboard/contrib/sahara/api/sahara.py b/openstack_dashboard/contrib/sahara/api/sahara.py index 2b0971e3cb..54d31afb9a 100644 --- a/openstack_dashboard/contrib/sahara/api/sahara.py +++ b/openstack_dashboard/contrib/sahara/api/sahara.py @@ -379,13 +379,14 @@ def job_binary_internal_delete(request, jbi_id): client(request).job_binary_internals.delete(job_binary_id=jbi_id) -def job_create(request, name, j_type, mains, libs, description): +def job_create(request, name, j_type, mains, libs, description, interface): return client(request).jobs.create( name=name, type=j_type, mains=mains, libs=libs, - description=description) + description=description, + interface=interface) def job_list(request, search_opts=None): @@ -405,13 +406,15 @@ def job_get_configs(request, job_type): def job_execution_create(request, job_id, cluster_id, - input_id, output_id, configs): + input_id, output_id, configs, + interface): return client(request).job_executions.create( job_id=job_id, cluster_id=cluster_id, input_id=input_id, output_id=output_id, - configs=configs) + configs=configs, + interface=interface) def _resolve_job_execution_names(job_execution, cluster=None, diff --git a/openstack_dashboard/contrib/sahara/content/data_processing/jobs/templates/data_processing.jobs/job_interface_arguments_template.html b/openstack_dashboard/contrib/sahara/content/data_processing/jobs/templates/data_processing.jobs/job_interface_arguments_template.html new file mode 100644 index 0000000000..db141d6c5c --- /dev/null +++ b/openstack_dashboard/contrib/sahara/content/data_processing/jobs/templates/data_processing.jobs/job_interface_arguments_template.html @@ -0,0 +1,43 @@ +{% load i18n %} + + + + + + + + + + +
+
+
+
+ diff --git a/openstack_dashboard/contrib/sahara/content/data_processing/jobs/templates/data_processing.jobs/jobs.html b/openstack_dashboard/contrib/sahara/content/data_processing/jobs/templates/data_processing.jobs/jobs.html index 5e3c16ee55..39ed81f5bd 100644 --- a/openstack_dashboard/contrib/sahara/content/data_processing/jobs/templates/data_processing.jobs/jobs.html +++ b/openstack_dashboard/contrib/sahara/content/data_processing/jobs/templates/data_processing.jobs/jobs.html @@ -34,9 +34,6 @@ $navbar.hide(); } - $(".hidden_nodegroups_field").val(""); - $(".hidden_configure_field").val(""); - lower_limit = 0; $(".count-field").change(); if ($(modal).find(".hidden_create_field").length > 0) { diff --git a/openstack_dashboard/contrib/sahara/content/data_processing/jobs/templates/data_processing.jobs/library_template.html b/openstack_dashboard/contrib/sahara/content/data_processing/jobs/templates/data_processing.jobs/library_template.html index 26fb097708..a3a6b3c86f 100644 --- a/openstack_dashboard/contrib/sahara/content/data_processing/jobs/templates/data_processing.jobs/library_template.html +++ b/openstack_dashboard/contrib/sahara/content/data_processing/jobs/templates/data_processing.jobs/library_template.html @@ -1,7 +1,7 @@ {% load i18n %}