[v8.4.x] CI: Sync CI changes (#46083)

* CI: Introduce `build-frontend-packages` step (#45824)

* Split frontend build

* Fix command name

* Update grabpl

(cherry picked from commit 2f6c827f5d)

* CI: Add more checks to standalone docs pipeline (#46449)

* Add build frontend package step

* Reorder dependencies

* Add codespell and prettier checks

(cherry picked from commit 82b436afee)

* Update golang (#46458)

(cherry picked from commit a29159f362)

* Fix architectures
This commit is contained in:
Dimitris Sotirakis
2022-03-11 19:14:16 +02:00
committed by GitHub
parent 3158f15ce5
commit af255219a4
10 changed files with 402 additions and 218 deletions
+329 -200
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -20,7 +20,7 @@ COPY emails emails
ENV NODE_ENV production
RUN yarn build
FROM golang:1.17.7-alpine3.15 as go-builder
FROM golang:1.17.8-alpine3.15 as go-builder
RUN apk add --no-cache gcc g++ make
+1 -1
View File
@@ -21,7 +21,7 @@ COPY emails emails
ENV NODE_ENV production
RUN yarn build
FROM golang:1.17.7 AS go-builder
FROM golang:1.17.8 AS go-builder
WORKDIR /src/grafana
+1
View File
@@ -38,6 +38,7 @@
"packages:clean": "lerna run clean",
"precommit": "yarn run lint-staged",
"prettier:check": "prettier --check --list-different=false --loglevel=warn \"**/*.{scss,md,mdx}\"",
"prettier:checkDocs": "prettier --check --list-different=false --loglevel=warn \"docs/**.md\" \"packages/**.{ts,tsx,scss,md,mdx}\"",
"prettier:write": "prettier --list-different \"**/*.{scss,md,mdx}\" --write",
"start": "yarn themes:generate && yarn dev --watch",
"start:noTsCheck": "yarn start --env noTsCheck=1",
+1 -1
View File
@@ -110,7 +110,7 @@ RUN rm dockerize-linux-amd64-v${DOCKERIZE_VERSION}.tar.gz
# Use old Debian (this has support into 2022) in order to ensure binary compatibility with older glibc's.
FROM debian:stretch-20210208
ENV GOVERSION=1.17.7 \
ENV GOVERSION=1.17.8 \
PATH=/usr/local/go/bin:$PATH \
GOPATH=/go \
NODEVERSION=16.13.0-1nodesource1 \
+20 -2
View File
@@ -1,14 +1,14 @@
load(
'scripts/drone/steps/lib.star',
'build_image',
'initialize_step',
'download_grabpl_step',
'lint_frontend_step',
'codespell_step',
'shellcheck_step',
'build_frontend_step',
'test_frontend_step',
'build_storybook_step',
'build_frontend_docs_step',
'build_frontend_package_step',
'build_docs_website_step',
)
@@ -29,6 +29,9 @@ def docs_pipelines(edition, ver_mode, trigger):
# Insert remaining steps
steps.extend([
codespell_step(),
lint_docs(),
build_frontend_package_step(edition=edition, ver_mode=ver_mode),
build_frontend_docs_step(edition=edition),
build_docs_website_step(),
])
@@ -37,6 +40,21 @@ def docs_pipelines(edition, ver_mode, trigger):
name='{}-docs'.format(ver_mode), edition=edition, trigger=trigger, services=[], steps=steps,
)
def lint_docs():
return {
'name': 'lint-docs',
'image': build_image,
'depends_on': [
'initialize',
],
'environment': {
'NODE_OPTIONS': '--max_old_space_size=8192',
},
'commands': [
'yarn run prettier:checkDocs',
],
}
def trigger_docs():
return {
+4 -2
View File
@@ -12,6 +12,7 @@ load(
'test_frontend_step',
'build_backend_step',
'build_frontend_step',
'build_frontend_package_step',
'build_plugins_step',
'package_step',
'grafana_server_step',
@@ -79,6 +80,7 @@ def get_steps(edition, is_downstream=False):
enterprise_downstream_step(edition=edition),
build_backend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream),
build_frontend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream),
build_frontend_package_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream),
build_plugins_step(edition=edition, sign=True),
validate_scuemata_step(),
ensure_cuetsified_step(),
@@ -98,7 +100,7 @@ def get_steps(edition, is_downstream=False):
test_backend_integration_step(edition=edition2),
])
build_steps.extend([
build_backend_step(edition=edition2, ver_mode=ver_mode, variants=['linux-x64'], is_downstream=is_downstream),
build_backend_step(edition=edition2, ver_mode=ver_mode, variants=['linux-amd64'], is_downstream=is_downstream),
])
# Insert remaining steps
@@ -133,7 +135,7 @@ def get_steps(edition, is_downstream=False):
if include_enterprise2:
edition2 = 'enterprise2'
build_steps.extend([
package_step(edition=edition2, ver_mode=ver_mode, include_enterprise2=include_enterprise2, variants=['linux-x64'], is_downstream=is_downstream),
package_step(edition=edition2, ver_mode=ver_mode, include_enterprise2=include_enterprise2, variants=['linux-amd64'], is_downstream=is_downstream),
upload_packages_step(edition=edition2, ver_mode=ver_mode, is_downstream=is_downstream),
upload_cdn_step(edition=edition2, ver_mode=ver_mode)
])
+5 -3
View File
@@ -9,6 +9,7 @@ load(
'shellcheck_step',
'build_backend_step',
'build_frontend_step',
'build_frontend_package_step',
'build_plugins_step',
'test_backend_step',
'test_backend_integration_step',
@@ -56,7 +57,7 @@ ver_mode = 'pr'
def pr_pipelines(edition):
services = integration_test_services(edition)
volumes = integration_test_services_volumes()
variants = ['linux-x64', 'linux-x64-musl', 'osx64', 'win64', 'armv6',]
variants = ['linux-amd64', 'linux-amd64-musl', 'darwin-amd64', 'windows-amd64', 'armv6',]
include_enterprise2 = edition == 'enterprise'
test_steps = [
lint_drone_step(),
@@ -71,6 +72,7 @@ def pr_pipelines(edition):
build_steps = [
build_backend_step(edition=edition, ver_mode=ver_mode, variants=variants),
build_frontend_step(edition=edition, ver_mode=ver_mode),
build_frontend_package_step(edition=edition, ver_mode=ver_mode),
build_plugins_step(edition=edition),
validate_scuemata_step(),
ensure_cuetsified_step(),
@@ -90,7 +92,7 @@ def pr_pipelines(edition):
test_backend_integration_step(edition=edition2),
])
build_steps.extend([
build_backend_step(edition=edition2, ver_mode=ver_mode, variants=['linux-x64']),
build_backend_step(edition=edition2, ver_mode=ver_mode, variants=['linux-amd64']),
])
# Insert remaining build_steps
@@ -114,7 +116,7 @@ def pr_pipelines(edition):
memcached_integration_tests_step(edition=edition, ver_mode=ver_mode),
])
build_steps.extend([
package_step(edition=edition2, ver_mode=ver_mode, include_enterprise2=include_enterprise2, variants=['linux-x64']),
package_step(edition=edition2, ver_mode=ver_mode, include_enterprise2=include_enterprise2, variants=['linux-amd64']),
])
trigger = {
+4 -2
View File
@@ -16,6 +16,7 @@ load(
'test_frontend_step',
'build_backend_step',
'build_frontend_step',
'build_frontend_package_step',
'build_plugins_step',
'package_step',
'grafana_server_step',
@@ -179,6 +180,7 @@ def get_steps(edition, ver_mode):
build_steps = [
build_backend_step(edition=edition, ver_mode=ver_mode),
build_frontend_step(edition=edition, ver_mode=ver_mode),
build_frontend_package_step(edition=edition, ver_mode=ver_mode),
build_plugins_step(edition=edition, sign=True),
validate_scuemata_step(),
ensure_cuetsified_step(),
@@ -197,7 +199,7 @@ def get_steps(edition, ver_mode):
test_backend_integration_step(edition=edition2),
])
build_steps.extend([
build_backend_step(edition=edition2, ver_mode=ver_mode, variants=['linux-x64']),
build_backend_step(edition=edition2, ver_mode=ver_mode, variants=['linux-amd64']),
])
# Insert remaining steps
@@ -241,7 +243,7 @@ def get_steps(edition, ver_mode):
if include_enterprise2:
publish_steps.extend([
package_step(edition=edition2, ver_mode=ver_mode, include_enterprise2=include_enterprise2, variants=['linux-x64']),
package_step(edition=edition2, ver_mode=ver_mode, include_enterprise2=include_enterprise2, variants=['linux-amd64']),
upload_cdn_step(edition=edition2, ver_mode=ver_mode),
])
if should_upload:
+36 -6
View File
@@ -1,7 +1,7 @@
load('scripts/drone/vault.star', 'from_secret', 'github_token', 'pull_secret', 'drone_token', 'prerelease_bucket')
grabpl_version = 'v2.9.5'
build_image = 'grafana/build-container:1.5.1'
grabpl_version = 'v2.9.25'
build_image = 'grafana/build-container:1.5.3'
publish_image = 'grafana/grafana-ci-deploy:1.3.1'
deploy_docker_image = 'us.gcr.io/kubernetes-dev/drone/plugins/deploy-image'
alpine_image = 'alpine:3.15'
@@ -241,6 +241,7 @@ def build_storybook_step(edition, ver_mode):
'depends_on': [
# Best to ensure that this step doesn't mess with what's getting built and packaged
'build-frontend',
'build-frontend-packages',
],
'environment': {
'NODE_OPTIONS': '--max_old_space_size=4096',
@@ -421,18 +422,45 @@ def build_frontend_step(edition, ver_mode, is_downstream=False):
'commands': cmds,
}
def build_frontend_package_step(edition, ver_mode, is_downstream=False):
if not is_downstream:
build_no = '${DRONE_BUILD_NUMBER}'
else:
build_no = '$${SOURCE_BUILD_NUMBER}'
# TODO: Use percentage for num jobs
if ver_mode == 'release':
cmds = [
'./bin/grabpl build-frontend-packages --jobs 8 --github-token $${GITHUB_TOKEN} ' + \
'--edition {} --no-pull-enterprise ${{DRONE_TAG}}'.format(edition),
]
else:
cmds = [
'./bin/grabpl build-frontend-packages --jobs 8 --edition {} '.format(edition) + \
'--build-id {} --no-pull-enterprise'.format(build_no),
]
return {
'name': 'build-frontend-packages',
'image': build_image,
'depends_on': [
'initialize',
],
'environment': {
'NODE_OPTIONS': '--max_old_space_size=8192',
},
'commands': cmds,
}
def build_frontend_docs_step(edition):
return {
'name': 'build-frontend-docs',
'image': build_image,
'depends_on': [
'initialize'
'build-frontend-packages'
],
'commands': [
'yarn packages:build',
'yarn packages:docsExtract',
'yarn packages:docsToMarkdown',
'./scripts/ci-reference-docs-lint.sh ci',
]
}
@@ -607,6 +635,7 @@ def package_step(edition, ver_mode, include_enterprise2=False, variants=None, is
'build-plugins',
'build-backend',
'build-frontend',
'build-frontend-packages',
]
if include_enterprise2:
sfx = '-enterprise2'
@@ -682,6 +711,7 @@ def grafana_server_step(edition, port=3001):
'build-plugins',
'build-backend',
'build-frontend',
'build-frontend-packages',
],
'environment': environment,
'commands': [