diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 97e5502aa5..2e70fa4ce6 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -17,7 +17,7 @@ on: jobs: aim-ui-dist: - if: ${{ github.event_name == 'schedule' || github.actor == 'gorarakelyan' || github.actor == 'alberttorosyan' || github.actor == 'roubkar' }} + if: ${{ github.event_name == 'schedule' || github.actor == 'mihran113' || github.actor == 'alberttorosyan' || github.actor == 'roubkar' }} runs-on: ubuntu-latest steps: - name: Checkout sources @@ -59,7 +59,7 @@ jobs: python -m twine upload -u __token__ -p "${PYPI_PASSWORD}" dist/* linux-dist: - if: ${{ github.event_name == 'schedule' || github.actor == 'gorarakelyan' || github.actor == 'alberttorosyan' || github.actor == 'roubkar' }} + if: ${{ github.event_name == 'schedule' || github.actor == 'mihran113' || github.actor == 'alberttorosyan' || github.actor == 'roubkar' }} runs-on: ubuntu-latest strategy: matrix: @@ -125,7 +125,7 @@ jobs: run: . create-docker-image.sh macos-dist: - if: ${{ github.event_name == 'schedule' || github.actor == 'gorarakelyan' || github.actor == 'alberttorosyan' || github.actor == 'roubkar' }} + if: ${{ github.event_name == 'schedule' || github.actor == 'mihran113' || github.actor == 'alberttorosyan' || github.actor == 'roubkar' }} runs-on: m1 strategy: fail-fast: false diff --git a/CHANGELOG.md b/CHANGELOG.md index dc470fd836..98296131fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog -## 3.19.2 +## 3.19.2 +- Resolve live update failing issue (mihran113) - Resolve issue with remote tracking protocol probe fail (mihran113) ## 3.19.1 Mar 14, 2024 diff --git a/aim/web/ui/src/config/config.ts b/aim/web/ui/src/config/config.ts index 86f71ee3d6..fc196c7b8a 100644 --- a/aim/web/ui/src/config/config.ts +++ b/aim/web/ui/src/config/config.ts @@ -2,6 +2,7 @@ import { version } from '../../package.json'; interface GlobalScope extends Window { API_BASE_PATH?: string; + API_AUTH_TOKEN?: string; } let globalScope: GlobalScope; @@ -37,6 +38,14 @@ function setAPIBasePath(basePath: string) { : `${getBasePath()}/api`; } +function setAPIAuthToken(authToken: string) { + globalScope.API_AUTH_TOKEN = authToken; +} + +function getAPIAuthToken() { + return `${globalScope.API_AUTH_TOKEN}`; +} + export const AIM_VERSION = version; const PATHS_TO_SHOW_CACHE_BANNERS = ['notebook', 'aim-sage']; @@ -48,4 +57,11 @@ export function checkIsBasePathInCachedEnv(basePath: string) { return PATHS_TO_SHOW_CACHE_BANNERS.includes(parsed_path); } -export { isDEVModeOn, getBasePath, getAPIHost, setAPIBasePath }; +export { + isDEVModeOn, + getBasePath, + getAPIHost, + setAPIBasePath, + setAPIAuthToken, + getAPIAuthToken, +}; diff --git a/aim/web/ui/src/services/api/api.ts b/aim/web/ui/src/services/api/api.ts index 45b22143af..259269ba4f 100644 --- a/aim/web/ui/src/services/api/api.ts +++ b/aim/web/ui/src/services/api/api.ts @@ -1,6 +1,6 @@ import Cookies from 'js-cookie'; -import { getAPIHost } from 'config/config'; +import { getAPIHost, getAPIAuthToken } from 'config/config'; import ENDPOINTS from './endpoints'; @@ -253,6 +253,9 @@ function getRequestHeaders(headers = {}) { * @returns {string} - The token */ function getAuthToken(): string { + if (typeof window === 'undefined') { + return getAPIAuthToken(); + } return localStorage.getItem(AUTH_TOKEN_KEY) || ''; } diff --git a/aim/web/ui/src/services/live-update/Worker.ts b/aim/web/ui/src/services/live-update/Worker.ts index d249f195a4..d0923b0003 100644 --- a/aim/web/ui/src/services/live-update/Worker.ts +++ b/aim/web/ui/src/services/live-update/Worker.ts @@ -6,7 +6,7 @@ import * as Comlink from 'comlink'; -import { setAPIBasePath } from 'config/config'; +import { setAPIBasePath, setAPIAuthToken } from 'config/config'; import { decodeBufferPairs, @@ -254,6 +254,10 @@ function replaceBasePath(basePath: string) { setAPIBasePath(basePath); } +function setAuthToken(authToken: string) { + setAPIAuthToken(authToken); +} + const WebWorker = { subscribeToApiCallResult, setConfig, @@ -261,6 +265,7 @@ const WebWorker = { close, stop, replaceBasePath, + setAuthToken, }; export type IWorker = typeof WebWorker; diff --git a/aim/web/ui/src/services/live-update/examples/LiveUpdateBridge.example.js b/aim/web/ui/src/services/live-update/examples/LiveUpdateBridge.example.js index e5b5bcbd7f..1b207fb0ef 100644 --- a/aim/web/ui/src/services/live-update/examples/LiveUpdateBridge.example.js +++ b/aim/web/ui/src/services/live-update/examples/LiveUpdateBridge.example.js @@ -37,6 +37,7 @@ class UpdateService { this.instance = new LUWorker(); this.instance.replaceBasePath(window.API_BASE_PATH); + this.instance.setAuthToken(localStorage.getItem('Auth') || ''); this.instance.setConfig( appName, embeddedAppNames[this.appName].endpoint,