-
Notifications
You must be signed in to change notification settings - Fork 6
✨ Add: Manage grafana content/assets via terraform #913
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
Merged
mrnicegyu11
merged 60 commits into
ITISFoundation:main
from
mrnicegyu11:2024/add/grafanaTerraform
Mar 13, 2025
Merged
Changes from 36 commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
f0d8cf0
wip
mrnicegyu11 e906b41
Merge remote-tracking branch 'upstream/main' into main
mrnicegyu11 14c751d
Merge remote-tracking branch 'upstream/main' into main
mrnicegyu11 293f63c
Add csi-s3 and have portainer use it
mrnicegyu11 f7f72ec
Change request @hrytsuk 1GB max portainer volume size
mrnicegyu11 94cfb76
t push
mrnicegyu11 509c717
Merge remote-tracking branch 'upstream/main'
mrnicegyu11 1a65ecf
Merge remote-tracking branch 'upstream/main'
mrnicegyu11 77ee45e
Merge remote-tracking branch 'upstream/main'
mrnicegyu11 c9c70d6
Arch Linux Certificates Customization
mrnicegyu11 7b8be53
Merge remote-tracking branch 'upstream/main'
mrnicegyu11 bcd61cd
Merge remote-tracking branch 'upstream/main'
mrnicegyu11 58e1030
Merge remote-tracking branch 'upstream/main'
mrnicegyu11 5b1c3fb
Add grafana terrform tooling
mrnicegyu11 00bc0c7
Make osparc-config dotenv-precommit pass: Use all caps env-vars
mrnicegyu11 2e009bc
Refactoring: jinja2 takes .env file path as explicit argument (like i…
mrnicegyu11 8903007
Make CI_ENV_FILE vailable in makefile
mrnicegyu11 f520e7c
Refactor makefile targets
mrnicegyu11 764bb22
Add grafana terraform gitignore
mrnicegyu11 ead277a
Rename envvar: TF_STATE_S3_GRAFANAKEY
mrnicegyu11 13f92ba
Remove old scripts, makefile targets
mrnicegyu11 ebe66c0
Remove unused files
mrnicegyu11 fcab094
undue arch style commit
mrnicegyu11 2ba8070
Remove references to Tempo
mrnicegyu11 015cef0
Merge remote-tracking branch 'upstream/main' into 2024/add/grafanaTer…
mrnicegyu11 ebb9c2c
CHange request YH: Stop trying tor ecah grafana eventually
mrnicegyu11 a929e35
Change request YH: Move tf scripts to terraform folder
mrnicegyu11 989eaa3
Change request YH: stricter check
mrnicegyu11 75c79fe
Add files remove typo
mrnicegyu11 dc76837
Merge branch 'main' into 2024/add/grafanaTerraform
mrnicegyu11 bb59907
Add terraform fmt pre-commit hook
mrnicegyu11 c52b3f9
Use ansible.env file in lieu of ci.env if available
mrnicegyu11 c2c748f
Rename and refactor
mrnicegyu11 3404851
Merge remote-tracking branch 'upstream/main' into 2024/add/grafanaTer…
mrnicegyu11 73c384f
wip
mrnicegyu11 0aa010e
wip
mrnicegyu11 9f7be0b
remove line
mrnicegyu11 8eb2e73
Merge branch 'main' into 2024/add/grafanaTerraform
mrnicegyu11 ac627ea
Makefile repo base dir without git
mrnicegyu11 dc08b16
Grafana terraform ceph fixes
mrnicegyu11 22edf67
Fix indentation
mrnicegyu11 51e23c4
Add manual to traefik redirect capture all rule (#933)
YuryHrytsuk 8728f6c
Introduce rolling docker config / secret update concept :tada: :rocke…
YuryHrytsuk ef8bf6b
Update traefik router hardcoded priorities (#953)
YuryHrytsuk bcecab7
Configure redis replicas via ENV (#957)
YuryHrytsuk e055bbd
Filestash: remove special docker node label (#959)
YuryHrytsuk 998081a
rabbit: configurable replicas (#964)
YuryHrytsuk 83e21a8
💄 minor: Change DNS Server to Quad9 (#967)
mrnicegyu11 0e86628
single replica (#968)
sanderegg 54be62a
Remove docker api proxy from validate simcore settings (#972)
YuryHrytsuk 9001e23
Add appmotiongateway add dalco
mrnicegyu11 f5d5e63
Add appmotiongateway add dalco - 2
mrnicegyu11 721069e
Add appmotiongateway add dalco - 3
mrnicegyu11 80b24ff
Seperate dalco-staging: disable redis special handling (#976)
mrnicegyu11 bf5e264
Fix deploy ops failure
mrnicegyu11 5959bd5
Merge branch 'main' into 2024/add/grafanaTerraform
mrnicegyu11 7433f2a
Make curl in ensure_grafana_online_ timeout after 10s
mrnicegyu11 2da8740
Timeout in wait_graylog_is_online
mrnicegyu11 a87ee6b
Fix osparc.local pydantic validation failure director-v0
mrnicegyu11 e9a5631
Merge remote-tracking branch 'upstream/main' into 2024/add/grafanaTer…
mrnicegyu11 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| .DEFAULT_GOAL := help | ||
| REPO_BASE_DIR := $(shell git rev-parse --show-toplevel) | ||
mrnicegyu11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| include ${REPO_BASE_DIR}/scripts/common.Makefile | ||
|
|
||
|
|
||
|
|
||
| # Internal VARIABLES ------------------------------------------------ | ||
| TF_STATE_FILE := terraform/.terraform/terraform.tfstate | ||
|
|
||
| terraform/main.tf: terraform/main.tf.j2 .venv $(REPO_CONFIG_LOCATION) | ||
| # generate $@ | ||
| @$(call jinja, $<, $(REPO_CONFIG_LOCATION), $@) | ||
| # validate and format $@ | ||
mrnicegyu11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| terraform-init: $(TF_STATE_FILE) ## init terraform | ||
|
|
||
| $(TF_STATE_FILE): $(REPO_CONFIG_LOCATION) terraform/main.tf | ||
| # terraform init | ||
| @set -a; source $<; set +a; \ | ||
| if [ "$${GRAFANA_TERRAFORM_STATE_BACKEND_TYPE}" = "local" ]; then \ | ||
| terraform -chdir=./terraform init; \ | ||
| else \ | ||
| terraform -chdir=./terraform init -backend-config="access_key=$${TF_GRAFANA_STATE_BACKEND_AWS_ACCESS_KEY_ID}" -backend-config="secret_key=$${TF_GRAFANA_STATE_BACKEND_AWS_SECRET_ACCESS_KEY}"; \ | ||
| fi | ||
|
|
||
| terraform/plan.cache: | ||
| @echo "$@ file not found. Run 'make terraform-plan' to generate it." | ||
| @exit 1 | ||
|
|
||
| .PHONY: terraform-plan | ||
| terraform-plan: $(REPO_CONFIG_LOCATION) $(TF_STATE_FILE) ensure-grafana-online ## terraform plan | ||
| # terraform plan | ||
| @set -a; source $<; set +a; \ | ||
mrnicegyu11 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| terraform -chdir=./terraform plan -out=plan.cache | ||
mrnicegyu11 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| .PHONY: terraform-apply | ||
| terraform-apply: $(REPO_CONFIG_LOCATION) terraform/plan.cache $(TF_STATE_FILE) ensure-grafana-online ## terraform apply | ||
mrnicegyu11 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # terraform apply | ||
| @set -a; source $<; set +a; \ | ||
mrnicegyu11 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| terraform -chdir=./terraform apply plan.cache | ||
|
|
||
| .PHONY: ensure-grafana-online | ||
| ensure-grafana-online: | ||
| @set -o allexport; \ | ||
| source $(REPO_CONFIG_LOCATION); \ | ||
| set +o allexport; \ | ||
| url=$${TF_VAR_GRAFANA_URL}; \ | ||
| echo "Waiting for grafana at $$url to become reachable..."; \ | ||
| attempts=0; \ | ||
| max_attempts=10; \ | ||
| while [ $$attempts -lt $$max_attempts ]; do \ | ||
mrnicegyu11 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| status_code=$$(curl -k -o /dev/null -s -w "%{http_code}" $$url); \ | ||
| if [ "$$status_code" -ge 200 ] && [ "$$status_code" -lt 400 ]; then \ | ||
| echo "Grafana is online"; \ | ||
| break; \ | ||
| else \ | ||
| echo "Grafana still unreachable, waiting 5s for grafana to become reachable... (Attempt $$((attempts+1)))"; \ | ||
| sleep 5; \ | ||
| attempts=$$((attempts + 1)); \ | ||
| fi; \ | ||
| done; \ | ||
| if [ $$attempts -eq $$max_attempts ]; then \ | ||
| echo "Max attempts reached, Grafana is still unreachable."; \ | ||
| exit 1; \ | ||
| fi; | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.