forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Added Dev Container Using MCR #21675
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0dd4db6
Dev Container Using MCR
anthonykim1 2436d06
fix broken mixed
anthonykim1 df9e82c
remove postCreate and revert CI_PYTHON_PATH
anthonykim1 9ec9380
get correct CI_PYTHON_PATH tested
anthonykim1 694c123
fix dead symlink
anthonykim1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,18 @@ | ||
# This image will serve as a starting point for devcontainer.json. | ||
# Get latest image of Fedora as the base image. | ||
FROM docker.io/library/fedora:latest | ||
FROM mcr.microsoft.com/devcontainers/typescript-node:16-bookworm | ||
|
||
# Install supported python versions and nodejs. | ||
RUN dnf -y --nodocs install /usr/bin/{python3.7,python3.8,python3.9,python3.10,python3.11,git,conda,clang} && \ | ||
dnf clean all | ||
RUN apt-get install -y wget bzip2 | ||
|
||
ENV NVM_VERSION=0.39.3 | ||
ENV NODE_VERSION=16.17.1 | ||
ENV NPM_VERSION=8.19.3 | ||
|
||
# Installation instructions from https://github.com/nvm-sh/nvm . | ||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v$NVM_VERSION/install.sh | bash | ||
RUN export NVM_DIR="$HOME/.nvm" && \ | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ | ||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" && \ | ||
nvm install $NODE_VERSION && \ | ||
npm install -g npm@$NPM_VERSION | ||
|
||
# For clean open source builds. | ||
ENV DISABLE_TRANSLATIONS=true | ||
# Run in silent mode and save downloaded script as anaconda.sh. | ||
# Run with /bin/bash and run in silent mode to /opt/conda. | ||
# Also get rid of installation script after finishing. | ||
RUN wget --quiet https://repo.anaconda.com/archive/Anaconda3-2023.07-1-Linux-x86_64.sh -O ~/anaconda.sh && \ | ||
/bin/bash ~/anaconda.sh -b -p /opt/conda && \ | ||
rm ~/anaconda.sh | ||
|
||
ENV PATH="/opt/conda/bin:$PATH" | ||
|
||
# Sudo apt update needs to run in order for installation of fish to work . | ||
RUN sudo apt update && \ | ||
sudo apt install fish -y | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,8 @@ | |
}, | ||
// Commands to execute on container creation,start. | ||
"postCreateCommand": "bash scripts/postCreateCommand.sh", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can remove this |
||
// Environment variable placed inside containerEnv following: https://containers.dev/implementors/json_reference/#general-properties | ||
"onCreateCommand": "bash scripts/onCreateCommand.sh", | ||
|
||
"containerEnv": { | ||
"CI_PYTHON_PATH": "/workspaces/vscode-python/.venv/bin/python" | ||
anthonykim1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Install pyenv and Python versions here to avoid using shim. | ||
curl https://pyenv.run | bash | ||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc | ||
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc | ||
# echo 'eval "$(pyenv init -)"' >> ~/.bashrc | ||
|
||
export PYENV_ROOT="$HOME/.pyenv" | ||
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" | ||
# eval "$(pyenv init -)" Comment this out and DO NOT use shim. | ||
source ~/.bashrc | ||
|
||
# Install Python via pyenv . | ||
pyenv install 3.7:latest 3.8:latest 3.9:latest 3.10:latest 3.11:latest | ||
|
||
# Set default Python version to 3.7 . | ||
anthonykim1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
pyenv global 3.7.17 | ||
|
||
npm ci | ||
|
||
# Create Virutal environment. | ||
pyenv exec python3.7 -m venv .venv | ||
anthonykim1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Activate Virtual environment. | ||
source /workspaces/vscode-python/.venv/bin/activate | ||
|
||
# Install required Python libraries. | ||
npx gulp installPythonLibs | ||
|
||
/workspaces/vscode-python/.venv/bin/python -m pip install -r build/test-requirements.txt | ||
/workspaces/vscode-python/.venv/bin/python -m pip install -r build/smoke-test-requirements.txt | ||
/workspaces/vscode-python/.venv/bin/python -m pip install -r build/functional-test-requirements.txt | ||
|
||
# Below will crash codespace | ||
# npm run compile |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.