Skip to content

Commit 4c4b25a

Browse files
author
Kartik Raj
committed
Revert "Dev Container Using MCR (#21675)"
This reverts commit 6af959d.
1 parent 9ac14b8 commit 4c4b25a

File tree

7 files changed

+43
-57
lines changed

7 files changed

+43
-57
lines changed

.devcontainer/Dockerfile

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
FROM mcr.microsoft.com/devcontainers/typescript-node:16-bookworm
1+
# This image will serve as a starting point for devcontainer.json.
2+
# Get latest image of Fedora as the base image.
3+
FROM docker.io/library/fedora:latest
24

3-
RUN apt-get install -y wget bzip2
5+
# Install supported python versions and nodejs.
6+
RUN dnf -y --nodocs install /usr/bin/{python3.7,python3.8,python3.9,python3.10,python3.11,git,conda,clang} && \
7+
dnf clean all
48

5-
# Run in silent mode and save downloaded script as anaconda.sh.
6-
# Run with /bin/bash and run in silent mode to /opt/conda.
7-
# Also get rid of installation script after finishing.
8-
RUN wget --quiet https://repo.anaconda.com/archive/Anaconda3-2023.07-1-Linux-x86_64.sh -O ~/anaconda.sh && \
9-
/bin/bash ~/anaconda.sh -b -p /opt/conda && \
10-
rm ~/anaconda.sh
9+
ENV NVM_VERSION=0.39.3
10+
ENV NODE_VERSION=16.17.1
11+
ENV NPM_VERSION=8.19.3
12+
13+
# Installation instructions from https://github.com/nvm-sh/nvm .
14+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v$NVM_VERSION/install.sh | bash
15+
RUN export NVM_DIR="$HOME/.nvm" && \
16+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
17+
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" && \
18+
nvm install $NODE_VERSION && \
19+
npm install -g npm@$NPM_VERSION
20+
21+
# For clean open source builds.
22+
ENV DISABLE_TRANSLATIONS=true
1123

12-
ENV PATH="/opt/conda/bin:$PATH"
1324

14-
# Sudo apt update needs to run in order for installation of fish to work .
15-
RUN sudo apt update && \
16-
sudo apt install fish -y
1725

1826

.devcontainer/devcontainer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
},
2222
// Commands to execute on container creation,start.
2323
"postCreateCommand": "bash scripts/postCreateCommand.sh",
24-
"onCreateCommand": "bash scripts/onCreateCommand.sh",
25-
24+
// Environment variable placed inside containerEnv following: https://containers.dev/implementors/json_reference/#general-properties
2625
"containerEnv": {
2726
"CI_PYTHON_PATH": "/workspaces/vscode-python/.venv/bin/python"
2827
}

scripts/onCreateCommand.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.

scripts/postCreateCommand.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
npm ci
3+
# Create Virutal environment.
4+
python3.7 -m venv /workspaces/vscode-python/.venv
5+
6+
# Activate Virtual environment.
7+
source /workspaces/vscode-python/.venv/bin/activate
8+
9+
# Install required Python libraries.
10+
npx gulp installPythonLibs
11+
12+
# Install testing requirement using python in .venv .
13+
/workspaces/vscode-python/.venv/bin/python -m pip install -r build/test-requirements.txt
14+
/workspaces/vscode-python/.venv/bin/python -m pip install -r build/smoke-test-requirements.txt
15+
/workspaces/vscode-python/.venv/bin/python -m pip install -r build/functional-test-requirements.txt

src/client/common/interpreterPathService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const isRemoteGlobalSettingCopiedKey = 'isRemoteGlobalSettingCopiedKey';
3030
export const defaultInterpreterPathSetting: keyof IPythonSettings = 'defaultInterpreterPath';
3131
const CI_PYTHON_PATH = getCIPythonPath();
3232

33-
export function getCIPythonPath(): string {
33+
function getCIPythonPath(): string {
3434
if (process.env.CI_PYTHON_PATH && fs.existsSync(process.env.CI_PYTHON_PATH)) {
3535
return process.env.CI_PYTHON_PATH;
3636
}

src/test/common/interpreterPathService.unit.test.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ import {
1515
WorkspaceConfiguration,
1616
} from 'vscode';
1717
import { IApplicationEnvironment, IWorkspaceService } from '../../client/common/application/types';
18-
import {
19-
defaultInterpreterPathSetting,
20-
getCIPythonPath,
21-
InterpreterPathService,
22-
} from '../../client/common/interpreterPathService';
18+
import { defaultInterpreterPathSetting, InterpreterPathService } from '../../client/common/interpreterPathService';
2319
import { FileSystemPaths } from '../../client/common/platform/fs-paths';
2420
import { InterpreterConfigurationScope, IPersistentState, IPersistentStateFactory } from '../../client/common/types';
2521
import { createDeferred, sleep } from '../../client/common/utils/async';
@@ -451,8 +447,7 @@ suite('Interpreter Path Service', async () => {
451447
workspaceValue: undefined,
452448
});
453449
const settingValue = interpreterPathService.get(resource);
454-
455-
expect(settingValue).to.equal(getCIPythonPath());
450+
expect(settingValue).to.equal('python');
456451
});
457452

458453
test('If defaultInterpreterPathSetting is changed, an event is fired', async () => {

src/test/pythonEnvironments/common/commonUtils.functional.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ suite('pyenvs common utils - finding Python executables', () => {
8686
<python3.8>
8787
python3 -> sub2/sub2.2/python3
8888
python3.7 -> sub2/sub2.1/sub2.1.1/python
89+
python2.7 -> does-not-exist
8990
`);
9091
}
9192
});
@@ -105,6 +106,7 @@ suite('pyenvs common utils - finding Python executables', () => {
105106
// These will match.
106107
'python',
107108
'python2',
109+
'python2.7',
108110
'python3',
109111
'python3.7',
110112
'python3.8',
@@ -135,6 +137,7 @@ suite('pyenvs common utils - finding Python executables', () => {
135137
// These will match.
136138
'python',
137139
'python2',
140+
'python2.7',
138141
'python3',
139142
'python3.7',
140143
'python3.8',
@@ -164,6 +167,7 @@ suite('pyenvs common utils - finding Python executables', () => {
164167
// These will match.
165168
'python',
166169
'python2',
170+
'python2.7',
167171
'python3',
168172
'python3.7',
169173
'python3.8',

0 commit comments

Comments
 (0)