Skip to content

Commit

Permalink
Release prototype update. (kubeflow#990)
Browse files Browse the repository at this point in the history
* Bugfix for release workflow; adding support for releasing images hosted outside kubeflow repo.

* reformat json, and add this step to doc
  • Loading branch information
kunmingg authored and k8s-ci-robot committed Jun 13, 2018
1 parent aa2c64b commit 3b8a7e7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 10 deletions.
21 changes: 19 additions & 2 deletions docs_dev/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,31 @@ Currently auto release will use master branch.

2. Create your workflow:

Under [releasing](../releasing):
* Under [releasing](../releasing):
```
export RELEASENAME=<name it>
ks init ${RELEASENAME}
cd ${RELEASENAME}
ks registry add kubeflow github.com/kubeflow/kubeflow/tree/master/kubeflow
ks pkg install kubeflow/automation@master
ks generate release ${RELEASENAME} --image=<your image name>
ks generate release ${RELEASENAME} --image=<your image name> --dockerfileDir=kubeflow/repo_name/<path to docker build context>
```

* Example: for bootstrapper release we can do:
```
ks generate release bootstrapper-release --image=bootstrapper --dockerfileDir=kubeflow/kubeflow/bootstrap
```

* If your build context is not in kubeflow repo, like pytorch-operator, add param:
```
--extra_repos=kubeflow/testing@HEAD;kubeflow/pytorch-operator@HEAD
```
when run ```ks generate``` to have your repo checked out during release.
3. Reformat your new workflow using [jsonnet](https://jsonnet.org/learning/tools.html):
```
jsonnet fmt -i $(find . -name '[a-z]*sonnet') --string-style d --comment-style s --indent 2
```
## Update Release Config
Expand Down
10 changes: 8 additions & 2 deletions kubeflow/automation/prototypes/release.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// @shortDescription setup auto release of any image in 30 min.
// @param name string Name to give to each of the components
// @param image string Image name to give to released image
// @param dockerfileDir string Path to dockerfile used for releasing image
// @optionalParam cluster string kubeflow-releasing Self explanatory.
// @optionalParam gcpCredentialsSecretName string gcp-credentials Name of GCP credential stored in cluster as a secret.
// @optionalParam namespace string kubeflow-releasing Self explanatory.
Expand All @@ -15,9 +16,14 @@
// @optionalParam bucket string kubeflow-releasing-artifacts GCS bucket storing artifacts.
// @optionalParam prow_env string REPO_OWNER=kubeflow,REPO_NAME=kubeflow,PULL_BASE_SHA=master Self explanatory.
// @optionalParam versionTag string latest Tag for released image.
// @optionalParam extra_args string Extra args for your build_image.sh
// @optionalParam dockerfile string Dockerfile Name of your dockerfile.
// @optionalParam extra_repos string kubeflow/testing@HEAD Append your repo here (; seperated) if your image is not in kubeflow.
// @optionalParam extra_args string null args for your build_image.sh

local k = import "k.libsonnet";
local release = import "kubeflow/automation/release.libsonnet";
local updatedParams = params {
extra_args: if params.extra_args == "null" then "" else " " + params.extra_args,
};

std.prune(k.core.v1.list.new(release.parts(params.namespace, params.name, overrides=params).release))
std.prune(k.core.v1.list.new(release.parts(updatedParams.namespace, updatedParams.name, overrides=updatedParams).release))
14 changes: 8 additions & 6 deletions kubeflow/automation/release.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
cluster: "kubeflow-releasing",
zone: "us-central1-a",
image: "default-should-not-exist",
dockerfile: "Dockerfile",
extra_repos: "kubeflow/testing@HEAD",
extra_args: "",
},

Expand Down Expand Up @@ -75,7 +77,7 @@
local kubeflowTestingPy = srcRootDir + "/kubeflow/testing/py";

// Location where build_image.sh
local imageDir = srcRootDir + "/kubeflow/kubeflow/components/k8s-model-server/images";
local imageDir = srcRootDir + "/" + params.dockerfileDir;

local releaseImage = params.registry + "/" + params.image;

Expand Down Expand Up @@ -136,9 +138,9 @@
"-c",
imageDir + "/build_image.sh "
+ imageDir + "/" + dockerfile + " "
+ image + " ",
+params.versionTag + " ",
+params.extra_args,
+ image + " "
+ params.versionTag
+ params.extra_args,
],
[
{
Expand Down Expand Up @@ -231,7 +233,7 @@
],
env: prow_env + [{
name: "EXTRA_REPOS",
value: "kubeflow/testing@HEAD",
value: params.extra_repos,
}],
image: testing_image,
volumeMounts: [
Expand All @@ -243,7 +245,7 @@
},
}, // checkout

buildImageTemplate("image-build-release", imageDir, "Dockerfile.cpu", releaseImage),
buildImageTemplate("image-build-release", imageDir, params.dockerfile, releaseImage),

buildTemplate(
"copy-artifacts",
Expand Down

0 comments on commit 3b8a7e7

Please sign in to comment.