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

✨ Add devcontainer #1085

Merged
merged 18 commits into from
Mar 2, 2024
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
55 changes: 55 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:0-3.10",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/git:1": {"version": "os-provided"}
},

// The arguments required when starting in the container.
"runArgs": [
// "--ipc=host",
// "--gpus=all" // Enable GPU
],
adamjstewart marked this conversation as resolved.
Show resolved Hide resolved

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.isort",
"ms-python.black-formatter",
"ms-python.vscode-pylance",
"cschleiden.vscode-github-actions",
"GitHub.vscode-pull-request-github",
"ms-toolsai.jupyter",
"christian-kohler.path-intellisense"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.flake8Enabled": true,
"python.testing.pytestEnabled":true,
"python.editor.defaultFormatter": "ms-python.black-formatter",
"python.editor.formatOnSave": true,
"python.editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
}
},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
13 changes: 13 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -y --force-yes update
sudo apt-get -y --force-yes install libgdal-dev
echo CPLUS_INCLUDE_PATH=/usr/include/gdal >> ~/.bashrc
echo C_INCLUDE_PATH=/usr/include/gdal >> ~/.bashrc
julien-blanchon marked this conversation as resolved.
Show resolved Hide resolved
pip install --upgrade pip
pip install --user -r ./requirements/datasets.txt
pip install --user -r ./requirements/docs.txt
pip install --user -r ./requirements/required.txt
pip install --user -r ./requirements/style.txt
pip install --user -r ./requirements/tests.txt
julien-blanchon marked this conversation as resolved.
Show resolved Hide resolved
pip install --user pre-commit