Change AutoPilot for CI settings
Replaces the settings at one scope. A null field inherits from the wider scope. max_cores, allowed_os, allowed_arch and allow_gpu limit the runners AutoPilot may choose and can only narrow: the smallest max_cores, the overlap of the lists and allow_gpu false at any scope apply. A job whose default runner is outside them keeps its default. pin lists what jobs must run on: providers (beam, blacksmith), runner labels (ubicloud-standard-8, a cluster runner set label) or sandbox sizes as provider:size (beam:sandbox-8c-32g). The policy picks among the pinned runners that fit the job, without having to beat the default runner, which runs the job only when no pinned runner can. A pinned provider must also be allowed, and an entry that is not a known provider or runner is rejected. An empty list clears an inherited pin; a pin set in the workflow file overrides it. fallback_target is one of your connected sandboxes (a sandbox target from the providers list); a job on a costgraph= runner label that no runner picked up within fallback_after_seconds (300 when unset) runs there. baseline_label is the runner savings of costgraph= jobs are measured against. These three are set in CostGraph only, never in the workflow file. usage_capture false stops the runners AutoPilot launches from measuring CPU and memory; the narrowest scope that sets it wins, and it is on when none does.
curl --request PUT \
--url https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>' \
--data '
{
"pin": [
"beam"
],
"allow_gpu": true,
"allowed_arch": [
"<string>"
],
"allowed_os": [
"<string>"
],
"allowed_providers": [
"<string>"
],
"baseline_label": "ubuntu-latest",
"enabled": true,
"fallback_after_seconds": 61,
"fallback_target": "costgraph:microsandbox:fpc_OQFtLP2fwuDh2Q82",
"max_cores": 2,
"paused_until": "<string>",
"release": true,
"repository": "baselinehq/backend",
"usage_capture": true,
"workflow_path": ".github/workflows/ci.yml"
}
'import requests
url = "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings"
payload = {
"pin": ["beam"],
"allow_gpu": True,
"allowed_arch": ["<string>"],
"allowed_os": ["<string>"],
"allowed_providers": ["<string>"],
"baseline_label": "ubuntu-latest",
"enabled": True,
"fallback_after_seconds": 61,
"fallback_target": "costgraph:microsandbox:fpc_OQFtLP2fwuDh2Q82",
"max_cores": 2,
"paused_until": "<string>",
"release": True,
"repository": "baselinehq/backend",
"usage_capture": True,
"workflow_path": ".github/workflows/ci.yml"
}
headers = {
"X-CostGraph-Tenant-ID": "<x-costgraph-tenant-id>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-CostGraph-Tenant-ID': '<x-costgraph-tenant-id>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
pin: ['beam'],
allow_gpu: true,
allowed_arch: ['<string>'],
allowed_os: ['<string>'],
allowed_providers: ['<string>'],
baseline_label: 'ubuntu-latest',
enabled: true,
fallback_after_seconds: 61,
fallback_target: 'costgraph:microsandbox:fpc_OQFtLP2fwuDh2Q82',
max_cores: 2,
paused_until: '<string>',
release: true,
repository: 'baselinehq/backend',
usage_capture: true,
workflow_path: '.github/workflows/ci.yml'
})
};
fetch('https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'pin' => [
'beam'
],
'allow_gpu' => true,
'allowed_arch' => [
'<string>'
],
'allowed_os' => [
'<string>'
],
'allowed_providers' => [
'<string>'
],
'baseline_label' => 'ubuntu-latest',
'enabled' => true,
'fallback_after_seconds' => 61,
'fallback_target' => 'costgraph:microsandbox:fpc_OQFtLP2fwuDh2Q82',
'max_cores' => 2,
'paused_until' => '<string>',
'release' => true,
'repository' => 'baselinehq/backend',
'usage_capture' => true,
'workflow_path' => '.github/workflows/ci.yml'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings"
payload := strings.NewReader("{\n \"pin\": [\n \"beam\"\n ],\n \"allow_gpu\": true,\n \"allowed_arch\": [\n \"<string>\"\n ],\n \"allowed_os\": [\n \"<string>\"\n ],\n \"allowed_providers\": [\n \"<string>\"\n ],\n \"baseline_label\": \"ubuntu-latest\",\n \"enabled\": true,\n \"fallback_after_seconds\": 61,\n \"fallback_target\": \"costgraph:microsandbox:fpc_OQFtLP2fwuDh2Q82\",\n \"max_cores\": 2,\n \"paused_until\": \"<string>\",\n \"release\": true,\n \"repository\": \"baselinehq/backend\",\n \"usage_capture\": true,\n \"workflow_path\": \".github/workflows/ci.yml\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings")
.header("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"pin\": [\n \"beam\"\n ],\n \"allow_gpu\": true,\n \"allowed_arch\": [\n \"<string>\"\n ],\n \"allowed_os\": [\n \"<string>\"\n ],\n \"allowed_providers\": [\n \"<string>\"\n ],\n \"baseline_label\": \"ubuntu-latest\",\n \"enabled\": true,\n \"fallback_after_seconds\": 61,\n \"fallback_target\": \"costgraph:microsandbox:fpc_OQFtLP2fwuDh2Q82\",\n \"max_cores\": 2,\n \"paused_until\": \"<string>\",\n \"release\": true,\n \"repository\": \"baselinehq/backend\",\n \"usage_capture\": true,\n \"workflow_path\": \".github/workflows/ci.yml\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-CostGraph-Tenant-ID"] = '<x-costgraph-tenant-id>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pin\": [\n \"beam\"\n ],\n \"allow_gpu\": true,\n \"allowed_arch\": [\n \"<string>\"\n ],\n \"allowed_os\": [\n \"<string>\"\n ],\n \"allowed_providers\": [\n \"<string>\"\n ],\n \"baseline_label\": \"ubuntu-latest\",\n \"enabled\": true,\n \"fallback_after_seconds\": 61,\n \"fallback_target\": \"costgraph:microsandbox:fpc_OQFtLP2fwuDh2Q82\",\n \"max_cores\": 2,\n \"paused_until\": \"<string>\",\n \"release\": true,\n \"repository\": \"baselinehq/backend\",\n \"usage_capture\": true,\n \"workflow_path\": \".github/workflows/ci.yml\"\n}"
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"fork_label_workflows": [
{
"last_seen": "<string>",
"repository": "<string>",
"workflow_path": "<string>"
}
],
"effective": {
"allow_gpu": true,
"allowed_arch": [
"<string>"
],
"allowed_os": [
"<string>"
],
"allowed_providers": [
"<string>"
],
"baseline_label": "<string>",
"enabled": true,
"fallback_after_seconds": 123,
"fallback_target": "<string>",
"max_cores": 123,
"paused_until": "<string>",
"pin": [
"<string>"
],
"policy": "cheapest",
"release": true,
"usage_capture": true
},
"inherited_from": {},
"own": {
"allow_gpu": true,
"allowed_arch": [
"<string>"
],
"allowed_os": [
"<string>"
],
"allowed_providers": [
"<string>"
],
"baseline_label": "<string>",
"enabled": true,
"fallback_after_seconds": 123,
"fallback_target": "<string>",
"max_cores": 123,
"paused_until": "<string>",
"pin": [
"<string>"
],
"policy": "cheapest",
"release": true,
"usage_capture": true
},
"repository": "<string>",
"workflow_path": "<string>"
}
}{
"message": "some message",
"status": "error"
}{
"code": "subscription_required",
"message": "some message",
"status": "error"
}Body
Scope and settings
Was this page helpful?
curl --request PUT \
--url https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>' \
--data '
{
"pin": [
"beam"
],
"allow_gpu": true,
"allowed_arch": [
"<string>"
],
"allowed_os": [
"<string>"
],
"allowed_providers": [
"<string>"
],
"baseline_label": "ubuntu-latest",
"enabled": true,
"fallback_after_seconds": 61,
"fallback_target": "costgraph:microsandbox:fpc_OQFtLP2fwuDh2Q82",
"max_cores": 2,
"paused_until": "<string>",
"release": true,
"repository": "baselinehq/backend",
"usage_capture": true,
"workflow_path": ".github/workflows/ci.yml"
}
'import requests
url = "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings"
payload = {
"pin": ["beam"],
"allow_gpu": True,
"allowed_arch": ["<string>"],
"allowed_os": ["<string>"],
"allowed_providers": ["<string>"],
"baseline_label": "ubuntu-latest",
"enabled": True,
"fallback_after_seconds": 61,
"fallback_target": "costgraph:microsandbox:fpc_OQFtLP2fwuDh2Q82",
"max_cores": 2,
"paused_until": "<string>",
"release": True,
"repository": "baselinehq/backend",
"usage_capture": True,
"workflow_path": ".github/workflows/ci.yml"
}
headers = {
"X-CostGraph-Tenant-ID": "<x-costgraph-tenant-id>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-CostGraph-Tenant-ID': '<x-costgraph-tenant-id>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
pin: ['beam'],
allow_gpu: true,
allowed_arch: ['<string>'],
allowed_os: ['<string>'],
allowed_providers: ['<string>'],
baseline_label: 'ubuntu-latest',
enabled: true,
fallback_after_seconds: 61,
fallback_target: 'costgraph:microsandbox:fpc_OQFtLP2fwuDh2Q82',
max_cores: 2,
paused_until: '<string>',
release: true,
repository: 'baselinehq/backend',
usage_capture: true,
workflow_path: '.github/workflows/ci.yml'
})
};
fetch('https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'pin' => [
'beam'
],
'allow_gpu' => true,
'allowed_arch' => [
'<string>'
],
'allowed_os' => [
'<string>'
],
'allowed_providers' => [
'<string>'
],
'baseline_label' => 'ubuntu-latest',
'enabled' => true,
'fallback_after_seconds' => 61,
'fallback_target' => 'costgraph:microsandbox:fpc_OQFtLP2fwuDh2Q82',
'max_cores' => 2,
'paused_until' => '<string>',
'release' => true,
'repository' => 'baselinehq/backend',
'usage_capture' => true,
'workflow_path' => '.github/workflows/ci.yml'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings"
payload := strings.NewReader("{\n \"pin\": [\n \"beam\"\n ],\n \"allow_gpu\": true,\n \"allowed_arch\": [\n \"<string>\"\n ],\n \"allowed_os\": [\n \"<string>\"\n ],\n \"allowed_providers\": [\n \"<string>\"\n ],\n \"baseline_label\": \"ubuntu-latest\",\n \"enabled\": true,\n \"fallback_after_seconds\": 61,\n \"fallback_target\": \"costgraph:microsandbox:fpc_OQFtLP2fwuDh2Q82\",\n \"max_cores\": 2,\n \"paused_until\": \"<string>\",\n \"release\": true,\n \"repository\": \"baselinehq/backend\",\n \"usage_capture\": true,\n \"workflow_path\": \".github/workflows/ci.yml\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings")
.header("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"pin\": [\n \"beam\"\n ],\n \"allow_gpu\": true,\n \"allowed_arch\": [\n \"<string>\"\n ],\n \"allowed_os\": [\n \"<string>\"\n ],\n \"allowed_providers\": [\n \"<string>\"\n ],\n \"baseline_label\": \"ubuntu-latest\",\n \"enabled\": true,\n \"fallback_after_seconds\": 61,\n \"fallback_target\": \"costgraph:microsandbox:fpc_OQFtLP2fwuDh2Q82\",\n \"max_cores\": 2,\n \"paused_until\": \"<string>\",\n \"release\": true,\n \"repository\": \"baselinehq/backend\",\n \"usage_capture\": true,\n \"workflow_path\": \".github/workflows/ci.yml\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/ci/autopilot/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-CostGraph-Tenant-ID"] = '<x-costgraph-tenant-id>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pin\": [\n \"beam\"\n ],\n \"allow_gpu\": true,\n \"allowed_arch\": [\n \"<string>\"\n ],\n \"allowed_os\": [\n \"<string>\"\n ],\n \"allowed_providers\": [\n \"<string>\"\n ],\n \"baseline_label\": \"ubuntu-latest\",\n \"enabled\": true,\n \"fallback_after_seconds\": 61,\n \"fallback_target\": \"costgraph:microsandbox:fpc_OQFtLP2fwuDh2Q82\",\n \"max_cores\": 2,\n \"paused_until\": \"<string>\",\n \"release\": true,\n \"repository\": \"baselinehq/backend\",\n \"usage_capture\": true,\n \"workflow_path\": \".github/workflows/ci.yml\"\n}"
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"fork_label_workflows": [
{
"last_seen": "<string>",
"repository": "<string>",
"workflow_path": "<string>"
}
],
"effective": {
"allow_gpu": true,
"allowed_arch": [
"<string>"
],
"allowed_os": [
"<string>"
],
"allowed_providers": [
"<string>"
],
"baseline_label": "<string>",
"enabled": true,
"fallback_after_seconds": 123,
"fallback_target": "<string>",
"max_cores": 123,
"paused_until": "<string>",
"pin": [
"<string>"
],
"policy": "cheapest",
"release": true,
"usage_capture": true
},
"inherited_from": {},
"own": {
"allow_gpu": true,
"allowed_arch": [
"<string>"
],
"allowed_os": [
"<string>"
],
"allowed_providers": [
"<string>"
],
"baseline_label": "<string>",
"enabled": true,
"fallback_after_seconds": 123,
"fallback_target": "<string>",
"max_cores": 123,
"paused_until": "<string>",
"pin": [
"<string>"
],
"policy": "cheapest",
"release": true,
"usage_capture": true
},
"repository": "<string>",
"workflow_path": "<string>"
}
}{
"message": "some message",
"status": "error"
}{
"code": "subscription_required",
"message": "some message",
"status": "error"
}