Spaces:
Runtime error
Runtime error
betheredge
commited on
Commit
·
ad43d40
1
Parent(s):
c17f48e
Tweaking environment.
Browse files- .devcontainer/Dockerfile +21 -0
- .devcontainer/devcontainer.json +61 -0
- .dockerignore +9 -0
- .gitignore +2 -0
- README.md +1 -0
.devcontainer/Dockerfile
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/python-3/.devcontainer/base.Dockerfile
|
2 |
+
|
3 |
+
# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
|
4 |
+
ARG VARIANT="3.10-bullseye"
|
5 |
+
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
|
6 |
+
|
7 |
+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
|
8 |
+
ARG NODE_VERSION="none"
|
9 |
+
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
|
10 |
+
|
11 |
+
# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
|
12 |
+
# COPY requirements.txt /tmp/pip-tmp/
|
13 |
+
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
|
14 |
+
# && rm -rf /tmp/pip-tmp
|
15 |
+
|
16 |
+
# [Optional] Uncomment this section to install additional OS packages.
|
17 |
+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
18 |
+
&& apt-get -y install --no-install-recommends ffmpeg
|
19 |
+
|
20 |
+
# [Optional] Uncomment this line to install global node packages.
|
21 |
+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
|
.devcontainer/devcontainer.json
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
2 |
+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/python-3
|
3 |
+
{
|
4 |
+
"name": "Python 3",
|
5 |
+
"build": {
|
6 |
+
"dockerfile": "Dockerfile",
|
7 |
+
"context": "..",
|
8 |
+
"args": {
|
9 |
+
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
|
10 |
+
// Append -bullseye or -buster to pin to an OS version.
|
11 |
+
// Use -bullseye variants on local on arm64/Apple Silicon.
|
12 |
+
"VARIANT": "3.8",
|
13 |
+
// Options
|
14 |
+
"NODE_VERSION": "none"
|
15 |
+
}
|
16 |
+
},
|
17 |
+
|
18 |
+
// Configure tool-specific properties.
|
19 |
+
"customizations": {
|
20 |
+
// Configure properties specific to VS Code.
|
21 |
+
"vscode": {
|
22 |
+
// Set *default* container specific settings.json values on container create.
|
23 |
+
"settings": {
|
24 |
+
"python.defaultInterpreterPath": "/usr/local/bin/python",
|
25 |
+
"python.linting.enabled": true,
|
26 |
+
"python.linting.pylintEnabled": true,
|
27 |
+
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
|
28 |
+
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
|
29 |
+
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
|
30 |
+
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
|
31 |
+
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
|
32 |
+
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
|
33 |
+
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
|
34 |
+
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
|
35 |
+
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
|
36 |
+
},
|
37 |
+
|
38 |
+
// Add the IDs of extensions you want installed when the container is created.
|
39 |
+
"extensions": [
|
40 |
+
"ms-python.python",
|
41 |
+
"ms-python.vscode-pylance",
|
42 |
+
"GitHub.copilot"
|
43 |
+
]
|
44 |
+
}
|
45 |
+
},
|
46 |
+
|
47 |
+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
48 |
+
// "forwardPorts": [],
|
49 |
+
|
50 |
+
// Use 'postCreateCommand' to run commands after the container is created.
|
51 |
+
"postCreateCommand": "pip3 install --user -r src/requirements.txt",
|
52 |
+
"runArgs": ["--gpus", "all", "--env-file" , ".env"],
|
53 |
+
|
54 |
+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
55 |
+
"remoteUser": "vscode",
|
56 |
+
"features": {
|
57 |
+
"docker-from-docker": "20.10",
|
58 |
+
"git": "os-provided",
|
59 |
+
"git-lfs": "latest"
|
60 |
+
}
|
61 |
+
}
|
.dockerignore
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.env
|
2 |
+
flagged
|
3 |
+
notebooks
|
4 |
+
.git
|
5 |
+
.gitignore
|
6 |
+
.gitattributes
|
7 |
+
.gitmodules
|
8 |
+
.gitkeep
|
9 |
+
.gitconfig
|
.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
.env
|
2 |
+
flagged
|
README.md
CHANGED
@@ -8,6 +8,7 @@ sdk_version: 3.1.1
|
|
8 |
app_file: src/app.py
|
9 |
pinned: false
|
10 |
license: gpl-3.0
|
|
|
11 |
---
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
8 |
app_file: src/app.py
|
9 |
pinned: false
|
10 |
license: gpl-3.0
|
11 |
+
python_version: 3.8
|
12 |
---
|
13 |
|
14 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|