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 2020/10/05 21:24:21 UTC

[airavata-django-portal] 01/04: AIRAVATA-3346 Updating tutorial instructions

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 b52500324812de96d427aca7ae56c59ac870c8f1
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Oct 5 12:14:27 2020 -0400

    AIRAVATA-3346 Updating tutorial instructions
---
 docs/tutorial/gateways2019_tutorial.md | 51 ++++------------------------------
 1 file changed, 6 insertions(+), 45 deletions(-)

diff --git a/docs/tutorial/gateways2019_tutorial.md b/docs/tutorial/gateways2019_tutorial.md
index e7ae202..1a1f931 100644
--- a/docs/tutorial/gateways2019_tutorial.md
+++ b/docs/tutorial/gateways2019_tutorial.md
@@ -493,22 +493,7 @@ molecular orbital energies. Then `matplotlib` is used to create two plots of
 these values. Finally, the plots are exported as a PNG image that is returns as
 a buffer of bytes.
 
-4. To test this locally we need access to a file to test with. While our local
-   portal instance can connect to the Airavata API just like the production
-   deployed Django portal instance, only the production deployed Django portal
-   has access to the output files generated by users' experiments. So for
-   testing purposes we'll define a file to be used when there is no Gaussian log
-   file available (this test file will only be used when the Django portal is
-   running in `DEBUG` mode).
-
-Just after the `name` attribute of `GaussianEigenvaluesViewProvider` we add the
-following:
-
-```python
-test_output_file = os.path.join(BASE_DIR, "data", "gaussian.log")
-```
-
-5. Altogether, the output_views.py file should have the following contents:
+4. Altogether, the output_views.py file should have the following contents:
 
 ```python
 import io
@@ -524,7 +509,6 @@ BASE_DIR = os.path.dirname(os.path.abspath(__file__))
 class GaussianEigenvaluesViewProvider:
     display_type = 'image'
     name = "Gaussian Eigenvalues"
-    test_output_file = os.path.join(BASE_DIR, "data", "gaussian.log")
 
     def generate_data(self, request, experiment_output, experiment, output_file=None):
 
@@ -573,7 +557,7 @@ class GaussianEigenvaluesViewProvider:
 
 ```
 
-6. Now we need to register our _output view provider_ with the package metadata
+5. Now we need to register our _output view provider_ with the package metadata
    so that the Django Portal will be able to discover it. We add the following
    lines to the `entry_points` parameter in the
    `$HOME/gateways19-tutorial/setup.py` file:
@@ -592,7 +576,7 @@ gaussian-eigenvalues-plot = gateways19_tutorial.output_views:GaussianEigenvalues
 `gateways19_tutorial.output_views` is the module in which the
 `GaussianEigenvaluesViewProvider` output view provider class is found.
 
-7. Now we need to install the _gateways19-tutorial_ package into the Django
+6. Now we need to install the _gateways19-tutorial_ package into the Django
    portal's virtual environment.
 
 ```bash
@@ -1128,15 +1112,6 @@ $("#run-button").click((e) => {
 ```
 
 Now that we can launch the experiment we can go ahead and give it a try.
-However, the job will ultimately fail because Airavata won't be able to transfer
-the file back to our locally running Django portal (if we had our locally
-running Django portal running a public SSH server we could configure it so that
-Airavata could SCP the file back to our local instance). But this custom Django
-app is also deployed in the hosted tutorial Django instance so you can run it
-there to verify it works.
-
-6. Try this out in the production deployment at
-   <https://testdrive.airavata.org/gateways19_tutorial/hello/>.
 
 ### Displaying the experiment output
 
@@ -1200,18 +1175,11 @@ if (exp.experimentStatus === models.ExperimentState.COMPLETED) {
 }
 ```
 
-3. However, as noted earlier this won't quite work with our local Django
-   instance since it doesn't have access to the output file. That's fine though
-   since we can fake the STDOUT text so that we can test our code locally.
-   Remove the comment starting with `/* Displaying the experiment output` on
-   line 88 and ending on line 116. Here's the update to the `loadExperiments`
-   function:
+3. To enable this, remove the comment starting with
+   `/* Displaying the experiment output` on line 88 and ending on line 113.
+   Here's the update to the `loadExperiments` function:
 
 ```javascript
-const FAKE_STDOUT = `
-bonjour
-`;
-
 function loadExperiments() {
     return services.ExperimentSearchService.list({
         limit: 5,
@@ -1249,9 +1217,6 @@ function loadExperiments() {
                             return fetch(stdoutDataProduct.downloadURL, {
                                 credentials: "same-origin",
                             }).then((result) => result.text());
-                        } else {
-                            // If we can't download it, fake it
-                            return FAKE_STDOUT;
                         }
                     })
                     .then((text) => {
@@ -1263,10 +1228,6 @@ function loadExperiments() {
 }
 ```
 
-4. You can try out this custom Django app in the production deployed instance at
-   <https://testdrive.airavata.org/gateways19_tutorial/hello/> where it really
-   does download and parse the standard out.
-
 ## Resources
 
 You can browser the final version of the _gateways19-tutorial_ code at