1
0
mirror of https://github.com/ubuntu/microk8s.git synced 2021-05-23 02:23:41 +03:00

Unrevert Kubeflow bundle and update to latest version (#1870)

The latest version includes a fix for the issue leading to the reversion
This commit is contained in:
Kenneth Koski
2021-01-05 14:42:06 -06:00
committed by GitHub
parent bf11ab5831
commit 8ff0f4ab3b
2 changed files with 19 additions and 64 deletions

View File

@@ -181,7 +181,7 @@ def get_hostname():
"microk8s-kubectl.wrapper",
"get",
"--namespace=kubeflow",
"svc/ambassador",
"svc/istio-ingressgateway",
"-ojson",
stdout=False,
die=False,
@@ -196,7 +196,7 @@ def get_hostname():
@click.command()
@click.option(
'--bundle',
default='cs:kubeflow-206',
default='cs:kubeflow-239',
help='The Kubeflow bundle to deploy. Can be one of full, lite, edge, or a charm store URL.',
)
@click.option(
@@ -263,7 +263,7 @@ def kubeflow(bundle, channel, debug, hostname, ignore_min_mem, no_proxy, passwor
sys.exit(1)
try:
juju("show-controller", "uk8s", die=False)
juju("show-controller", "uk8s", die=False, stdout=False)
except subprocess.CalledProcessError:
pass
else:
@@ -276,49 +276,13 @@ def kubeflow(bundle, channel, debug, hostname, ignore_min_mem, no_proxy, passwor
# user to specify a full charm store URL if they'd like, such as
# `cs:kubeflow-lite-123`.
if bundle == 'full':
bundle = 'cs:kubeflow-206'
bundle_type = 'full'
password_overlay = {
"applications": {
"dex-auth": {"options": {"static-username": "admin", "static-password": password}},
"katib-db": {"options": {"root_password": get_random_pass()}},
"oidc-gatekeeper": {"options": {"client-secret": get_random_pass()}},
"pipelines-api": {"options": {"minio-secret-key": "minio123"}},
"pipelines-db": {"options": {"root_password": get_random_pass()}},
}
}
bundle = 'cs:kubeflow-239'
elif bundle == 'lite':
bundle = 'cs:~kubeflow-charmers/bundle/kubeflow-lite-6'
bundle_type = 'lite'
password_overlay = {
"applications": {
"dex-auth": {"options": {"static-username": "admin", "static-password": password}},
"oidc-gatekeeper": {"options": {"client-secret": get_random_pass()}},
"pipelines-api": {"options": {"minio-secret-key": "minio123"}},
"pipelines-db": {"options": {"root_password": get_random_pass()}},
}
}
bundle = 'cs:kubeflow-lite-26'
elif bundle == 'edge':
bundle = 'cs:~kubeflow-charmers/bundle/kubeflow-edge-12'
bundle_type = 'edge'
password_overlay = {
"applications": {
"pipelines-api": {"options": {"minio-secret-key": "minio123"}},
"pipelines-db": {"options": {"root_password": get_random_pass()}},
}
}
bundle = 'cs:kubeflow-edge-23'
else:
bundle = bundle
bundle_type = 'full'
password_overlay = {
"applications": {
"dex-auth": {"options": {"static-username": "admin", "static-password": password}},
"katib-db": {"options": {"root_password": get_random_pass()}},
"oidc-gatekeeper": {"options": {"client-secret": get_random_pass()}},
"pipelines-api": {"options": {"minio-secret-key": "minio123"}},
"pipelines-db": {"options": {"root_password": get_random_pass()}},
}
}
run("microk8s-status.wrapper", "--wait-ready", debug=debug)
run(
@@ -375,12 +339,9 @@ def kubeflow(bundle, channel, debug, hostname, ignore_min_mem, no_proxy, passwor
juju("bootstrap", "microk8s", "uk8s")
juju("add-model", "kubeflow", "microk8s")
print("Bootstrap complete.")
with tempfile.NamedTemporaryFile("w+") as f:
json.dump(password_overlay, f)
f.flush()
print("Successfully bootstrapped, deploying...")
juju("deploy", bundle, "--channel", channel, "--overlay", f.name)
print("Successfully bootstrapped, deploying...")
juju("deploy", bundle, "--channel", channel)
print("Kubeflow deployed.")
print("Waiting for operator pods to become ready.")
@@ -404,7 +365,7 @@ def kubeflow(bundle, channel, debug, hostname, ignore_min_mem, no_proxy, passwor
print("Operator pods ready.")
print("Waiting for service pods to become ready.")
if bundle_type in ('full', 'lite'):
if kubectl_exists('service/pipelines-api'):
with tempfile.NamedTemporaryFile(mode='w+') as f:
json.dump(
{
@@ -425,6 +386,14 @@ def kubeflow(bundle, channel, debug, hostname, ignore_min_mem, no_proxy, passwor
f.flush()
run('microk8s-kubectl.wrapper', 'apply', '-f', f.name)
hostname = parse_hostname(hostname or get_hostname())
if kubectl_exists('service/dex-auth'):
juju("config", "dex-auth", "public-url=%s" % hostname.geturl())
if kubectl_exists('service/oidc-gatekeeper'):
juju("config", "oidc-gatekeeper", "public-url=%s" % hostname.geturl())
retry_run(
"microk8s-kubectl.wrapper",
"wait",
@@ -437,23 +406,9 @@ def kubeflow(bundle, channel, debug, hostname, ignore_min_mem, no_proxy, passwor
times=100,
)
if bundle_type == 'full':
run(
'microk8s-kubectl.wrapper',
'delete',
'mutatingwebhookconfigurations/katib-mutating-webhook-config',
'validatingwebhookconfigurations/katib-validating-webhook-config',
)
print("Congratulations, Kubeflow is now available.")
if bundle_type in ('full', 'lite'):
hostname = parse_hostname(hostname or get_hostname())
juju("config", "dex-auth", "public-url=%s" % hostname.geturl())
juju("config", "oidc-gatekeeper", "public-url=%s" % hostname.geturl())
juju("config", "ambassador", "juju-external-hostname=%s" % hostname.hostname)
juju("expose", "ambassador")
if kubectl_exists('service/istio-ingressgateway'):
print(
textwrap.dedent(
"""

View File

@@ -554,7 +554,7 @@ parts:
juju:
plugin: dump
source: https://launchpad.net/juju/2.7/2.7.6/+download/juju-2.7.6-k8s.tar.xz
source: https://launchpad.net/juju/2.8/2.8.6/+download/juju-2.8.6-k8s.tar.xz
source-type: tar
organize:
juju: bin/juju