From cb3d449fd77b983decff0015e5c7d6b132eae0de Mon Sep 17 00:00:00 2001 From: Huoran Li Date: Wed, 15 Nov 2023 12:56:24 +0800 Subject: [PATCH 1/2] init --- .devcontainer/Dockerfile | 3 +++ .devcontainer/devcontainer.json | 11 +++++++++++ .gitattributes | 3 +++ 3 files changed, 17 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .gitattributes diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..208868409 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,3 @@ +FROM python:3.10 +RUN apt-get -y update +RUN apt-get -y install git diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..6e63b1a96 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,11 @@ +{ + "name": "MARO Dev Container", + "build": { + "context": "..", + "dockerfile": "Dockerfile" + }, + "postCreateCommand": [ + "bash scripts/install_maro.sh", + "pip install -r ./requirements.dev.txt" + ] +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..314766e91 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +* text=auto eol=lf +*.{cmd,[cC][mM][dD]} text eol=crlf +*.{bat,[bB][aA][tT]} text eol=crlf From 752f0865f660cccd43b9c08bbb0a0289ec5b2893 Mon Sep 17 00:00:00 2001 From: Huoran Li Date: Wed, 15 Nov 2023 13:34:32 +0800 Subject: [PATCH 2/2] First version --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 5 +---- README.md | 11 +++++++++++ requirements.dev.txt | 1 + 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 208868409..189125c04 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,3 +1,3 @@ -FROM python:3.10 +FROM python:3.9 RUN apt-get -y update RUN apt-get -y install git diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6e63b1a96..35af77463 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,8 +4,5 @@ "context": "..", "dockerfile": "Dockerfile" }, - "postCreateCommand": [ - "bash scripts/install_maro.sh", - "pip install -r ./requirements.dev.txt" - ] + "postCreateCommand": "bash scripts/install_maro.sh && pip install -r ./requirements.dev.txt" } diff --git a/README.md b/README.md index 2750a51cd..f1b4c562f 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,17 @@ of user-defined functions for message auto-handling, cluster provision, and job $Env:PYTHONPATH=PATH-TO-MARO ``` +## Use MARO in [VSCode DevContainer](https://code.visualstudio.com/docs/devcontainers/containers) + +- Prerequisites + - Install Docker on your local machine. + - Make sure your Docker daemon is running. +- Open MARO folder with VSCode. +- Open command palette by pressing `Ctrl/Cmd` + `Shift` + `P`. +- Type `Dev Containers: Rebuild and Reopen in Container` in the command palette and then prese `Enter` to start building dev container. +- The building process might takes a few minutes. After it is done, you are all set! + + ## Quick Example ```python diff --git a/requirements.dev.txt b/requirements.dev.txt index 6c78701de..04adce20f 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -20,6 +20,7 @@ Flask_SocketIO>=5.2.0 flloat==0.3.0 geopy>=2.0.0 holidays>=0.10.3 +ipython Jinja2>=2.11.3 kubernetes>=21.7.0 markupsafe==2.0.1