diff --git a/docs/cluster/cluster.html b/docs/cluster/cluster.html index 82c7c154e..bf84856bb 100644 --- a/docs/cluster/cluster.html +++ b/docs/cluster/cluster.html @@ -103,8 +103,10 @@

Module codeflare_sdk.cluster.cluster

""" self.config = config self.app_wrapper_yaml = self.create_app_wrapper() - self.app_wrapper_name = self.app_wrapper_yaml.split(".")[0] self._job_submission_client = None + self.app_wrapper_name = self.app_wrapper_yaml.replace(".yaml", "").split("/")[ + -1 + ] @property def _client_headers(self): @@ -1051,8 +1053,10 @@

Classes

""" self.config = config self.app_wrapper_yaml = self.create_app_wrapper() - self.app_wrapper_name = self.app_wrapper_yaml.split(".")[0] self._job_submission_client = None + self.app_wrapper_name = self.app_wrapper_yaml.replace(".yaml", "").split("/")[ + -1 + ] @property def _client_headers(self): diff --git a/docs/utils/generate_yaml.html b/docs/utils/generate_yaml.html index ba2446644..c5a6affa7 100644 --- a/docs/utils/generate_yaml.html +++ b/docs/utils/generate_yaml.html @@ -50,6 +50,7 @@

Module codeflare_sdk.utils.generate_yaml

import yaml import sys +import os import argparse import uuid from kubernetes import client, config @@ -537,8 +538,14 @@

Module codeflare_sdk.utils.generate_yaml

def write_user_appwrapper(user_yaml, output_file_name): + # Create the directory if it doesn't exist + directory_path = os.path.dirname(output_file_name) + if not os.path.exists(directory_path): + os.makedirs(directory_path) + with open(output_file_name, "w") as outfile: yaml.dump(user_yaml, outfile, default_flow_style=False) + print(f"Written to: {output_file_name}") @@ -706,7 +713,8 @@

Module codeflare_sdk.utils.generate_yaml

if openshift_oauth: enable_openshift_oauth(user_yaml, cluster_name, namespace) - outfile = appwrapper_name + ".yaml" + directory_path = os.path.expanduser("~/.codeflare/appwrapper/") + outfile = os.path.join(directory_path, appwrapper_name + ".yaml") if not mcad: write_components(user_yaml, outfile) else: @@ -1019,7 +1027,8 @@

Functions

if openshift_oauth: enable_openshift_oauth(user_yaml, cluster_name, namespace) - outfile = appwrapper_name + ".yaml" + directory_path = os.path.expanduser("~/.codeflare/appwrapper/") + outfile = os.path.join(directory_path, appwrapper_name + ".yaml") if not mcad: write_components(user_yaml, outfile) else: @@ -1541,8 +1550,14 @@

Functions

Expand source code
def write_user_appwrapper(user_yaml, output_file_name):
+    # Create the directory if it doesn't exist
+    directory_path = os.path.dirname(output_file_name)
+    if not os.path.exists(directory_path):
+        os.makedirs(directory_path)
+
     with open(output_file_name, "w") as outfile:
         yaml.dump(user_yaml, outfile, default_flow_style=False)
+
     print(f"Written to: {output_file_name}")