Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e311851
Add GitHub workflows
kshmidt-digma Jun 8, 2023
4b59538
Add event trigger on pull request
kshmidt-digma Jun 11, 2023
4901862
Fix branch
kshmidt-digma Jun 11, 2023
ec17231
Fix workflow path
kshmidt-digma Jun 11, 2023
6447cb7
Remove token input for checkout
kshmidt-digma Jun 12, 2023
76dac0b
Increase yarn network timeout
kshmidt-digma Jun 12, 2023
7d04001
Build from the root directory
kshmidt-digma Jun 12, 2023
ede75da
Keep only one build platform
kshmidt-digma Jun 13, 2023
47ecd10
Build for arm platform
kshmidt-digma Jun 13, 2023
50d75e4
Switch to Depot runner
kshmidt-digma Jun 13, 2023
15b9b45
Use Depot runner
kshmidt-digma Jun 13, 2023
dcbf979
Switch back to Docker actions
kshmidt-digma Jun 13, 2023
66a367a
Merge branch 'digma' into feature/docker
kshmidt-digma Jun 13, 2023
6151dd1
Allow to publish docker image on pull request
kshmidt-digma Jun 13, 2023
98eeb30
Improve Dockerfile
kshmidt-digma Jun 13, 2023
1a522bc
Merge branch 'digma' into feature/docker
kshmidt-digma Jun 14, 2023
45f9f04
Merge branch 'digma' into feature/docker
kshmidt-digma Jun 15, 2023
db952c5
Merge branch 'digma' into feature/docker
kshmidt-digma Jun 15, 2023
4a3d18b
Update Dockerhub credentials
kshmidt-digma Jun 15, 2023
9c8ef25
Update reusable-push-to-docker.yml
shaykeren Jun 15, 2023
d956547
Update release-digma.yml
shaykeren Jun 15, 2023
ae60512
Update release-digma.yml
shaykeren Jun 15, 2023
78d7fee
Move build step outside QEMU
kshmidt-digma Jun 17, 2023
b519c77
Refactor to use single workflow
kshmidt-digma Jun 17, 2023
d71288d
Disable linting
kshmidt-digma Jun 17, 2023
709e809
Fix artifact path
kshmidt-digma Jun 17, 2023
f7d8f51
Fix Dockerfile
kshmidt-digma Jun 17, 2023
88b3a96
Set context
kshmidt-digma Jun 17, 2023
a91df5c
Fix lint
kshmidt-digma Jun 18, 2023
e449ad8
Fix lint
kshmidt-digma Jun 18, 2023
52fb968
Do not show default nginx error page
kshmidt-digma Jun 18, 2023
e31bd84
Revert changes
kshmidt-digma Jun 18, 2023
6fac903
Fix Jaeger Not Available error screen
kshmidt-digma Jun 18, 2023
3f791b4
Revert push condition
kshmidt-digma Jun 19, 2023
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
16 changes: 0 additions & 16 deletions .dockerignore

This file was deleted.

103 changes: 103 additions & 0 deletions .github/workflows/release-digma.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Publish Digma release

# Controls when the workflow will run
on:
workflow_dispatch:
release:
types: [released]

# permissions are needed if pushing to ghcr.io
permissions:
packages: write

jobs:
build:
name: Build Jaeger UI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: '16'
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn build

- uses: actions/upload-artifact@v3
with:
name: jaeger-build
path: packages/jaeger-ui/build/

- uses: actions/upload-artifact@v3
with:
name: nginx-config
path: nginx.conf.template

- uses: actions/upload-artifact@v3
with:
name: dockerfile
path: Dockerfile

download:
name: Build and push Docker image
needs: [build]
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v3
with:
name: jaeger-build
path: build

- uses: actions/download-artifact@v3
with:
name: nginx-config

- uses: actions/download-artifact@v3
with:
name: dockerfile

# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_DIGMAAI_USERNAME }}
password: ${{ secrets.DOCKERHUB_DIGMAAI_TOKEN }}

- name: Docker meta
id: metadata # you'll use this in the next step
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: digmaai/jaeger-ui
# Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
# set latest tag for digma branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'digma') }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
19 changes: 1 addition & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
FROM node:16.20.0 AS build

WORKDIR /app

COPY package.json ./
COPY yarn.lock ./
COPY packages/jaeger-ui/package.json ./packages/jaeger-ui/
COPY . .
RUN yarn install --frozen-lockfile
# RUN yarn prettier-lint
# RUN yarn eslint

WORKDIR /app/packages/jaeger-ui

# RUN yarn test
RUN yarn build

FROM nginx:1.25.0

COPY --from=build /app/packages/jaeger-ui/build/ /usr/share/nginx/html/
COPY ./build/ /usr/share/nginx/html/
COPY ./nginx.conf.template /etc/nginx/conf.d/default.conf.template

CMD ["/bin/sh" , "-c" , "envsubst '${JAEGER_QUERY_URL}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"coverage": "lerna run coverage",
"eslint": "eslint --cache 'scripts/*.{js,jsx,ts,tsx}' 'packages/*/src/**/*.{js,jsx,ts,tsx}' 'packages/*/*.{js,jsx,ts,tsx}'",
"fmt": "yarn prettier",
"lint": "npm-run-all -ln --parallel prettier-lint tsc-lint eslint check-license",
"lint": "npm-run-all -ln --parallel prettier-lint tsc-lint eslint",
"prepare": "lerna run --stream --sort prepublishOnly",
"prettier": "prettier --write '{.,scripts}/*.{js,jsx,json,md,ts,tsx}' 'packages/*/{src,demo/src}/**/!(layout.worker.bundled|react-vis).{css,js,jsx,json,md,ts,tsx}' 'packages/*/*.{css,js,jsx,json,md,ts,tsx}'",
"prettier-lint": "prettier --list-different '{.,scripts}/*.{js,jsx,json,md,ts,tsx}' 'packages/*/{src,demo/src}/**/!(layout.worker.bundled|react-vis).{css,js,jsx,json,md,ts,tsx}' 'packages/*/*.{css,js,jsx,json,md,ts,tsx}'",
Expand Down
4 changes: 3 additions & 1 deletion packages/jaeger-ui/src/api/jaeger.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ function getJSON(url, options = {}) {
});
}

export const DEFAULT_API_ROOT = isString(window.apiBaseUrl) ? `${window.apiBaseUrl}/api/` : prefixUrl('/api/');
export const DEFAULT_API_ROOT = isString(window.apiBaseUrl)
? `${window.apiBaseUrl}/api/`
: prefixUrl('/api/');
export const ANALYTICS_ROOT = prefixUrl('/analytics/');
export const DEFAULT_DEPENDENCY_LOOKBACK = moment.duration(1, 'weeks').asMilliseconds();

Expand Down
2 changes: 1 addition & 1 deletion packages/jaeger-ui/src/components/App/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class JaegerUIApp extends Component {
// Navigate to URL provided on app start
if (isString(window.initialRoutePath) && window.initialRoutePath) {
const urlToNavigate = window.initialRoutePath;
window.initialRoutePath = "";
window.initialRoutePath = '';
history.push(urlToNavigate);
}

Expand Down
18 changes: 9 additions & 9 deletions packages/jaeger-ui/src/components/SearchTracePage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,22 @@ const logoUrl = getStaticAssetPath(JaegerLogo);
// Sanitize query params to filter out ones provided by VS Code
const sanitizeQueryParams = params => {
const VS_CODE_PARAMS = [
"id",
"origin",
"swVersion",
"extensionId",
"platform",
"vscode-resource-base-authority",
"parentOrigin"
'id',
'origin',
'swVersion',
'extensionId',
'platform',
'vscode-resource-base-authority',
'parentOrigin',
];

const filteredParams = {};

Object.keys(params).forEach(key => {
if (!VS_CODE_PARAMS.includes(key)) {
filteredParams[key] = params[key]
filteredParams[key] = params[key];
}
})
});

return filteredParams;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/jaeger-ui/src/components/common/ErrorMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export default function ErrorMessage({
);
}

if (error.message.includes('Failed to fetch')) {
if (error.message.includes('Failed to fetch') || error.httpStatus === 502) {
const isUserDefinedJaegerQueryURL = window.isUserDefinedJaegerQueryURL === true;
return (
<DigmaErrorMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ limitations under the License.

.LoadingIndicator.is-medium {
font-size: 1.5em;
}
}
6 changes: 3 additions & 3 deletions packages/jaeger-ui/src/reducers/embedded.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import { getEmbeddedState, VERSION_0 } from '../utils/embedded-url';
export default function embeddedConfig(state: EmbeddedState | undefined) {
if (state === undefined) {
let search = _get(window, 'location.search');

const params = new URLSearchParams(search);
if (typeof window.embeddedMode === "boolean" && window.embeddedMode && !params.get("uiEmbed")) {
params.set("uiEmbed", VERSION_0);
if (typeof window.embeddedMode === 'boolean' && window.embeddedMode && !params.get('uiEmbed')) {
params.set('uiEmbed', VERSION_0);
search = params.toString();
}

Expand Down
6 changes: 3 additions & 3 deletions packages/jaeger-ui/src/utils/getStaticAssetPath.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isString } from "./ts/typeGuards/isString";
import { isString } from './ts/typeGuards/isString';

export const getStaticAssetPath = (path: string) =>
isString(window.staticPath) ? new URL(path, window.staticPath).href : path
export const getStaticAssetPath = (path: string) =>
isString(window.staticPath) ? new URL(path, window.staticPath).href : path;
5 changes: 2 additions & 3 deletions packages/jaeger-ui/src/utils/ts/typeGuards/isObject.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isNull } from "./isNull";
import { isNull } from './isNull';

export const isObject = (x: unknown): x is Record<string, unknown> =>
typeof x === "object" && !isNull(x);
export const isObject = (x: unknown): x is Record<string, unknown> => typeof x === 'object' && !isNull(x);
2 changes: 1 addition & 1 deletion packages/jaeger-ui/src/utils/ts/typeGuards/isString.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const isString = (x: unknown): x is string => typeof x === "string";
export const isString = (x: unknown): x is string => typeof x === 'string';
3 changes: 1 addition & 2 deletions packages/jaeger-ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
// limitations under the License.
{
"extends": "../../tsconfig",
"include": ["src", "typings"],
"exclude": ["src/**/*.d.ts"],
"include": ["src/**/*.tsx", "src/**/*.ts", "typings"]
}