-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds devcontainer to Hatchet to help with things like formatting
- Loading branch information
Showing
16 changed files
with
287 additions
and
43 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,60 @@ | ||
FROM continuumio/miniconda3:24.9.2-0 | ||
|
||
USER root | ||
|
||
ARG USERNAME=vscode | ||
ARG USER_UID=1000 | ||
ARG USER_GID=1000 | ||
ENV USERNAME=${USERNAME} | ||
ENV USER_UID=${USER_UID} | ||
ENV USER_GID=${USER_GID} | ||
|
||
RUN apt-get update -q \ | ||
&& apt-get install -q -y --no-install-recommends \ | ||
build-essential \ | ||
ripgrep \ | ||
pandoc \ | ||
adduser \ | ||
git \ | ||
grep \ | ||
curl \ | ||
wget \ | ||
vim | ||
|
||
RUN conda install -y python=3.9 \ | ||
&& pip install --no-cache-dir pipx \ | ||
&& pipx reinstall-all | ||
|
||
RUN conda install -c conda-forge gh jupyterlab | ||
|
||
COPY requirements.txt /requirements.txt | ||
|
||
RUN python3 -m pip install -r requirements.txt | ||
|
||
RUN python3 -m pip install --upgrade flake8-pytest-importorskip click==8.0.4 black==24.4.2 flake8==4.0.1 | ||
|
||
RUN groupadd -g ${USER_GID} ${USERNAME} && \ | ||
adduser --disabled-password --uid ${USER_UID} --gid ${USER_GID} --gecos "" ${USERNAME} && \ | ||
echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers | ||
|
||
USER $USERNAME | ||
|
||
# FROM mcr.microsoft.com/devcontainers/miniconda:1-3 | ||
# | ||
# # Copy environment.yml (if found) to a temp location so we update the environment. Also | ||
# # copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists. | ||
# COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/ | ||
# RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \ | ||
# && rm -rf /tmp/conda-tmp | ||
# | ||
# COPY requirements.txt /requirements.txt | ||
# | ||
# RUN conda install -y python=3.9 \ | ||
# && pip install --no-cache-dir pipx \ | ||
# && pipx reinstall-all | ||
# | ||
# | ||
# # [Optional] Uncomment this section to install additional OS packages. | ||
# # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
# # && apt-get -y install --no-install-recommends <your-package-list-here> | ||
|
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,81 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/miniconda | ||
{ | ||
"name": "Hatchet Python 3.9", | ||
"build": { | ||
"context": "..", | ||
"dockerfile": "Dockerfile" | ||
}, | ||
// "features": { | ||
// // "ghcr.io/devcontainers/features/git:1": { | ||
// // "ppa": true, | ||
// // "version": "os-provided" | ||
// // }, | ||
// // "ghcr.io/devcontainers/features/git-lfs:1": { | ||
// // "autoPull": true, | ||
// // "version": "latest" | ||
// // }, | ||
// "ghcr.io/devcontainers/features/github-cli:1": { | ||
// "installDirectlyFromGitHubRelease": true, | ||
// "version": "latest" | ||
// } | ||
// // "ghcr.io/devcontainers/features/python:1": { | ||
// // "installTools": true, | ||
// // "toolsToInstall": "autopep8,yapf,pydocstyle,pycodestyle,bandit,pytest,pylint", | ||
// // "enableShared": true, | ||
// // "installJupyterlab": true, | ||
// // "version": "3.9" | ||
// // }, | ||
// // "ghcr.io/devcontainers-extra/features/act:1": { | ||
// // "version": "latest" | ||
// // }, | ||
// // "ghcr.io/devcontainers-extra/features/curl-apt-get:1": {}, | ||
// // "ghcr.io/devcontainers-extra/features/fd:1": { | ||
// // "version": "latest" | ||
// // }, | ||
// // "ghcr.io/devcontainers-extra/features/fzf:1": { | ||
// // "version": "latest" | ||
// // }, | ||
// // "ghcr.io/devcontainers-extra/features/ripgrep:1": { | ||
// // "version": "latest" | ||
// // }, | ||
// // "ghcr.io/devcontainers-extra/features/wget-apt-get:1": {} | ||
// }, | ||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.black-formatter", | ||
"ms-python.flake8", | ||
"dbaeumer.vscode-eslint", | ||
"ms-python.debugpy", | ||
"ms-toolsai.jupyter" | ||
], | ||
"settings": { | ||
"python.defaultInterpreterPath": "/opt/conda/bin/python3", | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter", | ||
"editor.formatOnSave": true | ||
}, | ||
"python.formatting.provider": "black", | ||
"python.formatting.blackPath": "/opt/conda/bin/black", | ||
"black-formatter.path": [ | ||
"/opt/conda/bin/black" | ||
] | ||
} | ||
} | ||
}, | ||
"remoteEnv": { | ||
"PATH": "/opt/conda/bin:${containerEnv:PATH}", | ||
"EDITOR": "/usr/bin/vim" | ||
} | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "echo \"export PATH=$CURRENT_PYTHON_BINDIR:\\$PATH\" >> ~/.bashrc" | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
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,12 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for more information: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
# https://containers.dev/guide/dependabot | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "devcontainers" | ||
directory: "/" | ||
schedule: | ||
interval: weekly |
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
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
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
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
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
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
Oops, something went wrong.