Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Extend Functionality of Grafana Package #2098

Open
wants to merge 17 commits into
base: version-3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 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
142 changes: 142 additions & 0 deletions repo/packages/G/grafana/7/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"type": "object",
"properties": {
"service": {
"type": "object",
"description": "DC/OS service configuration properties",
"properties": {
"name": {
"description": "The name of the service instance",
"type": "string",
"default": "grafana",
"title": "Service name"
},
"user": {
"description": "The user that the service will run as.",
"type": "string",
"default": "root",
"title": "User"
},
"service_account": {
"description": "The service account for DC/OS service authentication. This is typically left empty to use the default unless service authentication is needed. The value given here is passed as the principal of Mesos framework.",
"type": "string",
"default": ""
},
"service_account_secret": {
"description": "Name of the Secret Store credentials to use for DC/OS service authentication. This should be left empty unless service authentication is needed.",
"type": "string",
"default": "",
"title": "Credential secret name (optional)"
},
"mesos_api_version": {
"description": "Configures the Mesos API version to use. Possible values: V0 (non-HTTP), V1 (HTTP)",
"type": "string",
"enum": [
"V0",
"V1"
],
"default": "V1"
},
"log_level": {
"description": "The log level for the DC/OS service.",
"type": "string",
"enum": [
"OFF",
"FATAL",
"ERROR",
"WARN",
"INFO",
"DEBUG",
"TRACE",
"ALL"
],
"default": "INFO"
}
},
"required": [
"name",
"user"
]
},
"grafana": {
"description": "grafana pod configuration properties",
"type": "object",
"properties": {
"cpus": {
"description": "Grafana pod CPU requirements",
"type": "number",
"default": 0.2
},
"mem": {
"description": "Grafana pod mem requirements (in MB)",
"type": "integer",
"default": 2048
},
"volume": {
"description": "Grafana volume requirements",
"type": "object",
"properties": {
"path": {
"description": "Location of persistent volume to store data",
"type": "string",
"default": "grafana-data"
},
"type": {
"description": "The type of persistent volume to use, one of ROOT or MOUNT",
"type": "string",
"default": "ROOT",
"enum": [
"ROOT",
"MOUNT",
"PATH"
]
},
"size": {
"description": "The size of the persistent volume in MB",
"type": "integer",
"default": 512,
"minimum": 512
}
}
},
"ini": {
"description": "Base64 encoded conf/grafana.ini",
"type": "string",
"media": {
"binaryEncoding": "base64",
"type": "application/x-yaml"
},
"default": "YXBwX21vZGUgPSBwcm9kdWN0aW9uCmluc3RhbmNlX25hbWUgPSAke0hPU1ROQU1FfQpbcGF0aHNdCmRhdGEgPSAvZ3JhZmFuYS1kYXRhCjt0ZW1wX2RhdGFfbGlmZXRpbWUgPSAyNGgKbG9ncyA9IC9ncmFmYW5hLWRhdGEKcGx1Z2lucyA9IC9ncmFmYW5hLWRhdGEvcGx1Z2lucwpwcm92aXNpb25pbmcgPSBjb25mL3Byb3Zpc2lvbmluZwoK"
},
"provisioning": {
"description": "Provisioning properties to be used",
"type": "object",
"properties": {
"datasources": {
"description": "Base64 encoded conf/provisioning/datasources/datasources.yml",
"type": "string",
"media": {
"binaryEncoding": "base64",
"type": "application/x-yaml"
},
"default": "YXBpVmVyc2lvbjogMQoKI2RlbGV0ZURhdGFzb3VyY2VzOgojICAtIG5hbWU6IFByb21ldGhldXMKIyAgICBvcmdJZDogMQoKI2RhdGFzb3VyY2VzOgojICAtIG5hbWU6IFByb21ldGhldXMKIyAgICB0eXBlOiBwcm9tZXRoZXVzCiMgICAgYWNjZXNzOiBwcm94eQojICAgIG9yZ0lkOiAxCiMgICAgdXJsOiBodHRwOi8vcHJvbWV0aGV1cy5wcm9tZXRoZXVzLmw0bGIudGhpc2Rjb3MuZGlyZWN0b3J5OjkwOTAKIyAgICBpc0RlZmF1bHQ6IHRydWUKIyAgICBqc29uRGF0YTogeyAidGltZUludGVydmFsIjogIjMwcyIgfQo"
},
"dashboards": {
"description": "Base64 encoded conf/provisioning/dashboards/dashboards.yml config",
"type": "string",
"media": {
"binaryEncoding": "base64",
"type": "application/x-yaml"
},
"default": "YXBpVmVyc2lvbjogMQoK"
}
}
}
},
"required": [
"cpus",
"mem"
]
}
}
}
104 changes: 104 additions & 0 deletions repo/packages/G/grafana/7/marathon.json.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@

{
"id": "{{service.name}}",
"cpus": 1.0,
"mem": 1024,
"instances": 1,
"user": "{{service.user}}",
"cmd": "export LD_LIBRARY_PATH=$MESOS_SANDBOX/libmesos-bundle/lib:$LD_LIBRARY_PATH; export MESOS_NATIVE_JAVA_LIBRARY=$(ls $MESOS_SANDBOX/libmesos-bundle/lib/libmesos-*.so); export JAVA_HOME=$(ls -d $MESOS_SANDBOX/jdk*/jre/); export JAVA_HOME=${JAVA_HOME%/}; export PATH=$(ls -d $JAVA_HOME/bin):$PATH && export JAVA_OPTS=\"-Xms256M -Xmx512M -XX:-HeapDumpOnOutOfMemoryError\" && ./bootstrap -resolve=false -template=false && ./operator-scheduler/bin/operator svc.yml",
"labels": {
"DCOS_COMMONS_API_VERSION": "v1",
"DCOS_COMMONS_UNINSTALL": "true",
"DCOS_PACKAGE_FRAMEWORK_NAME": "{{service.name}}",
"MARATHON_SINGLE_INSTANCE_APP": "true",
"DCOS_SERVICE_NAME": "{{service.name}}",
"DCOS_SERVICE_PORT_INDEX": "0",
"DCOS_SERVICE_SCHEME": "http"
},
{{#security.secret-name}}
"container": {
"type": "MESOS",
"volumes":[
{
"containerPath": "secrets/service-account.json",
"secret": "serviceCredential"
}
]
},
"secrets": {
"serviceCredential": {
"source": "{{security.secret-name}}"
}
},
{{/security.secret-name}}
"env": {
"PACKAGE_NAME": "{{package-name}}",
"PACKAGE_VERSION": "{{package-version}}",
"PACKAGE_BUILD_TIME_EPOCH_MS": "1531343768523",
"PACKAGE_BUILD_TIME_STR": "2018-07-11T21:16:08.523025",
"FRAMEWORK_NAME": "{{service.name}}",
"FRAMEWORK_USER": "{{service.user}}",
"FRAMEWORK_PRINCIPAL": "{{service.service_account}}",
"FRAMEWORK_LOG_LEVEL": "{{service.log_level}}",
"MESOS_API_VERSION": "{{service.mesos_api_version}}",

"GRAFANA_CPUS": "{{grafana.cpus}}",
"GRAFANA_MEM": "{{grafana.mem}}",
"GRAFANA_VOLUME": "{{grafana.volume.path}}",
"GRAFANA_VOLUME_TYPE": "{{grafana.volume.type}}",
"GRAFANA_VOLUME_SIZE": "{{grafana.volume.size}}",
"GRAFANA_INI": "{{grafana.ini}}",
"GRAFANA_DSP": "{{grafana.provisioning.datasources}}",
"GRAFANA_DBP": "{{grafana.provisioning.dashboards}}",

"NODE_COUNT": "{{node.count}}",
"NODE_PLACEMENT": "{{{node.placement_constraint}}}",

"NODE_CPUS": "{{node.cpus}}",
"NODE_MEM": "{{node.mem}}",
"NODE_DISK": "{{node.disk}}",
"NODE_DISK_TYPE": "{{node.disk_type}}",

"JAVA_URI": "{{resource.assets.uris.jre-tar-gz}}",
"EXECUTOR_URI": "{{resource.assets.uris.executor-zip}}",
"BOOTSTRAP_URI": "{{resource.assets.uris.bootstrap-zip}}",
"GRAFANA_URI": "{{resource.assets.uris.grafana-tar-gz}}",
{{#security.secret-name}}
"DCOS_SERVICE_ACCOUNT_CREDENTIAL": "secrets/service-account.json",
"MESOS_MODULES": "{\"libraries\":[{\"file\":\"libmesos-bundle\/lib\/mesos\/libdcos_security.so\",\"modules\":[{\"name\": \"com_mesosphere_dcos_ClassicRPCAuthenticatee\"},{\"name\":\"com_mesosphere_dcos_http_Authenticatee\",\"parameters\":[{\"key\":\"jwt_exp_timeout\",\"value\":\"5mins\"},{\"key\":\"preemptive_refresh_duration\",\"value\":\"30mins\"}]}]}]}",
"MESOS_AUTHENTICATEE": "com_mesosphere_dcos_ClassicRPCAuthenticatee",
"MESOS_HTTP_AUTHENTICATEE": "com_mesosphere_dcos_http_Authenticatee",
{{/security.secret-name}}
"LIBMESOS_URI": "{{resource.assets.uris.libmesos-bundle-tar-gz}}"
},
"uris": [
"{{resource.assets.uris.bootstrap-zip}}",
"{{resource.assets.uris.jre-tar-gz}}",
"{{resource.assets.uris.scheduler-zip}}",
"{{resource.assets.uris.libmesos-bundle-tar-gz}}",
"{{resource.assets.uris.svc}}"
],
"upgradeStrategy":{
"minimumHealthCapacity": 0,
"maximumOverCapacity": 0
},
"healthChecks": [
{
"protocol": "MESOS_HTTP",
"path": "/v1/health",
"gracePeriodSeconds": 900,
"intervalSeconds": 30,
"portIndex": 0,
"timeoutSeconds": 30,
"maxConsecutiveFailures": 0
}
],
"portDefinitions": [
{
"port": 0,
"protocol": "tcp",
"name": "api",
"labels": { "VIP_0": "/api.{{service.name}}:80" }
}
]
}
23 changes: 23 additions & 0 deletions repo/packages/G/grafana/7/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"packagingVersion": "4.0",
"upgradesFrom": [
"*"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be the previous package version?

],
"downgradesTo": [
"*"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be the previous package version?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied this from 6/package.json. Should I change it to 3.0?

],
"minDcosReleaseVersion": "1.11",
"name": "grafana",
"version": "5.5.0-5.3.4",
"maintainer": "https://dcos.io/community",
"description": "Grafana on DC/OS",
"selected": false,
"framework": true,
"tags": [
"grafana",
"monitoring",
"visualization"
],
"postInstallNotes": "DC/OS Grafana is being installed!",
"postUninstallNotes": "DC/OS Grafana is being uninstalled."
}
62 changes: 62 additions & 0 deletions repo/packages/G/grafana/7/resource.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"assets": {
"uris": {
"jre-tar-gz": "https://downloads.mesosphere.com/java/server-jre-8u192-linux-x64.tar.gz",
"libmesos-bundle-tar-gz": "https://downloads.mesosphere.com/libmesos-bundle/libmesos-bundle-1.12.0.tar.gz",
"bootstrap-zip": "http://downloads.mesosphere.com/dcos-commons/artifacts/0.42.1/bootstrap.zip",
"executor-zip": "http://downloads.mesosphere.com/dcos-commons/artifacts/0.42.1/executor.zip",
"scheduler-zip": "https://s3-us-west-1.amazonaws.com/mbgl-bucket/sdk/0.42.1/operator-scheduler.zip",
"svc": "https://s3-us-west-2.amazonaws.com/dcos-objects/grafana/7/svc.yml",
"grafana-tar-gz": "https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.3.4.linux-amd64.tar.gz"
}
},
"images": {
"icon-small": "https://downloads.mesosphere.com/assets/universe/000/grafana-icon-small.png",
"icon-medium": "https://downloads.mesosphere.com/assets/universe/000/grafana-icon-medium.png",
"icon-large": "https://downloads.mesosphere.com/assets/universe/000/grafana-icon-large.png",
"screenshots": [
"https://prometheus.io/assets/grafana_prometheus.png",
"https://grafana.com/blog/img/docs/v45/query_inspector.png"
]
},
"cli": {
"binaries": {
"darwin": {
"x86-64": {
"contentHash": [
{
"algo": "sha256",
"value": "c459d2109b31fc0b423f8cacd49df855ef898e63609f7050957f4a0e044d5432"
}
],
"kind": "executable",
"url": "https://downloads.mesosphere.com/dcos-commons/artifacts/0.42.1/dcos-service-cli-darwin"
}
},
"linux": {
"x86-64": {
"contentHash": [
{
"algo": "sha256",
"value": "e580ee8b71c0c26b1a1a605ca09cbd3528a2c031a8de11519024ccbbce862339"
}
],
"kind": "executable",
"url": "https://downloads.mesosphere.com/dcos-commons/artifacts/0.42.1/dcos-service-cli-linux"
}
},
"windows": {
"x86-64": {
"contentHash": [
{
"algo": "sha256",
"value": "9135f9456a40cd53e27e73e44fc94c1d4cbf27d9b59f2b47d82bad3ae0f8c714"
}
],
"kind": "executable",
"url": "https://downloads.mesosphere.com/dcos-commons/artifacts/0.42.1/dcos-service-cli.exe"
}
}
}
}
}