Skip to content

Commit

Permalink
Dockerfile changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksongoode committed May 17, 2024
1 parent 6e6fbf6 commit 94681e7
Show file tree
Hide file tree
Showing 52 changed files with 276 additions and 142 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-gridwatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build & Publish GridWatch Image

on:
workflow_dispatch:
push:
tags:
- v*.*.*-gridwatch-*

env:
REPO: gcr.io/powerwatch-backend/nline-grafana-image

jobs:
build-and-push-to-gcr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCLOUD_JSON }}

- name: Configure Docker for GCR
run: |
gcloud --quiet auth configure-docker
gcloud --quiet config set project powerwatch-backend
- name: Build and push Docker image
run: |
NAME=$REPO:${{github.ref_name}}
docker build -t $NAME -f Dockerfile .
docker push $NAME
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: |
~/.docker
key: ${{ runner.os }}-docker-${{ hashFiles('**`/Dockerfile') }}
restore-keys: |
${{ runner.os }}-docker-
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ ARG GO_BUILD_TAGS="oss"
ARG WIRE_TAGS="oss"
ARG BINGO="true"

# This is required to allow building on arm64 due to https://github.com/golang/go/issues/22040
RUN apk add --no-cache binutils-gold

# Install build dependencies
RUN if grep -i -q alpine /etc/issue; then \
apk add --no-cache gcc g++ make git; \
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,19 @@ build-docker-full: ## Build Docker image for development.
--tag grafana/grafana$(TAG_SUFFIX):dev \
$(DOCKER_BUILD_ARGS)

build-docker-arm: ## Build ARM Docker image for development.
@echo "build docker container"
tar -ch . | \
docker buildx build - \
--platform linux/arm64/v8 \
--build-arg BINGO=false \
--build-arg GO_BUILD_TAGS=$(GO_BUILD_TAGS) \
--build-arg WIRE_TAGS=$(WIRE_TAGS) \
--build-arg COMMIT_SHA=$$(git rev-parse HEAD) \
--build-arg BUILD_BRANCH=$$(git rev-parse --abbrev-ref HEAD) \
--tag grafana/grafana$(TAG_SUFFIX):dev \
$(DOCKER_BUILD_ARGS)

build-docker-full-ubuntu: ## Build Docker image based on Ubuntu for development.
@echo "build docker container"
tar -ch . | \
Expand Down
18 changes: 9 additions & 9 deletions conf/sample.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
;static_root_path = public

# enable gzip
;enable_gzip = false
enable_gzip = true

# https certs & key file
;cert_file =
Expand Down Expand Up @@ -247,7 +247,7 @@
# No ip addresses are being tracked, only simple counters to track
# running instances, dashboard and error counts. It is very helpful to us.
# Change this option to false to disable reporting.
;reporting_enabled = true
reporting_enabled = false

# The name of the distributor of the Grafana instance. Ex hosted-grafana, grafana-labs
;reporting_distributor = grafana-labs
Expand All @@ -257,14 +257,14 @@
# in some UI views to notify that a grafana update exists.
# This option does not cause any auto updates, nor send any information
# only a GET request to https://grafana.com/api/grafana/versions/stable to get the latest version.
;check_for_updates = true
check_for_updates = false

# Set to false to disable all checks to https://grafana.com
# for new versions of plugins. The check is used
# in some UI views to notify that a plugin update exists.
# This option does not cause any auto updates, nor send any information
# only a GET request to https://grafana.com to get the latest versions.
;check_for_plugin_updates = true
check_for_plugin_updates = false

# Google Analytics universal tracking code, only enabled if you specify an id here
;google_analytics_ua_id =
Expand Down Expand Up @@ -335,10 +335,10 @@
;cookie_secure = false

# set cookie SameSite attribute. defaults to `lax`. can be set to "lax", "strict", "none" and "disabled"
;cookie_samesite = lax
cookie_samesite = disabled

# set to true if you want to allow browsers to render Grafana in a <frame>, <iframe>, <embed> or <object>. default is false.
;allow_embedding = false
allow_embedding = true

# Set to true if you want to enable http strict transport security (HSTS) response header.
# HSTS tells browsers that the site should only be accessed using HTTPS.
Expand Down Expand Up @@ -457,7 +457,7 @@
;password_hint = password

# Default UI theme ("dark" or "light")
;default_theme = dark
default_theme = light

# Default UI language (supported IETF language tag, such as en-US)
;default_language = en-US
Expand Down Expand Up @@ -581,7 +581,7 @@
;org_role = Viewer

# mask the Grafana version number for unauthenticated users
;hide_version = false
hide_version = true

#################################### GitHub Auth ##########################
[auth.github]
Expand Down Expand Up @@ -1444,7 +1444,7 @@

[panels]
# If set to true Grafana will allow script tags in text panels. Not recommended as it enable XSS vulnerabilities.
;disable_sanitize_html = false
disable_sanitize_html = true

[plugins]
;enable_alpha = false
Expand Down
2 changes: 1 addition & 1 deletion emails/templates/new_user_invite.mjml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<mj-head>
<!-- ⬇ Don't forget to specify an email subject below! ⬇ -->
<mj-title>
{{ Subject .Subject .TemplateData "{{ .InvitedBy }} has invited you to join Grafana" }}
{{ Subject .Subject .TemplateData "{{ .InvitedBy }} has invited you to join GridWatch" }}
</mj-title>
<mj-include path="./partials/layout/head.mjml" />
</mj-head>
Expand Down
2 changes: 1 addition & 1 deletion emails/templates/new_user_invite.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[[HiddenSubject .Subject "[[.InvitedBy]] has invited you to join Grafana"]]
[[HiddenSubject .Subject "[[.InvitedBy]] has invited you to join GridWatch"]]

You're invited to join [[.OrgName]]

Expand Down
2 changes: 1 addition & 1 deletion emails/templates/partials/layout/footer.mjml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<mj-column background-color="transparent">
<mj-text align="center">
&copy; {{ now | date "2006" }} Grafana Labs. Sent by <a href="{{ .AppUrl }}">Grafana v{{ .BuildVersion }}</a>.
&copy; {{ now | date "2006" }} nLine Inc. Sent by <a href="{{ .AppUrl }}">GridWatch v{{ .BuildVersion }}</a>.
</mj-text>
</mj-column>
2 changes: 1 addition & 1 deletion emails/templates/partials/layout/header.mjml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<mj-column background-color="transparent">
<mj-image padding="0" width="200px" src="https://grafana.com/static/assets/img/logo_new_transparent_light_400x100.png" align="left" />
<mj-image padding="0" width="200px" src="https://nline.io/nline-light.png" align="left" />
</mj-column>
4 changes: 2 additions & 2 deletions emails/templates/welcome_on_signup.mjml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<mj-head>
<!-- ⬇ Don't forget to specify an email subject below! ⬇ -->
<mj-title>
{{ Subject .Subject .TemplateData "Welcome to Grafana" }}
{{ Subject .Subject .TemplateData "Welcome to GridWatch" }}
</mj-title>
<mj-include path="./partials/layout/head.mjml" />
</mj-head>
Expand All @@ -33,7 +33,7 @@
Thank you for joining our community.
</mj-text>
<mj-text>
The Grafana Team
nLine Inc.
</mj-text>
</mj-column>
</mj-section>
Expand Down
4 changes: 2 additions & 2 deletions emails/templates/welcome_on_signup.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[[HiddenSubject .Subject "Welcome to Grafana"]]
[[HiddenSubject .Subject "Welcome to GridWatch"]]

Hi [[.Name]],

Expand All @@ -8,4 +8,4 @@ If you are new to Grafana, refer to the Getting started with Grafana guide on ht

Thank you for joining our community.

The Grafana team
nLine Inc.
1 change: 1 addition & 0 deletions packages/grafana-data/src/datetime/rangeutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const rangeOptions: TimeOption[] = [
{ from: 'now-1y', to: 'now', display: 'Last 1 year' },
{ from: 'now-2y', to: 'now', display: 'Last 2 years' },
{ from: 'now-5y', to: 'now', display: 'Last 5 years' },
{ from: 'now-10y', to: 'now', display: 'Last 10 years' },
{ from: 'now/fQ', to: 'now', display: 'This fiscal quarter so far' },
{ from: 'now/fQ', to: 'now/fQ', display: 'This fiscal quarter' },
{ from: 'now/fy', to: 'now', display: 'This fiscal year so far' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const quickOptions: TimeOption[] = [
{ from: 'now-1y', to: 'now', display: 'Last 1 year' },
{ from: 'now-2y', to: 'now', display: 'Last 2 years' },
{ from: 'now-5y', to: 'now', display: 'Last 5 years' },
{ from: 'now-10y', to: 'now', display: 'Last 10 years' },
{ from: 'now-1d/d', to: 'now-1d/d', display: 'Yesterday' },
{ from: 'now-2d/d', to: 'now-2d/d', display: 'Day before yesterday' },
{ from: 'now-7d/d', to: 'now-7d/d', display: 'This day last week' },
Expand Down
8 changes: 4 additions & 4 deletions public/app/core/components/Branding/Branding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const LoginBackground: FC<BrandComponentProps> = ({ className, children }) => {
right: 0,
bottom: 0,
top: 0,
background: `url(public/img/g8_login_${theme.isDark ? 'dark' : 'light'}.svg)`,
background: `url(public/img/g8_login_${theme.isDark ? 'dark' : 'light'}.jpg)`,
backgroundPosition: 'top center',
backgroundSize: 'auto',
backgroundRepeat: 'no-repeat',
Expand Down Expand Up @@ -59,9 +59,9 @@ export class Branding {
static LoginBackground = LoginBackground;
static MenuLogo = MenuLogo;
static LoginBoxBackground = LoginBoxBackground;
static AppTitle = 'Grafana';
static LoginTitle = 'Welcome to Grafana';
static HideEdition = false;
static AppTitle = 'GridWatch';
static LoginTitle = 'Welcome to GridWatch';
static HideEdition = true;
static GetLoginSubTitle = (): null | string => {
return null;
};
Expand Down
39 changes: 20 additions & 19 deletions public/app/core/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React from 'react';

import { LinkTarget } from '@grafana/data';
import { config } from '@grafana/runtime';
import { Icon, IconName } from '@grafana/ui';
// import { Icon, IconName } from '@grafana/ui';
import { IconName } from '@grafana/ui';
import { t } from 'app/core/internationalization';

export interface FooterLink {
Expand Down Expand Up @@ -99,37 +100,37 @@ export interface Props {
}

export const Footer = React.memo(({ customLinks, hideEdition }: Props) => {
const links = (customLinks || getFooterLinks()).concat(getVersionLinks(hideEdition));
// const links = (customLinks || getFooterLinks()).concat(getVersionLinks(hideEdition));

return (
<footer className="footer">
<div className="text-center">
<ul>
{/* <ul>
{links.map((link) => (
<li key={link.text}>
<FooterItem item={link} />
</li>
))}
</ul>
</ul> */}
</div>
</footer>
);
});

Footer.displayName = 'Footer';

function FooterItem({ item }: { item: FooterLink }) {
const content = item.url ? (
<a href={item.url} target={item.target} rel="noopener noreferrer" id={item.id}>
{item.text}
</a>
) : (
item.text
);

return (
<>
{item.icon && <Icon name={item.icon} />} {content}
</>
);
}
// function FooterItem({ item }: { item: FooterLink }) {
// const content = item.url ? (
// <a href={item.url} target={item.target} rel="noopener noreferrer" id={item.id}>
// {item.text}
// </a>
// ) : (
// item.text
// );

// return (
// <>
// {item.icon && <Icon name={item.icon} />} {content}
// </>
// );
// }
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const useGetConfig = (cfg?: PublicDashboardCfg) => {
const styles = useStyles2(getStyles);

const { footerHide, footerText, footerLink, footerLogo, headerLogoHide } = cfg || {
footerHide: false,
footerHide: true,
footerText: 'Powered by',
footerLogo: GRAFANA_LOGO_DEFAULT_VALUE,
footerLink: FOOTER_URL,
Expand Down
11 changes: 9 additions & 2 deletions public/app/features/dashboard/dashgrid/DashboardPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,16 @@ export class DashboardPanelUnconnected extends PureComponent<Props> {
lazy: true,
};

isLazyLoadDisabled = () => {
return (
new URLSearchParams(window.location.search).get('lazy') === 'false' ||
(this.props.dashboard.templating.list || []).some((o) => o.name === 'lazy' && o.query === 'false')
);
};

componentDidMount() {
this.props.panel.isInView = !this.props.lazy;
if (!this.props.lazy) {
if (!(this.props.lazy && !this.isLazyLoadDisabled())) {
this.onPanelLoad();
}
}
Expand Down Expand Up @@ -127,7 +134,7 @@ export class DashboardPanelUnconnected extends PureComponent<Props> {
render() {
const { width, height, lazy } = this.props;

return lazy ? (
return lazy && !this.isLazyLoadDisabled() ? (
<LazyLoader width={width} height={height} onChange={this.onVisibilityChange} onLoad={this.onPanelLoad}>
{this.renderPanel}
</LazyLoader>
Expand Down
4 changes: 2 additions & 2 deletions public/app/features/invites/SignupInvited.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('SignupInvitedPage', () => {
await setupTestContext();

const view = screen.getByText(
/has invited you to join grafana and the organization please complete the following and choose a password to accept your invitation and continue:/i
/has invited you to join GridWatch and the organization please complete the following and choose a password to accept your invitation and continue:/i
);

expect(within(view).getByText(/invited by user/i)).toBeInTheDocument();
Expand All @@ -91,7 +91,7 @@ describe('SignupInvitedPage', () => {
await setupTestContext();

const view = screen.getByText(
/has invited you to join grafana and the organization please complete the following and choose a password to accept your invitation and continue:/i
/has invited you to join GridWatch and the organization please complete the following and choose a password to accept your invitation and continue:/i
);

expect(within(view).getByText(/invited to org name/i)).toBeInTheDocument();
Expand Down
2 changes: 1 addition & 1 deletion public/app/features/invites/SignupInvited.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const SignupInvitedPage = ({ match }: Props) => {
<h3 className="page-sub-heading">Hello {greeting || 'there'}.</h3>

<div className="modal-tagline p-b-2">
<em>{invitedBy || 'Someone'}</em> has invited you to join Grafana and the organization{' '}
<em>{invitedBy || 'nLine Inc.'}</em> has invited you to join GridWatch and the organization{' '}
<span className="highlight-word">{contextSrv.user.orgName}</span>
<br />
Please complete the following and choose a password to accept your invitation and continue:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function PluginDetailsHeaderDependencies({ plugin, grafanaDependency }: P
{Boolean(grafanaDependency) && (
<div className={styles.depBadge}>
<Icon name="grafana" className={styles.icon} />
Grafana {grafanaDependency}
GridWatch {grafanaDependency}
</div>
)}

Expand Down
2 changes: 1 addition & 1 deletion public/app/partials/signup_invited.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h3 class="page-sub-heading">Hello {{greeting}}.</h3>

<div class="modal-tagline p-b-2">
<em>{{invitedBy}}</em> has invited you to join Grafana and the organization <span class="highlight-word">{{contextSrv.user.orgName}}</span></br>Please complete the following and choose a password to accept your invitation and continue:
<em>{{invitedBy}}</em> has invited you to join GridWatch and the organization <span class="highlight-word">{{contextSrv.user.orgName}}</span></br>Please complete the following and choose a password to accept your invitation and continue:
</div>

<form name="inviteForm" class="login-form gf-form-group">
Expand Down
Loading

0 comments on commit 94681e7

Please sign in to comment.