blob: 7497b7beea59194f732d1d701a9db1da5cf7ccf3 [file] [log] [blame]
// changes propertiesObj -> properties_j
local finalizeBuilder(b) = b {
recipe+: {
// Converts a JSON object into a list of '<key>:<value>' strings.
local objToPropertiesJ(obj) = [
key + ':' + std.manifestJsonEx(obj[key], ' ')
for key in std.objectFields(obj)],
// Hide it, its only purpose is to be transformed into properties_j.
propertiesObj+:: {},
properties_j: objToPropertiesJ(self.propertiesObj),
}
};
local builderTmpl = {
execution_timeout_secs: 60 * 60,
dimensions: ['pool:luci.fuchsia.ci'],
swarming_tags: [
'allow_milo:1',
'vpython:native-python-wrapper',
],
recipe: {
cipd_package:
'fuchsia/infra/recipe_bundles/fuchsia.googlesource.com/infra/recipes',
propertiesObj: {
// TODO: we should probably get rid of all of these defaults.
// They end up getting applied to many things where they don't actually
// make sense.
// Keeping for now to maintain parity with old configs.
'manifest': 'fuchsia',
'remote': 'https://fuchsia.googlesource.com/manifest',
'packages': ['topaz/packages/buildbot'],
}
}
};
local autoRollerTmpl = builderTmpl {
execution_timeout_secs: 100 * 60,
dimensions+: ['os:Linux'],
recipe+: {
name: 'fuchsia_roller',
propertiesObj+: {
poll_timeout_secs: 5400,
'$kitchen': {
git_auth: true
},
},
},
};
local THIRD_PARTY_ROLLER_SERVICE_ACCOUNT =
'third-party-roller@fuchsia-infra.iam.gserviceaccount.com';
local buildRoller = autoRollerTmpl {
category: 'Build',
name: 'build-roller',
recipe+: {
propertiesObj+: {
project: 'garnet',
remote: 'https://fuchsia.googlesource.com/garnet',
manifest: 'manifest/minimal',
import_in: 'manifest/garnet',
import_from: 'build',
}
},
service_account: THIRD_PARTY_ROLLER_SERVICE_ACCOUNT,
};
local buildtoolsRoller = autoRollerTmpl {
category: 'Build',
name: 'buildtools-roller',
recipe+: {
propertiesObj+: {
project: 'garnet',
remote: 'https://fuchsia.googlesource.com/garnet',
manifest: 'manifest/minimal',
import_in: 'manifest/garnet',
import_from: 'buildtools',
},
},
service_account: THIRD_PARTY_ROLLER_SERVICE_ACCOUNT,
};
local cobaltConfigRoller = autoRollerTmpl {
category: 'Cobalt',
name: 'cobalt-config-roller',
recipe+: {
propertiesObj+: {
project: 'garnet',
remote: 'https://fuchsia.googlesource.com/garnet',
manifest: 'manifest/minimal',
roll_type: 'project',
import_in: 'manifest/third_party',
import_from: 'cobalt_config',
},
},
service_account: THIRD_PARTY_ROLLER_SERVICE_ACCOUNT,
};
local makeLayerRoller(fromLayer, toLayer) = autoRollerTmpl {
category: std.asciiUpper(fromLayer)[0] + fromLayer[1:],
name: fromLayer + '-roller',
recipe+: {
propertiesObj+: {
project: toLayer,
remote: 'https://fuchsia.googlesource.com/' + toLayer,
manifest: 'manifest/' + toLayer,
import_in: 'manifest/' + toLayer,
import_from: fromLayer,
},
},
service_account: fromLayer + '-roller@fuchsia-infra.iam.gserviceaccount.com',
};
local garnetRoller = makeLayerRoller('garnet', 'peridot');
local peridotRoller = makeLayerRoller('peridot', 'topaz');
local zirconRoller = makeLayerRoller('zircon', 'garnet');
local scriptsRoller = autoRollerTmpl {
category: 'Scripts',
name: 'scripts-roller',
recipe+: {
propertiesObj+: {
project: 'garnet',
remote: 'https://fuchsia.googlesource.com/garnet',
manifest: 'manifest/minimal',
import_in: 'manifest/garnet',
import_from: 'scripts',
},
},
service_account: THIRD_PARTY_ROLLER_SERVICE_ACCOUNT,
};
local dartFlutterRoller = autoRollerTmpl {
category: 'Third Party',
name: 'dart-flutter-roller',
recipe+: {
name: 'dart_flutter_roller',
},
service_account: THIRD_PARTY_ROLLER_SERVICE_ACCOUNT,
};
local dartPkgRoller = autoRollerTmpl {
category: 'Third Party',
name: 'dart-pkg-roller',
recipe+: {
propertiesObj+: {
project: 'topaz',
remote: 'https://fuchsia.googlesource.com/topaz',
manifest: 'manifest/minimal',
import_in: 'manifest/dart',
import_from: 'third_party/dart-pkg',
},
},
service_account: THIRD_PARTY_ROLLER_SERVICE_ACCOUNT,
};
local dartPkgUpdater = autoRollerTmpl {
category: 'Third Party',
name: 'dart-pkg-updater',
recipe+: {
name: 'dart_pkg_roller',
},
service_account: THIRD_PARTY_ROLLER_SERVICE_ACCOUNT,
};
local makeGarnetThirdPartyRoller(name, import_from, roll_type=null) =
autoRollerTmpl {
category: 'Third Party',
name: name,
recipe+: {
propertiesObj+: {
project: 'garnet',
remote: 'https://fuchsia.googlesource.com/garnet',
manifest: 'manifest/minimal',
import_in: 'manifest/third_party',
import_from: import_from,
[if roll_type != null then 'roll_type']: roll_type,
},
},
service_account: THIRD_PARTY_ROLLER_SERVICE_ACCOUNT,
};
local netstackRoller = makeGarnetThirdPartyRoller(
'netstack-roller', 'third_party/netstack');
local crAngleRoller = makeGarnetThirdPartyRoller(
'cr-angle-roller', 'third_party/angle', roll_type='project');
local crCatapultRoller = makeGarnetThirdPartyRoller(
'cr-catapult-roller', 'external/github.com/catapult-project/catapult',
roll_type='project');
local netstackRoller = makeGarnetThirdPartyRoller(
'netstack-roller', 'third_party/netstack');
local syzkallerRoller = makeGarnetThirdPartyRoller(
'syzkaller-roller', 'third_party/syzkaller');
{
builders: [finalizeBuilder(b) for b in [
buildRoller,
buildtoolsRoller,
cobaltConfigRoller,
crAngleRoller,
crCatapultRoller,
dartFlutterRoller,
dartPkgRoller,
dartPkgUpdater,
garnetRoller,
netstackRoller,
peridotRoller,
scriptsRoller,
syzkallerRoller,
zirconRoller,
]],
}