MCPcopy
hub / github.com/iterative/cml / runTerraform

Function runTerraform

bin/cml/runner/launch.js:113–190  ·  view source on GitHub ↗
(opts)

Source from the content-addressed store, hash-verified

111
112const runCloud = async (opts) => {
113 const runTerraform = async (opts) => {
114 logger.info('Terraform apply...');
115
116 const { token, repo, driver } = cml;
117 const {
118 tpiVersion,
119 labels,
120 idleTimeout,
121 name,
122 cmlVersion,
123 single,
124 dockerVolumes,
125 cloud,
126 cloudRegion: region,
127 cloudType: type,
128 cloudPermissionSet: permissionSet,
129 cloudMetadata: metadata,
130 cloudGpu: gpu,
131 cloudHddSize: hddSize,
132 cloudSshPrivate: sshPrivate,
133 cloudSpot: spot,
134 cloudSpotPrice: spotPrice,
135 cloudStartupScript: startupScript,
136 cloudAwsSecurityGroup: awsSecurityGroup,
137 cloudAwsSubnet: awsSubnet,
138 cloudKubernetesNodeSelector: kubernetesNodeSelector,
139 cloudImage: image,
140 workdir
141 } = opts;
142
143 await tf.checkMinVersion();
144
145 if (gpu === 'tesla')
146 logger.warn(
147 'GPU model "tesla" has been deprecated; please use "v100" instead.'
148 );
149
150 const tfPath = workdir;
151 const tfMainPath = join(tfPath, 'main.tf.json');
152
153 const tpl = tf.iterativeCmlRunnerTpl({
154 tpiVersion,
155 repo,
156 token,
157 driver,
158 labels,
159 cmlVersion,
160 idleTimeout,
161 name,
162 single,
163 cloud,
164 region,
165 type,
166 permissionSet,
167 metadata,
168 gpu: gpu === 'tesla' ? 'v100' : gpu,
169 hddSize,
170 sshPrivate,

Callers 1

runCloudFunction · 0.85

Calls 1

warnMethod · 0.45

Tested by

no test coverage detected