Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run coredns charm validation with image from charmhub #1506

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function compile::env
: "${JUJU_DEPLOY_CHANNEL:?Must have a channel defined}"
: "${JUJU_MODEL:?Must have a model defined}"
: "${JUJU_UPDATE_STATUS_INTERVAL:=150s}"
: "${JUJU_OWNER:=k8sci}"
: "${JOB_STAGE:-}"
: "${JOB_REPORTING:-yes}"
: "${SERIES:?Must have a release series defined}"
Expand Down
2 changes: 1 addition & 1 deletion jobs/arc-conformance/conformance-spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function juju::bootstrap
--force \
--bootstrap-constraints arch="$ARCH" \
--model-default test-mode=true \
--model-default resource-tags="owner=k8sci" \
--model-default resource-tags="owner=$JUJU_OWNER" \
--model-default image-stream=released \
--model-default automatically-retry-hooks=true \
--model-default logging-config="<root>=DEBUG"
Expand Down
6 changes: 3 additions & 3 deletions jobs/integration/tigera_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

VPC_CIDR = "172.30.0.0/16"
SUBNET_CIDRS = ["172.30.0.0/24", "172.30.1.0/24"]
REGION = "us-east-2"
AVAILABILITY_ZONE = "us-east-2a"
OWNER = "k8sci"
REGION = os.environ.get("JUJU_CLOUD", "us-east-2")
AVAILABILITY_ZONE = f"{REGION}a"
OWNER = os.environ.get("JUJU_OWNER", "k8sci")

BIRD_CONFIG_BASE = """
log syslog all;
Expand Down
34 changes: 11 additions & 23 deletions jobs/integration/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1928,30 +1928,18 @@ async def get_offer():
log.info("---")
log.info("☆ Verifying DNS with CoreDNS charm")

# Apply a few workarounds for deploying a multiarch coredns image
# See LP#1998607
worker_arch = os.environ.get("ARCH", "amd64")
series = os.environ["SERIES"]
with NamedTemporaryFile("w", dir=Path.cwd()) as f:
f.write(
'{"ImageName": "rocks.canonical.com:443/cdk/coredns/coredns:1.10.0"}'
)
f.flush()
await tools.run(
"juju",
"deploy",
"-m",
f"{tools.controller_name}:{tools.k8s_model_name}",
f"--constraints=arch={worker_arch}",
f"--channel={tools.charm_channel}",
tools.juju_base(series),
"coredns",
"--trust",
"--resource",
f"coredns-image={f.name}",
)
await k8s_model.block_until(lambda: "coredns" in k8s_model.applications)
coredns = k8s_model.applications["coredns"]
base_cli_args = tools.juju_base(os.environ["SERIES"])
base_args = dict([base_cli_args.strip("--").split("=")])
await k8s_model.deploy(
"coredns",
channel=tools.charm_channel,
constraints={"arch": worker_arch},
trust=True,
**base_args,
)
await k8s_model.block_until(lambda: "coredns" in k8s_model.applications)
coredns = k8s_model.applications["coredns"]

log.info("Waiting for CoreDNS charm to be ready")
await k8s_model.wait_for_idle(raise_on_error=False, status="active")
Expand Down
2 changes: 1 addition & 1 deletion jobs/spec-helpers/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ juju:
replace-controller: yes
model-default:
- test-mode=true
- resource-tags=owner=k8sci
- resource-tags=owner=$JUJU_OWNER
deploy:
reuse: no
bundle: $JUJU_DEPLOY_BUNDLE
Expand Down
2 changes: 1 addition & 1 deletion jobs/validate-offline/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plan:
set -x

juju kill-controller -y $JUJU_CONTROLLER || true
juju bootstrap $JUJU_CLOUD $JUJU_CONTROLLER --model-default resource-tags=owner=k8sci --model-default test-mode=true
juju bootstrap $JUJU_CLOUD $JUJU_CONTROLLER --model-default resource-tags=owner=$JUJU_OWNER --model-default test-mode=true
juju deploy ubuntu --constraints "mem=16G root-disk=500G cores=16"
juju-wait -e $JUJU_CONTROLLER:$JUJU_MODEL -w

Expand Down
2 changes: 1 addition & 1 deletion jobs/validate/calico-spec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function juju::bootstrap
--force \
--bootstrap-constraints arch="$ARCH" \
--model-default test-mode=true \
--model-default resource-tags=owner=k8sci \
--model-default resource-tags=owner=$JUJU_OWNER \
--model-default image-stream=daily \
--model-default automatically-retry-hooks=true \
--model-default logging-config="<root>=DEBUG" \
Expand Down
2 changes: 1 addition & 1 deletion jobs/validate/tigera-ee-spec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function juju::bootstrap
--force --bootstrap-series "$SERIES" \
--bootstrap-constraints arch="amd64" \
--model-default test-mode=true \
--model-default resource-tags=owner=k8sci \
--model-default resource-tags=owner=$JUJU_OWNER \
--model-default image-stream=daily \
--model-default automatically-retry-hooks=true \
--model-default logging-config="<root>=DEBUG" \
Expand Down
2 changes: 1 addition & 1 deletion jobs/validate/vault-spec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set -x
# --force --bootstrap-series "$SERIES" \
# --bootstrap-constraints arch="amd64" \
# --model-default test-mode=true \
# --model-default resource-tags=owner=k8sci \
# --model-default resource-tags=owner=$JUJU_OWNER \
# --model-default image-stream=daily \
# --model-default vpc-id=vpc-0e4f11d0d4e9ba35f \
# --model-default automatically-retry-hooks=true \
Expand Down
2 changes: 1 addition & 1 deletion juju.bash
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function juju::bootstrap
fi

juju::destroy
TAGS="owner=k8sci job=${JOB_NAME_CUSTOM}"
TAGS="owner=${JUJU_OWNER} job=${JOB_NAME_CUSTOM}"
if [ "${JOB_STAGE}" ]; then TAGS+=" stage=${STAGE}"; fi
juju bootstrap "$JUJU_CLOUD" "$JUJU_CONTROLLER" \
${add_model[@]} \
Expand Down
Loading