File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1212 "KERAS_REMOTE_STATE_DIR" ,
1313 os .path .expanduser ("~/.keras-remote/pulumi" ),
1414)
15+ PULUMI_ROOT = os .path .expanduser ("~/.keras-remote/pulumi-cli" )
1516REQUIRED_APIS = [
1617 "compute.googleapis.com" ,
1718 "cloudbuild.googleapis.com" ,
Original file line number Diff line number Diff line change 11"""Pulumi Automation API wrapper for keras-remote."""
22
33import os
4- import shutil
54
65import click
76import pulumi .automation as auto
87
9- from keras_remote .cli .constants import RESOURCE_NAME_PREFIX , STATE_DIR
8+ from keras_remote .cli .constants import (
9+ PULUMI_ROOT ,
10+ RESOURCE_NAME_PREFIX ,
11+ STATE_DIR ,
12+ )
1013
1114
1215def get_stack (program_fn , config ):
@@ -22,9 +25,11 @@ def get_stack(program_fn, config):
2225 os .makedirs (STATE_DIR , exist_ok = True )
2326
2427 # Auto-install the Pulumi CLI if not already present.
25- if not shutil .which ("pulumi" ):
28+ try :
29+ pulumi_cmd = auto .PulumiCommand (root = PULUMI_ROOT )
30+ except Exception : # noqa: BLE001
2631 click .echo ("Pulumi CLI not found. Installing..." )
27- pulumi_cmd = auto .PulumiCommand .install ()
32+ pulumi_cmd = auto .PulumiCommand .install (root = PULUMI_ROOT )
2833
2934 # Use project ID as stack name so each GCP project gets its own stack
3035 stack_name = config .project
You can’t perform that action at this time.
0 commit comments