Skip to content

Commit

Permalink
chart: Remove (kubeflow#566)
Browse files Browse the repository at this point in the history
* chart: Remove

Signed-off-by: Ce Gao <[email protected]>

* py: Fix lint issues

Signed-off-by: Ce Gao <[email protected]>

* release_test: Revert

Signed-off-by: Ce Gao <[email protected]>
  • Loading branch information
gaocegege authored and k8s-ci-robot committed May 5, 2018
1 parent 56db83f commit b475081
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 2,207 deletions.
1,796 changes: 0 additions & 1,796 deletions examples/gke/TF on GKE.ipynb

This file was deleted.

66 changes: 0 additions & 66 deletions py/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# and it doesn't use this script.
import argparse
import datetime
import glob
import json
import logging
import os
Expand Down Expand Up @@ -234,7 +233,6 @@ def build_operator_image(root_dir,
def build_and_push_artifacts(go_dir,
src_dir,
registry,
publish_path=None,
gcb_project=None,
build_info_path=None,
version_tag=None):
Expand All @@ -244,8 +242,6 @@ def build_and_push_artifacts(go_dir,
go_dir: The GOPATH directory
src_dir: The root directory where we checked out the repo.
registry: Docker registry to use.
publish_path: (Optional) The GCS path where artifacts should be published.
Set to none to only build locally.
gcb_project: The project to use with GCB to build docker images.
If set to none uses docker to build.
build_info_path: (Optional): GCS location to write YAML file containing
Expand All @@ -264,67 +260,6 @@ def build_and_push_artifacts(go_dir,
build_info = build_operator_image(
src_dir, registry, project=gcb_project, version_tag=version_tag)

# Copy the chart to a temporary directory because we will modify some
# of its YAML files.
chart_build_dir = tempfile.mkdtemp(prefix="tmpTFJobChartBuild")
shutil.copytree(
os.path.join(src_dir, "tf-job-operator-chart"),
os.path.join(chart_build_dir, "tf-job-operator-chart"))
version = build_info["image"].split(":")[-1]
values_file = os.path.join(chart_build_dir, "tf-job-operator-chart",
"values.yaml")
update_values(values_file, build_info["image"])

chart_file = os.path.join(chart_build_dir, "tf-job-operator-chart",
"Chart.yaml")
update_chart(chart_file, version)

# Delete any existing matches because we assume there is only 1 below.
matches = glob.glob(os.path.join(bin_dir, "tf-job-operator-chart*.tgz"))
for m in matches:
logging.info("Delete previous build: %s", m)
os.unlink(m)

util.run(
[
"helm", "package", "--save=false", "--destination=" + bin_dir,
"./tf-job-operator-chart"
],
cwd=chart_build_dir)

matches = glob.glob(os.path.join(bin_dir, "tf-job-operator-chart*.tgz"))

if len(matches) != 1:
raise ValueError(
"Expected 1 chart archive to match but found {0}".format(matches))

chart_archive = matches[0]

release_path = version

targets = [
os.path.join(release_path, os.path.basename(chart_archive)),
"latest/tf-job-operator-chart-latest.tgz",
]

if publish_path:
gcs_client = storage.Client(project=gcb_project)
bucket_name, base_path = util.split_gcs_uri(publish_path)
bucket = gcs_client.get_bucket(bucket_name)
for t in targets:
blob = bucket.blob(os.path.join(base_path, t))
gcs_path = util.to_gcs_uri(bucket_name, blob.name)
if not t.startswith("latest"):
build_info["helm_chart"] = gcs_path
if blob.exists() and not t.startswith("latest"):
logging.warning("%s already exists", gcs_path)
continue
logging.info("Uploading %s to %s.", chart_archive, gcs_path)
blob.upload_from_filename(chart_archive)

create_latest(bucket, build_info["commit"],
util.to_gcs_uri(bucket_name, targets[0]))

# Always write to the bin dir.
paths = [os.path.join(bin_dir, "build_info.yaml")]

Expand Down Expand Up @@ -426,7 +361,6 @@ def build_and_push(go_dir, src_dir, args):
go_dir,
src_dir,
registry=args.registry,
publish_path=args.releases_path,
gcb_project=args.project,
build_info_path=args.build_info_path,
version_tag=args.version_tag)
Expand Down
24 changes: 0 additions & 24 deletions py/release_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import unittest

import mock
import yaml

from py import release

Expand Down Expand Up @@ -80,28 +79,5 @@ def test_update_values(self):
apiVersion: v1beta1"""
self.assertEqual(expected, output)

def test_update_chart_file(self):
with tempfile.NamedTemporaryFile(delete=False) as hf:
hf.write("""
name: tf-job-operator-chart
home: https://github.com/kubeflow/tf-operator
version: 0.1.0
appVersion: 0.1.0
""")
chart_file = hf.name

release.update_chart(chart_file, "v20171019")

with open(chart_file) as hf:
output = yaml.load(hf)
expected = {
"name": "tf-job-operator-chart",
"home": "https://github.com/kubeflow/tf-operator",
"version": "0.1.0-v20171019",
"appVersion": "0.1.0-v20171019",
}
self.assertEqual(expected, output)


if __name__ == "__main__":
unittest.main()
6 changes: 0 additions & 6 deletions tf-job-operator-chart/Chart.yaml

This file was deleted.

31 changes: 0 additions & 31 deletions tf-job-operator-chart/templates/config.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions tf-job-operator-chart/templates/crd.yaml

This file was deleted.

34 changes: 0 additions & 34 deletions tf-job-operator-chart/templates/dashboard.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions tf-job-operator-chart/templates/deployment.yaml

This file was deleted.

131 changes: 0 additions & 131 deletions tf-job-operator-chart/templates/rbac.yaml

This file was deleted.

Loading

0 comments on commit b475081

Please sign in to comment.