forked from kubeflow/kubeflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scripts for replicating Docker images using GCB to support private GK…
…E and VPC service controls. (kubeflow#3080) * Scripts for replicating Docker images using GCB to support private GKE and VPC service controls. * With private GKE we can't pull docker images from non-GCR registries (e.g. quoay) * To support private GKE clusters we want to make it easy for users to mirror Kubeflow images to their own registry * We create a GCB workflow to retag Kubeflow images * Using GCB is advantageous because it avoids pulling the networks over the user's network. * Update the script to update the Kubeflow components to use the images in the user's registry. * The kubeflow cluster isn't fully accessible yet. looks like pipelines and some other components still have images that need to be ported over. Related to kubeflow#2086 * Update the images.
- Loading branch information
1 parent
671c09f
commit 3f3783e
Showing
4 changed files
with
145 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#--ext-str imageBase=$(IMG) \ | ||
# --ext-str gitVersion=$(GIT_VERSION) --ext-str tag=$(TAG) \ | ||
# --ext-str useImageCache=$(USE_IMAGE_CACHE) \ | ||
PROJECT ?= cloud-ml-dev | ||
NEW_REGISTRY ?= gcr.io/$(PROJECT) | ||
|
||
build-gcb-spec: gcb_copy_images.jsonnet | ||
rm -rf ./build | ||
mkdir -p build | ||
jsonnet ./gcb_copy_images.jsonnet --ext-str newRegistry=$(NEW_REGISTRY) \ | ||
> ./build/gcb_copy_images.json | ||
|
||
copy-gcb: build-gcb-spec | ||
gcloud builds submit --machine-type=n1-highcpu-32 --project=$(PROJECT) --config=./build/gcb_copy_images.json \ | ||
--timeout=3600 --no-source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// This is a jsonnet file to generate a GCB workflow to copy Kubeflow docker images to a personal GCR registry. | ||
// | ||
// The primary purpose of this workflow is to copy Docker images hosted outside of GCR to a | ||
// a GCR registry so they can be used with private GKE clusters. | ||
{ | ||
|
||
// The newRegistry for the image | ||
local newRegistry = std.extVar("newRegistry"), | ||
|
||
// A template for defining the steps to retag each image. | ||
local subGraphTemplate(image) = { | ||
local imagePieces = std.split(image, "/"), | ||
local nameAndTag = std.split(imagePieces[std.length(imagePieces) -1], ":"), | ||
|
||
local name = nameAndTag[0], | ||
|
||
local template = self, | ||
|
||
local newImage = std.join("/", [newRegistry] + imagePieces[1:]), | ||
|
||
images+: [newImage], | ||
|
||
local pullName = "pull-" + name, | ||
steps+: [ | ||
{ | ||
id: pullName, | ||
name: "gcr.io/cloud-builders/docker", | ||
args: ["pull", image], | ||
waitFor: ["-"], | ||
}, | ||
{ | ||
id: "tag-" + name, | ||
name: "gcr.io/cloud-builders/docker", | ||
args: ["tag", image, newImage], | ||
waitFor: ["pull-" + name], | ||
}, | ||
], | ||
}, | ||
|
||
local images = [ | ||
"argoproj/argoui:v2.2.0", | ||
"argoproj/argoexec:v2.2.0", | ||
"argoproj/workflow-controller:v2.2.0", | ||
"metacontroller/metacontroller:v0.3.0", | ||
"minio/minio:RELEASE.2018-02-09T22-40-05Z", | ||
"mysql:8.0.3", | ||
"quay.io/datawire/ambassador:0.37.0", | ||
], | ||
|
||
local steps = std.map(subGraphTemplate, images), | ||
|
||
local combine(l, r) = l+r, | ||
all: std.foldl(combine, steps, {}), | ||
}.all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters