Skip to content

Commit

Permalink
Build and push skia-release and skia-wasm-release docker images
Browse files Browse the repository at this point in the history
Bug: skia:9514
Change-Id: Ia76a2b233f87b4fc68010fdea8e942498b5986ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260397
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
  • Loading branch information
rmistry authored and Skia Commit-Bot committed Dec 18, 2019
1 parent 21df075 commit e6a2ad8
Show file tree
Hide file tree
Showing 4 changed files with 247 additions and 0 deletions.
1 change: 1 addition & 0 deletions infra/bots/build_task_drivers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ cd skia

# Build task drivers from the infra repo.
export GOBIN="${1}"
go install -v go.skia.org/infra/infra/bots/task_drivers/build_push_docker_image
go install -v go.skia.org/infra/infra/bots/task_drivers/update_go_deps
48 changes: 48 additions & 0 deletions infra/bots/gen_tasks_logic/gen_tasks_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,44 @@ func (b *builder) updateGoDeps(name string) string {
return name
}

// createDockerImage creates the specified docker image.
func (b *builder) createDockerImage(name, imageName, imageDir string) string {
cipd := append([]*specs.CipdPackage{}, specs.CIPD_PKGS_GIT...)
cipd = append(cipd, b.MustGetCipdPackageFromAsset("go"))
cipd = append(cipd, b.MustGetCipdPackageFromAsset("protoc"))

t := &specs.TaskSpec{
Caches: append(CACHES_GO, CACHES_DOCKER...),
CipdPackages: cipd,
Command: []string{
"./build_push_docker_image",
"--image_name", fmt.Sprintf("gcr.io/skia-public/%s", imageName),
"--dockerfile_dir", imageDir,
"--project_id", "skia-swarming-bots",
"--task_id", specs.PLACEHOLDER_TASK_ID,
"--task_name", name,
"--workdir", ".",
"--gerrit_project", "skia",
"--gerrit_url", "https://skia-review.googlesource.com",
"--repo", specs.PLACEHOLDER_REPO,
"--revision", specs.PLACEHOLDER_REVISION,
"--patch_issue", specs.PLACEHOLDER_ISSUE,
"--patch_set", specs.PLACEHOLDER_PATCHSET,
"--patch_server", specs.PLACEHOLDER_CODEREVIEW_SERVER,
"--alsologtostderr",
},
Dependencies: []string{BUILD_TASK_DRIVERS_NAME},
Dimensions: b.dockerGceDimensions(),
EnvPrefixes: map[string][]string{
"PATH": {"cipd_bin_packages", "cipd_bin_packages/bin", "go/go/bin"},
},
Isolate: "empty.isolate",
ServiceAccount: b.cfg.ServiceAccountCompile,
}
b.MustAddTask(name, t)
return name
}

// isolateAssetConfig represents a task which copies a CIPD package into
// isolate.
type isolateAssetCfg struct {
Expand Down Expand Up @@ -1433,6 +1471,15 @@ func (b *builder) process(name string) {
deps = append(deps, b.updateGoDeps(name))
}

// Create docker image.
if strings.Contains(name, "CreateDockerImage") {
if strings.Contains(parts["extra_config"], "Skia_Release") {
deps = append(deps, b.createDockerImage(name, "skia-release-v2", filepath.Join("docker", "skia-release")))
} else if strings.Contains(parts["extra_config"], "Skia_WASM_Release") {
deps = append(deps, b.createDockerImage(name, "skia-wasm-release-v2", filepath.Join("docker", "skia-wasm-release")))
}
}

// Infra tests.
if strings.Contains(name, "Housekeeper-PerCommit-InfraTests") {
deps = append(deps, b.infra(name))
Expand Down Expand Up @@ -1467,6 +1514,7 @@ func (b *builder) process(name string) {
name != "Housekeeper-OnDemand-Presubmit" &&
name != "Housekeeper-PerCommit" &&
name != BUILD_TASK_DRIVERS_NAME &&
!strings.Contains(name, "CreateDockerImage") &&
!strings.Contains(name, "Android_Framework") &&
!strings.Contains(name, "G3_Framework") &&
!strings.Contains(name, "RecreateSKPs") &&
Expand Down
2 changes: 2 additions & 0 deletions infra/bots/jobs.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@
"Housekeeper-PerCommit-BuildTaskDrivers",
"Housekeeper-PerCommit-BundleRecipes",
"Housekeeper-PerCommit-CheckGeneratedFiles",
"Housekeeper-PerCommit-CreateDockerImage_Skia_Release",
"Housekeeper-PerCommit-CreateDockerImage_Skia_WASM_Release",
"Housekeeper-PerCommit-InfraTests_Linux",
"Housekeeper-PerCommit-InfraTests_Win",
"Housekeeper-PerCommit-IsolateMSKP",
Expand Down
196 changes: 196 additions & 0 deletions infra/bots/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,16 @@
"Housekeeper-PerCommit-CheckGeneratedFiles"
]
},
"Housekeeper-PerCommit-CreateDockerImage_Skia_Release": {
"tasks": [
"Housekeeper-PerCommit-CreateDockerImage_Skia_Release"
]
},
"Housekeeper-PerCommit-CreateDockerImage_Skia_WASM_Release": {
"tasks": [
"Housekeeper-PerCommit-CreateDockerImage_Skia_WASM_Release"
]
},
"Housekeeper-PerCommit-InfraTests_Linux": {
"tasks": [
"Housekeeper-PerCommit-InfraTests_Linux"
Expand Down Expand Up @@ -14125,6 +14135,192 @@
"max_attempts": 2,
"service_account": "skia-external-compile-tasks@skia-swarming-bots.iam.gserviceaccount.com"
},
"Housekeeper-PerCommit-CreateDockerImage_Skia_Release": {
"caches": [
{
"name": "go_cache",
"path": "cache/go_cache"
},
{
"name": "gopath",
"path": "cache/gopath"
},
{
"name": "docker",
"path": "cache/docker"
}
],
"cipd_packages": [
{
"name": "infra/git/${platform}",
"path": "cipd_bin_packages",
"version": "version:2.24.0.chromium16"
},
{
"name": "infra/tools/git/${platform}",
"path": "cipd_bin_packages",
"version": "git_revision:af7d2ebd14e9bdad51ff1afacbf37f49815ad27b"
},
{
"name": "infra/tools/luci/git-credential-luci/${platform}",
"path": "cipd_bin_packages",
"version": "git_revision:af7d2ebd14e9bdad51ff1afacbf37f49815ad27b"
},
{
"name": "skia/bots/go",
"path": "go",
"version": "version:8"
},
{
"name": "skia/bots/protoc",
"path": "protoc",
"version": "version:0"
}
],
"command": [
"./build_push_docker_image",
"--image_name",
"gcr.io/skia-public/skia-release-v2",
"--dockerfile_dir",
"docker/skia-release",
"--project_id",
"skia-swarming-bots",
"--task_id",
"<(TASK_ID)",
"--task_name",
"Housekeeper-PerCommit-CreateDockerImage_Skia_Release",
"--workdir",
".",
"--gerrit_project",
"skia",
"--gerrit_url",
"https://skia-review.googlesource.com",
"--repo",
"<(REPO)",
"--revision",
"<(REVISION)",
"--patch_issue",
"<(ISSUE)",
"--patch_set",
"<(PATCHSET)",
"--patch_server",
"<(CODEREVIEW_SERVER)",
"--alsologtostderr"
],
"dependencies": [
"Housekeeper-PerCommit-BuildTaskDrivers"
],
"dimensions": [
"cpu:x86-64-Haswell_GCE",
"gpu:none",
"machine_type:n1-standard-16",
"os:Debian-9.8",
"pool:Skia",
"docker_installed:true"
],
"env_prefixes": {
"PATH": [
"cipd_bin_packages",
"cipd_bin_packages/bin",
"go/go/bin"
]
},
"isolate": "empty.isolate",
"service_account": "skia-external-compile-tasks@skia-swarming-bots.iam.gserviceaccount.com"
},
"Housekeeper-PerCommit-CreateDockerImage_Skia_WASM_Release": {
"caches": [
{
"name": "go_cache",
"path": "cache/go_cache"
},
{
"name": "gopath",
"path": "cache/gopath"
},
{
"name": "docker",
"path": "cache/docker"
}
],
"cipd_packages": [
{
"name": "infra/git/${platform}",
"path": "cipd_bin_packages",
"version": "version:2.24.0.chromium16"
},
{
"name": "infra/tools/git/${platform}",
"path": "cipd_bin_packages",
"version": "git_revision:af7d2ebd14e9bdad51ff1afacbf37f49815ad27b"
},
{
"name": "infra/tools/luci/git-credential-luci/${platform}",
"path": "cipd_bin_packages",
"version": "git_revision:af7d2ebd14e9bdad51ff1afacbf37f49815ad27b"
},
{
"name": "skia/bots/go",
"path": "go",
"version": "version:8"
},
{
"name": "skia/bots/protoc",
"path": "protoc",
"version": "version:0"
}
],
"command": [
"./build_push_docker_image",
"--image_name",
"gcr.io/skia-public/skia-wasm-release-v2",
"--dockerfile_dir",
"docker/skia-wasm-release",
"--project_id",
"skia-swarming-bots",
"--task_id",
"<(TASK_ID)",
"--task_name",
"Housekeeper-PerCommit-CreateDockerImage_Skia_WASM_Release",
"--workdir",
".",
"--gerrit_project",
"skia",
"--gerrit_url",
"https://skia-review.googlesource.com",
"--repo",
"<(REPO)",
"--revision",
"<(REVISION)",
"--patch_issue",
"<(ISSUE)",
"--patch_set",
"<(PATCHSET)",
"--patch_server",
"<(CODEREVIEW_SERVER)",
"--alsologtostderr"
],
"dependencies": [
"Housekeeper-PerCommit-BuildTaskDrivers"
],
"dimensions": [
"cpu:x86-64-Haswell_GCE",
"gpu:none",
"machine_type:n1-standard-16",
"os:Debian-9.8",
"pool:Skia",
"docker_installed:true"
],
"env_prefixes": {
"PATH": [
"cipd_bin_packages",
"cipd_bin_packages/bin",
"go/go/bin"
]
},
"isolate": "empty.isolate",
"service_account": "skia-external-compile-tasks@skia-swarming-bots.iam.gserviceaccount.com"
},
"Housekeeper-PerCommit-InfraTests_Linux": {
"caches": [
{
Expand Down

0 comments on commit e6a2ad8

Please sign in to comment.