From 9ab881e9862222f5d6a0ccd41c4f22414e307c09 Mon Sep 17 00:00:00 2001 From: anirrudh Date: Sun, 3 Apr 2022 03:17:35 -0400 Subject: [PATCH 1/7] added conda environment.yaml --- development/environment.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 development/environment.yaml diff --git a/development/environment.yaml b/development/environment.yaml new file mode 100644 index 0000000..f13a229 --- /dev/null +++ b/development/environment.yaml @@ -0,0 +1,7 @@ +name: epython-dev +channels: + - conda-forge +dependencies: + - python==3.9 + - pydantic + - pip From f4e9e92e9a1fa93bde7895233412bbe72f3b5f60 Mon Sep 17 00:00:00 2001 From: anirrudh Date: Sun, 3 Apr 2022 03:17:55 -0400 Subject: [PATCH 2/7] init Dockerfile --- development/Dockerfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 development/Dockerfile diff --git a/development/Dockerfile b/development/Dockerfile new file mode 100644 index 0000000..484bdc4 --- /dev/null +++ b/development/Dockerfile @@ -0,0 +1,30 @@ +FROM pyodide/pyodide:0.19.1 + +# Switch shell to bash +SHELL ["/bin/bash", "--login", "-c"] + +# Setup epyhton-dev +RUN mkdir -p /epython/ &&\ + mkdir -p /epython/epython/ + +# Copy Development Files +COPY ./development/environment.yaml . +COPY ./epython/* /epython/epython/ +COPY setup.py /epython/ +COPY README.md /epython/ +COPY tests /epyhton/ + +# Install Miniconda +RUN wget --quiet "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-x86_64.sh" -O ~/miniconda.sh &&\ +/bin/bash ~/miniconda.sh -b -p /opt/conda &&\ +/opt/conda/condabin/conda init bash + +ENV PATH /opt/conda/bin:/src/pyodide/:$PATH + +# Activate environment, install epython +RUN conda env update -f ./environment.yaml +SHELL ["conda", "run", "-n", "epython-dev", "/bin/bash", "-c"] + +RUN cd /epython/ && pip install . + +CMD ["/bin/bash"] \ No newline at end of file From 0cc352401ba1e148451a1a607c5d2a7fe26a3976 Mon Sep 17 00:00:00 2001 From: anirrudh Date: Sun, 3 Apr 2022 03:20:15 -0400 Subject: [PATCH 3/7] update readme --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index e57185c..5cbf23f 100644 --- a/README.md +++ b/README.md @@ -20,3 +20,14 @@ If you are interested in contributing to the design and goals, then join the Dis epython extmodule.epy --backend=cpython Produces a compiled extension module for the given Python backend. + +## Docker Development +---------------------- + +Install Docker Daemon, then run: + +`docker build -t epython-wasm -f ./development/Dockerfile .` + +To run the interactive session: + +`docker run -i epython-wasm:latest "/bin/bash"` From 45032d4f21be0ae8ff105df5161f059008f8aa29 Mon Sep 17 00:00:00 2001 From: anirrudh Date: Mon, 4 Apr 2022 00:56:46 -0400 Subject: [PATCH 4/7] working pyodide --- development/Dockerfile | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/development/Dockerfile b/development/Dockerfile index 484bdc4..82082aa 100644 --- a/development/Dockerfile +++ b/development/Dockerfile @@ -1,7 +1,7 @@ FROM pyodide/pyodide:0.19.1 # Switch shell to bash -SHELL ["/bin/bash", "--login", "-c"] +SHELL ["/bin/bash", "-c"] # Setup epyhton-dev RUN mkdir -p /epython/ &&\ @@ -14,17 +14,25 @@ COPY setup.py /epython/ COPY README.md /epython/ COPY tests /epyhton/ +# Add Conda to PATH +ENV PATH /opt/conda/bin:$PATH + # Install Miniconda RUN wget --quiet "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-x86_64.sh" -O ~/miniconda.sh &&\ -/bin/bash ~/miniconda.sh -b -p /opt/conda &&\ -/opt/conda/condabin/conda init bash +/bin/bash ~/miniconda.sh -q -b -p /opt/conda &&\ +conda init &&\ +conda env update --quiet -f ./environment.yaml &&\ +echo "conda activate epython-dev" >> /root/.bashrc -ENV PATH /opt/conda/bin:/src/pyodide/:$PATH +ENV PATH /opt/conda/envs/epyhton-dev/bin:$PATH -# Activate environment, install epython -RUN conda env update -f ./environment.yaml SHELL ["conda", "run", "-n", "epython-dev", "/bin/bash", "-c"] -RUN cd /epython/ && pip install . +RUN cd /epython/ && pip install . &&\ + cd /src/pyodide/ && pip install -e pyodide-build + +ENV PYTHONPATH /src/pyodide/pyodide-build/:$PYTHONPATH + +RUN cd ./pyodide/ && make -CMD ["/bin/bash"] \ No newline at end of file +CMD ["python", "-m", "pyodide_build", "serve"] \ No newline at end of file From 68253911834508e387da8d0595696233d81ad17b Mon Sep 17 00:00:00 2001 From: anirrudh Date: Mon, 4 Apr 2022 00:57:03 -0400 Subject: [PATCH 5/7] add pyodide deps --- development/environment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/development/environment.yaml b/development/environment.yaml index f13a229..e796b68 100644 --- a/development/environment.yaml +++ b/development/environment.yaml @@ -5,3 +5,4 @@ dependencies: - python==3.9 - pydantic - pip + - pyyaml \ No newline at end of file From bd81a124466dcd839815c725b59abc67e286c8fa Mon Sep 17 00:00:00 2001 From: anirrudh Date: Mon, 4 Apr 2022 01:02:29 -0400 Subject: [PATCH 6/7] update readme --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5cbf23f..565175c 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,12 @@ Produces a compiled extension module for the given Python backend. ## Docker Development ---------------------- -Install Docker Daemon, then run: +Install Docker, then run: `docker build -t epython-wasm -f ./development/Dockerfile .` +From the root of the repository. + To run the interactive session: -`docker run -i epython-wasm:latest "/bin/bash"` +`docker run -p 8008:8000 -t epython-wasm:latest ` From 6a4d2b001fd39abd694269079ae3ad343dbb8043 Mon Sep 17 00:00:00 2001 From: Anirrudh Krishnan Date: Sat, 16 Apr 2022 17:09:01 -0700 Subject: [PATCH 7/7] Update dockerfile with latest pyodide --- development/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/development/Dockerfile b/development/Dockerfile index 82082aa..63161aa 100644 --- a/development/Dockerfile +++ b/development/Dockerfile @@ -1,4 +1,4 @@ -FROM pyodide/pyodide:0.19.1 +FROM pyodide/pyodide:0.20.0 # Switch shell to bash SHELL ["/bin/bash", "-c"] @@ -35,4 +35,4 @@ ENV PYTHONPATH /src/pyodide/pyodide-build/:$PYTHONPATH RUN cd ./pyodide/ && make -CMD ["python", "-m", "pyodide_build", "serve"] \ No newline at end of file +CMD ["python", "-m", "pyodide_build", "serve"]