Skip to content

Commit

Permalink
Merge branch 'release/3.19.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
alberttorosyan committed Mar 22, 2024
2 parents 96f7659 + d1426d9 commit 94646d2
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 3.19.2 Mar 22, 2024
- Resolve live update failing issue (mihran113)
- Resolve issue with remote tracking protocol probe fail (mihran113)

## 3.19.1 Mar 14, 2024
- Accept calls on tracking server without trailing slashes (mihran113)

Expand Down
2 changes: 1 addition & 1 deletion aim/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.19.1
3.19.2
4 changes: 2 additions & 2 deletions aim/ext/transport/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ def __init__(self, remote_path: str):

self._http_protocol = 'http://'
self._ws_protocol = 'ws://'
self.request_headers = {}
self.protocol_probe()

self._resource_pool = weakref.WeakValueDictionary()

self._client_endpoint = f'{self.remote_path}/client'
self._tracking_endpoint = f'{self.remote_path}/tracking'
self.request_headers = {}
self.connect()

self._heartbeat_sender = HeartbeatSender(self)
Expand All @@ -71,7 +71,7 @@ def protocol_probe(self):
if response.url.startswith('https://'):
self._http_protocol = 'https://'
self._ws_protocol = 'wss://'
return
return
except Exception:
pass

Expand Down
2 changes: 1 addition & 1 deletion aim/web/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ui_v2",
"version": "3.19.1",
"version": "3.19.2",
"private": true,
"dependencies": {
"@aksel/structjs": "^1.0.0",
Expand Down
18 changes: 17 additions & 1 deletion aim/web/ui/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { version } from '../../package.json';

interface GlobalScope extends Window {
API_BASE_PATH?: string;
API_AUTH_TOKEN?: string;
}

let globalScope: GlobalScope;
Expand Down Expand Up @@ -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'];
Expand All @@ -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,
};
5 changes: 4 additions & 1 deletion aim/web/ui/src/services/api/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Cookies from 'js-cookie';

import { getAPIHost } from 'config/config';
import { getAPIHost, getAPIAuthToken } from 'config/config';

import ENDPOINTS from './endpoints';

Expand Down Expand Up @@ -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) || '';
}

Expand Down
7 changes: 6 additions & 1 deletion aim/web/ui/src/services/live-update/Worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import * as Comlink from 'comlink';

import { setAPIBasePath } from 'config/config';
import { setAPIBasePath, setAPIAuthToken } from 'config/config';

import {
decodeBufferPairs,
Expand Down Expand Up @@ -254,13 +254,18 @@ function replaceBasePath(basePath: string) {
setAPIBasePath(basePath);
}

function setAuthToken(authToken: string) {
setAPIAuthToken(authToken);
}

const WebWorker = {
subscribeToApiCallResult,
setConfig,
start,
close,
stop,
replaceBasePath,
setAuthToken,
};

export type IWorker = typeof WebWorker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 94646d2

Please sign in to comment.