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

Dpe 6349 add sharded tf #381

Open
wants to merge 20 commits into
base: 6/edge
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:
on:
pull_request:
schedule:
- cron: '53 0 * * *' # Daily at 00:53 UTC
- cron: "53 0 * * *" # Daily at 00:53 UTC
# Triggered on push to branch "main" by .github/workflows/release.yaml
workflow_call:
outputs:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Check libs
uses: canonical/charming-actions/[email protected]
with:
charmcraft-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
charmcraft-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
credentials: ${{ secrets.CHARMHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
use-labels: false
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
terraform fmt
terraform validate
- name: lint test charm module
working-directory: ./terraform/tests
working-directory: ./terraform/modules
run: |
terraform init
terraform fmt
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
- tests/integration/ha_tests/application_charm
- tests/integration/relation_tests/application-charm
with:
charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
charmcraft-snap-channel: latest/candidate # TODO: remove after charmcraft 3.3 stable release
path-to-charm-directory: ${{ matrix.path }}

integration-test:
Expand All @@ -129,8 +129,8 @@ jobs:
with:
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
cloud: microk8s
microk8s-snap-channel: 1.29-strict/stable # renovate: latest microk8s
juju-agent-version: 3.6.1 # renovate: juju-agent-pin-minor
microk8s-snap-channel: 1.29-strict/stable # renovate: latest microk8s
juju-agent-version: 3.6.1 # renovate: juju-agent-pin-minor
_beta_allure_report: true
permissions:
contents: write # Needed for Allure Report beta
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ resource "juju_application" "data-integrator" {
model = var.model_name
depends_on = [null_resource.preamble]
}

resource "juju_application" "s3-integrator" {
charm {
name = "s3-integrator"
channel = "latest/stable"
}
model = var.model_name
depends_on = [null_resource.preamble]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module "mongodb-k8s" {
channel = "6/edge"
}

resource "juju_integration" "simple_deployment_tls-operator_mongodb-integration" {
resource "juju_integration" "tls-operator_mongodb-integration" {
model = var.model_name

application {
Expand All @@ -22,7 +22,7 @@ resource "juju_integration" "simple_deployment_tls-operator_mongodb-integration"

}

resource "juju_integration" "simple_deployment_data-integrator_mongodb-integration" {
resource "juju_integration" "data-integrator_mongodb-integration" {
model = var.model_name

application {
Expand All @@ -38,12 +38,29 @@ resource "juju_integration" "simple_deployment_data-integrator_mongodb-integrati

}

resource "null_resource" "simple_deployment_juju_wait_deployment" {
resource "juju_integration" "s3-integrator_mongodb-integration" {
model = var.model_name

application {
name = juju_application.s3-integrator.name
}
application {
name = var.app_name
}
depends_on = [
juju_application.s3-integrator,
module.mongodb-k8s
]

}


resource "null_resource" "juju_wait_deployment" {
provisioner "local-exec" {
command = <<-EOT
juju-wait -v --model ${var.model_name}
EOT
}

depends_on = [juju_integration.simple_deployment_tls-operator_mongodb-integration]
depends_on = [juju_integration.tls-operator_mongodb-integration]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ variable "model_name" {
}

variable "app_name" {
description = "MongoDB app name"
description = "mongodb app name"
type = string
default = "mongodb-k8s"
}
Expand Down
74 changes: 74 additions & 0 deletions terraform/modules/sharded_module/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions terraform/modules/sharded_module/preamble.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
resource "null_resource" "preamble" {
provisioner "local-exec" {
command = <<-EOT
sudo snap install juju-wait --classic || true
EOT
}
}

resource "juju_application" "self-signed-certificates" {
charm {
name = "self-signed-certificates"
channel = "latest/stable"
}
model = var.model_name
depends_on = [null_resource.preamble]
}

resource "juju_application" "data-integrator" {
charm {
name = "data-integrator"
channel = "latest/stable"
}
model = var.model_name
depends_on = [null_resource.preamble]
}

resource "juju_application" "s3-integrator" {
charm {
name = "s3-integrator"
channel = "latest/stable"
}
model = var.model_name
depends_on = [null_resource.preamble]
}

resource "juju_application" "mongos-k8s" {
charm {
name = "mongos-k8s"
channel = "6/stable"
}
model = var.model_name
depends_on = [null_resource.preamble]
}
16 changes: 16 additions & 0 deletions terraform/modules/sharded_module/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
terraform {
required_providers {
juju = {
source = "juju/juju"
version = "~> 0.14.0"
}
http = {
source = "hashicorp/http"
version = "~> 3.4.5"
}
external = {
source = "hashicorp/external"
version = "~> 2.3.4"
}
}
}
Loading
Loading