Skip to content

Commit ff29ae0

Browse files
committed
Merge branch 'upstream/2.9' into 2.9-into-develop
2 parents b1d97bb + bdb4960 commit ff29ae0

File tree

1,613 files changed

+4713
-3296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,613 files changed

+4713
-3296
lines changed

.github/workflows/microk8s-tests.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
11
name: Test Kubeflow
22

3-
on:
4-
push:
5-
paths-ignore:
6-
- 'acceptancetests/**'
7-
- 'doc/**'
8-
- 'snap/**'
9-
- 'testcharms/**'
10-
- 'testing/**'
11-
- 'tests/**'
12-
pull_request:
13-
paths-ignore:
14-
- 'acceptancetests/**'
15-
- 'doc/**'
16-
- 'snap/**'
17-
- 'testcharms/**'
18-
- 'testing/**'
19-
- 'tests/**'
3+
# The small `edge` bundle has been deprecated, `lite` bundle takes 40mins to run which is too slow for gh action.
4+
# Disable this one for now, please check `nw-deploy-kubeflow` on Jenkins.
5+
on: {}
206

217
env:
228
DOCKER_USERNAME: jujuqabot
@@ -97,7 +83,7 @@ jobs:
9783
sleep 10
9884
microk8s kubectl patch role -n kubeflow istio-ingressgateway-operator -p '{"apiVersion":"rbac.authorization.k8s.io/v1","kind":"Role","metadata":{"name":"istio-ingressgateway-operator"},"rules":[{"apiGroups":["*"],"resources":["*"],"verbs":["*"]}]}'
9985
sleep 6m
100-
juju --debug wait -wv -m kubeflow -t 300
86+
juju --debug wait -wv -m kubeflow -t 1200
10187
10288
microk8s kubectl get pods -l 'juju-operator' -A -o custom-columns='Name:metadata.name,Image:spec.containers[0].image'
10389
EOF

.github/workflows/smoke.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ jobs:
6060
strategy:
6161
matrix:
6262
snap_version: ["latest/stable", "latest/beta"]
63-
model_type: ["localhost", "microk8s"]
63+
# TODO - microk8s upgrade test is broken
64+
model_type: ["localhost"] #, "microk8s"]
6465
env:
6566
CHARM_localhost: apache2
6667
CHARM_microk8s: elasticsearch-k8s

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,16 @@ OPERATOR_IMAGE_PATH=sh -c '. "${PROJECT_DIR}/make_functions.sh"; operator_image_
231231
OPERATOR_IMAGE_RELEASE_PATH=sh -c '. "${PROJECT_DIR}/make_functions.sh"; operator_image_release_path "$$@"' operator_image_release_path
232232
UPDATE_MICROK8S_OPERATOR=sh -c '. "${PROJECT_DIR}/make_functions.sh"; microk8s_operator_update "$$@"' microk8s_operator_update
233233

234-
image-check-build:
235-
ifeq ($(OPERATOR_IMAGE_BUILD_SRC),true)
236-
make build
237-
else
238-
@echo "skipping to build jujud bin, use existing one at ${JUJUD_BIN_DIR}/."
234+
image_check_prereq=build
235+
ifneq ($(OPERATOR_IMAGE_BUILD_SRC),true)
236+
image_check_prereq=image-check-build-skip
239237
endif
240238

239+
image-check-build: $(image_check_prereq)
240+
241+
image-check-build-skip:
242+
@echo "skipping to build jujud bin, use existing one at ${JUJUD_BIN_DIR}/."
243+
241244
operator-image: image-check-build
242245
## operator-image: Build operator image via docker
243246
$(BUILD_OPERATOR_IMAGE)

acceptancetests/assess_caas_deploy_kubeflow.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ def deploy_kubeflow(caas_client, k8s_model, bundle, build):
126126
else:
127127
k8s_model.deploy(
128128
charm=bundle_info[bundle]['uri'],
129-
channel="stable",
129+
revision="60",
130+
trust="true",
130131
)
131132

132133
if application_exists(k8s_model, 'istio-ingressgateway'):
@@ -190,28 +191,31 @@ def deploy_kubeflow(caas_client, k8s_model, bundle, build):
190191
)
191192

192193
pub_addr = get_pub_addr(caas_client, k8s_model.model_name)
193-
password = "foobar"
194194
app_name_to_config = 'dex-auth'
195195
if application_exists(k8s_model, app_name_to_config):
196196
log.info("configuring %s application", app_name_to_config)
197-
k8s_model.set_config(
198-
app_name_to_config,
199-
{
200-
'public-url': f'http://{pub_addr}:80',
201-
'static-password': f'{password}',
202-
},
203-
)
197+
k8s_model.set_config(app_name_to_config, {'public-url': f'http://{pub_addr}'})
204198
log.info("application config of %s: \n%s", app_name_to_config, k8s_model.get_config(app_name_to_config))
205199

206200
app_name_to_config = 'oidc-gatekeeper'
207201
if application_exists(k8s_model, app_name_to_config):
208202
log.info("configuring %s application", app_name_to_config)
209-
k8s_model.set_config(app_name_to_config, {'public-url': f'http://{pub_addr}:80'})
203+
k8s_model.set_config(app_name_to_config, {'public-url': f'http://{pub_addr}'})
210204
log.info("application config of %s: \n%s", app_name_to_config, k8s_model.get_config(app_name_to_config))
211205

212206
log.info("Waiting for Kubeflow to become ready")
213207

214-
k8s_model.juju('wait', ('-wv', '-m', k8s_model.model_name, '-t', str(10 * 60)))
208+
# See here for why loop is necessary:
209+
# https://bugs.launchpad.net/juju/+bug/1921739
210+
for _ in range(120):
211+
try:
212+
k8s_model.juju('wait', ('-wv', '-m', k8s_model.model_name, '-t', str(30)))
213+
break
214+
except subprocess.CalledProcessError:
215+
time.sleep(5)
216+
else:
217+
k8s_model.juju('wait', ('-wv', '-m', k8s_model.model_name, '-t', str(300)))
218+
215219
caas_client.kubectl(
216220
"wait",
217221
"--for=condition=available",
@@ -286,7 +290,7 @@ def get_pub_addr(caas_client, model_name):
286290
try:
287291
output = caas_client.kubectl('-n', model_name, 'get', f'svc/{charm}', '-ojson')
288292
pub_ip = json.loads(output)['status']['loadBalancer']['ingress'][0]['ip']
289-
return '%s.xip.io' % pub_ip
293+
return '%s.nip.io' % pub_ip
290294
except (KeyError, subprocess.CalledProcessError):
291295
pass
292296
log.warn("""

acceptancetests/assess_model_migration.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@
3333
log = logging.getLogger("assess_model_migration")
3434

3535

36+
model_constraints = dict(
37+
arch="amd64",
38+
cores=2,
39+
mem="4096M",
40+
)
41+
42+
3643
def assess_model_migration(bs1, bs2, args):
3744
with bs1.booted_context(args.upload_tools):
3845
bs2.client.env.juju_home = bs1.client.env.juju_home
@@ -43,12 +50,12 @@ def assess_model_migration(bs1, bs2, args):
4350
# continues to operate after the originating controller is torn
4451
# down.
4552
results = ensure_migration_with_resources_succeeds(
46-
source_client,
47-
dest_client)
53+
source_client, dest_client, model_constraints,
54+
)
4855
migrated_client, application, resource_contents = results
4956

50-
ensure_model_logs_are_migrated(source_client, dest_client)
51-
ensure_api_login_redirects(source_client, dest_client)
57+
ensure_model_logs_are_migrated(source_client, dest_client, constraints=model_constraints)
58+
ensure_api_login_redirects(source_client, dest_client, model_constraints)
5259

5360
# Continue test where we ensure that a migrated model continues to
5461
# work after it's originating controller has been destroyed.
@@ -162,11 +169,13 @@ def wait_for_migrating(client, timeout=600):
162169
))
163170

164171

165-
def ensure_api_login_redirects(source_client, dest_client):
172+
def ensure_api_login_redirects(source_client, dest_client, constraints=None):
166173
"""Login attempts must get transparently redirected to the new controller.
167174
"""
168175
new_model_client = deploy_dummy_source_to_new_model(
169-
source_client, 'api-redirection')
176+
source_client, 'api-redirection',
177+
constraints=constraints,
178+
)
170179

171180
# show model controller details
172181
before_model_details = source_client.show_model()
@@ -221,7 +230,7 @@ def assert_model_has_correct_controller_uuid(client):
221230
raise JujuAssertionError()
222231

223232

224-
def ensure_migration_with_resources_succeeds(source_client, dest_client):
233+
def ensure_migration_with_resources_succeeds(source_client, dest_client, constraints=None):
225234
"""Test simple migration of a model to another controller.
226235
227236
Ensure that migration a model that has an application, that uses resources,
@@ -242,7 +251,7 @@ def ensure_migration_with_resources_succeeds(source_client, dest_client):
242251
"""
243252
resource_contents = get_random_string()
244253
test_model, application = deploy_simple_server_to_new_model(
245-
source_client, 'example-model-resource', resource_contents)
254+
source_client, 'example-model-resource', resource_contents, constraints=constraints)
246255
migration_target_client = migrate_model_to_controller(
247256
test_model, source_client, dest_client)
248257
assert_model_migrated_successfully(
@@ -351,7 +360,7 @@ def raise_if_shared_machines(unit_machines):
351360
raise JujuAssertionError('Application units reside on the same machine')
352361

353362

354-
def ensure_model_logs_are_migrated(source_client, dest_client, timeout=600):
363+
def ensure_model_logs_are_migrated(source_client, dest_client, timeout=600, constraints=None):
355364
"""Ensure logs are migrated when a model is migrated between controllers.
356365
357366
:param source_client: ModelClient representing source controller to create
@@ -360,7 +369,9 @@ def ensure_model_logs_are_migrated(source_client, dest_client, timeout=600):
360369
:param timeout: int seconds to wait for logs to appear in migrated model.
361370
"""
362371
new_model_client = deploy_dummy_source_to_new_model(
363-
source_client, 'log-migration')
372+
source_client, 'log-migration',
373+
constraints=constraints,
374+
)
364375
before_migration_logs = new_model_client.get_juju_output(
365376
'debug-log', '--no-tail', '-l', 'DEBUG')
366377
log.info('Attempting migration process')

0 commit comments

Comments
 (0)