diff --git a/octue/templates/template-child-services/wind_speed_service/app.py b/octue/templates/template-child-services/wind_speed_service/app.py index 40236cbd1..e99341fcb 100644 --- a/octue/templates/template-child-services/wind_speed_service/app.py +++ b/octue/templates/template-child-services/wind_speed_service/app.py @@ -8,4 +8,3 @@ def run(analysis): :return None: """ analysis.output_values = [random.randint(0, 200) for location in analysis.input_values["locations"]] - analysis.finalise() diff --git a/octue/templates/template-fractal/app.py b/octue/templates/template-fractal/app.py index 67b300339..4a7793cbc 100644 --- a/octue/templates/template-fractal/app.py +++ b/octue/templates/template-fractal/app.py @@ -55,9 +55,3 @@ def run(analysis): # Add the app's output values to the analysis. analysis.output_values = {"data": data, "layout": layout} - - # Optionally finalise the analysis. This validates the output data and output manifest against the twine and uploads - # any datasets in the output manifest to the service's cloud bucket. Signed URLs are provided so that the parent - # that asked the service for the analysis can access the data (until the signed URLs expire). Finalising explicitly - # isn't needed unless the output location is different from (or not specified in) the service configuration. - analysis.finalise() diff --git a/octue/templates/template-using-manifests/app.py b/octue/templates/template-using-manifests/app.py index 33dace06e..cb934180d 100644 --- a/octue/templates/template-using-manifests/app.py +++ b/octue/templates/template-using-manifests/app.py @@ -5,7 +5,6 @@ from octue.resources import Datafile, Dataset from octue.utils.files import RegisteredTemporaryDirectory -from tests import TEST_BUCKET_NAME logger = logging.getLogger(__name__) @@ -100,11 +99,6 @@ def run(analysis): # also used to separate words in natural language search. analysis.output_manifest.get_dataset("cleaned_met_mast_data").labels = ["met", "mast", "cleaned"] - # Finalise the analysis. This validates the output data and output manifest against the twine and optionally - # uploads any datasets in the output manifest to the service's cloud bucket. Signed URLs are provided so that - # the parent that asked the service for the analysis can access the data (until the signed URLs expire). - analysis.finalise(upload_output_datasets_to=f"gs://{TEST_BUCKET_NAME}/output/test_using_manifests_analysis") - # We're done! There's only one datafile in the output dataset, but you could create thousands more and add them # all :) # diff --git a/tests/templates/test_template_apps.py b/tests/templates/test_template_apps.py index 4a23c567e..8d35683ed 100644 --- a/tests/templates/test_template_apps.py +++ b/tests/templates/test_template_apps.py @@ -36,11 +36,13 @@ def test_fractal_template_with_default_configuration(self): def test_using_manifests_template(self): """Ensure the `using-manifests` template app works correctly.""" self.set_template("template-using-manifests") + output_location = f"gs://{TEST_BUCKET_NAME}" runner = Runner( app_src=self.template_path, twine=self.template_twine, configuration_values=os.path.join("data", "configuration", "values.json"), + output_location=output_location, ) with patch("google.cloud.storage.blob.Blob.generate_signed_url", new=mock_generate_signed_url): @@ -56,8 +58,7 @@ def test_using_manifests_template(self): ) output_url = urlparse(downloaded_output_manifest.datasets["cleaned_met_mast_data"].files.one().cloud_path).path - - self.assertTrue(output_url.startswith(f"/{TEST_BUCKET_NAME}/output/test_using_manifests_analysis")) + self.assertTrue(output_url.startswith(f"/{TEST_BUCKET_NAME}")) self.assertTrue(output_url.endswith("/cleaned_met_mast_data/cleaned.csv")) @unittest.skipIf(condition=os.name == "nt", reason="See issue https://github.com/octue/octue-sdk-python/issues/229")