-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a devcontainer configuration to our repository, and documents it as the recommended development workflow. This should clean up quite a few platform and environment setup problems for development work. Batch jobs and evaluation should still be done directly in Linux environments, which are still supported. This also switches our pre-commit hook to use `dprint` instead of `taplo`, because it's easier to install dprint on linux-aarch64 (and having pre-commit hooks depend on executables only inside the Pixi environment doesn't work very well).
- Loading branch information
1 parent
e37cfba
commit 9a1db28
Showing
11 changed files
with
12,581 additions
and
418 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,9 @@ | ||
FROM mcr.microsoft.com/devcontainers/base:bookworm | ||
ARG PIXI_VERSION=v0.38.0 | ||
|
||
# derived from https://pixi.sh/latest/ide_integration/devcontainer/ | ||
RUN curl -L -o /usr/local/bin/pixi -fsSL --compressed "https://github.com/prefix-dev/pixi/releases/download/${PIXI_VERSION}/pixi-$(uname -m)-unknown-linux-musl" \ | ||
&& chmod +x /usr/local/bin/pixi \ | ||
&& pixi info | ||
|
||
RUN echo 'eval "$(pixi completion -s bash)"' >> /home/vscode/.bashrc |
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,35 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/debian | ||
{ | ||
"name": "POPROX Recommender", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers-extra/features/pre-commit:2": {} | ||
}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [ | ||
3000 | ||
], | ||
// Set up mounts for locally-installed software | ||
"mounts": [ | ||
"source=${localWorkspaceFolderBasename}-pixi,target=${containerWorkspaceFolder}/.pixi,type=volume", | ||
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume" | ||
], | ||
"postCreateCommand": "./.devcontainer/setup.sh", | ||
// VS Code settings | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"EditorConfig.EditorConfig", | ||
"ms-python.python", | ||
"charliermarsh.ruff", | ||
"redhat.vscode-yaml", | ||
"tamasfe.even-better-toml", | ||
"ms-toolsai.jupyter", | ||
"ms-azuretools.vscode-docker" | ||
] | ||
} | ||
} | ||
} |
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,13 @@ | ||
#!/bin/bash | ||
set -xeo pipefail | ||
|
||
# set up environment dirs | ||
sudo chown vscode:vscode .pixi node_modules | ||
|
||
# get pre-commit wired up and ready | ||
pre-commit install | ||
pre-commit install-hooks | ||
|
||
# install the development environment | ||
pixi install -e dev | ||
pixi run -e dev install-serverless |
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,17 @@ | ||
{ | ||
"json": { | ||
}, | ||
"toml": { | ||
}, | ||
"yaml": { | ||
}, | ||
"excludes": [ | ||
"**/*-lock.json", | ||
"**/cloudformation.yml" | ||
], | ||
"plugins": [ | ||
"https://plugins.dprint.dev/json-0.19.4.wasm", | ||
"https://plugins.dprint.dev/toml-0.6.3.wasm", | ||
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -86,6 +86,7 @@ celerybeat.pid | |
|
||
# Environments | ||
.env | ||
.envrc | ||
.venv | ||
env/ | ||
venv/ | ||
|
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.