Commit Graph

141 Commits

Author SHA1 Message Date
Timur Olzhabayev
4991e71b85
Chore: Upgrade Go to 1.21.5 (#79329)
* bumping grafanas go version to 1.21.5

* adding how to upgrade go doc

* removing the whole ci-build and corresponding pipelines

* clarifying that we have to run make drone

* fixing starlark linter and removing unused code

* Adding note about enterprise

* trying to change the underyling image to avoid musl issues

* only need to golang one
2023-12-15 10:36:49 +01:00
Dan Cech
9f6144059a
Storage: Switch from tenant to namespace & remove GRN (#79250)
* remove GRN and switch tenant to namespace

* clean up remaining references

* simplify and remove inconsistency in With* parameters

* parse listing keys so we can use db index

* bump the schema version

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-12-11 12:26:05 -05:00
gotjosh
23fe8f4e9c
Alerting: Introduce a Mimir client as part of the Remote Alertmanager (#78357)
* Alerting: Introduce a Mimir client as part of the Remote Alertmanager

This is our first attempt at making Grafana communicate use Mimir as a backend - it uses a new set of APIs that we've developed on the Mimir side to upload the grafana configuration and alertmanager state so that it can then be ported over.

Codewise, we've introduced a couple of things:

A client to isolate in its own package all the communication that happens with Mimir
A few changes to the remote/alertmanager to include uploading the configuration and state when it starts
A few refactors that align a bit better with the design approach that we're thinking
An integration tests again these newly developed APIs using a custom image

---------

Signed-off-by: gotjosh <josue.abreu@gmail.com>
Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
2023-11-23 16:59:36 +00:00
Santiago
eef8525a4b
Alerting: Fix remote Alertmanager integration tests (CI/Makefile) (#78541)
* Alerting: Fix remote Alertmanager integration tests (CI/Makefile)
2023-11-22 18:13:04 +00:00
Ryan McKinley
d410ef3439
K8s: Use grafana executable for standalone api service (#77904)
Co-authored-by: Dan Cech <dcech@grafana.com>
2023-11-09 16:50:27 -08:00
Charandas
28e58c1725
Grafana app platform: drop etcd requirement in example-apiserver (#77886) 2023-11-08 10:57:32 -08:00
Charandas
8a46dc39d0
Grafana App Platform: provide an example-apiserver to easily deploy aggregated APIservers (#77826) 2023-11-07 22:35:15 -08:00
Ryan McKinley
5d5f8dfc52
Chore: Upgrade Go to 1.21.3 (#77304) 2023-11-01 09:17:38 -07:00
Andres Martinez Gotor
580a4cac58
Chore: Makefile / Magefile task to build plugins (#76763) 2023-10-23 10:44:38 +02:00
Santiago
7d9b2c73c7
Alerting: Use Mimir image to run integration tests for the remote Alertmanager (#76608)
* Alerting: Use Mimir image to run integration tests for the remote Alertmanager

* skip integration test when running all tests

* skipping integration test when no Alertmanager URL is provided

* fix bad host for mimir_backend

* remove basic auth testing until we have an nginx image in our CI
2023-10-17 12:21:45 +02:00
Horst Gutmann
6b52bb9c27
Chore: Upgrade Go to 1.20.10 (#76359) 2023-10-11 16:49:24 +03:00
Orgad Shaneh
b0b2158dea
Chore: Update ubuntu image to 22.04 (#70719) 2023-09-28 08:48:41 -05:00
Tim Levett
ebec452f9f
Use the full commit sha (#75489)
remove the --short from the commit sha because we had issues with our commit lookup with the short
2023-09-26 14:15:39 -05:00
Kat Yang
9532ff3799
Chore: Split OSS and Enterprise OAPI Spec Generation (#75133)
* chore: implement sofia makefile changes from #62456

* chore: clean up makefile and generate specs

* docs: update command to delete old specs

* fix: regenerate specs with enterprise linked

* chore: implement review comments

* Update Makefile

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* chore: update make command in drone step

* chore: update bingo, fix makefile indentation error, regen specs

* fix: revert .bingo/README changes to make prettier happy

* chore: add BEP as owners of api-enterprise-spec.json

* chore: rerun drone

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2023-09-25 15:34:57 -04:00
Horst Gutmann
39dbd98458
Chore: Upgrade Go to 1.20.8 (#74978)
chore: Update to Go 1.20.8
2023-09-18 11:29:50 +03:00
Kevin Minehart
915f198ecb
Refactor starlark to remove references to the build_image (#74624)
* Refactor starlark to remove references to the build_image
2023-09-12 12:19:06 -03:00
Dan Cech
85a207fceb
Chore: Replace entity GRN with infra/grn GRN (#74198)
replace entity GRN with infra/grn GRN
2023-08-31 15:43:35 -04:00
Josh Hunt
654d99fbca
Chore: Replace Husky/Lint-staged with Lefthook (#66608)
* Switch from husky+precommit to lefthook

Migrate from husky/precommit to lefthook

h

old husky precommit

lefthook so far

remove husky folder

switch to new lefthook package

Add postinstall script to clean up after husky

preinstall to remove husky config

package.json

package.json

package.json

script

v

Reduce lefthook output

Cleanup

testing

reduce output

testing betterer

testing betterer

testing betterer

testing betterer

testing betterer

testing betterer

testing betterer

skip skipping execution info

small cleanup

remove comment from testing

clean up old husky hooks in .git/hooks path

run scripts in parallel

update codeowners

don't auto-install lefthook

install lefthook with make command

fix yarn checksum

* update codeowners

* don't use source because it isn't available in ubuntu/debian's /bin/sh

* Ensure lefthook commits files fixed by precommit hooks

* add comment to lefthook.rc explaining what it does

* add i18n:pseudo precommit

* Don't create .husky/safe-to-delete file anymore

* cleanup old lint-staged config

* contribute docs

* update lefthook to 1.4.8

* Move frontend encouragement docs

* rewrite husky cleanup script in bash so we can run it with make

* Make old husky precommit script reject commits until husky is removed

* log precommit warning for everyone

* fix package.json

* run lefthook hooks from old husky hook

* run lefthook hooks from old husky hook

* comments

* codeowners

* codeowners
2023-08-17 09:56:52 +00:00
Emil Tullstedt
e07fbeef60
Chore: Upgrade Go to 1.20.6 (#71440) 2023-07-12 15:32:40 +02:00
Agnès Toulet
f96ceb7804
Kinds: Fix report generation (#71048)
Fix kindsys report generation
2023-07-05 14:58:00 -04:00
OdysseyGuy
da54fe8ae8
Removed duplicate build flags. (#70653) 2023-06-27 10:09:44 +03:00
sam boyer
2bef09bfcb
All: Remove make gen-cue from main dev flow (#67838) 2023-05-04 16:40:35 +03:00
Sofia Papagiannaki
9812ad2cb2
Chore: Upgrade Go to 1.20.4 (#67748)
Upgrade Go to 1.20.4
2023-05-04 10:52:43 +03:00
Guilherme Caulada
614427c602
Build: Add optional build-args for COMMIT_SHA and BUILD_BRANCH (#66672)
* Remove .git from .dockerignore

* Revert "Remove .git from .dockerignore"

This reverts commit 5a4658f270.

* Add optional COMMIT_SHA and BUILD_BRANCH environment variables
2023-04-18 10:03:27 -03:00
Serge Zaitsev
391a192310
Chore: Try a different way to run integration tests (#66653)
* try a different way to run integration tests

* fix formatting

* clean test cache again

* use previous command

* playing around with random commands

* dont run tests in parallel yet

* use parallel option instead of gomaxprocs

* use same package set for redis/memcached; use p=1
2023-04-17 18:33:43 +02:00
Emil Tullstedt
202afb9041
Chore: Upgrade Go to 1.20.3 (#66264) 2023-04-14 10:01:14 +02:00
Sofia Papagiannaki
caac9838d8
Build: Fix Redis/Memcached integration tests (#64298)
* Build: Fix integration cache tests

* Allow REDIS_URL with scheme

* Reduce cache integration tests timeout to 5m

* Apply suggestion from code review

* Run redis/memcached integration tests in OSS pipelines

* Change redis image
2023-04-05 11:55:55 +03:00
Guilherme Caulada
ac03c0efed
Docker: Allow docker-build-full to work for BSD and GNU based systems (#65216)
* Replace tmp folder for tar stdin on build-docker-full

* Fix building linux/arm64 images using the Dockerfile
   Introduces JS_PLATFORM variable with linux/amd64 as default to allow building node packages.

* Revert unintended white line changes on Dockerfile
2023-03-23 12:03:25 -03:00
Serge Zaitsev
2d30f33ad8
Chore: Unite wire graphs for cli and server (#61143)
* Chore: unite wire graphs for cli and server

* remove cli wire once again

* try to fix runner wire injection

* unify runner initialisation
2023-03-17 16:36:39 +01:00
Todd Treece
c1f1cb8524
Chore: Remove apiserver from devenv sources (#64847) 2023-03-15 14:46:35 -04:00
Guilherme Caulada
69aba3eed3
Dockerfile: Allow building docker images locally for different editions (#63893)
* Allow to build different editions from dockerfile

* Fix missing argument on dockerfile
2023-02-28 17:18:00 -03:00
Emil Tullstedt
110b05a0c0
Chore: Upgrade Go to 1.20.1 and Alpine to 3.17 (#63639) 2023-02-27 14:50:32 +01:00
Emil Tullstedt
c72d18f5e6
Revert "Chore: Upgrade Go to 1.20.1 and Alpine to 3.17 (#63506)" (#63567)
This reverts commit 747ddf7b33.
2023-02-22 08:14:26 -05:00
Emil Tullstedt
747ddf7b33
Chore: Upgrade Go to 1.20.1 and Alpine to 3.17 (#63506) 2023-02-22 11:53:06 +01:00
Todd Treece
dea108a8b9
DevEnv: Add k8s apiserver (#63031)
Adds kind to bingo dependencies, and makes it available via `make devenv sources=apiserver`.
2023-02-07 20:34:05 -05:00
Sofia Papagiannaki
29d3e696f0
Swagger: Fix circular reference (#62673)
* Swagger: Fix circular reference

* gitignore intermediate swagger file

* Update specs

* Do not generate specs when building the backend
2023-02-02 13:18:04 +02:00
Sofia Papagiannaki
f8bd13ffad
Chore: Regenerate swagger and openapi specifications (#62561) 2023-01-31 11:00:45 +00:00
Jack Baldry
8379a5338c
CI: Lint starlark files with buildifier (#59157)
* Add verify-starlark build action that returns an error for starlark files with lint

Relies on `buildifier` tool.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add verify_starlark_step to PR pipeline

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Manually fetch buildifier in curl_image until a new build_image is created

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Format with buildifier

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Remove all unused variables retaining one unused function

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Use snake_case for variable

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Replace deprecated dictionary concatenation with .update() method

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Start adding docstrings for all modules and functions

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Prefer os.WriteFile as ioutil.WriteFile has been deprecated since go 1.16

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Attempt to document the behavior of the init_enterprise_step

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document test_backend pipeline

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document enterprise_downstream_step

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document the pipeline utility function

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document publish_images_step

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document publish_images_steps

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document enterprise2_pipelines function

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add tags table for Starlark files.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document test_frontend

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document windows function

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add docstrings to verifystarlark functions

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Refactor error handling to be more clear and document complex behavior

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Split errors into execution errors and verification errors

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document all other library functions

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add local variables to TAGS

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add blank line between all Args and Returns sections

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix new linting errors

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Lint new Starlark files

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Correct buildifier binary mv

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Document the need to set nofile ulimit to at least 2048

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Update build-container to include buildifier

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Ensure buildifier binary is executable

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix valid content test

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Simply return execution error

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Only check files rather than fixing them

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Use updated build-container with executable buildifier

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Test that context cancellation stops execution

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Simplify error handling

Return execution errors that short circuit WalkDir rather than
separately tracking that error.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Remove fetching of buildifier binary now that it is in the build-container

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Use build image in verify-starlark step

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Use semver tag

The image is the same but uses a semver tag to make it clearer that
this is a forward upgrade from the old version.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Use node 18 image with buildifier

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

---------

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2023-01-30 09:27:11 +00:00
Selene
6f26333e96
Chore: Add cuefix hook (#61941)
* Add cue

* Add fix-cue target

* Add pre-commit hook

* fixup! Add fix-cue target

* Update the cue version

* Add datasources and panels folders

* Update cue files

Co-authored-by: Tania B <yalyna.ts@gmail.com>
2023-01-23 20:36:46 -05:00
sam boyer
492bdbd585
Kindsys: Rename mudball to common schemas, allow multiple input cue files (#61703)
* kindsys: Rename mudball to common schemas

* Update all core plugin imports

* Add missed table types

* Remove invalid JSON comment

* Remove coremodel dir from codeowners
2023-01-18 17:40:22 +00:00
Emil Tullstedt
bf574e98c8
Chore: Upgrade Go to 1.19.4 (#60794) 2022-12-29 13:03:56 +01:00
Joan López de la Franca Beltran
329fedb55d
Codegen: Fix mudball gen (#60812)
* Codegen: Fix mudball gen

* Fix Go build tags annotations
2022-12-29 12:48:27 +01:00
sam boyer
cc4d18f626
kindsys: Include composable kinds and planned maturity in report (#60477)
kindsys: Include composable kinds + planned maturity
2022-12-19 09:14:51 +01:00
Joan López de la Franca Beltran
61cd9eeb24
Kinds: Generate JSON report (#59742)
* Kinds: Generate JSON report

* Kinds: Add Validate/Write support for JSON report

* Kinds: Report format

* Kinds: Report new line

* Kinds: Use kindsys.SomeKindMeta to generate the report

* Move kinds report generation to the end

* Re-structure kinds report JSON output

* Make prettier to ignore kinds json report

* Minor on kinds report generation

* Fix toggles_gen test
2022-12-12 15:47:19 +01:00
Dan Cech
440d8a3d88
Build: Drone starlark file cleanup (#59919)
* format drone starlark files with black

* clean up unused params

* more simplification

* more cleanup

* more cleanup
2022-12-07 09:13:57 +02:00
Marcus Andersson
7f92f1df00
Schema: Refactor plugin code generation (#58901)
* wip

* wip

* almost there..

* wip - change so it can run.

* treelist is working.

* support CODEGEN_VERIFY env variable

* use log.fatal

* comment out old PluginTreeList code generation

* cleanup

* rename corelist package files

* fix makefile

* move pkg/codegen/pluggen.go to pkg/plugins/codegen

* copy and refactor files to pkg/plugins/codegen

* use pkg/plugins/codegen instead of pkg/codegen for core plugins code gen

* remove unneeded files

* remove unused code to resolve linting errors

* adapters first hack

* added flattener

* add back ignore build tags to go generate file

* cleaned up the code a bit.

* seems to work, needs to do some refactoring of the GoTypesJenns and TSTypesJenny.

* one more step, going to get upstream changes in this branch.

* working but need to run import tmpl in jenny_schemapath to have the proper imports.

* added header to generated files.

* added missing jenny.

* preventing plugins with multiple decls/schemas to insert multiple lines in corelist.

* fixed so we use Slot type from kindsys to detect if its group.

* adding a go jenny that only runs if the plugin has a backend.

* added version object to generated ts.

* generating the ts types with the same output as prior to this refactoring.

* removed code that is replaced by the jenny pattern.

* removed the go code that isn't used anymore.

* removed some more unused code and renamed pluggen to util_ts

* fixed linting issue.

* removed unused vars.

* use a jenny list postprocessor for header injection

* moved decl and decl_parser to pfs.

* removed the pre-pended header in the gotypes jenny since it is done in the postprocess.

* moved decl to pfs.

* removed unused template.

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-12-02 08:22:28 +01:00
Dan Cech
7436872dab
Build: Unified dockerfile for all builds (#59173)
* unified dockerfile for all builds

* update builder

* include docker commands and output in logs

* quiet docker build

* quiet gsutil
2022-11-28 16:18:53 -05:00
Dan Cech
9fec54df2d
Build: Streamline and sync dockerfiles (#58101)
* streamline and sync dockerfiles

* improve go dependency cacheability

* unify alpine and ubuntu Dockerfiles

* include glibc support in locally-built alpine images
2022-11-28 14:43:42 -05:00
Dan Cech
de99ce139c
Server: Switch from separate server & cli to a unified grafana binary (#58286)
* avoid the need for a second bulky binary for grafana-cli

* look for grafana-server in $PATH as well as same directory

* implement unified "grafana" command

* update dockerfiles, fix grafana-cli -v

* update packaging to work with single binary

- add wrapper scripts for grafana and grafana-server
- update and sync package files
- implement --sign flag of build package command
- stop packaging scripts folder, they are not useful for end users
- add support for --configOverrides in server command
- remove unused nfpm.yaml config file

* windows support
2022-11-22 11:53:43 -05:00
sam boyer
78f0340031
plugindef: Move pluginmeta out of coremodels as standalone thema lineage (#56765)
* Get pluginmeta mostly moved over to pkg/plugins/plugindef

* Remove dead func

* Fix up pfs, use sync.Once in plugindef

* Update to latest thema

* Chase Endec->Codec conversion in Thema

* Comments on slash header gen; use ToSlash

* Also generate JSON schema for plugindef

* Generate JSON Schema as well

* Fix slot loading from kindsys cue decls

* Remove unused vars

* skip generating plugin.schema.json for now

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-11-15 14:48:31 +01:00