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

Add Auxillary services #597

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
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
22 changes: 22 additions & 0 deletions docker/grafana/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Grafana

This sample demonstrates how to deploy and use Grafana as a visualization tool in your Quix Cloud pipeline. Please note: this image is provided by Grafana and is offered as-is, with no specific support from Quix.

## How to Run

1. Log in or sign up at [Quix](https://portal.platform.quix.io/signup?xlink=github) and navigate to the Code Samples section.
2. Click **Deploy** to launch a pre-built container.
3. Fill in the required environment variables for your Grafana instance.
4. Enable state, otherwise changes will be lost on restart. Please note, the necessary storage type may not be supported on all Quix Platforms.

## Save dashboards with code

Dashboards can be [exported](https://grafana.com/docs/grafana/latest/dashboards/share-dashboards-panels/#export-a-dashboard-as-json) and saved under the `provisioning` folder, see `sensors.json` for example. This allows you to programmatically set up dashboards and protected them from accidental modification or if you want to set them up in other environments.

## Contribute

Feel free to fork this project on the [GitHub](https://github.com/quixio/quix-samples) repository and contribute your enhancements. Any accepted contributions will be attributed accordingly.

## License & Support

This project is open source under the Apache 2.0 license and available in our [GitHub](https://github.com/quixio/quix-samples) repo. Remember, this image is provided by Grafana and is offered as-is, with no Grafana specific support from Quix.
29 changes: 29 additions & 0 deletions docker/grafana/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Use the official Grafana image from the Docker Hub
FROM grafana/grafana:11.5.2

COPY provisioning/ /provisioning

# To enable function without State enabled, however will only be temporary
USER root
RUN mkdir -p /app/state
RUN chown grafana /app/state
USER grafana
RUN mkdir -p /app/state/data /app/state/logs /app/state/plugins /app/state/dashboards

# Set environment variables to point to /state/ folder
ENV GF_PATHS_DATA=/app/state/data \
GF_PATHS_LOGS=/app/state/logs \
GF_PATHS_PLUGINS=/app/state/plugins \
GF_PATHS_PROVISIONING=/provisioning \
GF_DASHBOARDS_PATH=/app/state/dashboards

# Set environment variables for the admin user.
ENV GF_SECURITY_ADMIN_USER=admin


# Optionally, override Grafana's default port
ENV GF_SERVER_HTTP_PORT=3000
EXPOSE 3000

# Command to start Grafana
CMD ["grafana-server", "--homepath=/usr/share/grafana"]
Binary file added docker/grafana/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions docker/grafana/library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"libraryItemId": "grafana",
"name": "Grafana",
"language": "docker",
"tags": {
"Category": ["Monitoring"]
},
"shortDescription": "Run Grafana in your pipeline.",
"DefaultFile": "dockerfile",
"EntryPoint": "dockerfile",
"IconFile": "icon.png",
"DeploySettings": {
"DeploymentType": "Service",
"CpuMillicores": 200,
"MemoryInMb": 800,
"Replicas": 1,
"PublicAccess": true,
"UrlPrefix": "grafana",
"Network": {
"ServiceName": "grafana",
"Ports":
[
{
"Port": 80,
"TargetPort": 3000
}
]
}
},
"Variables": [
{
"Name": "GF_SECURITY_ADMIN_PASSWORD",
"Type": "EnvironmentVariable",
"InputType": "Secret",
"Description": "Password for the admin user",
"DefaultValue": "ADMIN_PASSWORD",
"Required": true
},
{
"Name": "INFLUXDB_TOKEN",
"Type": "EnvironmentVariable",
"InputType": "Secret",
"Description": "The optional InfluxDB Token to use",
"DefaultValue": "INFLUXDB_ADMIN_TOKEN",
"Required": false
}
]
}
12 changes: 12 additions & 0 deletions docker/grafana/provisioning/dashboards/dashboard_provisioning.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: 1

providers:
- name: 'default'
org_id: 1
folder: ''
type: file
disableDeletion: false
updateIntervalSeconds: 10
options:
path: /provisioning/dashboards

Loading