-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* devcontainer * add button * change to python 3.10
- Loading branch information
1 parent
db3f9d5
commit 0f9ba11
Showing
3 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,51 @@ | ||
# Use Nvidia Ubuntu 20 base (includes CUDA if a supported GPU is present) | ||
# https://hub.docker.com/r/nvidia/cuda | ||
FROM nvidia/cuda:11.6.2-cudnn8-devel-ubuntu20.04@sha256:55211df43bf393d3393559d5ab53283d4ebc3943d802b04546a24f3345825bd9 | ||
|
||
ARG USERNAME | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
# Create the user | ||
# https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user | ||
RUN groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ | ||
&& usermod -a -G video user \ | ||
&& apt-get update \ | ||
&& apt-get install -y sudo \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install dependencies | ||
RUN apt-get update && \ | ||
apt-get -qq -y install \ | ||
software-properties-common && \ | ||
add-apt-repository ppa:deadsnakes/ppa && \ | ||
apt-get update && \ | ||
apt-get -qq -y install \ | ||
build-essential \ | ||
python3.10 \ | ||
python3.10-dev \ | ||
python3.10-distutils \ | ||
python3.10-venv \ | ||
curl \ | ||
git \ | ||
tmux | ||
|
||
# Update package list, add the deadsnakes PPA, and install dependencies | ||
|
||
|
||
ENV PATH="$HOME/.local/bin:$PATH" | ||
|
||
# Install pip (we need the latest version not the standard Ubuntu version, to | ||
# support modern wheels) | ||
RUN sudo curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3.10 get-pip.py | ||
|
||
# Set python aliases | ||
RUN sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 | ||
RUN sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 | ||
|
||
# User the new user | ||
USER $USERNAME |
This file contains 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,47 @@ | ||
{ | ||
"name": "Python 3", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"args": { | ||
"USERNAME": "user" | ||
} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.formatting.autopep8Path": "autopep8", | ||
"python.linting.mypyPath": "mypy", | ||
"terminal.integrated.defaultProfile.linux": "tmux", | ||
"terminal.integrated.profiles.linux": { | ||
"bash": { | ||
"path": "bash", | ||
"icon": "terminal-bash" | ||
}, | ||
"tmux": { | ||
"path": "bash", | ||
"args": ["-c", "tmux new -ADs ${PWD##*/}"], | ||
"icon": "terminal-tmux" | ||
} | ||
} | ||
}, | ||
"extensions": [ | ||
"davidanson.vscode-markdownlint", | ||
"donjayamanne.githistory", | ||
"donjayamanne.python-extension-pack", | ||
"github.vscode-pull-request-github", | ||
"ms-python.python", | ||
"ms-toolsai.jupyter", | ||
"ms-vsliveshare.vsliveshare-pack", | ||
"njpwerner.autodocstring", | ||
"stkb.rewrap", | ||
"streetsidesoftware.code-spell-checker", | ||
"tushortz.python-extended-snippets", | ||
"yzhang.markdown-all-in-one", | ||
"elagil.pre-commit-helper", | ||
"eamodio.gitlens" | ||
] | ||
} | ||
}, | ||
"containerUser": "user", | ||
"postCreateCommand": "pip install -e .[dev] --no-warn-script-location" | ||
} |
This file contains 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