Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit e6a2ad8

Browse files
rmistrySkia Commit-Bot
authored and
Skia Commit-Bot
committed
Build and push skia-release and skia-wasm-release docker images
Bug: skia:9514 Change-Id: Ia76a2b233f87b4fc68010fdea8e942498b5986ed Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260397 Reviewed-by: Joe Gregorio <[email protected]> Reviewed-by: Eric Boren <[email protected]> Commit-Queue: Ravi Mistry <[email protected]>
1 parent 21df075 commit e6a2ad8

File tree

4 files changed

+247
-0
lines changed

4 files changed

+247
-0
lines changed

infra/bots/build_task_drivers.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ cd skia
1414

1515
# Build task drivers from the infra repo.
1616
export GOBIN="${1}"
17+
go install -v go.skia.org/infra/infra/bots/task_drivers/build_push_docker_image
1718
go install -v go.skia.org/infra/infra/bots/task_drivers/update_go_deps

infra/bots/gen_tasks_logic/gen_tasks_logic.go

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,44 @@ func (b *builder) updateGoDeps(name string) string {
868868
return name
869869
}
870870

871+
// createDockerImage creates the specified docker image.
872+
func (b *builder) createDockerImage(name, imageName, imageDir string) string {
873+
cipd := append([]*specs.CipdPackage{}, specs.CIPD_PKGS_GIT...)
874+
cipd = append(cipd, b.MustGetCipdPackageFromAsset("go"))
875+
cipd = append(cipd, b.MustGetCipdPackageFromAsset("protoc"))
876+
877+
t := &specs.TaskSpec{
878+
Caches: append(CACHES_GO, CACHES_DOCKER...),
879+
CipdPackages: cipd,
880+
Command: []string{
881+
"./build_push_docker_image",
882+
"--image_name", fmt.Sprintf("gcr.io/skia-public/%s", imageName),
883+
"--dockerfile_dir", imageDir,
884+
"--project_id", "skia-swarming-bots",
885+
"--task_id", specs.PLACEHOLDER_TASK_ID,
886+
"--task_name", name,
887+
"--workdir", ".",
888+
"--gerrit_project", "skia",
889+
"--gerrit_url", "https://skia-review.googlesource.com",
890+
"--repo", specs.PLACEHOLDER_REPO,
891+
"--revision", specs.PLACEHOLDER_REVISION,
892+
"--patch_issue", specs.PLACEHOLDER_ISSUE,
893+
"--patch_set", specs.PLACEHOLDER_PATCHSET,
894+
"--patch_server", specs.PLACEHOLDER_CODEREVIEW_SERVER,
895+
"--alsologtostderr",
896+
},
897+
Dependencies: []string{BUILD_TASK_DRIVERS_NAME},
898+
Dimensions: b.dockerGceDimensions(),
899+
EnvPrefixes: map[string][]string{
900+
"PATH": {"cipd_bin_packages", "cipd_bin_packages/bin", "go/go/bin"},
901+
},
902+
Isolate: "empty.isolate",
903+
ServiceAccount: b.cfg.ServiceAccountCompile,
904+
}
905+
b.MustAddTask(name, t)
906+
return name
907+
}
908+
871909
// isolateAssetConfig represents a task which copies a CIPD package into
872910
// isolate.
873911
type isolateAssetCfg struct {
@@ -1433,6 +1471,15 @@ func (b *builder) process(name string) {
14331471
deps = append(deps, b.updateGoDeps(name))
14341472
}
14351473

1474+
// Create docker image.
1475+
if strings.Contains(name, "CreateDockerImage") {
1476+
if strings.Contains(parts["extra_config"], "Skia_Release") {
1477+
deps = append(deps, b.createDockerImage(name, "skia-release-v2", filepath.Join("docker", "skia-release")))
1478+
} else if strings.Contains(parts["extra_config"], "Skia_WASM_Release") {
1479+
deps = append(deps, b.createDockerImage(name, "skia-wasm-release-v2", filepath.Join("docker", "skia-wasm-release")))
1480+
}
1481+
}
1482+
14361483
// Infra tests.
14371484
if strings.Contains(name, "Housekeeper-PerCommit-InfraTests") {
14381485
deps = append(deps, b.infra(name))
@@ -1467,6 +1514,7 @@ func (b *builder) process(name string) {
14671514
name != "Housekeeper-OnDemand-Presubmit" &&
14681515
name != "Housekeeper-PerCommit" &&
14691516
name != BUILD_TASK_DRIVERS_NAME &&
1517+
!strings.Contains(name, "CreateDockerImage") &&
14701518
!strings.Contains(name, "Android_Framework") &&
14711519
!strings.Contains(name, "G3_Framework") &&
14721520
!strings.Contains(name, "RecreateSKPs") &&

infra/bots/jobs.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@
148148
"Housekeeper-PerCommit-BuildTaskDrivers",
149149
"Housekeeper-PerCommit-BundleRecipes",
150150
"Housekeeper-PerCommit-CheckGeneratedFiles",
151+
"Housekeeper-PerCommit-CreateDockerImage_Skia_Release",
152+
"Housekeeper-PerCommit-CreateDockerImage_Skia_WASM_Release",
151153
"Housekeeper-PerCommit-InfraTests_Linux",
152154
"Housekeeper-PerCommit-InfraTests_Win",
153155
"Housekeeper-PerCommit-IsolateMSKP",

infra/bots/tasks.json

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,16 @@
756756
"Housekeeper-PerCommit-CheckGeneratedFiles"
757757
]
758758
},
759+
"Housekeeper-PerCommit-CreateDockerImage_Skia_Release": {
760+
"tasks": [
761+
"Housekeeper-PerCommit-CreateDockerImage_Skia_Release"
762+
]
763+
},
764+
"Housekeeper-PerCommit-CreateDockerImage_Skia_WASM_Release": {
765+
"tasks": [
766+
"Housekeeper-PerCommit-CreateDockerImage_Skia_WASM_Release"
767+
]
768+
},
759769
"Housekeeper-PerCommit-InfraTests_Linux": {
760770
"tasks": [
761771
"Housekeeper-PerCommit-InfraTests_Linux"
@@ -14125,6 +14135,192 @@
1412514135
"max_attempts": 2,
1412614136
"service_account": "skia-external-compile-tasks@skia-swarming-bots.iam.gserviceaccount.com"
1412714137
},
14138+
"Housekeeper-PerCommit-CreateDockerImage_Skia_Release": {
14139+
"caches": [
14140+
{
14141+
"name": "go_cache",
14142+
"path": "cache/go_cache"
14143+
},
14144+
{
14145+
"name": "gopath",
14146+
"path": "cache/gopath"
14147+
},
14148+
{
14149+
"name": "docker",
14150+
"path": "cache/docker"
14151+
}
14152+
],
14153+
"cipd_packages": [
14154+
{
14155+
"name": "infra/git/${platform}",
14156+
"path": "cipd_bin_packages",
14157+
"version": "version:2.24.0.chromium16"
14158+
},
14159+
{
14160+
"name": "infra/tools/git/${platform}",
14161+
"path": "cipd_bin_packages",
14162+
"version": "git_revision:af7d2ebd14e9bdad51ff1afacbf37f49815ad27b"
14163+
},
14164+
{
14165+
"name": "infra/tools/luci/git-credential-luci/${platform}",
14166+
"path": "cipd_bin_packages",
14167+
"version": "git_revision:af7d2ebd14e9bdad51ff1afacbf37f49815ad27b"
14168+
},
14169+
{
14170+
"name": "skia/bots/go",
14171+
"path": "go",
14172+
"version": "version:8"
14173+
},
14174+
{
14175+
"name": "skia/bots/protoc",
14176+
"path": "protoc",
14177+
"version": "version:0"
14178+
}
14179+
],
14180+
"command": [
14181+
"./build_push_docker_image",
14182+
"--image_name",
14183+
"gcr.io/skia-public/skia-release-v2",
14184+
"--dockerfile_dir",
14185+
"docker/skia-release",
14186+
"--project_id",
14187+
"skia-swarming-bots",
14188+
"--task_id",
14189+
"<(TASK_ID)",
14190+
"--task_name",
14191+
"Housekeeper-PerCommit-CreateDockerImage_Skia_Release",
14192+
"--workdir",
14193+
".",
14194+
"--gerrit_project",
14195+
"skia",
14196+
"--gerrit_url",
14197+
"https://skia-review.googlesource.com",
14198+
"--repo",
14199+
"<(REPO)",
14200+
"--revision",
14201+
"<(REVISION)",
14202+
"--patch_issue",
14203+
"<(ISSUE)",
14204+
"--patch_set",
14205+
"<(PATCHSET)",
14206+
"--patch_server",
14207+
"<(CODEREVIEW_SERVER)",
14208+
"--alsologtostderr"
14209+
],
14210+
"dependencies": [
14211+
"Housekeeper-PerCommit-BuildTaskDrivers"
14212+
],
14213+
"dimensions": [
14214+
"cpu:x86-64-Haswell_GCE",
14215+
"gpu:none",
14216+
"machine_type:n1-standard-16",
14217+
"os:Debian-9.8",
14218+
"pool:Skia",
14219+
"docker_installed:true"
14220+
],
14221+
"env_prefixes": {
14222+
"PATH": [
14223+
"cipd_bin_packages",
14224+
"cipd_bin_packages/bin",
14225+
"go/go/bin"
14226+
]
14227+
},
14228+
"isolate": "empty.isolate",
14229+
"service_account": "skia-external-compile-tasks@skia-swarming-bots.iam.gserviceaccount.com"
14230+
},
14231+
"Housekeeper-PerCommit-CreateDockerImage_Skia_WASM_Release": {
14232+
"caches": [
14233+
{
14234+
"name": "go_cache",
14235+
"path": "cache/go_cache"
14236+
},
14237+
{
14238+
"name": "gopath",
14239+
"path": "cache/gopath"
14240+
},
14241+
{
14242+
"name": "docker",
14243+
"path": "cache/docker"
14244+
}
14245+
],
14246+
"cipd_packages": [
14247+
{
14248+
"name": "infra/git/${platform}",
14249+
"path": "cipd_bin_packages",
14250+
"version": "version:2.24.0.chromium16"
14251+
},
14252+
{
14253+
"name": "infra/tools/git/${platform}",
14254+
"path": "cipd_bin_packages",
14255+
"version": "git_revision:af7d2ebd14e9bdad51ff1afacbf37f49815ad27b"
14256+
},
14257+
{
14258+
"name": "infra/tools/luci/git-credential-luci/${platform}",
14259+
"path": "cipd_bin_packages",
14260+
"version": "git_revision:af7d2ebd14e9bdad51ff1afacbf37f49815ad27b"
14261+
},
14262+
{
14263+
"name": "skia/bots/go",
14264+
"path": "go",
14265+
"version": "version:8"
14266+
},
14267+
{
14268+
"name": "skia/bots/protoc",
14269+
"path": "protoc",
14270+
"version": "version:0"
14271+
}
14272+
],
14273+
"command": [
14274+
"./build_push_docker_image",
14275+
"--image_name",
14276+
"gcr.io/skia-public/skia-wasm-release-v2",
14277+
"--dockerfile_dir",
14278+
"docker/skia-wasm-release",
14279+
"--project_id",
14280+
"skia-swarming-bots",
14281+
"--task_id",
14282+
"<(TASK_ID)",
14283+
"--task_name",
14284+
"Housekeeper-PerCommit-CreateDockerImage_Skia_WASM_Release",
14285+
"--workdir",
14286+
".",
14287+
"--gerrit_project",
14288+
"skia",
14289+
"--gerrit_url",
14290+
"https://skia-review.googlesource.com",
14291+
"--repo",
14292+
"<(REPO)",
14293+
"--revision",
14294+
"<(REVISION)",
14295+
"--patch_issue",
14296+
"<(ISSUE)",
14297+
"--patch_set",
14298+
"<(PATCHSET)",
14299+
"--patch_server",
14300+
"<(CODEREVIEW_SERVER)",
14301+
"--alsologtostderr"
14302+
],
14303+
"dependencies": [
14304+
"Housekeeper-PerCommit-BuildTaskDrivers"
14305+
],
14306+
"dimensions": [
14307+
"cpu:x86-64-Haswell_GCE",
14308+
"gpu:none",
14309+
"machine_type:n1-standard-16",
14310+
"os:Debian-9.8",
14311+
"pool:Skia",
14312+
"docker_installed:true"
14313+
],
14314+
"env_prefixes": {
14315+
"PATH": [
14316+
"cipd_bin_packages",
14317+
"cipd_bin_packages/bin",
14318+
"go/go/bin"
14319+
]
14320+
},
14321+
"isolate": "empty.isolate",
14322+
"service_account": "skia-external-compile-tasks@skia-swarming-bots.iam.gserviceaccount.com"
14323+
},
1412814324
"Housekeeper-PerCommit-InfraTests_Linux": {
1412914325
"caches": [
1413014326
{

0 commit comments

Comments
 (0)