Skip to content

Commit

Permalink
Clean up build
Browse files Browse the repository at this point in the history
  • Loading branch information
bziobrowski committed Feb 21, 2024
1 parent c5cc51c commit b045431
Show file tree
Hide file tree
Showing 12 changed files with 1,513 additions and 1,070 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/dependabot-reviewer.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/issue_commands.yml

This file was deleted.

266 changes: 133 additions & 133 deletions .github/workflows/pull-request-image.yml
Original file line number Diff line number Diff line change
@@ -1,133 +1,133 @@
name: Create Docker image for local testing

on:
pull_request:
types: [opened, reopened, synchronize]
branches:
- main

permissions:
pull-requests: write
issues: write

jobs:
build:
name: Build and archive plugin build artifacts
runs-on: ubuntu-latest
strategy:
fail-fast: true

steps:
- uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version-file: '.nvmrc'

- name: Install Go environment
uses: actions/setup-go@v5
with:
go-version: 'stable'

- name: Install yarn dependencies
run: yarn install
env:
NODE_OPTIONS: '--max_old_space_size=4096'

- name: Build
run: go build -v ./...

- name: Build Frontend
run: yarn build
env:
NODE_OPTIONS: '--max_old_space_size=4096'

- name: Archive plugin build artifacts
uses: actions/upload-artifact@v4
with:
name: plugin-dist
path: |
dist
retention-days: 1
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
needs: build
steps:
- name: Download plugin build artifacts
uses: actions/download-artifact@v4
id: download
with:
name: plugin-dist

- name: Generate Dockerfile
shell: bash
run: |
echo "FROM grafana/grafana-oss:latest
# Make it as simple as possible to access the grafana instance for development purposes
# Do NOT enable these settings in a public facing / production grafana instance
ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin"
ENV GF_AUTH_ANONYMOUS_ENABLED "true"
ENV GF_AUTH_BASIC_ENABLED "false"
# Set development mode so plugins can be loaded without the need to sign
ENV GF_DEFAULT_APP_MODE "development"
# TODO: Cleanup script should remove images from closed PRs using these labels
LABEL gh-sha="${{ github.event.pull_request.head.sha }}"
LABEL gh-repo="${{ github.event.repository.name }}"
LABEL gh-pr-number="${{ github.event.number }}"
# Copy plugin build artifacts into the image
COPY . /var/lib/grafana/plugins/${{ github.event.repository.name }}/" > Dockerfile
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: grafana/plugin-builds:${{ github.event.pull_request.head.sha }}pre
add_pr_comment:
name: Add PR comment
runs-on: ubuntu-latest
needs: push_to_registry
steps:
- name: Find previous comment (if any)
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.number }}
body-includes: Use the following command to run this PR with Docker
- name: Update comment on PR
if: steps.fc.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
issue-number: ${{ github.event.number }}
body: |
Use the following command to run this PR with Docker at http://localhost:3000:
```
docker run --rm -p 3000:3000 grafana/plugin-builds:${{ github.event.pull_request.head.sha }}pre
```
- name: Add comment to PR
if: steps.fc.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.number }}
body: |
Use the following command to run this PR with Docker at http://localhost:3000:
```
docker run --rm -p 3000:3000 grafana/plugin-builds:${{ github.event.pull_request.head.sha }}pre
```
#name: Create Docker image for local testing
#
#on:
# pull_request:
# types: [opened, reopened, synchronize]
# branches:
# - main
#
#permissions:
# pull-requests: write
# issues: write
#
#jobs:
# build:
# name: Build and archive plugin build artifacts
# runs-on: ubuntu-latest
# strategy:
# fail-fast: true
#
# steps:
# - uses: actions/checkout@v4
#
# - name: Setup Node.js environment
# uses: actions/[email protected]
# with:
# node-version-file: '.nvmrc'
#
# - name: Install Go environment
# uses: actions/setup-go@v5
# with:
# go-version: 'stable'
#
# - name: Install yarn dependencies
# run: yarn install
# env:
# NODE_OPTIONS: '--max_old_space_size=4096'
#
# - name: Build
# run: go build -v ./...
#
# - name: Build Frontend
# run: yarn build
# env:
# NODE_OPTIONS: '--max_old_space_size=4096'
#
# - name: Archive plugin build artifacts
# uses: actions/upload-artifact@v4
# with:
# name: plugin-dist
# path: |
# dist
# retention-days: 1
# push_to_registry:
# name: Push Docker image to Docker Hub
# runs-on: ubuntu-latest
# needs: build
# steps:
# - name: Download plugin build artifacts
# uses: actions/download-artifact@v4
# id: download
# with:
# name: plugin-dist
#
# - name: Generate Dockerfile
# shell: bash
# run: |
# echo "FROM grafana/grafana-oss:latest
#
# # Make it as simple as possible to access the grafana instance for development purposes
# # Do NOT enable these settings in a public facing / production grafana instance
# ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin"
# ENV GF_AUTH_ANONYMOUS_ENABLED "true"
# ENV GF_AUTH_BASIC_ENABLED "false"
#
# # Set development mode so plugins can be loaded without the need to sign
# ENV GF_DEFAULT_APP_MODE "development"
#
# # TODO: Cleanup script should remove images from closed PRs using these labels
# LABEL gh-sha="${{ github.event.pull_request.head.sha }}"
# LABEL gh-repo="${{ github.event.repository.name }}"
# LABEL gh-pr-number="${{ github.event.number }}"
#
# # Copy plugin build artifacts into the image
# COPY . /var/lib/grafana/plugins/${{ github.event.repository.name }}/" > Dockerfile
#
# - name: Log in to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
#
# - name: Build and push Docker image
# uses: docker/build-push-action@v5
# with:
# context: .
# file: ./Dockerfile
# push: true
# tags: grafana/plugin-builds:${{ github.event.pull_request.head.sha }}pre
# add_pr_comment:
# name: Add PR comment
# runs-on: ubuntu-latest
# needs: push_to_registry
# steps:
# - name: Find previous comment (if any)
# uses: peter-evans/find-comment@v2
# id: fc
# with:
# issue-number: ${{ github.event.number }}
# body-includes: Use the following command to run this PR with Docker
# - name: Update comment on PR
# if: steps.fc.outputs.comment-id != ''
# uses: peter-evans/create-or-update-comment@v3
# with:
# comment-id: ${{ steps.fc.outputs.comment-id }}
# edit-mode: replace
# issue-number: ${{ github.event.number }}
# body: |
# Use the following command to run this PR with Docker at http://localhost:3000:
#
# ```
# docker run --rm -p 3000:3000 grafana/plugin-builds:${{ github.event.pull_request.head.sha }}pre
# ```
# - name: Add comment to PR
# if: steps.fc.outputs.comment-id == ''
# uses: peter-evans/create-or-update-comment@v3
# with:
# issue-number: ${{ github.event.number }}
# body: |
# Use the following command to run this PR with Docker at http://localhost:3000:
#
# ```
# docker run --rm -p 3000:3000 grafana/plugin-builds:${{ github.event.pull_request.head.sha }}pre
# ```
2 changes: 0 additions & 2 deletions .github/workflows/run-backend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ name: run-backend-tests
on:
push:
branches:
- v1
- main
pull_request:
branches:
- v1
- main
schedule:
- cron: '0 9 1 * *'
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/run-frontend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ name: run-frontend-tests
on:
push:
branches:
- v1
- main
pull_request:
branches:
- v1
- main
schedule:
- cron: '0 9 1 * *'
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ You need to have commit rights to the GitHub repository to publish a release.
from [GitHub's Release drafter interface](https://github.com/questdb/grafana-questdb-datasource/releases/new) or by
running `npm run generate-release-notes`.
3. PR the changes.
4. Once merged, follow the Drone release process that you can find [here](https://github.com/grafana/integrations-team/wiki/Plugin-Release-Process#drone-release-proces
4. Once merged, follow the Drone release process that you can find [here](https://github.com/grafana/integrations-team/wiki/Plugin-Release-Process#drone-release-proces)
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# QuestDB data source for Grafana

<img alt="Sql builder" src="sql_builder.png" width="800"/>

The QuestDB data source plugin allows you to query and visualize QuestDB
data from within Grafana.

Expand All @@ -19,11 +21,17 @@ example, statements like `UPDATE users SET name='blahblah'`
and `DROP TABLE importantTable;` would be executed.

To configure a readonly user, follow these steps:
1. Set the following properties in server.conf file:
- pg.readonly.user.enabled=true
- pg.readonly.user=myuser
- pg.readonly.password=secret
2. Restart QuestDB instance.
* Open Source version
1. Set the following properties in server.conf file:
- pg.readonly.user.enabled=true
- pg.readonly.user=myuser
- pg.readonly.password=secret
2. Restart QuestDB instance.
* Enterprise version
1. Create user:
- CREATE USER grafana_readonly;
2. Grant read permission on selected tables/table columns ;
- GRANT SELECT ON table1, ... TO grafana_readonly;

### Manual configuration

Expand Down
Loading

0 comments on commit b045431

Please sign in to comment.