Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry pick fixes into release #16686

Merged
merged 5 commits into from
Jul 16, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
uses: actions/checkout@v2.3.4

- name: Install Node
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.2.0
with:
node-version: ${{env.NODE_VERSION}}

Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
uses: actions/checkout@v2.3.4

- name: Install Node
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.2.0
with:
node-version: ${{env.NODE_VERSION}}

Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
path: ${{env.special-working-directory-relative}}

- name: Install Node
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.2.0
with:
node-version: ${{env.NODE_VERSION}}

Expand All @@ -155,7 +155,7 @@ jobs:
python-version: ${{matrix.python}}

- name: Install Node
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.2.0
with:
node-version: ${{env.NODE_VERSION}}

Expand Down Expand Up @@ -340,7 +340,7 @@ jobs:
uses: actions/checkout@v2.3.4

- name: Install Node
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.2.0
with:
node-version: ${{env.NODE_VERSION}}

Expand Down Expand Up @@ -404,7 +404,7 @@ jobs:
# uses: actions/checkout@v2.3.4

# - name: Install Node
# uses: actions/setup-node@v2.1.5
# uses: actions/setup-node@v2.2.0
# with:
# node-version: ${{env.NODE_VERSION}}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: actions/checkout@v2.3.4

- name: Install Node
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.2.0
with:
node-version: ${{env.NODE_VERSION}}

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/checkout@v2.3.4

- name: Install Node
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.2.0
with:
node-version: ${{env.NODE_VERSION}}

Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
uses: actions/checkout@v2.3.4

- name: Install Node
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.2.0
with:
node-version: ${{env.NODE_VERSION}}

Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
path: ${{env.special-working-directory-relative}}

- name: Install Node
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.2.0
with:
node-version: ${{env.NODE_VERSION}}

Expand All @@ -134,7 +134,7 @@ jobs:
python-version: ${{matrix.python}}

- name: Install Node
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.2.0
with:
node-version: ${{env.NODE_VERSION}}

Expand Down Expand Up @@ -323,7 +323,7 @@ jobs:
uses: actions/checkout@v2.3.4

- name: Install Node
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.2.0
with:
node-version: ${{env.NODE_VERSION}}

Expand Down Expand Up @@ -389,7 +389,7 @@ jobs:
# uses: actions/checkout@v2.3.4

# - name: Install Node
# uses: actions/setup-node@v2.1.5
# uses: actions/setup-node@v2.2.0
# with:
# node-version: ${{env.NODE_VERSION}}

Expand Down Expand Up @@ -452,7 +452,7 @@ jobs:
uses: actions/checkout@v2.3.4

- name: Install Node
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.2.0
with:
node-version: ${{env.NODE_VERSION}}

Expand All @@ -468,7 +468,7 @@ jobs:
python-version: ${{env.PYTHON_VERSION}}

- name: Install Node
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v2.2.0
with:
node-version: ${{env.NODE_VERSION}}

Expand Down
1 change: 1 addition & 0 deletions news/1 Enhancements/16461.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Support starting a TensorBoard session with a remote URL hosting log files.
4 changes: 3 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,5 +251,7 @@
"TensorBoard.installProfilerPluginPrompt": "We recommend installing the PyTorch Profiler TensorBoard plugin. Would you like to install the package?",
"TensorBoard.upgradePrompt": "Integrated TensorBoard support is only available for TensorBoard >= 2.4.1. Would you like to upgrade your copy of TensorBoard?",
"TensorBoard.launchNativeTensorBoardSessionCodeAction": "Launch TensorBoard session",
"TensorBoard.launchNativeTensorBoardSessionCodeLens": "▶ Launch TensorBoard Session"
"TensorBoard.launchNativeTensorBoardSessionCodeLens": "▶ Launch TensorBoard Session",
"TensorBoard.enterRemoteUrl": "Enter remote URL",
"TensorBoard.enterRemoteUrlDetail": "Enter a URL pointing to a remote directory containing your TensorBoard log files"
}
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# IntelliSense via Jedi
jedi<0.18 # For Python 2.7 support
# Sort Imports
isort==5.8.0; python_version >= '3.6'
isort==5.9.2; python_version >= '3.6'
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#
# pip-compile --generate-hashes requirements.in
#
isort==5.8.0 ; python_version >= "3.6" \
--hash=sha256:0a943902919f65c5684ac4e0154b1ad4fac6dcaa5d9f3426b732f1c8b5419be6 \
--hash=sha256:2bb1680aad211e3c9944dbce1d4ba09a989f04e238296c87fe2139faa26d655d
isort==5.9.2 ; python_version >= "3.6" \
--hash=sha256:eed17b53c3e7912425579853d078a0832820f023191561fcee9d7cae424e0813 \
--hash=sha256:f65ce5bd4cbc6abdfbe29afc2f0245538ab358c14590912df638033f157d555e
# via -r requirements.in
jedi==0.17.2 \
--hash=sha256:86ed7d9b750603e4ba582ea8edc678657fb4007894a12bcf6f4bb97892f31d20 \
Expand Down
7 changes: 7 additions & 0 deletions src/client/common/experiments/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ export async function inDiscoveryExperiment(experimentService: IExperimentServic
]);
return results.includes(true);
}

export function inDiscoveryExperimentSync(experimentService: IExperimentService): boolean {
return (
experimentService.inExperimentSync(DiscoveryVariants.discoverWithFileWatching) ||
experimentService.inExperimentSync(DiscoveryVariants.discoveryWithoutFileWatching)
);
}
5 changes: 5 additions & 0 deletions src/client/common/utils/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ export namespace Jupyter {
}

export namespace TensorBoard {
export const enterRemoteUrl = localize('TensorBoard.enterRemoteUrl', 'Enter remote URL');
export const enterRemoteUrlDetail = localize(
'TensorBoard.enterRemoteUrlDetail',
'Enter a URL pointing to a remote directory containing your TensorBoard log files',
);
export const useCurrentWorkingDirectoryDetail = localize(
'TensorBoard.useCurrentWorkingDirectoryDetail',
'TensorBoard will search for tfevent files in all subdirectories of the current working directory',
Expand Down
4 changes: 2 additions & 2 deletions src/client/interpreter/interpreterService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
} from './contracts';
import { IVirtualEnvironmentManager } from './virtualEnvs/types';
import { getInterpreterHash } from '../pythonEnvironments/discovery/locators/services/hashProvider';
import { inDiscoveryExperiment } from '../common/experiments/helpers';
import { inDiscoveryExperiment, inDiscoveryExperimentSync } from '../common/experiments/helpers';
import { StopWatch } from '../common/utils/stopWatch';
import { PythonVersion } from '../pythonEnvironments/info/pythonVersion';

Expand Down Expand Up @@ -139,7 +139,7 @@ export class InterpreterService implements Disposable, IInterpreterService {
public async getInterpreters(resource?: Uri, options?: GetInterpreterOptions): Promise<PythonEnvironment[]> {
let environments: PythonEnvironment[] = [];
const stopWatch = new StopWatch();
if (await inDiscoveryExperiment(this.experimentService)) {
if (inDiscoveryExperimentSync(this.experimentService)) {
environments = await this.pyenvs.getInterpreters(resource, options);
} else {
const locator = this.serviceContainer.get<IInterpreterLocatorService>(
Expand Down
28 changes: 21 additions & 7 deletions src/client/tensorBoard/tensorBoardSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ export class TensorBoardSession {
return tensorboardInstallStatus === ProductInstallStatus.Installed;
}

// eslint-disable-next-line class-methods-use-this
private async showFilePicker(): Promise<string | undefined> {
const selection = await this.applicationShell.showOpenDialog({
canSelectFiles: false,
Expand All @@ -307,6 +306,8 @@ export class TensorBoardSession {

// eslint-disable-next-line class-methods-use-this
private getQuickPickItems(logDir: string | undefined) {
const items = [];

if (logDir) {
const useCwd = {
label: TensorBoard.useCurrentWorkingDirectory(),
Expand All @@ -316,13 +317,21 @@ export class TensorBoardSession {
label: TensorBoard.selectAnotherFolder(),
detail: TensorBoard.selectAnotherFolderDetail(),
};
return [useCwd, selectAnotherFolder];
items.push(useCwd, selectAnotherFolder);
} else {
const selectAFolder = {
label: TensorBoard.selectAFolder(),
detail: TensorBoard.selectAFolderDetail(),
};
items.push(selectAFolder);
}
const selectAFolder = {
label: TensorBoard.selectAFolder(),
detail: TensorBoard.selectAFolderDetail(),
};
return [selectAFolder];

items.push({
label: TensorBoard.enterRemoteUrl(),
detail: TensorBoard.enterRemoteUrlDetail(),
});

return items;
}

// Display a quickpick asking the user to acknowledge our autopopulated log directory or
Expand All @@ -341,6 +350,7 @@ export class TensorBoardSession {
const useCurrentWorkingDirectory = TensorBoard.useCurrentWorkingDirectory();
const selectAFolder = TensorBoard.selectAFolder();
const selectAnotherFolder = TensorBoard.selectAnotherFolder();
const enterRemoteUrl = TensorBoard.enterRemoteUrl();
const items: QuickPickItem[] = this.getQuickPickItems(logDir);
const item = await this.applicationShell.showQuickPick(items, {
canPickMany: false,
Expand All @@ -353,6 +363,10 @@ export class TensorBoardSession {
case selectAFolder:
case selectAnotherFolder:
return this.showFilePicker();
case enterRemoteUrl:
return this.applicationShell.showInputBox({
prompt: TensorBoard.enterRemoteUrlDetail(),
});
default:
return undefined;
}
Expand Down
17 changes: 16 additions & 1 deletion src/test/tensorBoard/tensorBoardSession.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ suite('TensorBoard session creation', async () => {
assert.ok(daemon?.killed, 'TensorBoard session process not killed after webview closed');
});
test('When user selects file picker, display file picker', async () => {
errorMessageStub = sandbox.stub(applicationShell, 'showErrorMessage');
// Stub user selections
sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.selectAnotherFolder() });
const filePickerStub = sandbox.stub(applicationShell, 'showOpenDialog');
Expand All @@ -155,6 +154,22 @@ suite('TensorBoard session creation', async () => {

assert.ok(filePickerStub.called, 'User requests to select another folder and file picker was not shown');
});
test('When user selects remote URL, display input box', async () => {
sandbox.stub(applicationShell, 'showQuickPick').resolves({ label: TensorBoard.enterRemoteUrl() });
const inputBoxStub = sandbox.stub(applicationShell, 'showInputBox');

// Create session
await commandManager.executeCommand(
'python.launchTensorBoard',
TensorBoardEntrypoint.palette,
TensorBoardEntrypointTrigger.palette,
);

assert.ok(
inputBoxStub.called,
'User requested to enter remote URL and input box to enter URL was not shown',
);
});
});
suite('Installation prompt message', async () => {
async function createSessionAndVerifyMessage(message: string) {
Expand Down