-
Notifications
You must be signed in to change notification settings - Fork 13
94 lines (90 loc) · 4.71 KB
/
update-rbe.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# This Workflow updates tensorflow/tools/toolchains/remote_config/configs.bzl
# to reference the most recent versions of the SIG Build Docker images.
name: Update RBE Configs
on:
workflow_dispatch:
jobs:
rbe:
name: Update RBE Configs
runs-on: ubuntu-latest
if: github.repository == 'tensorflow/tensorflow' # Don't do this in forks
steps:
- name: Checkout code
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
- name: Update the RBE Configs
run: |
function map() {
# The "digest" that allows us to pull an image is not the digest as
# returned by the API, but a sha256sum of the entire chunk of image
# metadata. gcr.io helpfully includes it in the header of the response
# as docker-content-digest: sha256:[digest]. Note we use egrep to
# match exactly sha256:<hash> because curl may include a ^M symbol at
# the end of the line.
# See https://cloud.google.com/architecture/using-container-images#exploring_image_manifests_digests_and_tags
echo -n "Trying to map name $1 to tag $2... "
digest=$(curl -s --head "https://gcr.io/v2/tensorflow-sigs/build/manifests/$2" | egrep -o "sha256:[[:alnum:]]*")
# Find the line matching the regex "sigbuild-r2.9" (with quotes) and
# replace just the digest portion in it
sed -i"" "/\"$1\"/ s/sha256:[[:alnum:]]*/$digest/g" tensorflow/tools/toolchains/remote_config/configs.bzl
echo "success."
}
# See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/toolchains/remote_config/configs.bzl
# This is a mapping of name_container_map keys under sigbuild_tf_configs
# to tag names on gcr.io/tensorflow-sigs/build.
# TF 2.9
map sigbuild-r2.9 2.9-python3.9
map sigbuild-r2.9-python3.8 2.9-python3.8
map sigbuild-r2.9-python3.9 2.9-python3.9
map sigbuild-r2.9-python3.10 2.9-python3.10
# TF 2.10
map sigbuild-r2.10 2.10-python3.9
map sigbuild-r2.10-python3.8 2.10-python3.8
map sigbuild-r2.10-python3.9 2.10-python3.9
map sigbuild-r2.10-python3.10 2.10-python3.10
# TF 2.11
map sigbuild-r2.11 2.11-python3.9
map sigbuild-r2.11-python3.8 2.11-python3.8
map sigbuild-r2.11-python3.9 2.11-python3.9
map sigbuild-r2.11-python3.10 2.11-python3.10
# WIP Clang Containers, used by TVCs
map sigbuild-57469 57469-python3.9
map sigbuild-57469-python3.8 57469-python3.8
map sigbuild-57469-python3.9 57469-python3.9
map sigbuild-57469-python3.10 57469-python3.10
# TF 2.12
map sigbuild-r2.12 2.12-python3.9
map sigbuild-r2.12-python3.8 2.12-python3.8
map sigbuild-r2.12-python3.9 2.12-python3.9
map sigbuild-r2.12-python3.10 2.12-python3.10
map sigbuild-r2.12-python3.11 2.12-python3.11
# TF 2.12 + Clang (containers are the same, but env vars in configs.bzl are different)
map sigbuild-r2.12-clang 2.12-python3.9
map sigbuild-r2.12-clang-python3.8 2.12-python3.8
map sigbuild-r2.12-clang-python3.9 2.12-python3.9
map sigbuild-r2.12-clang-python3.10 2.12-python3.10
map sigbuild-r2.12-clang-python3.11 2.12-python3.11
- name: Create Pull Request with changes
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3
with:
title: Update the RBE images to the latest container versions
committer: TensorFlow Release Automation <[email protected]>
token: ${{ secrets.JENKINS_TOKEN }}
reviewers: angerson,mihaimaruseac,learning-to-play,nitins17
body: |
This PR was created by a GitHub Actions workflow to update all the SIG Build-based RBE containers to the most recent containers. See:
- https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/toolchains/remote_config/configs.bzl
- https://github.com/tensorflow/tensorflow/blob/master/.github/workflows/update-rbe.yml