From 17137be4a1b378026bb83e1e21ef12644c06afe0 Mon Sep 17 00:00:00 2001 From: Akbar Rahman Date: Sun, 24 Dec 2023 20:44:29 +0000 Subject: [PATCH] create readme --- Dockerfile-example | 19 +++++++++++++++++++ Mandrake.toml | 16 ---------------- readme.md | 21 +++++++++++++++++++++ 3 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 Dockerfile-example create mode 100644 readme.md diff --git a/Dockerfile-example b/Dockerfile-example new file mode 100644 index 0000000..2467b0b --- /dev/null +++ b/Dockerfile-example @@ -0,0 +1,19 @@ +FROM ubuntu:latest + +RUN apt update && \ + DEBIAN_FRONTEND=noninteractive TZ=Europe/London \ + apt install -y pandoc make texlive texlive-latex-extra texlive-fonts-extra gpg curl npm python3-pip +RUN pip install matplotlib +RUN curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > conda.gpg \ + && install -o root -g root -m 644 conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg \ + && gpg --keyring /usr/share/keyrings/conda-archive-keyring.gpg --no-default-keyring --fingerprint 34161F5BF5EB1D4BFBBB8F0A8AEB4F8B29D82806 \ + && echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list \ + && apt update && DEBIAN_FRONTEND=noninteractive TZ=Europe/London apt install -y conda +RUN export PATH=/opt/conda/bin:$PATH \ + && conda install -y -c conda-forge pandoc-plot +RUN npm install --global mermaid-filter + +ENV PATH=/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + + +WORKDIR /context diff --git a/Mandrake.toml b/Mandrake.toml index 9d29e68..e40e9c8 100644 --- a/Mandrake.toml +++ b/Mandrake.toml @@ -5,22 +5,6 @@ try-multiple = false run-local = true output = "out" -[[remotes]] -name = "a2" -host = "alvps2" -default = false - -[remotes.ssh] -host = "alvps2" - -[[remotes]] -name = "gareth" -host = "http://gareth:5000" -default = false - -[remotes.ssh] -host = "gareth" - [[remotes]] name = "local" host = "http://localhost:5000" diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..94701bc --- /dev/null +++ b/readme.md @@ -0,0 +1,21 @@ +# 🍃 mandrake + +> (Proof of concept) run commands in remote docker container to offload compute intensive commands + + +## Usage + +1. Create `config-server.toml`. + See [`config-servre.toml`](./config-server.toml) for an example. +1. Start `mandrake-server.py` +1. Create `Mandrake.toml` file in root directory of project. + See [`Mandrake.toml`](Mandrake.toml) for an example. +1. Create a `Dockerfile` in the root directory of project to specify the environment to + execute the command. + See [`Dockerfile-example`](Dockerfile-example) for an example. + + Remember to the working directory to `/context`. + +1. Run `mandrake-server.py [arg1 [arg2 [...]]]` in the project directory, + where `` and `[argN]` the command and its arguments to run in the docker + container.