Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tf-build
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benedikt Wildenhain
tf-build
Commits
6b8c791c
Commit
6b8c791c
authored
Dec 3, 2021
by
Austin Anderson
Browse files
Options
Downloads
Patches
Plain Diff
Combine Docker GCR presubmits and also push main to gcr
parent
883b3b8d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.github/workflows/docker-gcr.yml
+0
-72
0 additions, 72 deletions
.github/workflows/docker-gcr.yml
.github/workflows/docker-presubmit.yml
+41
-13
41 additions, 13 deletions
.github/workflows/docker-presubmit.yml
with
41 additions
and
85 deletions
.github/workflows/docker-gcr.yml
deleted
100644 → 0
+
0
−
72
View file @
883b3b8d
name
:
Upload requested containers to gcr.io
on
:
pull_request
:
types
:
[
labeled
]
paths
:
-
'
.github/workflows/docker-gcr.yml'
-
'
tf_sig_build_dockerfiles/**'
-
'
!tf_sig_build_dockerfiles/README.md'
jobs
:
docker
:
if
:
${{ github.event.label.name == 'build and push to gcr.io for staging' }}
runs-on
:
ubuntu-latest
strategy
:
matrix
:
python-version
:
[
python3.7
,
python3.8
,
python3.9
]
steps
:
-
name
:
Checkout
uses
:
actions/checkout@v2
-
name
:
Clear the build-and-push label
uses
:
actions-ecosystem/action-remove-labels@v1
with
:
labels
:
build and push to gcr.io for staging
-
name
:
Set up QEMU
uses
:
docker/setup-qemu-action@v1
-
name
:
Set up Docker Buildx
uses
:
docker/setup-buildx-action@v1
-
name
:
Login to GCR
uses
:
docker/login-action@v1
with
:
registry
:
gcr.io
username
:
_json_key
password
:
${{ secrets.GCP_CREDS }}
-
name
:
Build and push
id
:
docker_build
uses
:
docker/build-push-action@v2
with
:
push
:
true
context
:
./tf_sig_build_dockerfiles
target
:
devel
build-args
:
|
PYTHON_VERSION=${{ matrix.python-version }}
tags
:
|
gcr.io/tensorflow-sigs/build:${{ github.event.number }}-${{ matrix.python-version }}
cache-from
:
|
type=registry,ref=tensorflow/build:latest-${{ matrix.python-version }}
type=registry,ref=gcr.io/tensorflow-sigs/build:${{ github.event.number }}-${{ matrix.python-version }}
cache-to
:
type=inline
-
name
:
Image digest
run
:
echo ${{ steps.docker_build.outputs.digest }}
-
name
:
Add a comment with the pushed containers
uses
:
mshick/add-pr-comment@v1
with
:
repo-token
:
${{ secrets.GITHUB_TOKEN }}
message
:
|
I pushed these containers:
- `gcr.io/tensorflow-sigs/build:${{ github.event.number }}-python3.9`
- `gcr.io/tensorflow-sigs/build:${{ github.event.number }}-python3.8`
- `gcr.io/tensorflow-sigs/build:${{ github.event.number }}-python3.7`
Re-apply the `build and push to gcr.io for staging` label to
rebuild and push again. This comment will only be posted once.
This diff is collapsed.
Click to expand it.
.github/workflows/docker-presubmit.yml
+
41
−
13
View file @
6b8c791c
# Run on pull requests.
name
:
Upload requested containers to gcr.io
# Builds Docker images but doesn't push them anywhere.
name
:
Docker presubmit
on
:
on
:
# Allow manual testing on side braches
workflow_dispatch
:
pull_request
:
pull_request
:
types
:
[
labeled
]
paths
:
paths
:
-
'
.github/workflows/docker-gcr.yml'
-
'
tf_sig_build_dockerfiles/**'
-
'
tf_sig_build_dockerfiles/**'
-
'
!tf_sig_build_dockerfiles/README.md'
-
'
!tf_sig_build_dockerfiles/README.md'
branches
:
-
master
jobs
:
jobs
:
docker
:
docker
:
if
:
${{ github.event.label.name == 'build and push to gcr.io for staging' }}
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
strategy
:
strategy
:
matrix
:
matrix
:
python-version
:
[
python3.7
,
python3.8
,
python3.9
]
python-version
:
[
python3.7
,
python3.8
,
python3.9
]
steps
:
steps
:
-
-
name
:
Checkout
this repository
name
:
Checkout
uses
:
actions/checkout@v2
uses
:
actions/checkout@v2
-
name
:
Clear the build-and-push label
uses
:
actions-ecosystem/action-remove-labels@v1
with
:
labels
:
build and push to gcr.io for staging
-
-
name
:
Set up QEMU
name
:
Set up QEMU
uses
:
docker/setup-qemu-action@v1
uses
:
docker/setup-qemu-action@v1
...
@@ -29,16 +31,42 @@ jobs:
...
@@ -29,16 +31,42 @@ jobs:
name
:
Set up Docker Buildx
name
:
Set up Docker Buildx
uses
:
docker/setup-buildx-action@v1
uses
:
docker/setup-buildx-action@v1
-
-
name
:
Build containers
name
:
Login to GCR
uses
:
docker/login-action@v1
with
:
registry
:
gcr.io
username
:
_json_key
password
:
${{ secrets.GCP_CREDS }}
-
name
:
Build and push
id
:
docker_build
id
:
docker_build
uses
:
docker/build-push-action@v2
uses
:
docker/build-push-action@v2
with
:
with
:
push
:
fals
e
push
:
tru
e
context
:
./tf_sig_build_dockerfiles
context
:
./tf_sig_build_dockerfiles
target
:
devel
target
:
devel
build-args
:
|
build-args
:
|
PYTHON_VERSION=${{ matrix.python-version }}
PYTHON_VERSION=${{ matrix.python-version }}
tags
:
tensorflow/build:latest-${{ matrix.python-version }}
tags
:
|
cache-from
:
type=registry,ref=tensorflow/build:latest-${{ matrix.python-version }}
gcr.io/tensorflow-sigs/build:${{ github.event.number }}-${{ matrix.python-version }}
cache-from
:
|
type=registry,ref=tensorflow/build:latest-${{ matrix.python-version }}
type=registry,ref=gcr.io/tensorflow-sigs/build:${{ github.event.number }}-${{ matrix.python-version }}
cache-to
:
type=inline
cache-to
:
type=inline
-
name
:
Image digest
run
:
echo ${{ steps.docker_build.outputs.digest }}
-
name
:
Add a comment with the pushed containers
uses
:
mshick/add-pr-comment@v1
with
:
repo-token
:
${{ secrets.GITHUB_TOKEN }}
message
:
|
I pushed these containers:
- `gcr.io/tensorflow-sigs/build:${{ github.event.number }}-python3.9`
- `gcr.io/tensorflow-sigs/build:${{ github.event.number }}-python3.8`
- `gcr.io/tensorflow-sigs/build:${{ github.event.number }}-python3.7`
Re-apply the `build and push to gcr.io for staging` label to
rebuild and push again. This comment will only be posted once.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment