Skip to content

Commit

Permalink
Revert changes to create_kf_instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Lewi committed Oct 23, 2019
1 parent 33d3ff2 commit 5ce9084
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions py/kubeflow/testing/create_kf_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,18 @@ def deploy_with_kfctl_go(kfctl_path, args, app_dir, env):

config_spec["spec"] = util.filter_spartakus(config_spec["spec"])

# Remove name because we will auto infer from directory.
if "name" in config_spec["metadata"]:
logging.info("Deleting name in kfdef spec.")
del config_spec["metadata"]["name"]

logging.info("KFDefSpec:\n%s", str(config_spec))
with tempfile.NamedTemporaryFile(suffix=".yaml", delete=False) as f:
config_file = f.name
logging.info("Writing file %s", f.name)
yaml.dump(config_spec, f)

if not os.path.exists(app_dir):
logging.info("Creating app dir %s", app_dir)
util.run([kfctl_path, "init", app_dir, "-V", "--config=" + config_file],
env=env)

config_file = os.path.join(app_dir, "kf_config.yaml")
with open(config_file, "w") as hf:
logging.info("Writing file %s", config_file)
yaml.dump(config_spec, hf)
util.run([kfctl_path, "generate", "-V", "all"], env=env, cwd=app_dir)

util.run([kfctl_path, "apply", "-V", "-f", config_file], env=env)
util.run([kfctl_path, "apply", "-V", "all"], env=env, cwd=app_dir)

def main(): # pylint: disable=too-many-locals,too-many-statements
logging.basicConfig(level=logging.INFO,
Expand Down

0 comments on commit 5ce9084

Please sign in to comment.