MCPcopy Index your code
hub / github.com/cortexlabs/cortex / runManagerAccessCommand

Function runManagerAccessCommand

cli/cmd/lib_manager.go:220–249  ·  view source on GitHub ↗
(entrypoint string, accessConfig clusterconfig.AccessConfig, awsClient *aws.Client, copyToPaths []dockerCopyToPath, copyFromPaths []dockerCopyFromPath)

Source from the content-addressed store, hash-verified

218}
219
220func runManagerAccessCommand(entrypoint string, accessConfig clusterconfig.AccessConfig, awsClient *aws.Client, copyToPaths []dockerCopyToPath, copyFromPaths []dockerCopyFromPath) (string, *int, error) {
221 containerConfig := &container.Config{
222 Image: accessConfig.ImageManager,
223 Entrypoint: []string{"/bin/bash", "-c"},
224 Cmd: []string{entrypoint},
225 Tty: true,
226 AttachStdout: true,
227 AttachStderr: true,
228 Env: []string{
229 "AWS_ACCESS_KEY_ID=" + *awsClient.AccessKeyID(),
230 "AWS_SECRET_ACCESS_KEY=" + *awsClient.SecretAccessKey(),
231 "CORTEX_CLUSTER_NAME=" + accessConfig.ClusterName,
232 "CORTEX_REGION=" + accessConfig.Region,
233 "CORTEX_TELEMETRY_DISABLE=" + os.Getenv("CORTEX_TELEMETRY_DISABLE"),
234 "CORTEX_TELEMETRY_SENTRY_DSN=" + os.Getenv("CORTEX_TELEMETRY_SENTRY_DSN"),
235 "CORTEX_TELEMETRY_SEGMENT_WRITE_KEY=" + os.Getenv("CORTEX_TELEMETRY_SEGMENT_WRITE_KEY"),
236 },
237 }
238
239 if sessionToken := awsClient.SessionToken(); sessionToken != nil {
240 containerConfig.Env = append(containerConfig.Env, "AWS_SESSION_TOKEN="+*sessionToken)
241 }
242
243 output, exitCode, err := runManager(containerConfig, true, copyToPaths, copyFromPaths)
244 if err != nil {
245 return "", nil, err
246 }
247
248 return output, exitCode, nil
249}

Callers 3

cluster.goFile · 0.85
cmdDebugFunction · 0.85

Calls 4

runManagerFunction · 0.85
AccessKeyIDMethod · 0.80
SecretAccessKeyMethod · 0.80
SessionTokenMethod · 0.80

Tested by

no test coverage detected